Implicit iterative methods oscillating?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
maistral
Messages
235
Reaction score
17
I'm under the impression that any implicit method for numerically solving ODE should be providing high stability in exchange for accuracy.

I'm trying to solve the differential equation:
dy/dx = -1000y + 3000 - 2000exp(-x) with intial conditions (0,0).

I still can't understand how come the numerical solution using the Implicit Midpoint is oscillating if it is supposed to be a stable method. Judging from the values, they oscillate between ~0 and~2.
t989rt.png


Am I missing something here?
 
on Phys.org
Seems to me your initial step is relatively big: dy/dx (0) = 1000 so 0.05 makes y shoot off.
You sure there aren't any conditions at all for the stability ?

[edit] perhaps this helps -- but your midpoint is left as an exercise (nr 3 on p. 64...)
 
  • Like
Likes   Reactions: maistral
I see. The implicit midpoint requiring an initial evaluation at dy/dx(0) at the evaluation (y0 + y1)/2 makes it shoot off. Thanks. Is it safe for me to say that implicit methods do strengthen stability, but not guarantee stability? (unless its backward Euler.. that thing is a tank)

I guess I'm really better off with the Gauss-Legendre RK or that BDF thing. Thanks!
 
I think I can agree with your statement. I think that's exactly the subject of the link I gave you.

I don't know what line of work/study you are in, but I find it very useful to check derivative absolute values, no matter which integrator is at work in the program I'm using.
Big values means you want to try small step sizes, but once the values are comparable and relatively smaller you want bigger steps to make reasonable progress.
For your expression I would say that's a 'stiff' ODE and the Gear method comes to mind. Sometimes you have a choice and you simply try one or two.

There's a truckload of litterature on this subject to be found on the internet nowadays, so: happy hunting !