We consider the following initial value problem for two functions $y(x),z(x)$: \begin{align} 0&=y''+(y'+5y)\sin(z) \\ 5z'&=x^2+y^2+z^2 \end{align} where $0≤x≤2$ and $y(0)=1.8$, $y′(0)=−2.4$, $z(0)=0.3$.
Approximate the solution of this initial value problem using Euler's method with $100$ steps. (Hint: Rewrite the system of ODEs in standard form using a suitable substitution)
I need to get the final ODE, then I can use Euler's method in maple. I just don't know how to get the correct equation.
Thanks!
The aim of this exercise is to test that you understood the idea of a numerical ODE solution. Of how the input needs to be prepared and what the expected output is and how to interpret it.
A big hint to the solution is given with the initial conditions. They strongly suggest to use a state vector $u$ that has components $(y,y',z)$. In reversing this relationship, the ODE system can be written as a first order system $$ u'=\pmatrix{u_1'\\u_2' \\u_3'}=F(x,u)=\pmatrix{u_2\\f(x,u)\\g(x,u)} $$ This you can now insert into the Euler method $$ u_{k+1}=u_k+hF(x_k,u_k) $$
Plotting the result for 5,10 and 20 segments gives