0% found this document useful (0 votes)
29 views2 pages

Adv Exam PDF

This document describes numerically solving the 1D advection equation using the Runge-Kutta fourth order method in time coupled with centered finite differences in space on a uniform grid. Key results include: 1) The CFL condition for stability is dependent on the grid spacing and limits the time step. 2) Finer grids yield smaller errors that converge at an observed order equal to the method's formal order. 3) Richardson extrapolation is used to combine solutions from different grid spacings, achieving higher-order accuracy.

Uploaded by

Chunhui Zhao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Adv Exam PDF

This document describes numerically solving the 1D advection equation using the Runge-Kutta fourth order method in time coupled with centered finite differences in space on a uniform grid. Key results include: 1) The CFL condition for stability is dependent on the grid spacing and limits the time step. 2) Finer grids yield smaller errors that converge at an observed order equal to the method's formal order. 3) Richardson extrapolation is used to combine solutions from different grid spacings, achieving higher-order accuracy.

Uploaded by

Chunhui Zhao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1D Advection Equation

Consider solution of the advection equation,


∂ ũ dũ
= −c , (1)
∂t dx
for (x, t) ∈ [0, 1] × (0, T ] with periodic boundary conditions ũ(0, t) = ũ(1, t) and advection speed
c = 1, a constant. Take the initial condition to be the periodic function,

ũ(x, 0) = u0 (x) := (sin(πx))20 .

Because of the periodic boundary conditions, this solution should wrap back on itself at integer
times, t = 1, 2, 3, . . . We will consider a final time of T =4. At that time, the exact solution is
equal to the initial condition and therefore the difference between our numerical solution and the
initial condition provides a direct measure of the error. We will use the pointwise infinity norm to
measure the error:

n := max |u0 (xj ) − uj (t = 4)|,


j

where xj are n uniformly-spaced nodes and uj is the numerical approximation at those nodes.

Semi-discretization of (1) leads to the ODE

du
= Cu, (2)
dt
where C is derived from centered finite differences being applied to ∂u ∂x with a uniform grid and
grid-spacing ∆x = 1/n. Defining xj = j · ∆x, j = 1, . . . , n, leads to unknowns u = [u1 u2 . . . un ]T ,
with u0 ≡ un because of the periodicity condition. The resultant system matrix is
 
0 1 −1
 
 −1 0 1 
 
c  .. ..

C=−

−1 . . .

2∆x

 

 . .
.. .. 1 

 
1 −1 0
• Write a code to numerically solve (1) using RK4 in time coupled with centered finite differences
in space using grid spacing ∆x = 1/n.
• Answer the following questions using the value of n given on the Relate page.

(a) What is the largest value of the Courant number (CFL) for which this scheme is stable?

• ANS: CFLmax = ?

(b) For the given n, what is the largest time step size ∆tmax for which this approach is stable?

• ANS: ∆tmax = ?

(c) For the given value of n and CFL= 0.5, what is the error, n , at time T = 4?

• ANS: n = ?

(d) Solve (1) with your code using n, 2n, 4n, and 8n points while keeping CFL= 0.5. Make
a table with columns ∆x and error  at time T = 4. (You do not need to submit the
table.) From the tabulated values, what is your observed order of convergence, p, such
that n = O(n−p ) = O(∆xp )?

• ANS: Order of convergence p = ?

• Let y = [u1 u2 . . . um ]T be the solution associated with m points and and let z =
[u2 u4 u6 . . . u2m ]T be every second point for a solution with 2m points. Respective en-
tries in y and z correspond to approximate solutions at xj = j · ∆x for j = 1, . . . , m with
∆x = 1/m. We can thus combine them using Richardson extrapolation to get an improved
answer at these points. Do this for m = n, 2n, and 4n. That is, construct a new numerical
solution
wj = αzj + (1 − α)yj , j = 1, . . . , m,
such that wj is a better approximation to ũ(xj , 4) than either yj or zj .

(e) What is the smallest error that you obtain in this case? That is, what is
 := max |u0 (xj ) − wj |
j

for Richardson iteration in the case m = 4n?

• ANS: Error for Richardson with (m = 4n) = ?

(f ) What is the order of convergence p for your Richardson-extrapolated result?

• ANS: Order of convergence for Richardson, p = ?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy