 Makena Preston

2022-07-19

i have this differential equation and actually i am not sure if i have solved it right with Euler's improved method :
${z}^{″}={f}_{z}-{C}_{z}\ast |{z}^{\prime }|\ast {z}^{\prime }$
${z}^{\prime }=u$
${u}^{\prime }={z}^{″}={f}_{z}-{C}_{z}\ast |u|\ast u$
Improved Euler Method :
${K}_{1}=fz-Cz\ast |{u}_{n}|\ast {u}_{n}$
${K}_{2}=fz-\left({C}_{z}\ast |{u}_{n}+h\ast {K}_{1}|\right)\ast \left({u}_{n}+h\ast {K}_{1}\right)$
so we get :
${z}_{n+1}=zn+h\ast {u}_{n}$
${u}_{n+1}={u}_{n}+\frac{h}{2}\ast \left({K}_{1}+h\ast {K}_{2}\right)$
Is this right ?
P.S (fz , Cz are just variables with numbers not function inputs) Trace House

Expert

There are several small errors that would sum up to a more grossly incorrect output. As a system with multiple components, you need to compute the intermediary slopes at all stages for all components, that is, additionally for the slopes in $z$ direction
$\begin{array}{rl}{L}_{1}& =u\\ {L}_{2}& =u+h{K}_{1}\end{array}$
Then the equations for the step are
$\begin{array}{rl}{u}_{+1}& =u+\frac{h}{2}\left({K}_{1}+{K}_{2}\right)\\ {z}_{+1}& =z+\frac{h}{2}\left({L}_{1}+{L}_{2}\right)=z+hu+\frac{{h}^{2}}{2}{K}_{1}\end{array}$ Bruno Thompson

Expert