4.1: The Euler Method
In general, (4.1) cannot be solved analytically, and we begin by deriving an algorithm for numerical solution. Consider the general second-order ode given by \[\overset{..}{x}=f(t,x,\overset{.}{x}).\nonumber\]
We can write this second-order ode as a pair of first-order odes by defining \(u =\overset{.}{x}\), and writing the first-order system as \[\begin{align}\overset{.}{x}&=u, \label{eq:1} \\ \overset{.}{u}&=f(t,x,u).\label{eq:2}\end{align}\]
The first ode, \(\eqref{eq:1}\), gives the slope of the tangent line to the curve \(x = x(t)\); the second ode, \(\eqref{eq:2}\), gives the slope of the tangent line to the curve \(u = u(t)\). Beginning at the initial values \((x, u) = (x_0, u_0)\) at the time \(t = t_0\), we move along the tangent lines to determine \(x_1 = x(t_0 + ∆t)\) and \(u_1 = u(t_0 + ∆t)\):
\[\begin{aligned}x_1&=x_0+\Delta tu_0, \\ u_1&=u_0+\Delta tf(t_0, x_0, u_0).\end{aligned}\]
The values \(x_1\) and \(u_1\) at the time \(t_1 = t_0 + ∆t\) are then used as new initial values to march the solution forward to time \(t_2 = t_1 + ∆t\). As long as \(f(t, x, u)\) is a well-behaved function, the numerical solution converges to the unique solution of the ode as \(∆t → 0\).