$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 5.4: The Backward-Euler Method

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

Where in the Inverse Laplace Transform section we tackled the derivative in

$\textbf{x} = B\textbf{x}+\textbf{g} \nonumber$

via an integral transform we pursue in this section a much simpler strategy, namely, replace the derivative with a finite difference quotient. That is, one chooses a small $$dt$$ and 'replaces' Equation with

$\frac{\tilde{x}(t)-\tilde{x}(t-dt)}{dt} = B \tilde{x}(t)+g(t) \nonumber$

The utility of Equation is that it gives a means of solving for $$\tilde{x}$$ at the present time, $$t$$, from the knowledge of $$\tilde{x}$$ in the immediate past, $$t-dt$$.

For example, as $$\tilde{x}(0) = x(0)$$ is supposed known we write Equation as $$\tilde{x}(0) = x(0)$$ is supposed known we write Equation as

$(\frac{I}{dt}-B) \tilde{x}(dt) = x(0)dt+g(dt) \nonumber$

Solving this for $$\tilde{x}(dt)$$ we return to Equation and find

$(\frac{I}{dt}-B) \tilde{x}(2dt) = x(dt)dt+g(2dt) \nonumber$

and solve for $$\tilde{x}(2dt)$$. The general step from past to present,

$\tilde{x} (jdt) = (\frac{I}{dt}-B)^{-1} (\frac{\tilde{x}((j-1)dt)}{dt}+g(jdt)) \nonumber$

is repeated until some desired final time, $$Tdt$$ is reached. This equation has been implemented in fib3.m with $$dt = 1$$ and $$B$$ and $$g$$ as in the dynamic Strang module. The resulting $$\tilde{x}$$ ( run fib3.m yourself!) is indistinguishable from the plot we obtained in the Inverse Laplace module.

Comparing the two representations, we see that they both produce the solution to the general linear system of ordinary equations by simply inverting a shifted copy of $$B$$. The former representation is hard but exact while the latter is easy but approximate. Of course we should expect the approximate solution, $$\tilde{x}$$, to approach the exact solution, $$x$$, as the time step $$dt$$, approaches zero. To see this let us return to Equation and assume, for now, that $$g \equiv 0$$. In this case, one can reverse the above steps and arrive at the representation

$\tilde{x}(jdt) = ((I-dtB)^{-1})^{j} x(0) \nonumber$

Now, for a fixed time $$t$$ we suppose that $$dt = \frac{t}{j}$$ and ask whether

$x(t) = \lim_{j \rightarrow \infty} ((I-\frac{t}{j}B)^{-1})^{j}x(0) \nonumber$

This limit, at least when $$B$$ is one-by-one, yields the exponential

$x(t) = e^{Bt} x(0) \nonumber$

clearly the correct solution to the equation. A careful explication of the matrix exponential and its relationship to the transfer function will have to wait until we have mastered the inverse laplace transform.