Why can't I get this integration to work?

1 次查看(过去 30 天)
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