# text book definition of local truncation differ from other

in my text book [burden faires]

ODE inital value problem $$y' = f(t,y) , a \leq t \leq b, y(a)= \alpha$$

and the difference method $$w_0=\alpha, w_{i+1} = w_i + h\phi(t_i,w_i)$$

then local truncation error $$\tau_{i+1}(h)= \frac{y_{i+1}-y_i}{h} - f(t_i,y_i)$$

is my text book definiton, which $$w_i$$ is approximation root and $$y_i$$ is exact.

but other book or wiki say that local truncation error is $$y_{i+1}-y_i-h\phi(t_i,y_i)$$ . what is difference?

and so runge kutta method of midpoint method and modified Euler methood have a local truncation error order $$O(h^2)$$ and Runge kutta order four has local truncatin error order $$O(h^4)$$ but other people say that midpoint method has a local truncation error order $$O(h^3)$$ I am very confused

• and I don't know my text book passage " assuming that the method was exact at the previous step". what is mean? this is in local truncation error definition – seyunkim Jul 24 at 18:22
• It should be $ϕ(t_i,w_i)$ also in the first definition of the truncation error. And in both cases it really should be $ϕ(t_i,w_i,h)$, as the inner stages of the method will depend on the step size, apart from the most trivial methods. – Dr. Lutz Lehmann Jul 25 at 8:24

There are two common definitions of local truncation error, which end up differing by an order. I'll work with an example method.

Let's consider the problem $$\begin{cases} u'(t)&=f(u(t)),\\ u(0)&=\eta\end{cases}$$ and approximate the solution via the midpoint/leapfrog method $$\frac{U^{n+1}-U^{n-1}}{2k}=f(U^n),$$ which can also be written as $$U^{n+1}=U^{n-1}+2kf(U^n).$$ The definition of local truncation error boils down to which of the above formulas you want to directly work with.

Definition One: This seems to be the convention that you use. Here, we plug the true solution into the finite difference formula (i.e. plug it into the formula that actually models the derivative and somewhat preserves that structure). Here, the local truncation error is $$\tau^n=\frac{u(t_{n+1})-u(t_{n-1})}{2k}-f(u(t_n))=\mathcal{O}(k^2),$$ which we get from Taylor expanding.

Definition Two: This is sometimes referred to as the one-step error. It is the error incurred from taking one step forward, assuming that the previous iterations were correct. This error is $$\mathcal{L}^n=u(t_{n+1})-U^{n+1}.$$ Here, we appeal to the second way that we wrote our ODE method. That is, if we consider the midpoint/leapfrog method $$U^{n+1}=U^{n-1}+2kf(U^n),$$ then $$\mathcal{L}^n=u(t_{n+1})-u(t_{n-1})-2ku'(t_n)=\mathcal{O}(k^3),$$ which also comes from Taylor expanding. It makes sense to get one less order of $$k$$ here, since we didn't divide by $$k$$ at the start.

Either definition is fine, and the convention that you follow is up to you. It's usually pretty easy to tell from context which one people are using. I believe that the second definition is the most common.

It does not really matter which definition you use, if you calculate $$\frac{y(t+h)-y(t)}h-ϕ(t ,y(t),h)\in O(h^{p})$$ or $$y(t+h)-y(t)-hϕ(t,y(t),h)\in O(h^{p+1}),$$ both define the same local error order $$p$$. For the usual methods this local error order directly translates into the global error order.

In the step from the local to the global error you consider exact solutions $$y_i(t)$$ with initial condition $$y_i(t_i)=w_i$$, so that in computing the error against the solution $$y_0(t)$$ of the original problem, one can apply the Grönwall lemma to the difference $$y_i(t)-y_0(t)$$ of exact solutions. Then the error at $$t_{i+1}$$ is the sum of the Grönwall-propagated error from $$t_i$$ and the truncation error in the step from $$(t_i,w_i)$$ to $$(t_{i+1},w_{i+1})$$.