97
M.Sc. in Meteorology UCD Numerical Weather Prediction Prof Peter Lynch Meteorology & Climate Centre School of Mathematical Sciences University College Dublin Second Semester, 2005–2006. In this section we consider the numerical discretization of the equations of motion.

Numerical Weather Prediction - maths.ucd.ie

  • Upload
    others

  • View
    22

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Numerical Weather Prediction - maths.ucd.ie

M.Sc. in Meteorology UCD

Numerical WeatherPrediction

Prof Peter Lynch

Meteorology & Climate CentreSchool of Mathematical Sciences

University College Dublin

Second Semester, 2005–2006.

In this section we consider the numerical discretization of the equations of motion.

Page 2: Numerical Weather Prediction - maths.ucd.ie

Text for the CourseThe lectures will be based closely on the text

Atmospheric Modeling, Data Assimilation and Predictabilityby

Eugenia Kalnay

published by Cambridge University Press (2002).

2

Page 3: Numerical Weather Prediction - maths.ucd.ie

Numerical Methods (Kalnay, Ch. 3)• NWP is an initial/boundary value problem

3

Page 4: Numerical Weather Prediction - maths.ucd.ie

Numerical Methods (Kalnay, Ch. 3)• NWP is an initial/boundary value problem

• Given

– an estimate of the present state of the atmosphere(initial conditions)

– appropriate surface and lateral boundary conditions

the model simulates or forecasts the evolution of the at-mosphere.

3

Page 5: Numerical Weather Prediction - maths.ucd.ie

Numerical Methods (Kalnay, Ch. 3)• NWP is an initial/boundary value problem

• Given

– an estimate of the present state of the atmosphere(initial conditions)

– appropriate surface and lateral boundary conditions

the model simulates or forecasts the evolution of the at-mosphere.

• The more accurate the estimate of the initial conditions,the better the quality of the forecasts.

3

Page 6: Numerical Weather Prediction - maths.ucd.ie

Numerical Methods (Kalnay, Ch. 3)• NWP is an initial/boundary value problem

• Given

– an estimate of the present state of the atmosphere(initial conditions)

– appropriate surface and lateral boundary conditions

the model simulates or forecasts the evolution of the at-mosphere.

• The more accurate the estimate of the initial conditions,the better the quality of the forecasts.

• Similariy, the more accurate the solution method, thebetter the quality of the forecasts.

3

Page 7: Numerical Weather Prediction - maths.ucd.ie

Numerical Methods (Kalnay, Ch. 3)• NWP is an initial/boundary value problem

• Given

– an estimate of the present state of the atmosphere(initial conditions)

– appropriate surface and lateral boundary conditions

the model simulates or forecasts the evolution of the at-mosphere.

• The more accurate the estimate of the initial conditions,the better the quality of the forecasts.

• Similariy, the more accurate the solution method, thebetter the quality of the forecasts.

We now consider methods of solving PDEs numerically.

3

Page 8: Numerical Weather Prediction - maths.ucd.ie

Partial Differential EquationsWe begin by looking at the classification of partial differen-tial equations (PDEs).

4

Page 9: Numerical Weather Prediction - maths.ucd.ie

Partial Differential EquationsWe begin by looking at the classification of partial differen-tial equations (PDEs).

The general second order linear PDE in 2D may be written

A∂2u

∂x2+ 2B

∂2u

∂x∂y+ C

∂2u

∂y2+ D

∂u

∂x+ E

∂u

∂y+ Fu = 0

4

Page 10: Numerical Weather Prediction - maths.ucd.ie

Partial Differential EquationsWe begin by looking at the classification of partial differen-tial equations (PDEs).

The general second order linear PDE in 2D may be written

A∂2u

∂x2+ 2B

∂2u

∂x∂y+ C

∂2u

∂y2+ D

∂u

∂x+ E

∂u

∂y+ Fu = 0

Second order linear partial differential equations are classi-fied into three types depending on the sign of B2 − AC:

• Hyperbolic: B2 − AC > 0

• Parabolic: B2 − AC = 0

• Elliptic: B2 − AC < 0

4

Page 11: Numerical Weather Prediction - maths.ucd.ie

Partial Differential EquationsWe begin by looking at the classification of partial differen-tial equations (PDEs).

The general second order linear PDE in 2D may be written

A∂2u

∂x2+ 2B

∂2u

∂x∂y+ C

∂2u

∂y2+ D

∂u

∂x+ E

∂u

∂y+ Fu = 0

Second order linear partial differential equations are classi-fied into three types depending on the sign of B2 − AC:

• Hyperbolic: B2 − AC > 0

• Parabolic: B2 − AC = 0

• Elliptic: B2 − AC < 0

Recall the equations of the conic sections

x2

a2− y2

b2= 1︸ ︷︷ ︸

Hyperbola

x2 = y︸ ︷︷ ︸Parabola

x2

a2+

y2

b2= 1︸ ︷︷ ︸

Ellipse

4

Page 12: Numerical Weather Prediction - maths.ucd.ie

