integral(exp(double integral)) ?===>integral of riemann
1 回表示 (過去 30 日間)
古いコメントを表示
Marwen Tarhouni
2019 年 7 月 20 日
コメント済み: Marwen Tarhouni
2019 年 7 月 21 日
Hi,
i have an equation to 3 unknown (x,y theta)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/230632/image.jpeg)
i try this code
a =2.2;
b =0:10:100;
r = 50;
for i = 1:length(b)
bin=100;
resultat=0;
for k=1:bin
y=k*r/bin;
eq1= @(x,theta) exp(-b(i).*(sqrt(x.^2.*(cos(theta)).^2+(x.*sin(theta)-y).^2).*x)) ;
In2=integral2(eq1,0,r,0,2*pi);
resultat=resultat+ exp(-a* (1-In2))*2*y/(r^2);
end
end
==== >result does not work correctly
2 件のコメント
John D'Errico
2019 年 7 月 20 日
Without even looking more carefully at the numbers, as soon as I see this start:
exp(-3.7154e+05*d(i).*(
I will predict your problem is in the form of exponential underflows. The result will be numerical garbage.
採用された回答
Sulaymon Eshkabilov
2019 年 7 月 20 日
Hi,
In your code, the variable d is assigned instead of b on line 2: d= 0:10:100; When this is fixed then everything works ok.
You can also start your simulation with the command: clearvars
Good luck
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!