Euler's method for a system

Euler's method may of course also be used for a system. Let's look at a simultaneous system of \( p \) equations $$ \begin{align} &y'_1=f_1(x,y_1,y_2,\dots y_p) \nonumber\\ &y'_2=f_2(x,y_1,y_2,\dots y_p) \nonumber\\ &. \tag{48}\\ &.\nonumber\\ &y'_p=f_p(x,y_1,y_2,\dots y_p)\nonumber \end{align} $$ with initial values $$ \begin{equation} \tag{49} y_1(x_0)=a_1,\ y_2(x_0)=a_2,\dots,\ y_p(x_0)=a_p \end{equation} $$ Or, in vectorial format as follows, $$ \begin{align} \tag{50} \mathbf{y'}&=\mathbf{f}(x,\mathbf{y})\\ \mathbf{y}&(x_0)=\mathbf{a} \nonumber \end{align} $$ where \( \mathbf{y'} \), \( \mathbf{f} \), \( \mathbf{y} \) and \( \mathbf{a} \) are column vectors with \( p \) components.

The Euler scheme (41) used on (50) gives $$ \begin{equation} \tag{51} \mathbf{y_{n+1}}=\mathbf{y_n}+h\cdot \mathbf{f}(x_n,\mathbf{y_n}) \end{equation} $$ For a system of three equations we get $$ \begin{align} y'_1=&y_2\nonumber\\ y'_2=&y_3 \tag{52}\\ y'_3=&-y_1y_3\nonumber \end{align} $$ In this case (51) gives $$ \begin{align} &(y_1)_{n+1}=(y_1)_n+h\cdot (y_2)_n\nonumber\\ &(y_2)_{n+1}=(y_2)_n+h\cdot (y_3)_n \tag{53}\\ &(y_3)_{n+1}=(y_3)_n-h\cdot (y_1)_n\cdot (y_3)_n\nonumber\\ \end{align} $$ with \( y_1(x_0)=a_1,\ y_2(x_0)=a_2,\text{ and }y_3(x_0)=a_3 \)

In the section Reduction of Higher order Equations we have seen how we can reduce a higher order ODE to a set of first order ODEs. In (42) and (43) we have the equation \( \frac{d^2z}{dt^2}=g-\alpha\cdot \left(\frac{dz}{dt}\right)^2 \) which we have reduced to a system as $$ \begin{align*} \frac{dz}{dt}= v&\\ \frac{dv}{dt}= g&-\alpha\cdot v^2 \end{align*} $$ which gives an Euler scheme as follows, $$ \begin{align*} &z_{n+1}=z_n+\Delta t\cdot v_n\\ &v_{n+1}=n_n+\Delta t\cdot [g-\alpha(v_n)^2]\\ &\text{med }z_0=0,\ v_0=0 \end{align*} $$