Both Midpoints Method and Modified Euler Method is local truncation error
$ O(h^2) $
but Midpoint Method is accurate than Modified Euler Method
why?
Both Midpoints Method and Modified Euler Method is local truncation error
$ O(h^2) $
but Midpoint Method is accurate than Modified Euler Method
why?
To get an empirical picture of the error sizes, take some non-linear test problem $$ y'+10\sin(y)=p'+10\sin(p)\iff y'=-10(\sin(y)-\sin(p))+p' $$ with $p(x)=\sin(x)$ as exact solution and apply the trapezoidal and midpoint methods in the explicit and implicit variants over a couple of step sizes. To get comparable quantities, compute the difference to the exact solution and divide by the expected size $h^2$. This gives the plots
As one can see, the errors for the midpoint methods have about the same magnitude. The explicit trapezoidal method has an error of the double size, while the implicit trapezoidal method has one tenth of the error compared to the midpoint methods.
The implementation for the methods is
and the test data
The plot is then produced via