Problem: Solve \[ y^{\prime \prime }\left ( t\right ) -1.5y^{\prime }\left ( t\right ) +5y\left ( t\right ) =0 \] with initial conditions \[ y\left ( 0\right ) =1,y^{\prime }\left ( 0\right ) =0 \] To use Matlab ode45, the second order ODE is first converted to state space formulation as follows
Given \(y^{\prime \prime }\left ( t\right ) -1.5y^{\prime }\left ( t\right ) +5y\left ( t\right ) =0\) let \begin {align*} x_{1} & =y\\ x_{2} & =y^{\prime }\\ & =x_{1}^{\prime } \end {align*}
hence \[ x_{1}^{\prime }=x_{2}\] and \begin {align*} x_{2}^{\prime } & =y^{\prime \prime }\\ & =1.5y^{\prime }-5y\\ & =1.5x_{2}-5x_{1} \end {align*}
Hence we can now write \[\begin {bmatrix} x_{1}^{\prime }\\ x_{2}^{\prime }\end {bmatrix} =\begin {bmatrix} 0 & 1\\ -5 & 1.5 \end {bmatrix}\begin {bmatrix} x_{1}\\ x_{2}\end {bmatrix} \] Now Matlab ODE45 can be used.