# Local truncation error and transformation of coordinates

I am given the advection equation $$u_t=u_x$$ and then the transformation of coordinates $$x=x(\xi,\theta), \qquad t=\theta$$ which leads us to the transformed equation $$x_{\xi} u_{\theta} - u_{\xi} x_{\theta} = u_{\xi}$$ Further, i have to derive the central difference approximation for $u_x$ (at point $x_i$). I derived it via Taylor expansions as $$u_x|_i \approx \frac{u_{i+1} - u_{i-1}}{x_{i+1}- x_{i-1}} = -\frac{1}{x_{i+1}-x_{i-1}} u_{i-1} - \frac{1}{x_{i+1}-x_{i-1}} u_{i+1}$$ Next, i have to work out local truncation error $\tau$ in terms of the transformation derivatives $x_\xi$, $x_{\xi \xi}$,$\dots$ and solution derivatives $u_{xx}$, $u_{xxx}$,$\dots$ and write it in the form $$\tau = E\cdot H^2 + O(H^3)$$ where $H=\Delta \xi$, the constant stepsize in transformed variable $\xi$.

I get $$\tau = \frac{1}{x_{i+1}- x_{i-1}} \big( -\frac{(\Delta x_{i-1})^2}{2} + \frac{(\Delta x_{i})^2}{2} \big) u_{xx} + \frac{1}{x_{i+1}- x_{i-1}} \big( \frac{(\Delta x_{i-1})^3}{6} + \frac{(\Delta x_{i})^3}{6} \big) u_{xxx} + \dots$$ where $\Delta x_i = x_{i+1} - x_i$.

But here my problem arises. I don't know where the $x_\xi,x_{\xi \xi},\dots$ are hidden and where do i find $\Delta \xi$. Any help appreciated.

• Is this question a homework problem? If so, please state that explicitly. Commented May 8, 2013 at 23:06
I have it. I just expand grid function around $x_i$: $$x_{i+1}(\xi,\theta) = x_i + \Delta \xi x_\xi + \frac{(\Delta \xi)^2}{2}x_{\xi \xi} + \dots$$ and $$x_{i-1}(\xi,\theta) = x_i - \Delta \xi x_\xi + \frac{(\Delta \xi)^2}{2}x_{\xi \xi} + \dots$$ Then i use $$(\Delta x_i)^2 - (\Delta x_{i-1})^2 = (\Delta x_{i} - \Delta x_{i-1})(\Delta x_{i} + \Delta x_{i-1})$$ and $$(\Delta x_i)^3 + (\Delta x_{i-1})^3 = (\Delta x_{i} + \Delta x_{i-1})((\Delta x_{i})^2 - \Delta x_i \Delta x_{i-1} + (\Delta x_{i-1})^2)$$ and $$\Delta x_{i} + \Delta x_{i-1} = x_{i+1}-x_{i-1}$$ After calculation you get to the solution.