Derivation of the midpoint method Midpoint method



illustration of numerical integration equation




y


=
y
,
y
(
0
)
=
1.


{\displaystyle y =y,y(0)=1.}

blue: euler method, green: midpoint method, red: exact solution,



y
=

e

t


.


{\displaystyle y=e^{t}.}

step size



h
=
1.0.


{\displaystyle h=1.0.}





the same illustration



h
=
0.25.


{\displaystyle h=0.25.}

seen midpoint method converges faster euler method.


the midpoint method refinement of euler s method








y

n
+
1


=

y

n


+
h
f
(

t

n


,

y

n


)
,



{\displaystyle y_{n+1}=y_{n}+hf(t_{n},y_{n}),\,}



and derived in similar manner. key deriving euler s method approximate equality







y
(
t
+
h
)

y
(
t
)
+
h
f
(
t
,
y
(
t
)
)


(
2
)


{\displaystyle y(t+h)\approx y(t)+hf(t,y(t))\qquad \qquad (2)}



which obtained slope formula








y


(
t
)




y
(
t
+
h
)

y
(
t
)

h




(
3
)


{\displaystyle y (t)\approx {\frac {y(t+h)-y(t)}{h}}\qquad \qquad (3)}



and keeping in mind




y


=
f
(
t
,
y
)
.


{\displaystyle y =f(t,y).}


for midpoint methods, 1 replaces (3) more accurate








y



(
t
+


h
2


)





y
(
t
+
h
)

y
(
t
)

h




{\displaystyle y \left(t+{\frac {h}{2}}\right)\approx {\frac {y(t+h)-y(t)}{h}}}



when instead of (2) find







y
(
t
+
h
)

y
(
t
)
+
h
f

(
t
+


h
2


,
y

(
t
+


h
2


)

)

.


(
4
)


{\displaystyle y(t+h)\approx y(t)+hf\left(t+{\frac {h}{2}},y\left(t+{\frac {h}{2}}\right)\right).\qquad \qquad (4)}



one cannot use equation find



y
(
t
+
h
)


{\displaystyle y(t+h)}

1 not know



y


{\displaystyle y}

@



t
+
h

/

2


{\displaystyle t+h/2}

. solution use taylor series expansion if using euler method solve



y
(
t
+
h

/

2
)


{\displaystyle y(t+h/2)}

:







y

(
t
+


h
2


)


y
(
t
)
+


h
2



y


(
t
)
=
y
(
t
)
+


h
2


f
(
t
,
y
(
t
)
)
,


{\displaystyle y\left(t+{\frac {h}{2}}\right)\approx y(t)+{\frac {h}{2}}y (t)=y(t)+{\frac {h}{2}}f(t,y(t)),}



which, when plugged in (4), gives us







y
(
t
+
h
)

y
(
t
)
+
h
f

(
t
+


h
2


,
y
(
t
)
+


h
2


f
(
t
,
y
(
t
)
)
)



{\displaystyle y(t+h)\approx y(t)+hf\left(t+{\frac {h}{2}},y(t)+{\frac {h}{2}}f(t,y(t))\right)}



and explicit midpoint method (1e).


the implicit method (1i) obtained approximating value @ half step



t
+
h

/

2


{\displaystyle t+h/2}

midpoint of line segment



y
(
t
)


{\displaystyle y(t)}





y
(
t
+
h
)


{\displaystyle y(t+h)}







y

(
t
+


h
2


)




1
2




(


y
(
t
)
+
y
(
t
+
h
)


)




{\displaystyle y\left(t+{\frac {h}{2}}\right)\approx {\frac {1}{2}}{\bigl (}y(t)+y(t+h){\bigr )}}



and thus










y
(
t
+
h
)

y
(
t
)

h




y



(
t
+


h
2


)


k
=
f

(
t
+


h
2


,


1
2




(


y
(
t
)
+
y
(
t
+
h
)


)


)



{\displaystyle {\frac {y(t+h)-y(t)}{h}}\approx y \left(t+{\frac {h}{2}}\right)\approx k=f\left(t+{\frac {h}{2}},{\frac {1}{2}}{\bigl (}y(t)+y(t+h){\bigr )}\right)}



inserting approximation




y

n


+
h

k


{\displaystyle y_{n}+h\,k}





y
(

t

n


+
h
)


{\displaystyle y(t_{n}+h)}

results in implicit runge-kutta method











k



=
f

(

t

n


+


h
2


,

y

n


+


h
2


k
)






y

n
+
1





=

y

n


+
h

k






{\displaystyle {\begin{aligned}k&=f\left(t_{n}+{\frac {h}{2}},y_{n}+{\frac {h}{2}}k\right)\\y_{n+1}&=y_{n}+h\,k\end{aligned}}}



which contains implicit euler method step size



h

/

2


{\displaystyle h/2}

first part.


because of time symmetry of implicit method, terms of degree in



h


{\displaystyle h}

of local error cancel, local error automatically of order





o


(

h

3


)


{\displaystyle {\mathcal {o}}(h^{3})}

. replacing implicit explicit euler method in determination of



k


{\displaystyle k}

results again in explicit midpoint method.







Comments

Popular posts from this blog

History Swan Lake

Medical vaporizers Vaporizer (inhalation device)

Proto-Slavic Loanwords in Serbian