필터 지우기
필터 지우기

Integral: "Warning: Minimum step size reached"

조회 수: 22 (최근 30일)
Anke Kügler
Anke Kügler 2015년 9월 27일
댓글: Star Strider 2015년 9월 27일
Hi,
I'm trying to calculate an Integral the following:
xmin=c0/b;
xmax=zn+c0/b;
tw=@(w)(1./(b.*w.*sqrt(1-power(a,2).*power(b,2).*power(w,2))));
r=@(w)(a.*b.*w)./sqrt(1-power(a,2).*power(b,2).*power(w,2));
rx=integral(r,xmin,xmax)
t=integral(tw,xmin,xmax)
For
a=0.00067024
b=-0.06
c0=1480
cn=1492
z0=1000
zn=799.9523
it is working fine, however, for
a=0.00067024
b=0.0133
c0=1480
cn=1492
z0=1000
zn=1902.3
it gives me the following error:
Warning: Minimum step size reached near x = 112181. There may be a singularity, or the
tolerances may be too tight for this problem.
What am I doing wrong?

답변 (3개)

Star Strider
Star Strider 2015년 9월 27일
It is a warning, not an error. It is telling you that the integral function has encountered s singularity and cannot continue.
I would plot the function that is throwing that error to see what the function is doing at that value of the independent variable. You might want to integrate it piecewise below and above the region of that independent variable value.

Anke Kügler
Anke Kügler 2015년 9월 27일
편집: Walter Roberson 2015년 9월 27일
Well, it is giving me results, but I don't know how to read them:
r=1.4201e+04 - 1.5011e+04i
t=9.5693 -10.0014i
what does the "i" mean? I've never seen that before (only for imaginary parts, but my results shouldn't be complex....)
  댓글 수: 1
Star Strider
Star Strider 2015년 9월 27일
The ‘i’ means you do have a complex value for the integration. It probably means you are taking the sqrt of a negative value.

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


Walter Roberson
Walter Roberson 2015년 9월 27일
In your formula r, if power(a,2)*power(b,2)*power(w,2) is greater than 1 then 1 minus that expression is negative and you would be taking sqrt() of a negative number.
power(a,2)*power(b,2) is fixed for any one run, so you can calculate the necessary w as
1/sqrt(power(a,2)*power(b,2))
or more simply 1/(a*b) . And if that is in the range xmin to xmax then your integral involves complex numbers.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by