The simplest (canonical) examples of these equations are

(a)∂2u

∂t2= c2∂

2u

∂x2Wave equation (hyperbolic).

(b)∂u

∂t= σ

∂2u

∂x2Diffusion equation (parabolic).

(c)∂2u

∂x2+

∂2u

∂y2= f (x, y) Poisson’s equation (elliptic).

5

Page 13: Numerical Weather Prediction - maths.ucd.ie

The simplest (canonical) examples of these equations are

(a)∂2u

∂t2= c2∂

2u

∂x2Wave equation (hyperbolic).

(b)∂u

∂t= σ

∂2u

∂x2Diffusion equation (parabolic).

(c)∂2u

∂x2+

∂2u

∂y2= f (x, y) Poisson’s equation (elliptic).

Example of hyperbolic equation:

• Vibrating String.

• Water Waves.

5

Page 14: Numerical Weather Prediction - maths.ucd.ie

The simplest (canonical) examples of these equations are

(a)∂2u

∂t2= c2∂

2u

∂x2Wave equation (hyperbolic).

(b)∂u

∂t= σ

∂2u

∂x2Diffusion equation (parabolic).

(c)∂2u

∂x2+

∂2u

∂y2= f (x, y) Poisson’s equation (elliptic).

Example of hyperbolic equation:

• Vibrating String.

• Water Waves.

Example of parabolic equation:

• Heated Rod.

• Viscous Damping.

5

Page 15: Numerical Weather Prediction - maths.ucd.ie

Examples of Elliptic Equation:

• Shape of a drum.

• Streamfunction/vorticity relationship.

? ? ?

6

Page 16: Numerical Weather Prediction - maths.ucd.ie

Examples of Elliptic Equation:

• Shape of a drum.

• Streamfunction/vorticity relationship.

? ? ?

Note: The following standard elliptic equations arise re-peatedly in a multitude of contexts throughout science:

• Poisson’s Equation: ∇2u = f .

• Laplace’s Equation: ∇2u = 0.

6

Page 17: Numerical Weather Prediction - maths.ucd.ie

The behaviour of the solutions, the proper initial and/orboundary conditions, and the numerical methods that canbe used to find the solutions depend essentially on the typeof PDE that we are dealing with.

7

Page 18: Numerical Weather Prediction - maths.ucd.ie

The behaviour of the solutions, the proper initial and/orboundary conditions, and the numerical methods that canbe used to find the solutions depend essentially on the typeof PDE that we are dealing with.

Thus, we need to study the canonical PDEs to develop anunderstanding of their properties, and then apply similarmethods to the more complicated NWP equations.

? ? ?

7

Page 19: Numerical Weather Prediction - maths.ucd.ie

The behaviour of the solutions, the proper initial and/orboundary conditions, and the numerical methods that canbe used to find the solutions depend essentially on the typeof PDE that we are dealing with.

Thus, we need to study the canonical PDEs to develop anunderstanding of their properties, and then apply similarmethods to the more complicated NWP equations.

? ? ?

A fourth canonical equation, of central importance in atmo-spheric science, is

(d)∂u

∂t+ c

∂u

∂x= 0 Advection equation.

7

Page 20: Numerical Weather Prediction - maths.ucd.ie

The behaviour of the solutions, the proper initial and/orboundary conditions, and the numerical methods that canbe used to find the solutions depend essentially on the typeof PDE that we are dealing with.

Thus, we need to study the canonical PDEs to develop anunderstanding of their properties, and then apply similarmethods to the more complicated NWP equations.

? ? ?

A fourth canonical equation, of central importance in atmo-spheric science, is

(d)∂u

∂t+ c

∂u

∂x= 0 Advection equation.

The advection equation has the solution u(x, t) = u(x− ct, 0).

7

Page 21: Numerical Weather Prediction - maths.ucd.ie

The advection equation is a first order PDE, but it can alsobe classified as hyperbolic, since its solutions satisfy thewave equation:

8

Page 22: Numerical Weather Prediction - maths.ucd.ie

The advection equation is a first order PDE, but it can alsobe classified as hyperbolic, since its solutions satisfy thewave equation:

∂2u

∂t2− c2∂

2u

∂x2=

(∂

∂t+ c

∂x

) (∂

∂t− c

∂x

)u = 0

Obviously, if ∂u/∂t + c ∂u/∂x = 0, then u is a solution of thewave equation.

? ? ?

8

Page 23: Numerical Weather Prediction - maths.ucd.ie

The advection equation is a first order PDE, but it can alsobe classified as hyperbolic, since its solutions satisfy thewave equation:

∂2u

∂t2− c2∂

2u

∂x2=

(∂

∂t+ c

∂x

) (∂

∂t− c

∂x

)u = 0

Obviously, if ∂u/∂t + c ∂u/∂x = 0, then u is a solution of thewave equation.

? ? ?

We note that if the elliptic Laplace equation is split up likethis, the component operators are complex:

∂2u

∂x2+

∂2u

∂y2=

