2

Approximating $y'(t^n)$ at the relation $y'(t^n)=f(t^n,y(t^n))$ with the difference quotient $\left[\frac{y(t^{n+1})-y(t^n)}{h} \right]$ we get to the Euler method.

Approximating the same derivative with the quotient $\left[\frac{y(t^{n})-y(t^{n-1})}{h} \right]$ we get to the backward Euler method

$$y^{n+1}=y^n+hf(t^{n+1},y^{n+1}), n=0, \dots, N-1$$

where $y^0:=y_0$.

In order to find the formula for the forward Euler method, we use the limit $\lim_{h \to 0} \frac{y(x_0+h)-y(x_0)}{h}$ for $x_0=t^n, h=t^{n+1}-t^n$.

In order to find the formula for the backward Euler method, could we pick $h=t^{n-1}-t^n$ although it is negative?

Or how do we get otherwise to the approximation:

$$y'(t^n) \approx \frac{y(t^n)-y(t^{n-1})}{h}$$

?

evinda
  • 7,823

1 Answers1

1

obviously, you still choose $t_{n+1}=t_n+h_n$, thus $h=h_n=t_{n+1}-t_n$ for the step from $y_n$ to $y_{n+1}$.


The mean value theorem only tells us that $$ \frac{y(t_{n+1})-y(t_n)}{t_{n+1}-t_n}=y'(t_n+\theta(t_{n+1}-t_n)) $$ where for most of the usual functions $θ\in(0,1)$ can be found close to $1/2$. Setting, for approximation purposes, $θ=0$ or $θ=1$ has thus about the same degree of inaccuracy.

Lutz Lehmann
  • 126,666
  • Using this $h$ we get the forward Euler method, i.e. we get $y'(t^n)=\frac{y(t^{n+1})-y(t^n)}{t^{n+1}-t^n}$. Or am I wrong? – evinda Mar 17 '15 at 18:12
  • yes, wrong. The slope between $(t_n,y_n)$ and $t_{n+1},y_{n+1)}$ can be assigned to both endpoints of the interval with the same right. Remember, the function is continuously differentiable. – Lutz Lehmann Mar 17 '15 at 18:33
  • I haven't understood why $\theta$ can also take the values $0$ and $1$. Also, what does it mean that "setting $\theta=0$ or $\theta=1$ has about the same degree of inaccuracy"? – evinda Mar 17 '15 at 19:43
  • In the mean value theorem, $0<θ<1$. Thus $θ=0$ or $1$ is most certainly wrong. But the error to both sides is generally of the same magnitude. – Lutz Lehmann Mar 17 '15 at 21:56
  • I still haven't understood how we get the formula $$y'(t^n) \approx \frac{y(t^n)-y(t^{n-1})}{h}$$

    Could you explain it further to me?

    – evinda Apr 30 '15 at 13:17