필터 지우기
필터 지우기

integral(exp(double integral)) ?===>integral of riemann

조회 수: 2 (최근 30일)
Marwen Tarhouni
Marwen Tarhouni 2019년 7월 20일
댓글: Marwen Tarhouni 2019년 7월 21일
Hi,
i have an equation to 3 unknown (x,y theta)
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
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.
Marwen Tarhouni
Marwen Tarhouni 2019년 7월 20일
편집: Marwen Tarhouni 2019년 7월 20일
Without this number ,i removed it. It's important to me to solve this equation ,i try this code as solution of my equation but i dont know if it's correctly.

댓글을 달려면 로그인하십시오.

채택된 답변

Sulaymon Eshkabilov
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
  댓글 수: 1
Marwen Tarhouni
Marwen Tarhouni 2019년 7월 21일
yes i correct this typo, thank you for your answer

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by