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

조회 수: 6 (최근 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!