matlab变上线积分

在对matlab进行求解变上限二重积分时,确定了一个关于x,y,a,b,h1的函数,对这个函数先积分,在带入下一个int函数中求二重积分,想知道在最后调用的时候如何进行传参以及在传参过程中出现的索引问题。

img

将程序以代码形式上传,图片不方便调试。
程序少了很多个*号,我加上了。看看是不是你要的结果:

H=3;
B=2;
A=1;
C=6;
R=13/8;
syms a b x y x0 y0 h1;
x0=R-A*(cos(a)-sin(a));
y0=(A/2)*(sin(a)+cos(b));
f1(x,y)=2*(R^2-(x-x0)^2-(y-y0)^2)^0.5;
f2(x,y)=2*(H^2/4-(y-H/2)^2)^0.5;
Va=@(x,y,a,b,h1) int(f1,x,x0-(R^2-(y-y0)^2)^0.5,-y*tan(a));
Vb=int(Va,y,0,((h1-H/2)*cos(b)+H/2)*cos(a)+B*sin(a));
Vc=@(x,y,a,b,h1) int(f2,y,0,((h1-H/2)*cos(b)+H/2)-(x-B)*tan(a));
Vd=int(Vc,x,0,((h1-H/2)*cos(b)+H/2)*cot(a));
V=Vb+Vd;

结果

V =
 
int(int(2*(169/64 - (cos(b)/2 - y + sin(a)/2)^2 - (x + cos(a) - sin(a) - 13/8)^2)^(1/2), x, sin(a) - cos(a) - (169/64 - (cos(b)/2 - y + sin(a)/2)^2)^(1/2) + 13/8, -y*tan(a)), y, 0, 2*sin(a) + cos(a)*(cos(b)*(h1 - 3/2) + 3/2)) + int((9*pi)/8 - (9*asin((2*tan(a)*(x - 2))/3 - (2*cos(b)*(h1 - 3/2))/3))/4 - (9/4 - (tan(a)*(x - 2) - cos(b)*(h1 - 3/2))^2)^(1/2)*(tan(a)*(x - 2) - cos(b)*(h1 - 3/2)), x, 0, cot(a)*(cos(b)*(h1 - 3/2) + 3/2))
 
>> 

img
其余的变量给在了这里

H=3;
B=2;
A=1;
C=6;
R=13/8;
syms a b x y x0 y0 h1;
x0=R-A*(cos(a)-sin(a));
y0=(A/2)(sin(a)+cos(b));
f1(x,y)=2
(R^2-(x-x0)^2-(y-y0)^2)^0.5;
f2(x,y)=2*(H^2/4-(y-H/2)^2)^0.5;
Va=@(x,y,a,b,h1)int(f1,x,x0-(R^2-(y-y0)^2)^0.5,-y*tan(a));
Vb=int(Va,y,0,((h1-H/2)*cos(b)+H/2)cos(a)+Bsin(a));
Vc=@(x,y,a,b,h1)int(f2,y,0,((h1-H/2)*cos(b)+H/2)-(x-B)*tan(a));
Vd=int(Vc,x,0,((h1-H/2)*cos(b)+H/2)*cot(a));
V=Vb+Vd;
代码在这里