<!DOCTYPE html> 3 Time-dependent Waves and Burgers’ Equation‣ Notes on the Finite Element Method
Notes on the Finite Element Method

Chapter 3 Time-dependent Waves and Burgers’ Equation

In many cases of practical importance, the system of interest evolves in time in such a way that the assumption of periodic motion is not useful. Describing the temporal evolution requires integrating the governing equations forward in time. Two examples involving problem that are one-dimensional in space are treated: the time dependent linear wave equation and the non-linear Burgers equation.

3.1 The Wave Equation Revisited

When selecting a method well-suited to step a solution forward in time, two questions arise: is the method stable and if it is how accurate is it. These issues are discussed in the next section.

3.1.1 Stability and Accuracy

Discretizing a differential equation can introduce spurious solutions. If these extraneous solutions grow, the computed solution will bear no resemblance to the exact solution (for example it might grow exponentially in time). Stability analysis provides a means to determine whether the solution to the discretized problem remains close to the real solution. Accuracy deals with the magnitude of differences between a computed solution and the analytical solution.

As far as accuracy is concerned, a classical example discussed by Strang (pp117-119) concerns a spring-mass system where the position of the mass is X(t). The velocity of the mass is u=dX/dt. The force balance governing X is:

d2Xdt2+X=0 (3.1)

Write the problems as a system of two first order equations:

dXdt=u,u=-dXdt (3.2)

where u is the velocity of the mass. At t=0 the mass is displaced to X=1, and the velocity is zero. If the time dependence is discretized into chunks of length δt, there are several ways to integrate system 3.2 forward in time. Strang compares the following four schemes:

Forward Euler

Xt+δt=Xt+δtUt,Ut+δt=Ut-δtXtor[XU]t+δt=𝒢F[XU]twhere𝒢F=[1δt-δt1] (3.3)

This scheme is explicit, meaning that the solution a the new time depends solely on quantities evaluated at an earlier time. For this reason it is known as the Forward Euler method. The matrix 𝒢 is the growth matrix. The growth factor is |𝒢|, the determinant of 𝒢. In this case |𝒢f|=1+(δt)2. The method is conditionally stable and errors grow.

Backward Euler

Xt+1=Xt+δtUt+1,Ut+1=Ut-δtXt+1,or[XU]t+δt=[1-δtδt1]-1[XU]t. (3.4)

The Backward Euler methoid is implicit. The growth factor is |𝒢f|=(1+(δt)2)-1, always less than one. The method is stabl Terms evaluated at the new time step t+1 appear on the right hand side.

Trapezoidal Method

The Trapezoidal method is also implicit:

Xt+1=Xt+δt(Ut+1+Ut)/2,Ut+1=Ut-δt(X+1+Xt)/2or[XU]t+δt=14[2-δtδt2]-1[2δt-δt2][XU]t. (3.5)

Now the growth factor is |𝒢t|=1. This is a second-order method, is the method of choice for integrating time-dependent problems (with the exception of stiff problems).

Leapfrog Method

The only drawback to the Trapezoidal method is that it is implicit, requiring a matrix inversion at each time step. The Leapfrog method is:

Xt+1=Xt+δtUt,Ut+1=Ut-δtXt+1,or[XU]t+δt=[1δt-δt1-(δt)2]-1[XU]t. (3.6)

The growth factor is also |𝒢l|=1.

Each scheme has been used to integrate system 3.2 forward from t=0 to t=2π, and the results are compared in figure 3.1, where the dependent variable u is show as a function of the other dependent variable X.

Phase diagram showing velocity

Figure 3.1: Phase diagram showing velocity u as a function of position X for four different integrations schemes. (see Strang, pg 117-118). The dashed circle represents the exact solution. In all cases, δt=1π/36; the symbol represents the solution in X-u space, with the solid symbol marking the initial position. Redrawn from Strang

The two Euler solutions rapidly diverge from the exact solution (the black circle): the accuracy is low. The trapezoidal solution, stay on the circle, however there is a small phase error at the end of a cycle. The leapfrog method has no phase error, but the amplitudes varies by a small amount so that the numerical solution traces an ellipse in the phase plane. The last two methods are much more accurate than the two Euler methods.