(∂

∂x+ i

∂y

) (∂

∂x− i

∂y

)u = 0

8

Page 24: Numerical Weather Prediction - maths.ucd.ie

The advection equation is a first order PDE, but it can alsobe classified as hyperbolic, since its solutions satisfy thewave equation:

∂2u

∂t2− c2∂

2u

∂x2=

(∂

∂t+ c

∂x

) (∂

∂t− c

∂x

)u = 0

Obviously, if ∂u/∂t + c ∂u/∂x = 0, then u is a solution of thewave equation.

? ? ?

We note that if the elliptic Laplace equation is split up likethis, the component operators are complex:

∂2u

∂x2+

∂2u

∂y2=

(∂

∂x+ i

∂y

) (∂

∂x− i

∂y

)u = 0

We cannot split this equation into two real first-orderfactors.

8

Page 25: Numerical Weather Prediction - maths.ucd.ie

Example: Solve the Wave EquationWe will derive the solution of the wave equation bytransformation of variables.

9

Page 26: Numerical Weather Prediction - maths.ucd.ie

Example: Solve the Wave EquationWe will derive the solution of the wave equation bytransformation of variables.

Define the new variables ξ = x− ct and η = x + ct.

9

Page 27: Numerical Weather Prediction - maths.ucd.ie

Example: Solve the Wave EquationWe will derive the solution of the wave equation bytransformation of variables.

Define the new variables ξ = x− ct and η = x + ct.

Then

ux = ξxuξ + ηxuη = uξ + uη

ut = ξtuξ + ηtuη = −cuξ + cuη

uxx = [uξξ + 2uξη + uηη]

utt = c2[uξξ − 2uξη + uηη]

9

Page 28: Numerical Weather Prediction - maths.ucd.ie

Example: Solve the Wave EquationWe will derive the solution of the wave equation bytransformation of variables.

Define the new variables ξ = x− ct and η = x + ct.

Then

ux = ξxuξ + ηxuη = uξ + uη

ut = ξtuξ + ηtuη = −cuξ + cuη

uxx = [uξξ + 2uξη + uηη]

utt = c2[uξξ − 2uξη + uηη]

Therefore

[utt − c2uxx] = −4c2uξη = 0 which means∂2u

∂ξ∂η= 0 .

9

Page 29: Numerical Weather Prediction - maths.ucd.ie

Example: Solve the Wave EquationWe will derive the solution of the wave equation bytransformation of variables.

Define the new variables ξ = x− ct and η = x + ct.

Then

ux = ξxuξ + ηxuη = uξ + uη

ut = ξtuξ + ηtuη = −cuξ + cuη

uxx = [uξξ + 2uξη + uηη]

utt = c2[uξξ − 2uξη + uηη]

Therefore

[utt − c2uxx] = −4c2uξη = 0 which means∂2u

∂ξ∂η= 0 .

The solution of this equation may be expressed as a sum ofa function of ξ and another of η: u = f (x− ct) + g(x + ct).

9

Page 30: Numerical Weather Prediction - maths.ucd.ie

Well-posednessA well-posed initial/boundary condition problem has a uniquesolution that depends continuously on the initial/boundaryconditions.

10

Page 31: Numerical Weather Prediction - maths.ucd.ie

Well-posednessA well-posed initial/boundary condition problem has a uniquesolution that depends continuously on the initial/boundaryconditions.

The specification of proper initial conditions and boundaryconditions for a PDE is essential in order to have a well-posed problem.

10

Page 32: Numerical Weather Prediction - maths.ucd.ie

Well-posednessA well-posed initial/boundary condition problem has a uniquesolution that depends continuously on the initial/boundaryconditions.

The specification of proper initial conditions and boundaryconditions for a PDE is essential in order to have a well-posed problem.

• If too many initial/boundary conditions are specified, therewill be no solution.

10

Page 33: Numerical Weather Prediction - maths.ucd.ie

Well-posednessA well-posed initial/boundary condition problem has a uniquesolution that depends continuously on the initial/boundaryconditions.

The specification of proper initial conditions and boundaryconditions for a PDE is essential in order to have a well-posed problem.

• If too many initial/boundary conditions are specified, therewill be no solution.

• If too few are specified, the solution will not be unique.

10

Page 34: Numerical Weather Prediction - maths.ucd.ie

Well-posednessA well-posed initial/boundary condition problem has a uniquesolution that depends continuously on the initial/boundaryconditions.

The specification of proper initial conditions and boundaryconditions for a PDE is essential in order to have a well-posed problem.

• If too many initial/boundary conditions are specified, therewill be no solution.

• If too few are specified, the solution will not be unique.

• If the number of initial/boundary conditions is right, butthey are specified at the wrong place or time, the solu-tion will be unique, but it will not depend smoothly oninitial/boundary conditions.

10

Page 35: Numerical Weather Prediction - maths.ucd.ie

Well-posednessA well-posed initial/boundary condition problem has a uniquesolution that depends continuously on the initial/boundaryconditions.

