last day (23 days later) » 

21:44
1
A: Deriving the central Euler method and intuition

ChristophIt's a two-step Nyström method. Using the ODE $u' = f(u)$ and $x_k := x_0 + k h$ you write \begin{equation} u(x_{k+1}) - u(x_{k-1}) = \int \limits_{x_{k-1}}^{x_{k+1}} u'(x) \, \mathrm{d}x = \int \limits_{x_{k-1}}^{x_{k+1}} f(u(x)) \, \mathrm{d}x. \end{equation} Now you use a quadrature formula fo...

Cool way of writing that difference as the definite integral of a derivative! So does this mean that the approximation error in the midpoint rule for this integral is the same as the truncation error of the "central euler method"?
That's right, I'll add something on the local truncation error.
So, my $u_{k+1}$ in the expression in my question is an approximation for the real value corresponding to $x_2$, right? And the $u(x_2)$ is the exact value at $x_2$? If that's the case, I understand why we then subract the approximation from the exact value. I don't understand the taylor expansion of $u(x_0)$ tho, where do the minus signs come from, and how do you expand to a higher $x_i$?
Yes, I did it for $k=1$ only, you can do it for any $k$ of course. The two expressions above are just Taylor expansions of $u(x_0) = u(x_1 - h)$ (note the minus sign!) and of $u(x_2) = u(x_1 + h)$ around $x_1$.
One more thing: In your formula for $\tau$ you use $u(x_2)$ and $u(x_0)$ and $u(x_1)$, but here the first is an exact value for every iteration right? But the second and third are approximate results from previous iterations if I'm not mistaken? (So in this case $x_0$ and $x_1$ are exact in this example, because they were given, but I mean for the next and subsequent iterations).
21:44
You are right, but for the local truncation error we always assume that the previous values $u_{k-1}, u_k$ are exact and we check the error of the next value, $u_{k+1}$, which is no longer exact. See en.wikipedia.org/wiki/… for example.
I understand that this works for the local truncation error.
My assignment is to calculate the truncation error in general (not any more specific, so I guess global). How would I calculate that? My book gives an example for the normal euler or forward euler method, but I don't know how to translate that to the central euler
It's much more complicated to go from the local to the global error for multistep methods (such as Nyström) than for one-step methods (such as Euler forward/backward). Some keywords are also there in the Wikipedia article.
In any case, the global error would be $h^2$, and you said the solution is $h^3$, so I guess the local error is sufficient for your exercise.
Does the "multi-step" refer to x_2 to being based on the previous two x_i? So on multiple x_i?
I'll read some more on wikipedia
Thanks for helping
Yes, that's correct: multiple previous values are used instead of just one.
Also note that the transition from the local to the global error is a general proof which is not specific to the method used. So it doesn't need to be proven every time, whereas the local error needs to be re-computed for every new method. Therefore, it's also the more useful exercise to compute the local error.
22:05
The global error is always the same, for whatever method you use? Or is it always one power less than the local?
Next up I'll have to find the "stability area" and after that a function on which that method might prove useful.

But for now, thanks for you help and good night
22:26
No, the error is not always the same but the transition from local to global is. You just need to assume Lipschitz continuity of f with a Lipschitz constant L. LutzL has written it in his answer.

And in this transition you lose one power of $h$, that's correct.
You're welcome and good night, too

  last day (23 days later) »