3.1.2 The Wave Equation

The wave equation is a good test bed to evaluate the stabilty of the four numerical schemes described above. Consider the system

ηt+(hu)x=0,ut=-gηx (3.7)

Difference between the solution computed by each scheme and
the exact solution at time

Figure 3.2: Difference between the solution computed by each scheme and the exact solution at time t=2. The Forward Euler scheme is unstable. The Trapezoidal scheme works well so long as δt<δx. The error associated withleapfrog is larger than trapezoidal. For these calculations δx=δt=410-3.

The weak form is:

t-LLϕmη𝑑x+-LLϕm(hu)x𝑑x=0t-LLϕmu𝑑x+gh-LLϕmηx𝑑x=0 (3.8)

Write the time index as a superscript; the solutions ut(x) and ηt(x) are written as expansions in the trial functions:

ut(x)=n=1nxuntϕnηt(x)=n=1nxηntϕn (3.9)

Introducing these expansions into equation 3.8

n=1nxηntt-LLϕmϕn𝑑x+n=1nxun-LLϕmϕnx𝑑x=0 (3.10)
ghn=1nx-LLϕmϕnxηnt𝑑x+n=1nxuntt-LLϕmϕn𝑑x=0 (3.11)

With the new FEM element matrix:

Demn=ϕmϕnx𝑑x (3.12)

For linear TF, Maxima gives:

Demn=12[-11-11] (3.13)

Form the global matrices from the element matrices in the usual way. The system of equations becomes

𝜼tt+𝒟T𝒖t=0,c2𝒟𝜼t+𝒖tt=0 (3.14)

The Forward Euler scheme is achieved by stepping:

[00][𝜼t+1𝒖t+1]=[-δt𝒟-δt𝒟][𝜼t𝒖t] (3.15)

forward. This is an explicit scheme.

For the Backward Euler scheme step:

[δt𝒟δt𝒟][𝜼t+1𝒖t+1]=[00][𝜼t𝒖t] (3.16)

For the Trapezoidal scheme, step

[δt𝒟/2δt𝒟/2][𝜼t+1𝒖t+1]=[-δt𝒟/2-δt𝒟/2][𝜼t𝒖t] (3.17)

and for the Leapfrog scheme

[δt𝒟0][𝜼t+1𝒖t+1]=[0-δt𝒟][𝜼t𝒖t] (3.18)

Consider a wave system where a gaussian bump of water is released from x=0 at t=0. With d’Alemebert’s solution it is clear that two gaussian bumps, each half the height of the original disturbance, will propgaten away from the center, one toward +x, and the other toward -x. The solution obtained by integrating the equations with each scheme over a two second period is illustrated in figure 3.2, as difference between the computed and exact solution. The Forward Euler scheme goes unstable immediately, as would any other explicit scheme. The error associated with the Trapezoidal scheme is the smallest, and diminishes as the number of elements squared. The trapezoidal scheme is said to be L-stable. We will adopt this scheme for the rest of the class with one exception: for stiff problems, such as the incompressible Navier-Stokes equations, methods that are L-stable are required.

The two components of equation 3.7 can be combined into the wave equation:

c22ηx2+2ηx2=0 (3.19)

for simplicity the phase speed is assumed c=1. If the boundary conditions guarantee that the variable satisfies homogeneous Neumann conditions (corresponding to zero mass flux through the boundaries),, the weak version in matrix form is

2t2(𝜼)=-𝒦𝜼 (3.20)

Now we replace the second derivatime in time by centered differences:

(𝜼t+1-2𝜼t+𝜼t-1)=-(δt)2𝒦𝜼t (3.21)

Surface elevations,

Figure 3.3: Surface elevations, η as a function of position x and time t. The initial bulge separates into two half height waves that propagate toward the basin extremities. The locus of the peaks follows the characteristics emananating from x=0 at t=0. At t=1 they reflect back into the basin. Without friction the process would go on forever.

This scheme requires initial values at two times. Fortunately we have the d’Alembert solution, so for a Gaussian bump at t=0, start with:

η(x,0)=2e-αx2,η(x,-δt)=e-α(x-cδt)2+e-α(x+cδt)2 (3.22)

The solution η(x,t) for a case where c=1 is illustrated in figure 3.3. As time increase the initial disturbance produces two faves, each progressing toward opposite ends of the basin, where they reflect and head back toward the center of the basin. The ridges of maximum η trace out the characteristics emanating from x=0 at t=0.

3.2 Burgers’ Equation

Read Strang pg 537


Burgers equation is:

ut+uux=ν2ux2 (3.23)

In the following three different exact solutions to Burgers’ equation are reviewed.

3.2.1 Characteristics, Expansions and Shocks

If the viscosity ν=0, Burgers equation looks like the one-way wave equation. Do characteristics exist? Define ξ=x-ut. Then, with the chain rule:

x=ddξξx=ddξ,t=ddξξt=-uddξ. (3.24)

Therefore any function g(ξ) satisfies the inviscid Burgers equation.

-udgdξ+udgdξ0. (3.25)

The function g is constant along characteristic lines. Hovever, in contrat to the linear case, the characteristics need no longer remain parallel, as illustrated by the solid black lines illustrated on the u=0 plane in figure 3.4. At time=0 the initial profile is a gaussian function of x, symmetric relative to x=0. As time increases the non-linearity distorts the initial profile in such a way that area where the velocity increases with x expand and areas where the velocity decrease with x sharpen. Eventually these area will contain shocks, where the Riemann solutions take over, as illustrated in figure 3.4.

Solution to Burgers equation with

Figure 3.4: Solution to Burgers equation with ν=0. Velocity u as a function of position x and time t. Initially the velocity bulge is symmetric about x=0. The characteristics, shown as black lines on the x-t plane, tend to coalesce in the region where the flow is deccelerating, and expand where the flow accelerates. As a result the velocity bulge evolves in shape, steepening in the region where the streamlines converge.

3.2.2 Solution for a Translating Front

Returning to the full Bergers equation, look for solutions of the form u(ζ) where ζ=x-ct, and the constant wave speed c is to be determined. The initial condition is uu1 as x and uu2 as x-. If we introduce the new independent variable into equation 3.23 we get:

-cdudζ+ududζ=νd2udζ2 (3.26)

Try a solution of the form

u=a+btanh(αζ) (3.27)

Equation 3.26 becomes

bα(a-c)cosh2(αξ)+bα(b+2αν)tanh(αξ)cosh2(αξ)=0 (3.28)

The choices

a=candb=-2αν (3.29)

turn equation 3.28 into an identity. The boundary conditions then determine a and b so the solution is

u=u¯+δu2tanhδuζ4νwhereζ=x-u¯t. (3.30)

Velocity

Figure 3.5: Velocity u (equation 3.30) as a function of position x for three values of the viscosity ν. For this calculation u¯=δu=1..

This solution is illustrated in figure 3.5 for several values of the ratio δu/ν. The form of the solution shows that the wavefront remains locally unchanges, moving to the right at the average speed of the two streams.

3.2.3 A second solution: the Cole-Hopf transformation

Consider equation 3.23 with initial and BC:

u(x,0)=δ(x),u(±,t)=0. (3.31)

Make the transformation ψx=u and integrate once in x to get an equation for ψ:

ψt+12(ψx)2=ν2ψx2 (3.32)

make the further transformation ψ=-4lnϕ/Re, equivalent to:

u=-2νϕxϕ (3.33)

the derivatives are:

ψt=-2νϕϕt;ψx=-2νϕϕx;2ψx2=2νϕ2[(ϕx)2-ϕ2ϕx2] (3.34)

substitute into equation 3.32:

-2νϕϕt+2(νϕϕx)2=2(νϕ2)2[(ϕx)2-ϕ2ϕx2] (3.35)

and the equation for ϕ is:

ϕt=ν2ϕx2 (3.36)

