필터 지우기
필터 지우기

Why can't I get this integration to work?

조회 수: 1 (최근 30일)
Kendra Hamilton
Kendra Hamilton 2023년 10월 6일
댓글: Kendra Hamilton 2023년 10월 6일
Hi, I'm trying to integrate the function I(z) from -infinity to infinity. This is my code:
syms P w0 r n lamda z
Pi = sym(pi);
zR = Pi*w0^2*n/lamda;
I(z) = 2*P*zR^2/(Pi*w0^2)*1/(zR^2+z^2)*exp(-2*r^2*zR^2/(w0^2*zR^2+w0^2*z^2));
I1 = int(I, z, -inf, inf)
I1 = 
but it just prints
I1 = int((2*P*n^2*w0^2*pi*exp(-(2*n^2*r^2*w0^4*pi^2)/(lamda^2*(w0^2*z^2 + (n^2*w0^6*pi^2)/lamda^2))))/(lamda^2*(z^2 + (n^2*w0^4*pi^2)/lamda^2)), z, -Inf, Inf)
Can someone tell me what I'm doing wrong?

채택된 답변

Walter Roberson
Walter Roberson 2023년 10월 6일
이동: Walter Roberson 2023년 10월 6일
syms P w0 r n lamda z real
Pi = sym(pi);
zR = Pi*w0^2*n/lamda;
I(z) = 2*P*zR^2/(Pi*w0^2)*1/(zR^2+z^2)*exp(-2*r^2*zR^2/(w0^2*zR^2+w0^2*z^2));
IE = expand(I)
IE(z) = 
I1 = int(IE, z, -inf, inf)
I1 = 
Now look at the form of that integral. Can we find a simpler integral that has the same general form but still cannot be integrated? Yes.
syms B C x
F = exp(-B/(x^2+C))
F = 
int(F, x, -inf, inf)
ans = 
A key point for this is that if you hardcode B as 1 then MATLAB can proceed, and likewise if you hard-code C as 0. But the combination of the two is more than MATLAB can deal with.
Maple is not able to deal with this integral either
Your actual integral is worse than this.
Your basic problem, then, is that there is no closed form integral for that expression that can be found by MATLAB (or Maple either)

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by