The specification of proper initial conditions and boundaryconditions for a PDE is essential in order to have a well-posed problem.

• If too many initial/boundary conditions are specified, therewill be no solution.

• If too few are specified, the solution will not be unique.

• If the number of initial/boundary conditions is right, butthey are specified at the wrong place or time, the solu-tion will be unique, but it will not depend smoothly oninitial/boundary conditions.

For ill-posed problems, small errors in the initial/boundaryconditions may produce huge errors in the solution.

10

Page 36: Numerical Weather Prediction - maths.ucd.ie

In any of the above cases we have an ill-posed problem.

11

Page 37: Numerical Weather Prediction - maths.ucd.ie

In any of the above cases we have an ill-posed problem.

We can never find a numerical solution of a problem that isill posed: the computation will react by blowing up.

? ? ?

11

Page 38: Numerical Weather Prediction - maths.ucd.ie

In any of the above cases we have an ill-posed problem.

We can never find a numerical solution of a problem that isill posed: the computation will react by blowing up.

? ? ?

Example: Solve the hyperbolic equation

∂2u

∂t2− c2 ∂2u

∂x2= 0

subject to the following conditions:

u(x, 0) = a0(x) u(x, 1) = a1(x) u(0, t) = b0(t) u(0, t) = b1(t)

11

Page 39: Numerical Weather Prediction - maths.ucd.ie

In any of the above cases we have an ill-posed problem.

We can never find a numerical solution of a problem that isill posed: the computation will react by blowing up.

? ? ?

Example: Solve the hyperbolic equation

∂2u

∂t2− c2 ∂2u

∂x2= 0

subject to the following conditions:

u(x, 0) = a0(x) u(x, 1) = a1(x) u(0, t) = b0(t) u(0, t) = b1(t)

Example: Solve the advection equation

∂u

∂t+ c

∂u

∂x= 0

on 0 ≤ x ≤ 1 and t ≥ 0 with the initial/boundary conditions

u(x, 0) = u0(x) u(0, t) = uL(t) u(1, t) = uR(t) .

11

Page 40: Numerical Weather Prediction - maths.ucd.ie

The Elliptic CaseSecond order elliptic equations require one boundary con-dition at each point of the spatial boundary.

12

Page 41: Numerical Weather Prediction - maths.ucd.ie

The Elliptic CaseSecond order elliptic equations require one boundary con-dition at each point of the spatial boundary.

These are pure boundary value, time-independent prob-lems. The boundary conditions may be:

12

Page 42: Numerical Weather Prediction - maths.ucd.ie

The Elliptic CaseSecond order elliptic equations require one boundary con-dition at each point of the spatial boundary.

These are pure boundary value, time-independent prob-lems. The boundary conditions may be:

• The value of the function (Dirichlet problem), as whenwe specify the temperature on the edge of a plate.

12

Page 43: Numerical Weather Prediction - maths.ucd.ie

The Elliptic CaseSecond order elliptic equations require one boundary con-dition at each point of the spatial boundary.

These are pure boundary value, time-independent prob-lems. The boundary conditions may be:

• The value of the function (Dirichlet problem), as whenwe specify the temperature on the edge of a plate.

• The normal derivative (Neumann problem), as when wespecify the heat flux.

12

Page 44: Numerical Weather Prediction - maths.ucd.ie

The Elliptic CaseSecond order elliptic equations require one boundary con-dition at each point of the spatial boundary.

These are pure boundary value, time-independent prob-lems. The boundary conditions may be:

• The value of the function (Dirichlet problem), as whenwe specify the temperature on the edge of a plate.

• The normal derivative (Neumann problem), as when wespecify the heat flux.

• A mixed boundary condition, involving a linear combina-tion of the function and its derivative (Robin problem).

12

Page 45: Numerical Weather Prediction - maths.ucd.ie

The Parabolic CaseLinear parabolic equations require one initial condition atthe initial time and one boundary condition at each pointof the spatial boundaries.

13

Page 46: Numerical Weather Prediction - maths.ucd.ie

The Parabolic CaseLinear parabolic equations require one initial condition atthe initial time and one boundary condition at each pointof the spatial boundaries.

For example, for a heated rod, we need the initial tempera-ture at each point T (x, 0) and the temperature at each end,T (0, t) and T (L, t) as a function of time.

13

Page 47: Numerical Weather Prediction - maths.ucd.ie

The Parabolic CaseLinear parabolic equations require one initial condition atthe initial time and one boundary condition at each pointof the spatial boundaries.

For example, for a heated rod, we need the initial tempera-ture at each point T (x, 0) and the temperature at each end,T (0, t) and T (L, t) as a function of time.

In atmospheric science, the parabolic case arises mainlywhen we consider diffusive processes: internal viscosity;boundary layer friction; etc.

13

Page 48: Numerical Weather Prediction - maths.ucd.ie

The Parabolic CaseLinear parabolic equations require one initial condition atthe initial time and one boundary condition at each pointof the spatial boundaries.