This is the heat equation. The initial condition the the various dependent variables are:

u(x,0)=δ(x),ψ(x,0)=H(x),ϕ(x,0)=exp(-H(x)2ν) (3.37)

Initially ϕ has a step change where x=0. The problem for ϕ is identical to the linearized shear layer problem, and the solution is known to be of the form:

ϕ=a+berf(η)whereη=x24νt (3.38)

The constants a and b are determined by the boundary conditions:

ϕ(-)=1,ϕ()=e-1/(2ν) (3.39)

The function ϕ becomes:

ϕ=1+e-1/(2ν)-(1-e-1/(2ν))erf(η)2, (3.40)

and the velocity is

u=2νπt(1-e-1/(2ν))e-η2(1+e-1/(2ν))-(1-e-1/(2ν))erf(η) (3.41)

The evolution in time of the velocity from equation 3.41 is illustrated in figure for an initial velocity disturbance u=δ(x), at three times. The peak velocity translates toward +x, and the velocity expansion, behind the peak spread out in time. The front, ahead of the peak does not sharpen, because of viscous diffusion.

The solution 

Figure 3.6: The solution 3.41 as a function of loaction x and time. The solution is omitted for the initial instant since it is a δ function.

3.2.4 FEM

Now turn our attention to using numerical methods to solve Burgers’ equation. The spatial discretization will be accomplished with FEM. Obtain the weak form by multiplying equation 3.23 by a test function, ϕm and integrate over the domain.

t-LLuϕm𝑑x+-LL(uux)ϕm𝑑x=2Re-LL2ux2ϕm𝑑x (3.42)

where we have replaced the infinite domain by a (large enough) domain: -LxL. There needs to be one initial condition and two boundary conditions.

Look for solutions of the form:

ut(x)=n=1nxuntϕn (3.43)

The superscript refers to time and the subscript refers to location.

tn=1nx-LLϕmϕn𝑑xun+-LLϕmn=1nxϕnun(xo=1nxϕouo)dx-νn=1nx-LLϕmxϕnx𝑑xun=0 (3.44)

or, using matrix notation

𝒖t+(𝒥+ν𝒦)𝒖=0. (3.45)

where 𝒥 is itself a function of 𝒖.

The boundary conditions specify values of the solution at either end of the spatial domain: they aree Dirichlet conditions, similar to the conditions encountered in section LABEL:sec:C2coos. When the interior and boundary portions of equation 3.45 are separated out:

~𝒖~t+(𝒥~+ν𝒦~)𝒖~=-(𝒥^+ν𝒦^)𝒖^ (3.46)

where the tilde and hat modifiere are defined in equation 1.41.

Advection

Advection is included as an additional term compared to the linear wave equation, namely

𝐉=𝒥𝒖=-LLϕmn=1nxϕnun(xo=1nxϕouo)dx (3.47)

With linear TF, the evaluation of the column vector 𝐉 is relatively straightforward, since gradients of the test functions are constant in each elelement. The contribution to node m come from two elements m and m+1, as shown in

𝐉m=-LLϕmn=1nxϕnun(xo=1nxϕouo)dx (3.48)

The only contributions come from the interval xm-1:xm+1 illustrated in figure 3.7, where ϕm0.

Figure 3.7: Contributions to the term 𝐉m are limited to the interval xm-1:xm+1

Away from the ends,this allows us to write:

𝐉m=xm-1xmϕmn=1nxϕnun(xo=1nxϕouo)dx+xmxm+1ϕmn=1nxϕnun(xo=1nxϕouo)dx (3.49)
𝐉m=xm-1xmϕm(ϕm-1um-1+ϕmum)(ϕm-1xum-1+ϕmxum)𝑑x+xmxm+1ϕm(ϕm+1um+1+ϕmum)(ϕm+1xum+1+ϕmxum)𝑑x (3.50)

The partial derivatives are constants, either ±1/(δx), so the second parenthesis can be moved out of the integral:

𝐉m=um-um-1δxxm-1xmϕm(ϕm-1um-1+ϕmum)𝑑x+um+1-umδxxmxm+1ϕm(ϕm+1um+1+ϕmum)𝑑x (3.51)

