Compute approximation of ODE using one step of explicit/implicit Euler method

euler's methodnumerical methodsordinary differential equationssystems of equations

I'm given the IVP:

$$u^{(3)}(t) + u'(t) = tu(t)$$
$$u''(2) = 2$$
$$u(2) = 0$$
$$u'(2) = 1$$

and am asked to approximate the solution for $t=2.5$ using one step of the explicit Euler-method and one step of the implicit Euler-method. I began with a transformation into a system of first order ODEs.

$$
\begin{align*}
u_0'(t) &= u_1(t) \\
u_1'(t) &= u_2(t) \\
u_2'(t) &= tu_0(t) – u_1(t) \\
u_0(2) &= 0 \\
u_1(2) &= 1 \\
u_2(2) &= 2 \\
\end{align*}
$$

Explicit Euler-method:

$$
\begin{align*}
u_0(2.5) &= u_0(2) + 0.5u_1(2) = 0.5 \\
u_1(2.5) &= \dots = 1 \\
u_1(2.5) &= \dots = -0.5
\end{align*}
$$

  • Implicit Euler-method: I seem to end in an infinite loop where I can't rearrange to find a solution:

$$u_0(2.5) = u_0(2) + 0.5u_1(2.5) = 0.5(u_1(2) + 0.5u_1(2.5))$$
$$= 0.5 + 0.25(u_2(2) + 0.5(2.5u_0(2.5) – u_1(2.5))) = 1 +\frac{1}{8
}(2.5u_0(2.5) – u_1(2.5))$$

Now this seems to go on forever. What am I doing wrong? Or am I actually on the right track here? I can't seem to ever get a term with just $u_0(2.5)$ on the RHS.

Best Answer

Note that in general to get to barely useful results with the Euler methods, one should observe the guideline that $Lh<1.5$. Here with $L\approx 2$ and $h=0.5$ that is satisfied.


The explicit step should have $u_0(2.5)=0.5$, $u_1(0.5)=1+0.5⋅2=2$ and $u_2(2.5)=2+0.5⋅(2⋅0-1)=1.5$, somehow in the omitted part there are some terms missing.


For the implicit step, you get a non-trivial system $u(t)=(I-hA)u(t+h)$ that you have to solve via Gauß elimination or similar. $$ \pmatrix{0\\1\\2} = \pmatrix{1&-0.5&0\\0&1&-0.5\\-0.5\cdot 2.5&0.5&1} \pmatrix{u_0(2.5)\\u_1(2.5)\\u_2(2.5)} $$ which solves as $u_0(2.5)=1.06666667$, $u_1(2.5)=2.13333333$, $u_2(2.5)=2.26666667$.


A more exact integration with a higher order method gives the value table \begin{array}{c|ccc} t&u_0(t)&u_1(t)&u_2(t)\\\hline 2.000 & 0.00000000 & 1.00000000 & 2.00000000 \\ 2.100 & 0.10983395 & 1.19502947 & 1.90118241 \\ 2.200 & 0.23868570 & 1.38047638 & 1.80957168 \\ 2.300 & 0.38564537 & 1.55743288 & 1.73264001 \\ 2.400 & 0.54995008 & 1.72774964 & 1.67807126 \\ 2.500 & 0.73106066 & 1.89405346 & 1.65369605 \\ \end{array} which is not exactly close in the last row.