For example, for a heated rod, we need the initial tempera-ture at each point T (x, 0) and the temperature at each end,T (0, t) and T (L, t) as a function of time.

In atmospheric science, the parabolic case arises mainlywhen we consider diffusive processes: internal viscosity;boundary layer friction; etc.

To give an example, consider the highlighted terms of theNavier-Stokes Equations

∂V

∂t+ V · ∇V + 2Ω×V +

1

ρ∇p = ν∇2V

? ? ?

13

Page 49: Numerical Weather Prediction - maths.ucd.ie

The Parabolic CaseLinear parabolic equations require one initial condition atthe initial time and one boundary condition at each pointof the spatial boundaries.

For example, for a heated rod, we need the initial tempera-ture at each point T (x, 0) and the temperature at each end,T (0, t) and T (L, t) as a function of time.

In atmospheric science, the parabolic case arises mainlywhen we consider diffusive processes: internal viscosity;boundary layer friction; etc.

To give an example, consider the highlighted terms of theNavier-Stokes Equations

∂V

∂t+ V · ∇V + 2Ω×V +

1

ρ∇p = ν∇2V

? ? ?

Break here.13

Page 50: Numerical Weather Prediction - maths.ucd.ie

The Hyperbolic CaseLinear hyperbolic equations require as many initial condi-tions as the number of characteristics that come out of everypoint in the surface t = 0, and as many boundary conditionsas the number of characteristics that cross a point in the(space) boundary pointing inwards.

14

Page 51: Numerical Weather Prediction - maths.ucd.ie

The Hyperbolic CaseLinear hyperbolic equations require as many initial condi-tions as the number of characteristics that come out of everypoint in the surface t = 0, and as many boundary conditionsas the number of characteristics that cross a point in the(space) boundary pointing inwards.

For example: Solve ∂u/∂t + c ∂u/∂x = 0 for x > 0, t > 0.

14

Page 52: Numerical Weather Prediction - maths.ucd.ie

The Hyperbolic CaseLinear hyperbolic equations require as many initial condi-tions as the number of characteristics that come out of everypoint in the surface t = 0, and as many boundary conditionsas the number of characteristics that cross a point in the(space) boundary pointing inwards.

For example: Solve ∂u/∂t + c ∂u/∂x = 0 for x > 0, t > 0.

The characteristics are the solutions of dx/dt = c.

The space boundary is x = 0.

14

Page 53: Numerical Weather Prediction - maths.ucd.ie

The Hyperbolic CaseLinear hyperbolic equations require as many initial condi-tions as the number of characteristics that come out of everypoint in the surface t = 0, and as many boundary conditionsas the number of characteristics that cross a point in the(space) boundary pointing inwards.

For example: Solve ∂u/∂t + c ∂u/∂x = 0 for x > 0, t > 0.

The characteristics are the solutions of dx/dt = c.

The space boundary is x = 0.

If c > 0, we need the initial condition u(x, 0) = f (x) and theboundary condition u(0, t) = g(t).

14

Page 54: Numerical Weather Prediction - maths.ucd.ie

The Hyperbolic CaseLinear hyperbolic equations require as many initial condi-tions as the number of characteristics that come out of everypoint in the surface t = 0, and as many boundary conditionsas the number of characteristics that cross a point in the(space) boundary pointing inwards.

For example: Solve ∂u/∂t + c ∂u/∂x = 0 for x > 0, t > 0.

The characteristics are the solutions of dx/dt = c.

The space boundary is x = 0.

If c > 0, we need the initial condition u(x, 0) = f (x) and theboundary condition u(0, t) = g(t).

If c < 0, we need the initial condition u(x, 0) = f (x) but noboundary conditions.

14

Page 55: Numerical Weather Prediction - maths.ucd.ie

Schematic of the characteristics of the advection equation

∂u

∂t+ c

∂u

∂x= 0

for (a) positive and (b) negative velocity c.

15

Page 56: Numerical Weather Prediction - maths.ucd.ie

For nonlinear equations, no general statements can be made,but physical insight and local linearization can help to de-termine proper initial/boundary conditions.

16

Page 57: Numerical Weather Prediction - maths.ucd.ie

For nonlinear equations, no general statements can be made,but physical insight and local linearization can help to de-termine proper initial/boundary conditions.

For example, in the nonlinear advection equation

∂u

∂t+ u

∂u

∂x= 0

the characteristics are dx/dt = u.

16

Page 58: Numerical Weather Prediction - maths.ucd.ie

For nonlinear equations, no general statements can be made,but physical insight and local linearization can help to de-termine proper initial/boundary conditions.

For example, in the nonlinear advection equation

∂u

∂t+ u

∂u

∂x= 0

the characteristics are dx/dt = u.

We don’t know a priori the sign of u at the boundary, andwhether the characteristics will point inwards or outwards.

? ? ?

16

Page 59: Numerical Weather Prediction - maths.ucd.ie

For nonlinear equations, no general statements can be made,but physical insight and local linearization can help to de-termine proper initial/boundary conditions.

For example, in the nonlinear advection equation

