9.5 Systems and higher-order equations
Every method of this section applies, without change, to a system \(\mathbf y' = \mathbf f(t,\mathbf y)\), \(\mathbf y(a) = \boldsymbol \alpha \), with the scalars \(w_i\), \(k_j\) replaced by vectors. A higher-order equation is reduced to a system: for \[y^{(m)} = f\left (t,y,y',\dots ,y^{(m-1)}\right ),\] put \(u_1 = y\), \(u_2 = y'\), …, \(u_m = y^{(m-1)}\). Then \(u_1' = u_2\), …, \(u_{m-1}' = u_m\), \(u_m' = f(t,u_1,\dots ,u_m)\).
Example 9.5.1. Use RK4 with \(h = 0.1\) for \begin {gather*} y''-2y'+2y = e^{2t}\sin t,\qquad 0\leq t\leq 1,\\ y(0) = -0.4,\qquad y'(0) = -0.6, \end {gather*} whose exact solution is \(y(t) = 0.2e^{2t}(\sin t-2\cos t)\).
Solution. With \(u_1 = y\), \(u_2 = y'\), the system is \[u_1' = u_2,\qquad u_2' = e^{2t}\sin t-2u_1+2u_2,\qquad u_1(0) = -0.4,\ u_2(0) = -0.6 .\] The first step uses vector stages: \begin {align*} \mathbf k_1 &= 0.1\bigl (-0.6,\ 0-2(-0.4)+2(-0.6)\bigr ) = (-0.06,\ -0.04),\\ \mathbf k_2 &= (-0.062,\ -0.0324764),\\ \mathbf k_3 &= (-0.0616238,\ -0.0315241),\\ \mathbf k_4 &= (-0.0631524,\ -0.0217864), \end {align*}
so \(\mathbf w_1 = (-0.4617333,\ -0.6316312)\), against \(y(0.1) = -0.4617330\) and \(y'(0.1) = -0.6316311\). Continuing to \(t = 1\) gives \(w_{10} = -0.3533989\), against \(y(1) = -0.3533944\), an error of \(4.5\times 10^{-6}\); the derivative is obtained as a by-product.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.