where δx is the distance between neighboring nodes.

𝐉m=um-um-1δx(um-1xm-1xmϕmϕm-1𝑑x+umxm-1xmϕm2𝑑x)+um+1-umδx(um+1xmxm+1ϕmϕm+1𝑑x+umxmxm+1ϕm2𝑑x) (3.52)
𝐉m=(um-um-1)(um-16+um3)+(um+1-um)(um+16+um3)=umum-16+um23-um-126-umum-13+um+126+umum+13-um+1um6-um23 (3.53)

Finally:

𝐉m=16(um+12+umum+1-umum-1-um-12) (3.54)

At the ends:

𝐉1=16(u2-u1)(2u1+u2),𝐉n=16(unx-unx-1)(2unx+unx-1) (3.55)

Noitice that if

𝒥=16[-u1u2-u1u3-u1u3-um-1um+1-um-1um+1] (3.56)

then

𝐉=𝒥𝒖 (3.57)
Element by element construction

the whole advection term will be 𝒥𝒖, where the matrix 𝒥 is itself a function of 𝒖. Element Matrices are Jmno.

Time-stepping

Because Burgers’ equation is non-linear, there is no assurance that the stability analysis described earlier in this chapter is pertinent. Instead we compare the stability and accuracy of several methods.

Trapezoidal
[~+δt2(𝒥~t+ν𝒦~)]𝒖~t+1=[~-δt2(𝒥~t+ν𝒦~)]𝒖~t-(𝒥^t+ν𝒦^)𝒖^ (3.58)

The weakness here is that the matrix 𝒥~t is evaluated at the know time. There is a way to overcome this by using Newton’s method: see Strang page 484.

BDF2

This is a multi step version of the Backward Euler scheme described in section LABEL:sec:C3S2:Acc-Stab. If u is the generic dependent variable, we want to integrate

ut=f(u,x,t) (3.59)

where the function f can be non-linear. Instead of using equation LABEL:eq:C3S2:TSBE, we make use of two earlier points:

3Ut+1-4Ut+Ut-12δt=f(Ut+1,t+1) (3.60)

For Burgers equation this is:

[3~+2δt(𝒥~t+ν𝒦~)]𝒖~t+1=~(4𝒖~t-𝒖~t-1)-2δt(𝒥^t+ν𝒦^)𝒖^ (3.61)

A single TR step is taken at first. Then for the second step, values of Ut and Ut-1 are available.

Multi-step: Gadzag

Reference: Time-Differencing Schemes and Transform Methods, J. of Computationa Physics, v 20, 196-207, 1976

This scheme belongs to the predictor-corrector family (Strang pg 486), where a prediction of the new value Ut+1 is made based on an explicit value of the nonlinear term, then a coorected value is made based on the nonlinear term evaluted based on the predictor. For the Gadzag scheme:

Upt+1=Ut+δt3ft-ft-12predictor step (3.62)
Ut+1=Ut+δtft+fpt+12corrector step

where fpt+1 is evaluated based on the predictor Upt+1. The Gadzag scheme has the advantage of requiring only one evaluation of matrix 𝒥 per time step.

Newton’s method

This method differs conceptually from all other methods described in that it doesn’t explicitly invole an integration in time. Consider

Instead, given the solution at some time, the solution at a later time is found as a correction based on

Each of the four schemes described above has been evaluated by computing the solution to the travelling wave problem described in sectionsec:C3S2:Burgers:TransFront, with u¯=δu=1.

Plot comparing ana with different methods

Figure 3.8:

Exercises

  1. 1.

    Rather than casting the time dependent wave problem as a system of two equations, it can be cast as a single second order system involving the mass and stiffness matrix. Do this for both trapezoidal and leapfrog schemes and compare results to the exact solution and to the two by two system solution.

  2. 2.

    Evalute several (at least four) integration schemes of your choice to compare their performace as measured by the Infinity norm of the difference between the solution given by the scheme and the exact solution.

3.3 Scripts