∂u

∂t+ u

∂u

∂x= 0

the characteristics are dx/dt = u.

We don’t know a priori the sign of u at the boundary, andwhether the characteristics will point inwards or outwards.

? ? ?

One method of solving simple PDEs is the method of sep-aration of variables. Unfortunately in most cases it is notpossible to use it.

16

Page 60: Numerical Weather Prediction - maths.ucd.ie

For nonlinear equations, no general statements can be made,but physical insight and local linearization can help to de-termine proper initial/boundary conditions.

For example, in the nonlinear advection equation

∂u

∂t+ u

∂u

∂x= 0

the characteristics are dx/dt = u.

We don’t know a priori the sign of u at the boundary, andwhether the characteristics will point inwards or outwards.

? ? ?

One method of solving simple PDEs is the method of sep-aration of variables. Unfortunately in most cases it is notpossible to use it.

Nevertheless, it is instructive to solve some simple PDE’sanalytically, using the method of separation of variables.

16

Page 61: Numerical Weather Prediction - maths.ucd.ie

Separation of VariablesExample 1: An Elliptic Equation.

17

Page 62: Numerical Weather Prediction - maths.ucd.ie

Separation of VariablesExample 1: An Elliptic Equation.

Solve, by the method of separation of variables, the PDE:

∇2u =∂2u

∂x2+

∂2u

∂y2= 0 0 ≤ x ≤ 1 0 ≤ y ≤ 1

subject to the boundary conditions

u(x, 0) = 0 u(0, y) = 0 u(1, y) = 0 u(x, 1) = A sin mπx,

17

Page 63: Numerical Weather Prediction - maths.ucd.ie

Separation of VariablesExample 1: An Elliptic Equation.

Solve, by the method of separation of variables, the PDE:

∇2u =∂2u

∂x2+

∂2u

∂y2= 0 0 ≤ x ≤ 1 0 ≤ y ≤ 1

subject to the boundary conditions

u(x, 0) = 0 u(0, y) = 0 u(1, y) = 0 u(x, 1) = A sin mπx,

Assume the solution is a product of a function of x and afunction of y:

u(x, y) = X(x) · Y (y)

17

Page 64: Numerical Weather Prediction - maths.ucd.ie

Separation of VariablesExample 1: An Elliptic Equation.

Solve, by the method of separation of variables, the PDE:

∇2u =∂2u

∂x2+

∂2u

∂y2= 0 0 ≤ x ≤ 1 0 ≤ y ≤ 1

subject to the boundary conditions

u(x, 0) = 0 u(0, y) = 0 u(1, y) = 0 u(x, 1) = A sin mπx,

Assume the solution is a product of a function of x and afunction of y:

u(x, y) = X(x) · Y (y)

The equation becomes

Yd2X

dx2+ X

d2Y

dy2= 0 or

1

X

d2X

dx2= − 1

Y

d2Y

dy2

17

Page 65: Numerical Weather Prediction - maths.ucd.ie

Separation of VariablesExample 1: An Elliptic Equation.

Solve, by the method of separation of variables, the PDE:

∇2u =∂2u

∂x2+

∂2u

∂y2= 0 0 ≤ x ≤ 1 0 ≤ y ≤ 1

subject to the boundary conditions

u(x, 0) = 0 u(0, y) = 0 u(1, y) = 0 u(x, 1) = A sin mπx,

Assume the solution is a product of a function of x and afunction of y:

u(x, y) = X(x) · Y (y)

The equation becomes

Yd2X

dx2+ X

d2Y

dy2= 0 or

1

X

d2X

dx2= − 1

Y

d2Y

dy2

The left side is a function of x, the right a function of y.17

Page 66: Numerical Weather Prediction - maths.ucd.ie

Thus, they must both be equal to a constant −K2

d2X

dx2+ K2X = 0

d2Y

dy2−K2Y = 0

18

Page 67: Numerical Weather Prediction - maths.ucd.ie

Thus, they must both be equal to a constant −K2

d2X

dx2+ K2X = 0

d2Y

dy2−K2Y = 0

The solutions of the two equations are

X = C1 sin Kx + C2 cos Kx Y = C3 sinh Ky + C4 cosh Ky

18

Page 68: Numerical Weather Prediction - maths.ucd.ie

Thus, they must both be equal to a constant −K2

d2X

dx2+ K2X = 0

d2Y

dy2−K2Y = 0

The solutions of the two equations are

X = C1 sin Kx + C2 cos Kx Y = C3 sinh Ky + C4 cosh Ky

The boundary condition u(0, y) = 0 forces C2 = 0,so X = C1 sin Kx.

18

Page 69: Numerical Weather Prediction - maths.ucd.ie

Thus, they must both be equal to a constant −K2

d2X

dx2+ K2X = 0

d2Y

dy2−K2Y = 0

The solutions of the two equations are

X = C1 sin Kx + C2 cos Kx Y = C3 sinh Ky + C4 cosh Ky

The boundary condition u(0, y) = 0 forces C2 = 0,so X = C1 sin Kx.

