フィルターのクリア

an ode where numerical method fails in matlab

1 回表示 (過去 30 日間)
Can
Can 2014 年 12 月 13 日
コメント済み: Can 2014 年 12 月 14 日
hello, consider this ode:
syms t
y=dsolve('Dy=sqrt(1-y^2)','y(0)=1/sqrt(2)',t)
and the result is
y = sin(pi/4 + t)
when i try to use numerical methods (like euler, runge kutta, adams bashforth or built in ode solvers in matlab) and plotting it, i get this warning message:
Warning: Imaginary parts of complex X and/or Y arguments ignored
and because y starts to get imaginary values and matlab ignores imaginary parts, resultant points starts to diverge after t=pi/4. is there any way to overcome this problem?

採用された回答

Roger Stafford
Roger Stafford 2014 年 12 月 13 日
編集済み: Roger Stafford 2014 年 12 月 13 日
When y nears 1, your differential equation system becomes what is known as 'stiff'. Even though the ideal solution is a perfectly smooth and regular function, the sizes of steps required in solving the corresponding differential equation system numerically become increasingly small. Look at it this way. When y attains a value of one, the differential equation dictates that the derivative dy/dt should be zero there. What is to prevent it from remaining fixed at y = 1 from that point on, or wandering off in any of a number of different directions? It is clearly a point of instability as far as the differential equation is concerned. This situation is not caused by the complex values you are seeing but lies in the very nature of the differential equation at this point. Read about this phenomenon at:
http://en.wikipedia.org/wiki/Stiff_equation
  2 件のコメント
Star Strider
Star Strider 2014 年 12 月 14 日
I appreciate the clear, concise discussion.
Can
Can 2014 年 12 月 14 日
thanks Roger Stafford, i'll look into it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by