带有多个参数的二重积分积分,求出带参数的-表达式
5 views (last 30 days)
Show older comments
其中,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
输出参数太多。
0 Comments
Answers (1)
Sai Teja G
on 16 Aug 2023
Edited: Sai Teja G
on 10 Oct 2023
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!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!