# Lernkarten

Karten 41 Karten 1 Lernende English Universität 21.07.2018 / 25.07.2018 Keine Angabe
0 Exakte Antworten 41 Text Antworten 0 Multiple Choice Antworten

stability analysis with the Neumann method: advection equation with leap-frog scheme.

$$\frac{u^{n+1}_j-u^{n-1}_j}{2\Delta t}+c\frac{u^n_{j+1}-u^n_{j-1}}{2\Delta x}=0$$

$$|\lambda|^2= \left(\frac{c\Delta t}{\Delta x}*sin(k\Delta x) \right)^2+1-\frac{c\Delta t}{\Delta x}*sin(k\Delta x)$$

The scheme is conditionally stable with the Courant-Fredrichs-Lewy or CFL criterion!

What is the Computational Mode? Show it for the leap-frog scheme and the oscillation equation!

A spurious solution to a finite-difference approximation to a differential equation that is not related to the physical solutions of the differential equation.

For instance, the leapfrog differencing scheme can introduce a computational mode.

--------

three level schemes like the leap-frog-scheme requires more than one initial condition (the physical initial condition $$u^{n=0}$$ and the computational initial condition $$u^{n=1}$$ .

taken the oscillation equation: $$\frac{du}{dt}=i\omega u\;\;where\;\;u=u(t)$$

with the solution:$$u=u_0e^{i\omega t}$$

the leap-frog scheme can be written as: $$u^{n+1}=u^{n-1}+2i\omega \Delta tu^n$$

Then there exists two amplification roots: $$\lambda_{1,2}=i\omega \Delta t\pm \sqrt{1-(\omega \Delta t)^2}$$

Thus there are two solutions of the form: $$u^{n+1}=\lambda u^n$$

Since we are solving a linear equation its solution will be a linear combination of the two solutions:

$$u^n=a\lambda_1^nu^0_1+b\lambda_2^nu^0_2$$

The physical mode is the one where $$\lambda \rightarrow 1$$ when $$\Delta t \rightarrow 0$$ . The other is the computational mode, which is introduced by the numerical scheme.

Stability analysis; Neumann method; advection equation; The upstream or upwind scheme

The upstream or upwind scheme:

$$\frac{u_j^{n+1}-u_j^n}{\Delta t}+c\frac{u^n_j-u^n_{j-1}}{\Delta x}\;\;\;if\;c>0\\ \frac{u_j^{n+1}-u_j^n}{\Delta t}+c\frac{u^n_{j+1}-u^n_{j}}{\Delta x}\;\;\;if\;c<0$$

The von Neumann stability analysis gives us:

$$\lambda=1-\frac{c\Delta t}{\Delta x}[1-cos(k\Delta x)+i*sin(k\Delta x)]$$

it follows:

$$0\leq\frac{c\Delta t}{\Delta x}\leq 1$$

which implies that c has to be positive to have stability. The scheme is hence conditionally stable.

advantage: A disturbance cannot propagate in the direction opposite to the physical advection. Thus, no parasitic waves will contaminate the numerical solution.

disadvantage: The upstream scheme is highly diffusive!

Alles über die Welle!

$$u(x,t)=u_0*exp(i(kx-\omega t))$$

with:

• angular frequency... $$\omega=2\pi f$$  mit  $$f=1/T$$
• wave number... $$k=2\pi/\lambda$$
• Dispersion-relation: $$\omega =kc$$

$$u(x,t)=u_0*exp(ik(x-ct))$$

group velocity: $$c_g=\frac{\partial \omega }{\partial k}$$

How to integrate the Rayleigh friction numerically?

Overview:

1. The leap-frog scheme is not a good idea since the stability analysis of Neumann gives unconditionally instability
2. Instead one should use the Crank- Nicholson scheme
1. This is unconditional stable but gives meaningful solutions only for $$\gamma \Delta t<1$$
2. The scheme is strictly seen implicit, but since the discretization doesn't vary in space, one can rearrange the solution to an "explicit scheme".

$$\frac{\partial u}{\partial t}=-\gamma u$$ where $$\gamma >0$$

the analytical solution is: $$u(t)=u_0*e^{-\gamma t}$$

leap-frog discretization brings:

$$\frac{u^{n+1}_j-u^{n-1}_j}{2\Delta t}=-\gamma u_j$$

The stability analysis by Neumann shows:

$$\lambda_{1,2}=-\Delta t*\gamma \pm \sqrt{(\gamma \Delta t)^2+1}$$

$$|\lambda |>1$$, which shows unconditional instability!

Typically used for the Rayleigh friction is the Crank-Nickolson scheme: here the right hand side is taken as an average of n-1 and n+1 such that:

$$\frac{u_j^{n+1}-u_j^{n-1}}{2\Delta t}=-\frac{\gamma }{2}(u_j^{n+1}+u_j^{n-1})$$

The stability analysis by Neumann gives:

$$\lambda^2=\frac{1-\gamma\Delta t}{1+\gamma \Delta t}<1$$

Hence, the scheme is absolutely stable. Although, one needs to choose $$\gamma \Delta t<1$$ to get a realisitc solution.

Furthermore, the scheme seems to be implicit, but since the discretization doesn't vary in space one can just rearrange the equation to an explicit scheme!

Arakawa:

• Euler scheme: conditionally stable
• backward scheme: stable if $$\gamma \Delta t>0$$ (unconditional stable)
• trapezoidal scheme: unconditionally stable

Fazit: I would use the Crank-Nicolson scheme, since this is unconditional stable and has an order of accuracy of 2. The popular leap-frog scheme is unconditional unstable and can't be used.

numerical integration of the heat equation (diffusion equation)!

$$\frac{\partial u}{\partial t}=A\frac{\partial^2u}{\partial x^2}\;\;where\;\;A>0$$

has the analytical solution: $$u(x,t)=u_0e^{\pm ikx-Ak^2t}$$

Euler forward: conditionally stable

Leap-frog: unconditionally unstable

Crank-Nicholson scheme/trapezoidal scheme: unconditionally stable

heat equation with leap frog scheme:

$$\frac{u_j^{n+1}-u_j^{n-1}}{2\Delta t}=A\frac{u_{j+1}-2u_j+u_{j-1}}{(\Delta x)^2}$$

for Neumann method set: $$u^n_j=u_0\lambda^ne^{ikj\Delta x}$$

depends on the time step (n-1,n,n+1) for the spatial derivative on the right hand side:

• for n: (leap frog)
• $$\lambda^2 +\frac{8A\Delta t}{(\Delta x)^2}sin^2(\frac{k\Delta x}{2})\lambda-1=0$$
• the scheme is unconditionally unstable
• (identity of use: $$sin^2(x)=\frac{1}{2}(1-cos(2x))$$)
• for n-1: (Euler forward)
• the scheme is conditionally stable with $$\frac{A\Delta t}{(\Delta x)^2}<1/4$$ ($$-1\leq\lambda\leq 1$$)
• to avoid imaginary roots and oscillating of the solution we recommend: $$\frac{A\Delta t}{(\Delta x)^2}<1/8$$ ($$\lambda^2>0$$)
• $$\lambda^2=1-\frac{8A\Delta t}{(\Delta x)^2}sin^2(\frac{k\Delta x}{2})$$
• for an average of n-1 and n+1 (Crank-Nicholson Scheme)
• absolute stable but imaginary roots which are leading to oscillating solutions can occur
• $$\lambda^2=\frac{1-\frac{4A\Delta t}{(\Delta x)^2}sin^2(\frac{k\Delta x}{2})}{1+\frac{4A\Delta t}{(\Delta x)^2}sin^2(\frac{k\Delta x}{2})}$$
• to avoid oscillating imaginary roots on should use: $$\frac{A\Delta t}{(\Delta x)^2}<1/4$$

There leap-frog can be replaced by an Euler forward in time (replace all n-1 by n). The stability analysis doesn't change.

Fazit: The leap-frog scheme is unconditionally unstable. Although the Crank-Nickolson scheme is unconditionally stable but one should use $$\frac{A\Delta t}{(\Delta x)^2}<1/4$$ to avoid oscillating solutions.

Numerical integration of the Poisson and Laplace equations (elliptic)

Poisson's equation in two dimensions:

$$\nabla^2 u=(\frac{\partial^2}{\partial x^2}+\frac{\partial ^2}{\partial y^2})u=f(x,y)$$

If $$f(x,y)=0$$ then it is the Laplace equation.

The equation can be discretised as

$$\frac{u_{i-1,j}-2u_{i,j}+u_{i+1,j}}{(\Delta x)^2}+\frac{u_{i,j-1}-2u_{i,j}+u_{i,j+1}}{(\Delta y)^2 }=f_{i,j}$$

If we consider a square grid $$(\Delta x=\Delta y)$$ we get:

$$u_{i,j}=\frac{1}{4}[u_{i-1,j}+u_{i+1,j}+u_{i,j-1}+u_{i,j+1}-(\Delta x)^2f_{i,j}]$$

To solve this we need boundary values for the domain and initial values at the iteration level $$u_{i,j}^m\;\;(m=0)$$

most simple form to solve this by iteration is the Jacobi iteration. Quite inefficient and not used for practical purposes.

$$u_{i,j}^{m+1}=\frac{1}{4}[u_{i-1,j}^m+u_{i+1,j}^m+u_{i,j-1}^m+u_{i,j+1}^m-(\Delta x)^2f_{i,j}]$$

An improvement in efficiency is the Gauss-Seidel iteration where newly computed values are partly used in the same iteration level: iteration level m+1 values are available for nodes (i-1,j) and (i,j-1).

$$u_{i,j}^{m+1}=\frac{1}{4}[u_{i-1,j}^{m+1}+u_{i+1,j}^m+u_{i,j-1}^{m+1}+u_{i,j+1}^m-(\Delta x)^2f_{i,j}]$$

Gauss-Seidel iteration can be further improved by increasing the convergence rate using the method of SOR (Successive Over Relaxation). The change between two successive Gauss-Seidel iterations is called the residual c, which is defined as:

$$c=u_{i,j}^{m+1}-u_{i,j}^m$$

The Gauss-Seidel residual is multiplied by a relaxation factor $$\omega$$ and new iteration value is obtained from:

$$u_{i,j}^{m+1}=u_{i,j}^m+\omega c=(1-\omega )u^m_{i,j}+\omega\widehat{u}_{i,j}^{m+1}$$

where  $$\widehat{u}_{i,j}^{m+1}$$ denotes the new iteration value obtained from Gauss-Seidel method.

$$u_{i,j}^{m+1}=(1-\omega)u_{i,j}^m+$$

Sketch the A,B and C-grid!