带有多个参数的二重积分积分,求出带参数的-表达式

5 次查看(过去 30 天)
Qiuqi
Qiuqi 2023-7-9
编辑: Sai Teja G 2023-10-10
其中,R,d是参数,是常量。alpha的范围是从-pi/6到pi/6,z的范围是从0到l(l是一个参数)
我想求上面那个式子的积分,得到一个由R,d,l组成的表达式。
syms R d l
fun=@(alpha,z)((R+d).^2.*cos(alpha)-R.*(R-d).*cos(alpha)-R.*d).*(R.*d-R.*(R+d).*cos(alpha)+R.^2.*cos(alpha)).*(R+d)./(pi.*d.^2.*(z.^2+(R+d).^2+R.^2-2.*R.*(R+d).*cos(alpha)))
int(int(fun,alpha,(-pi*1.0)/6.0,(pi*1.0)/6.0),z,0,l);
报错:
错误使用 alpha
输出参数太多。

回答(1 个)

Sai Teja G
Sai Teja G 2023-8-16
编辑:Sai Teja G 2023-10-10
Hi
此回复是用英文写的,旨在给您最快的回复
I understand that you are integrating the equation on ‘alpha’ and ‘z’.
I want to inform you that the usage of the 'int()' function for integration is incorrect. In MATLAB, the appropriate function for integrating an equation with double parameters is 'integral2()'. Please make sure to use 'integral2()' instead of 'int()' for correct integration in your code.
Please refer the following code to resolve your issue.
fun=@(alpha,z)((R+d).^2.*cos(alpha)-R.*(R-d).*cos(alpha)-R.*d).*(R.*d-R.*(R+d).*cos(alpha)+R.^2.*cos(alpha)).*(R+d)./(pi.*d.^2.*(z.^2+(R+d).^2+R.^2-2.*R.*(R+d).*cos(alpha)))
integral2(fun,(-pi*1.0)/6.0,(pi*1.0)/6.0,0,l) % integral2 is used for integration with double parameters
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 数学 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!