Midpoint method: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 6:
:<math> y'(t) = f(t, y(t)), \quad y(t_0) = y_0 .</math>
The explicit midpoint method is given by the formula
{{NumBlk|:|<math> y_{n+1} = y_n + hf\left(t_n+\frac{h}{2},y_n+\frac{h}{2}f(t_n, y_n)\right), \qquad\qquad (1e)</math>|{{EquationRef|1e}}}}
the implicit midpoint method by
{{NumBlk|:|<math> y_{n+1} = y_n + hf\left(t_n+\frac{h}{2},\frac12 (y_n+y_{n+1})\right), \qquad\qquad (1i)</math>|{{EquationRef|1i}}}}
for <math>n=0, 1, 2, \dots</math> Here, <math>h</math> is the ''step size'' &mdash; a small positive number, <math>t_n=t_0 + n h,</math> and <math>y_n</math> is the computed approximate value of <math>y(t_n).</math> The explicit midpoint method is sometimes also known as the '''modified Euler method''',<ref>{{harvnb|Süli|Mayers|2003|p=328}}</ref> the implicit method is the most simple [[collocation method]], and, applied to Hamiltonian dynamics, a [[symplectic integrator]]. Note that the '''modified Euler method''' can refer to [[Heun's method]],<ref>{{harvnb|Burden|Faires|2011|p=286}}</ref> for further clarity see [[List of Runge–Kutta methods]].
 
Line 27:
and is derived in a similar manner.
The key to deriving Euler's method is the approximate equality
{{NumBlk|:|<math> y(t+h) \approx y(t) + hf(t,y(t)) \qquad\qquad (2)</math>|{{EquationRef|2}}}}
which is obtained from the slope formula
{{NumBlk|:|<math> y'(t) \approx \frac{y(t+h) - y(t)}{h} \qquad\qquad (3)</math>|{{EquationRef|3}}}}
and keeping in mind that <math> y' = f(t, y).</math>
 
Line 35:
:<math> y'\left(t+\frac{h}{2}\right) \approx \frac{y(t+h) - y(t)}{h} </math>
when instead of (2) we find
{{NumBlk|:|<math> y(t+h) \approx y(t) + hf\left(t+\frac{h}{2},y\left(t+\frac{h}{2}\right)\right). \qquad\qquad (4)</math>|{{EquationRef|4}}}}
 
One cannot use this equation to find <math> y(t+h)</math> as one does not know <math>y</math> at <math>t+h/2</math>. The solution is then to use a [[Taylor series]] expansion exactly as if using the [[Euler method]] to solve for <math>y(t+h/2)</math>: