Thread: Euler method vs RK4

1. Euler method vs RK4

Hi,

Is RK4 strictly a better approximation than the Euler method? I'm writing the code for a program comparing the two on a particular ODE but I'm finding that the Euler gives the better results. I'm pretty sure my code is right (I can post this later if needs be) so I'm a little confused as I'm certain RK4 should be absolutely better.

Thanks

PS Also, does this forum support LaTex?

2. Yes, of course it support Latex.
PS I don't understand what you say since I have never learn RK4 and Euler method you mentioned.

3. Originally Posted by markchester
Hi,

Is RK4 strictly a better approximation than the Euler method? I'm writing the code for a program comparing the two on a particular ODE but I'm finding that the Euler gives the better results. I'm pretty sure my code is right (I can post this later if needs be) so I'm a little confused as I'm certain RK4 should be absolutely better.

Thanks

PS Also, does this forum support LaTex?
Euler is exact when the actual solution is linear, RK4 is exact for polynomials up to n-th order, n>1 but I don't remember its exact value you can look it up.

For a fixed step size RK4 should never be worse than Euler with the same step size. Excepting when there are discontinuities or other non-polynomial like behaviours in the equation.

CB