an ode where numerical method fails in matlab
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!