数值积分问题
如何求取变下限数值积分:积分表达式为:-1/2/((a^2+x)*(c^2+x))^(3/2)*(c^2+2*x+a^2)
a 和c 均为常数,积分限为 t(i) 到正无穷, 请高手指点一下,我写了积分表达式为:
str=vectorize('-1/2/(x^2+148*x+576)^(3/2)*(2*x+148) )');
expression=inline(str,'x');
for i=1:n
for j=1:n
bb(i,j)=( a^2+c^2-x(i,j).^2-y(i,j).^2);
cc(i,j)=( a^2*c^2-c^2*( x(i,j).^2+y(i,j).^2 ) );
xx(i,j)=0.5+( -bb(i,j)+(bb(i,j)^2-4*cc(i,j))^(1/2));
U(i,j)=quadl(expression,xx(i,j),inf);
end
end
可提示有错:
??? Error using ==> inlineeval
Error in inline expression ==> -1./2./(x.^2+148.*x+576).^(3./2).*(2.*x+148) )
??? Error: Unbalanced or misused parentheses or brackets.
Error in ==> inline.feval at 34
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in ==> quadl at 64
y = feval(f,x,varargin{:}); y = y(:).';
Error in ==> testfunction at 22
U(i,j)=quadl(expression,xx(i,j),inf);
什么意思呢? 指点一下!
回复
感觉程序很混乱.建议把完整的代码贴出来.
[ 本帖最后由 xjzuo 于 2007-1-15 15:14 编辑 ]
页:
[1]