The boundary condition u(1, y) = 0 forces sin Kx = 0 or K = nπso X = C1 sin nπx.

18

Page 70: Numerical Weather Prediction - maths.ucd.ie

Thus, they must both be equal to a constant −K2

d2X

dx2+ K2X = 0

d2Y

dy2−K2Y = 0

The solutions of the two equations are

X = C1 sin Kx + C2 cos Kx Y = C3 sinh Ky + C4 cosh Ky

The boundary condition u(0, y) = 0 forces C2 = 0,so X = C1 sin Kx.

The boundary condition u(1, y) = 0 forces sin Kx = 0 or K = nπso X = C1 sin nπx.

The boundary condition u(x, 0) = 0 forces C4 = 0,so Y = C3 sinh nπy.

18

Page 71: Numerical Weather Prediction - maths.ucd.ie

Thus, they must both be equal to a constant −K2

d2X

dx2+ K2X = 0

d2Y

dy2−K2Y = 0

The solutions of the two equations are

X = C1 sin Kx + C2 cos Kx Y = C3 sinh Ky + C4 cosh Ky

The boundary condition u(0, y) = 0 forces C2 = 0,so X = C1 sin Kx.

The boundary condition u(1, y) = 0 forces sin Kx = 0 or K = nπso X = C1 sin nπx.

The boundary condition u(x, 0) = 0 forces C4 = 0,so Y = C3 sinh nπy.

The boundary condition u(x, 1) = A sin mπx forces C1 sin nπx×C3 sinh nπ = A sin mπx, so that n = m and C1C3 sinh mπ = A.

18

Page 72: Numerical Weather Prediction - maths.ucd.ie

Thus, C1C3 = A/ sinh mπ, and the solution is

u(x, y) =

(A

sinh mπ

)sin mπx sinh mπy

? ? ?

19

Page 73: Numerical Weather Prediction - maths.ucd.ie

Thus, C1C3 = A/ sinh mπ, and the solution is

u(x, y) =

(A

sinh mπ

)sin mπx sinh mπy

? ? ?

More general BCs

Suppose the solution on the “northern” side is now

u(x, 1) = f (x)

Find the solution.

19

Page 74: Numerical Weather Prediction - maths.ucd.ie

Thus, C1C3 = A/ sinh mπ, and the solution is

u(x, y) =

(A

sinh mπ

)sin mπx sinh mπy

? ? ?

More general BCs

Suppose the solution on the “northern” side is now

u(x, 1) = f (x)

Find the solution.

We note that the equation is linear and homogeneous, sothat, given two solutions, a linear combination of them isalso a solution of the equation.

19

Page 75: Numerical Weather Prediction - maths.ucd.ie

We assume that we can Fourier-analyse the function f (x):

f (x) =

∞∑k=1

ak sin kπx with∞∑

k=1

k2 |ak| < ∞

20

Page 76: Numerical Weather Prediction - maths.ucd.ie

We assume that we can Fourier-analyse the function f (x):

f (x) =

∞∑k=1

ak sin kπx with∞∑

k=1

k2 |ak| < ∞

Then the solution may be expressed as:

u(x, y) =

∞∑k=1

( ak

sinh kπ

)sin kπx sinh kπy

20

Page 77: Numerical Weather Prediction - maths.ucd.ie

We assume that we can Fourier-analyse the function f (x):

f (x) =

∞∑k=1

ak sin kπx with∞∑

k=1

k2 |ak| < ∞

Then the solution may be expressed as:

u(x, y) =

∞∑k=1

( ak

sinh kπ

)sin kπx sinh kπy

In the same way, we can find solutions for non-vanishingboundary values on the other three edges.

20

Page 78: Numerical Weather Prediction - maths.ucd.ie

We assume that we can Fourier-analyse the function f (x):

f (x) =

∞∑k=1

ak sin kπx with∞∑

k=1

k2 |ak| < ∞

Then the solution may be expressed as:

u(x, y) =

∞∑k=1

( ak

sinh kπ

)sin kπx sinh kπy

In the same way, we can find solutions for non-vanishingboundary values on the other three edges.

Thus, the more general problem on a rectangular domain:

∇2u(x, y) = 0 , u(x, y) = F (x, y) on the boundary

may be solved.

20

Page 79: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Parabolic Equation.

21

Page 80: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Parabolic Equation.

∂u

∂t= σ

∂2u

∂x20 ≤ x ≤ 1 t ≥ 0

21

Page 81: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Parabolic Equation.

∂u

∂t= σ

∂2u

∂x20 ≤ x ≤ 1 t ≥ 0

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

21

Page 82: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Parabolic Equation.

∂u

∂t= σ

∂2u

∂x20 ≤ x ≤ 1 t ≥ 0

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Initial condition:

u(x, 0) = f (x) =

∞∑k=1

ak sin kπx

21

Page 83: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Parabolic Equation.

∂u

∂t= σ

∂2u

∂x20 ≤ x ≤ 1 t ≥ 0

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Initial condition:

u(x, 0) = f (x) =

∞∑k=1

ak sin kπx

Find the solution:

u(x, t) =

∞∑k=1

ake−σk2π2t sin kπx

21

Page 84: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Parabolic Equation.

∂u

∂t= σ

∂2u

∂x20 ≤ x ≤ 1 t ≥ 0

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Initial condition:

u(x, 0) = f (x) =

∞∑k=1

ak sin kπx

Find the solution:

u(x, t) =

∞∑k=1

ake−σk2π2t sin kπx

Note that the higher the wavenumber, the faster it goes tozero, i.e., the solution is smoothed as time goes on.

21

Page 85: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Hyperbolic Equation.

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

22

Page 86: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Hyperbolic Equation.

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Initial conditions:

u(x, 0) = f (x) =

∞∑k=1

ak sin kπx∂u

∂t(x, 0) = g(x) =

∞∑k=1

bk sin kπx

22

Page 87: Numerical Weather Prediction - maths.ucd.ie

Another Example: A Hyperbolic Equation.

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Initial conditions:

u(x, 0) = f (x) =

∞∑k=1

ak sin kπx∂u

∂t(x, 0) = g(x) =

∞∑k=1

bk sin kπx

Find the solution by the separation of variables method.

22

Page 88: Numerical Weather Prediction - maths.ucd.ie

Same equation as above, but different boundary conditions:

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

23

Page 89: Numerical Weather Prediction - maths.ucd.ie

Same equation as above, but different boundary conditions:

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

23

Page 90: Numerical Weather Prediction - maths.ucd.ie

Same equation as above, but different boundary conditions:

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Instead of two initial conditions, we give an initial and a“final” condition:

u(x, 0) = f (x) u(x, 1) = g(x)

23

Page 91: Numerical Weather Prediction - maths.ucd.ie

Same equation as above, but different boundary conditions:

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Instead of two initial conditions, we give an initial and a“final” condition:

u(x, 0) = f (x) u(x, 1) = g(x)

In other words, we try to solve a hyperbolic (wave) equationas if it were an elliptic equation (boundary value problem).

23

Page 92: Numerical Weather Prediction - maths.ucd.ie

Same equation as above, but different boundary conditions:

∂2u

∂t2= c2∂

2u

∂x20 ≤ x ≤ 1 0 ≤ t ≤ 1

Boundary conditions:

u(0, t) = 0 u(1, t) = 0

Instead of two initial conditions, we give an initial and a“final” condition:

u(x, 0) = f (x) u(x, 1) = g(x)

In other words, we try to solve a hyperbolic (wave) equationas if it were an elliptic equation (boundary value problem).

Exercise: Show that the solution is unique but that it doesnot depend continuously on the boundary conditions, andtherefore is not a well-posed problem.

23

Page 93: Numerical Weather Prediction - maths.ucd.ie

Conclusion: Before trying to solve a problem numerically,we must make sure that it is well posed: it has a uniquesolution that depends continuously on the data that definethe problem.

? ? ?

24

Page 94: Numerical Weather Prediction - maths.ucd.ie

Conclusion: Before trying to solve a problem numerically,we must make sure that it is well posed: it has a uniquesolution that depends continuously on the data that definethe problem.

? ? ?

Food for Thought

Lorenz showed that the atmosphere has a finite limit ofpredictability:

Even if the models and the observations are perfect, theflapping of a butterfly in Brazil will result in a completelydifferent forecast for Texas.

24

Page 95: Numerical Weather Prediction - maths.ucd.ie

Conclusion: Before trying to solve a problem numerically,we must make sure that it is well posed: it has a uniquesolution that depends continuously on the data that definethe problem.

? ? ?

Food for Thought

Lorenz showed that the atmosphere has a finite limit ofpredictability:

Even if the models and the observations are perfect, theflapping of a butterfly in Brazil will result in a completelydifferent forecast for Texas.

Does this mean that the problem of NWP is not well posed?

24

Page 96: Numerical Weather Prediction - maths.ucd.ie

Conclusion: Before trying to solve a problem numerically,we must make sure that it is well posed: it has a uniquesolution that depends continuously on the data that definethe problem.

? ? ?

Food for Thought

Lorenz showed that the atmosphere has a finite limit ofpredictability:

Even if the models and the observations are perfect, theflapping of a butterfly in Brazil will result in a completelydifferent forecast for Texas.

Does this mean that the problem of NWP is not well posed?

If not, why not?

24

Page 97: Numerical Weather Prediction - maths.ucd.ie

Conclusion: Before trying to solve a problem numerically,we must make sure that it is well posed: it has a uniquesolution that depends continuously on the data that definethe problem.

? ? ?

Food for Thought

Lorenz showed that the atmosphere has a finite limit ofpredictability:

Even if the models and the observations are perfect, theflapping of a butterfly in Brazil will result in a completelydifferent forecast for Texas.

Does this mean that the problem of NWP is not well posed?

If not, why not?

Consider again the definition of an ill-posed problem.

24