- 23,709
- 5,927
For this scheme, the error is going to be on the order of ##(\Delta t)^2##, compared to ##\Delta t## for the forward Euler scheme.TachyonLord said:Thank you so much for your suggestion. I appreciate it a lot ! :) By the way, what is the maximum error for this algorithm ?
But I still kinda want to know about the reason for energy having these little disturbances. Thanks again :)
The explicit difference equations are going to be $$v(t+\Delta t)=\frac{1-(\pi \Delta t)^2}{1+(\pi \Delta t)^2}v(t)-\frac{4\pi^2\Delta t}{1+(\pi \Delta t)^2}x(t)$$
$$x(t+\Delta t)=\frac{\Delta t }{1+(\pi \Delta t)^2}v(t)+\frac{1-(\pi \Delta t)^2}{1+(\pi \Delta t)^2}x(t)$$
Try it. You'll like it.