Manipulations of big oh notation

53 Views Asked by At

Suppose we have

$$ v_j^{n+1} = v_j^n + (v_j^n)_t \Delta t + O(\Delta t^2) $$

$$ v_{j+1}^{n} = v_j^n + (v_j^n)_x \Delta x + O(\Delta x^2) $$

$$ v_{j-1}^{n} = v_j^n - (v_j^n)_x \Delta x + O(\Delta x^2) $$

When trying to substitute this into

$$ \frac{ v_j^{n+1} - 1/2(v_{j+1}^n + v_{j-1}^n) }{\Delta t } + \frac{ v_{j+1}^n - v_{j-1}^n }{2 \Delta x} $$

I obtain for the first term:

$$ \frac{ v_j^n + (v_j^n)_t \Delta t + O(\Delta t^2) - 1/2[ v_j^n + (v_j^n)_x \Delta x + O(\Delta x^2) + v_j^n - (v_j^n)_t \Delta x + O(\Delta x^2) ] }{\Delta t} = \frac{ O(\Delta t) + O (\Delta x^2) }{\Delta t}$$

and the second term reduces to

$$ \frac{ v_j^n + (v_j^n)_x \Delta x + O(\Delta x^2) - v_{j-1}^{n} - v_j^n +(v_j^n)_t \Delta x - O(\Delta x^2) }{\Delta x} = \frac{ O(\Delta x)}{\Delta x} $$

Adding up the error we obtain

$$ O(1) + O( \Delta x^2/ \Delta t) + O(1) $$

Which is what is on my answer key that is $O(\Delta x) + O(\Delta t)$. What am I doing wrong here?

1

There are 1 best solutions below

6
On BEST ANSWER

The symmetric nature of the scheme $$ 0=\frac{ v_j^{n+1} - \frac12(v_{j+1}^n + v_{j-1}^n) }{\Delta t } + a\frac{ v_{j+1}^n - v_{j-1}^n }{2 \Delta x} $$ for $0=v_t+av_x$ suggests that it is second order at least in the $x$ direction. Let's test this. Suppose that the values $v_j^n$ are samples of an exact solution \begin{align} \frac12(v_{j+1}^n + v_{j-1}^n)&=v_j^n+\frac12(v_{xx})_j^nΔx^2+O(Δx^4)\\ \frac12(v_{j+1}^n - v_{j-1}^n)&=(v_x)_j^nΔx+\frac16(v_{xxx})_j^nΔx^3+O(Δx^5)\\ v_j^{n+1}=v_j^n+(v_t)_j^nΔt+\frac12(v_{tt})_j^nΔt^2+O(Δt^3)\\[1em]\hline \frac{ v_j^{n+1} - \frac12(v_{j+1}^n + v_{j-1}^n) }{\Delta t } + a\frac{ v_{j+1}^n - v_{j-1}^n }{2 \Delta x} &=(v_t)_j^n+\frac12(v_{tt})_j^nΔt+O(Δt^2) -\frac{\frac12(v_{xx})_j^nΔx^2+O(Δx^4)}{Δt}\\ &\qquad+a((v_x)_j^n+\frac16(v_{xxx})_j^nΔx^2+O(Δx^4))\\[.5em] &=\frac12(v_{xx})_j^n\left(a^2Δt-\frac{Δx^2}{Δt}\right)+O\left(Δt^2,Δx^2,\frac{Δx^4}{Δt}\right) \end{align} So if the ratio of the step sizes is fixed as $Δx=|a|Δt$, then the first term vanishes and the error is of size $O(Δt^2)$. If that ratio is not fixed that way, but still bounded to a finite range away from $0$, that is $Δx\sim Δt$ are of the same scale, then the error will indeed have the magnitude $O(Δx)+O(Δt)$.