0
f
x
(0, t) +
0
f(0, t) =
0
+
1
f
x
(1, t) +
1
f(1, t) =
1
. p.4/35
Conservation Laws
The amount of stuff in [0, 1]:
A(t) =
_
1
0
f(x, t) dx
. p.5/35
Conservation Laws
The amount of stuff in [0, 1]:
A(t) =
_
1
0
f(x, t) dx
The derivation of the conservation law:
A
t
=
_
1
0
f
t
=
_
1
0
2
f
x
2
dx
=
_
f
x
_
x=1
x=0
=
_
1
f(1, t) +
0
0
f(0, t)
_
. p.5/35
Conservation Laws
The amount of stuff in [0, 1]:
A(t) =
_
1
0
f(x, t) dx
The derivation of the conservation law:
A
t
=
_
1
0
f
t
=
_
1
0
2
f
x
2
dx
=
_
f
x
_
x=1
x=0
=
_
1
f(1, t) +
0
0
f(0, t)
_
Result: If f 0,
0
0
0,
1
1
0, then A(t) cannot increase.
. p.5/35
Dissipation Law
The amount of energy in [0, 1]:
E(t) =
1
2
_
1
0
f
2
(x, t) dx
. p.6/35
Dissipation Law
The amount of energy in [0, 1]:
E(t) =
1
2
_
1
0
f
2
(x, t) dx
The derivation of the decay law:
E
t
=
_
1
0
f
f
t
dx =
_
1
0
f
2
f
x
2
dx =
_
1
0
_
f
x
_
2
dx +
_
f
f
x
_
x=1
x=0
=
_
1
0
_
f
x
_
2
dx
_
1
f
2
(1, t) +
0
0
f
2
(0, t)
_
. p.6/35
Dissipation Law
The amount of energy in [0, 1]:
E(t) =
1
2
_
1
0
f
2
(x, t) dx
The derivation of the decay law:
E
t
=
_
1
0
f
f
t
dx =
_
1
0
f
2
f
x
2
dx =
_
1
0
_
f
x
_
2
dx +
_
f
f
x
_
x=1
x=0
=
_
1
0
_
f
x
_
2
dx
_
1
f
2
(1, t) +
0
0
f
2
(0, t)
_
Result: If
0
0
0,
1
1
0, then E(t) cannot increase.
Better: f not constant implies E(t) decreases.
. p.6/35
The Wave Equation
The energy (kinetic plus potential) is:
E(t) =
1
2
_
1
0
_
f
t
_
2
+
_
f
x
_
2
dx
. p.7/35
The Wave Equation
The energy (kinetic plus potential) is:
E(t) =
1
2
_
1
0
_
f
t
_
2
+
_
f
x
_
2
dx
E
t
=
_
1
0
_
f
t
2
f
t
2
+
f
x
2
f
t x
_
dx
=
_
1
0
_
f
t
2
f
x
2
f
t
2
f
x
2
_
dx +
_
f
t
f
x
_
x=1
x=0
=
_
f
t
f
x
_
x=1
x=0
=
1
2
t
_
1
f
2
(1, t) +
0
0
f
2
(0, t)
_
. p.7/35
The Wave Equation
The energy (kinetic plus potential) is:
E(t) =
1
2
_
1
0
_
f
t
_
2
+
_
f
x
_
2
dx
Result: If
0
0
= 0,
1
1
= 0 then E(t) is constant.
. p.7/35
The Wave Equation
The energy (kinetic plus potential) is:
E(t) =
1
2
_
1
0
_
f
t
_
2
+
_
f
x
_
2
dx
Result: If
0
0
= 0,
1
1
= 0 then E(t) is constant.
Better: Dene
E(t) =
1
2
_
1
0
_
f
t
_
2
+
_
f
x
_
2
dx +
1
2
_
1
f
2
(1, t) +
0
0
f
2
(0, t)
_
. p.7/35
Summary
The Fundamental Theorem:
_
1
0
df
dx
dx = f(1) f(0)
. p.8/35
Summary
The Fundamental Theorem:
_
1
0
df
dx
dx = f(1) f(0)
Integration by Parts:
_
1
0
df
dx
g dx +
_
1
0
f
dg
dx
dx = f(1) g(1) f(0) g(0)
. p.8/35
Summary
The Fundamental Theorem:
_
1
0
df
dx
dx = f(1) f(0)
Integration by Parts:
_
1
0
df
dx
g dx +
_
1
0
f
dg
dx
dx = f(1) g(1) f(0) g(0)
Follows from the Product Rule and the Fundamental Theorem:
d
dx
(f g) =
df
dx
g + f
dg
dx
. p.8/35
Summary
The Fundamental Theorem:
_
1
0
df
dx
dx = f(1) f(0)
Integration by Parts:
_
1
0
df
dx
g dx +
_
1
0
f
dg
dx
dx = f(1) g(1) f(0) g(0)
Follows from the Product Rule and the Fundamental Theorem:
d
dx
(f g) =
df
dx
g + f
dg
dx
Mimetic means to have discrete analogs of the fundamental theorem
and integration by parts.
. p.8/35
The Staggered Grid
i i1
i+1
i+1/2 i1/2
. p.9/35
The Staggered Grid
i i1
i+1
i+1/2 i1/2
Regular grid:
1. x
i
< x
i+1
for 0 i N 1
2. x
i
< x
i+1/2
< x
i+1
for 0 i N 1
. p.9/35
The Staggered Grid
i i1
i+1
i+1/2 i1/2
Regular grid:
1. x
i
< x
i+1
for 0 i N 1
2. x
i
< x
i+1/2
< x
i+1
for 0 i N 1
Cell-based grid:
x
i+1/2
=
x
i+1
+ x
i
2
, 0 i N 1
. p.9/35
Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
. p.10/35
Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
Grid functions:
v
i
, 0 i N ,
f
i+1/2
, 0 i N 1 ,
. p.10/35
Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
The basic differences:
(x)
i
= x
i+1/2
x
i1/2
, 1 i N 1
(f)
i
= f
i+1/2
f
i1/2
, 1 i N 1
(x)
i+1/2
= x
i+1
x
i
, 0 i N 1
(v)
i+1/2
= v
i+1
vi , 0 i N 1
. p.10/35
Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
The rst divided differences:
(G f)
i
=
(f)
i
(x)
i
, 1 i N 1
(Dv)
i+1/2
=
(v)
i+1/2
(x)
i+1/2
, 0 i N 1
. p.10/35
Boundary Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
. p.11/35
Boundary Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
Assume we are given (to be determined later):
(x)
0
, (x)
N
(f)
0
, (f)
N
. p.11/35
Boundary Difference Quotients
v f
v D
v f
f v D
v f
f v D
0
1
2
f G G
G
Dene the divided differences as:
(G f)
0
=
(f)
0
(x)
0
(G f)
N
=
(f)
N
(x)
N
. p.11/35
Summation (Integration)
Use the mid-point and trapezoid rules to dene discrete integration:
(I f)
k
=
k1
i=0
f
i+1/2
(x)
i+1/2
, 0 k N
(I v)
k+1/2
=
k
0
v
i
(x)
i
, 0 k N 1
. p.12/35
The Fundamental Theorem
THEOREM:
(I Dv)
k
= v
k
v
0
, 0 k N
(I G f)
k+1/2
= f
k+1/2
f
1/2
+ (f)
0
, 0 k N 1
and
(G I v)
k
= v
k
(DI f)
k+1/2
= f
k+1/2
. p.13/35
The Boundary Again
We want
f
1/2
(f)
0
= f
0
or
(f)
0
= f
1/2
f
0
0
1
2
Df
Dv
f v v v f
f
Dv Dv
f
Gf
Gf Gf
. p.14/35
Summation by Parts
The Basic Summation-by-Parts Formula is:
PROPOSITION:
N1
i=0
(v)
i+1/2
f
i+1/2
+
N1
i=1
v
i
(f)
i
= v
N
f
N1/2
v
0
f
1/2
. p.15/35
Proof of By Parts
PROOF: An analog of the product rule is
v
i+1
f
i+1/2
v
i
f
i1/2
= (v
i+1
v
i
) f
i+1/2
+ v
i
_
f
i+1/2
f
i1/2
_
. p.16/35
Proof of By Parts
PROOF: An analog of the product rule is
v
i+1
f
i+1/2
v
i
f
i1/2
= (v
i+1
v
i
) f
i+1/2
+ v
i
_
f
i+1/2
f
i1/2
_
Summing this gives
N1
i=1
(v
i+1
v
i
) f
i+1/2
+
N1
i=1
v
i
_
f
i+1/2
f
i1/2
_
= v
N
f
N1/2
v
1
f
1/2
. p.16/35
Proof of By Parts
PROOF: An analog of the product rule is
v
i+1
f
i+1/2
v
i
f
i1/2
= (v
i+1
v
i
) f
i+1/2
+ v
i
_
f
i+1/2
f
i1/2
_
Summing this gives
N1
i=1
(v
i+1
v
i
) f
i+1/2
+
N1
i=1
v
i
_
f
i+1/2
f
i1/2
_
= v
N
f
N1/2
v
1
f
1/2
and adding one more term to the rst sum gives
N1
i=0
(v
i+1
v
i
) f
i+1/2
+
N1
i=1
v
i
_
f
i+1/2
f
i1/2
_
= v
N
f
N1/2
v
0
f
1/2
. p.16/35
Summation by Parts
The Summation-by-Parts Formula is:
PROPOSITION:
N1
i=0
(v)
i+1/2
f
i+1/2
+
N1
i=1
v
i
(f)
i
= v
N
f
N1/2
v
0
f
1/2
. p.17/35
Summation by Parts
The Summation-by-Parts Formula is:
PROPOSITION:
N1
i=0
(v)
i+1/2
f
i+1/2
+
N1
i=1
v
i
(f)
i
= v
N
f
N1/2
v
0
f
1/2
Now we rewrite this using divided differences:
COROLLARY:
N1
i=0
(Dv)
i+1/2
f
i+1/2
(x)
i+1/2
+
N1
i=1
v
i
(G f)
i
(x)
i
= v
N
f
N1/2
v
0
f
1/2
. p.17/35
Summation by Parts
Now we rewrite this using divided differences:
COROLLARY:
N1
i=0
(Dv)
i+1/2
f
i+1/2
(x)
i+1/2
+
N1
i=1
v
i
(G f)
i
(x)
i
= v
N
f
N1/2
v
0
f
1/2
. p.18/35
Summation by Parts
Now we rewrite this using divided differences:
COROLLARY:
N1
i=0
(Dv)
i+1/2
f
i+1/2
(x)
i+1/2
+
N1
i=1
v
i
(G f)
i
(x)
i
= v
N
f
N1/2
v
0
f
1/2
Choose:
(x)
0
= x
1/2
x
0
, (x)
N
= x
N+1/2
x
N
(f)
0
= f
1/2
f
0
, (f)
N
= f
N+1/2
f
N
. p.18/35
Summation by Parts
Now we rewrite this using divided differences:
COROLLARY:
N1
i=0
(Dv)
i+1/2
f
i+1/2
(x)
i+1/2
+
N1
i=1
v
i
(G f)
i
(x)
i
= v
N
f
N1/2
v
0
f
1/2
Choose:
(x)
0
= x
1/2
x
0
, (x)
N
= x
N+1/2
x
N
(f)
0
= f
1/2
f
0
, (f)
N
= f
N+1/2
f
N
COROLLARY:
N1
i=0
(Dv)
i+1/2
f
i+1/2
(x)
i+1/2
+
N
i=0
v
i
(G f)
i
(x)
i
= v
N
f
N
v
0
f
0
. p.18/35
Inner Products
Inner products make the formulas even simpler:
u, v =
N
i=0
u
i
v
i
(x)
i
||u||
2
= u, u
f, g =
N1
i=0
f
i+1/2
g
i+1/2
(x)
i+1/2
||f||
2
= f, f
. p.19/35
Inner Products
Inner products make the formulas even simpler:
u, v =
N
i=0
u
i
v
i
(x)
i
||u||
2
= u, u
f, g =
N1
i=0
f
i+1/2
g
i+1/2
(x)
i+1/2
||f||
2
= f, f
THEOREM:
Dv, f +v, G f = v
N
f
N
v
0
f
0
. p.19/35
Inner Products
Inner products make the formulas even simpler:
u, v =
N
i=0
u
i
v
i
(x)
i
||u||
2
= u, u
f, g =
N1
i=0
f
i+1/2
g
i+1/2
(x)
i+1/2
||f||
2
= f, f
THEOREM:
Dv, f +v, G f = v
N
f
N
v
0
f
0
THEOREM: The difference operators kill and only kill constants:
G f = 0 f = c , Dv = 0 v = c
where c is constant.
. p.19/35
Second-Order Operators
0 1
2
Df
f f
f f
Gf
KGf
Gf
KGf
Gf
DKGf DKGf
DKGf
KGf
. p.20/35
Second-Order Operators
0 1
2
Df
f f
f f
Gf
KGf
Gf
KGf
Gf
DKGf DKGf
DKGf
KGf
L = D K G , (K v)
i
=
N
j=0
K
i,j
v
j
.
. p.20/35
The Flux Operator
The Flux Operator is
F f = KG f .
. p.21/35
The Flux Operator
The Flux Operator is
F f = KG f .
Now we can analyze the second-order operator. Set:
v = F f = KG f
. p.21/35
The Flux Operator
The Flux Operator is
F f = KG f .
Now we can analyze the second-order operator. Set:
v = F f = KG f
Then summation by parts gives:
DKG f, f +KG f, G f = (KG f)
N
f
N
(KG f)
0
f
0
. p.21/35
A Boundary-Value Problem
DKG f = g
l
(KG f)
0
+
l
f
0
=
l
+
r
(KG f)
N
+
r
f
N
=
r
. p.22/35
A Boundary-Value Problem
DKG f = g
l
(KG f)
0
+
l
f
0
=
l
+
r
(KG f)
N
+
r
f
N
=
r
ASSUME:
1. Non-Degeneracy: |
l
| +|
l
| > 0, |
r
| +|
r
| > 0;
2. Non-Inow:
l
l
0
r
r
0;
3. Non-Flux: |
l
| +|
r
| > 0;
4. Positive K: Kv, v 0, Kv, v = 0v = 0.
. p.22/35
The BVP is Solvable
THEOREM: The boundary-value problem has a unique solution.
. p.23/35
The BVP is Solvable
THEOREM: The boundary-value problem has a unique solution.
PROOF: For the case of Dirichlet boundary conditions, f
0
= f
N
= 0, the
summation by parts formula
DKG f, f +KG f, G f = (KG f)
N
f
N
(KG f)
0
f
0
gives
DKG f, f = KG f, G f
. p.23/35
The BVP is Solvable
THEOREM: The boundary-value problem has a unique solution.
PROOF: For the case of Dirichlet boundary conditions, f
0
= f
N
= 0, the
summation by parts formula
DKG f, f +KG f, G f = (KG f)
N
f
N
(KG f)
0
f
0
gives
DKG f, f = KG f, G f
Positive K gives
KG f, G f C ||G f||
2
. p.23/35
The BVP is Solvable
THEOREM: The boundary-value problem has a unique solution.
PROOF: For the case of Dirichlet boundary conditions, f
0
= f
N
= 0, the
summation by parts formula
DKG f, f +KG f, G f = (KG f)
N
f
N
(KG f)
0
f
0
gives
DKG f, f = KG f, G f
Positive K gives
KG f, G f C ||G f||
2
PoincarFriedricks gives
||G f|| C||f||
. p.23/35
Approximating the Continuum
If f(x) and v(x) are a smooth continuum functions and f and v are
discrete functions, then how do we get the following?
. p.24/35
Approximating the Continuum
If f(x) and v(x) are a smooth continuum functions and f and v are
discrete functions, then how do we get the following?
(G f)
k
df
dx
(x
k
) (Dv)
k+1/2
dv
dx
(x
k+1/2
)
. p.24/35
Approximating the Continuum
If f(x) and v(x) are a smooth continuum functions and f and v are
discrete functions, then how do we get the following?
(G f)
k
df
dx
(x
k
) (Dv)
k+1/2
dv
dx
(x
k+1/2
)
(I f)
k
_
x
k
0
f(x) dx (I v)
k+1/2
_
x
k+1/2
0
v(x) dx
. p.24/35
Approximating the Continuum
If f(x) and v(x) are a smooth continuum functions and f and v are
discrete functions, then how do we get the following?
(G f)
k
df
dx
(x
k
) (Dv)
k+1/2
dv
dx
(x
k+1/2
)
(I f)
k
_
x
k
0
f(x) dx (I v)
k+1/2
_
x
k+1/2
0
v(x) dx
(Lf)
k+1/2
Lf(x
k+1/2
)
. p.24/35
Projections
Cell projection:
f
i+1/2
= (Pf)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
f() d , 0 i N 1
. p.25/35
Projections
Cell projection:
f
i+1/2
= (Pf)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
f() d , 0 i N 1
Nodal projection
v
i
= (v)
i
= v(x
i
) , 0 i N
. p.25/35
Derivatives and Differences
T
i+1/2
=
_
P
dv
dx
_
i+1/2
(Dv)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
dv
d
d
v
i+1
v
i
x
i+1
x
i
0
. p.26/35
Derivatives and Differences
T
i+1/2
=
_
P
dv
dx
_
i+1/2
(Dv)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
dv
d
d
v
i+1
v
i
x
i+1
x
i
0
T
i
=
_
df
dx
_
i
(DP f)
i
=
df
dx
(x
i
)
(P f)
i+1/2
(P f)
i1/2
x
i+1/2
x
i1/2
=
df
dx
(x
i
)
1
(x)
i
_
1
(x)
i+1/2
_
x
i+1
x
i
f(s) ds
1
(x)
i1/2
_
x
i
x
i1
f(s) ds
_
(x)
i1/2
(x)
i+1/2
3
f
(x
i
)
. p.26/35
Second-Order Operators
Use the ux form!
. p.27/35
Second-Order Operators
Use the ux form!
Recall that for the discrete operator
L = DF F = KG (discrete ux)
. p.27/35
Second-Order Operators
Use the ux form!
Recall that for the discrete operator
L = DF F = KG (discrete ux)
For the continuum operator,
L =
d
dx
F F = k
d
dx
(continuum ux)
where k is a smooth function.
. p.27/35
Truncation Error
(Tf)
i+1/2
= (PLf)
i+1/2
LP f = (P((Ff)
))
i+1/2
(DF P f)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
d
d
(Ff) () d (DF P f)
i+1/2
=
(Ff)(x
i+1
) (Ff)(x
i
)
x
i+1/2
(F P f)
i+1
(F P f)
i
x
i+1/2
=
(Ef)
i+1
(Ef)
i
x
i+1/2
=
(Ef)
i+1/2
x
i+1/2
= (DEf)
i+1/2
. p.28/35
Truncation Error
(Tf)
i+1/2
= (PLf)
i+1/2
LP f = (P((Ff)
))
i+1/2
(DF P f)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
d
d
(Ff) () d (DF P f)
i+1/2
=
(Ff)(x
i+1
) (Ff)(x
i
)
x
i+1/2
(F P f)
i+1
(F P f)
i
x
i+1/2
=
(Ef)
i+1
(Ef)
i
x
i+1/2
=
(Ef)
i+1/2
x
i+1/2
= (DEf)
i+1/2
where
(Ef)
i
= (Ff)(x
i
) (F P f)
i
.
. p.28/35
Truncation Error
(Tf)
i+1/2
= (PLf)
i+1/2
LP f = (P((Ff)
))
i+1/2
(DF P f)
i+1/2
=
1
x
i+1/2
_
x
i+1
x
i
d
d
(Ff) () d (DF P f)
i+1/2
=
(Ff)(x
i+1
) (Ff)(x
i
)
x
i+1/2
(F P f)
i+1
(F P f)
i
x
i+1/2
=
(Ef)
i+1
(Ef)
i
x
i+1/2
=
(Ef)
i+1/2
x
i+1/2
= (DEf)
i+1/2
where
(Ef)
i
= (Ff)(x
i
) (F P f)
i
.
To nd an accurate approximation to the boundary-value problem, we
only need nd an accurate approximation to the ux.
. p.28/35
A Representation for Operators
LEMMA If H is a discrete operator that kills the discrete function that is
identically one, then
Hf = KG f
So, we can always represent a differentiation operator by N + 1 by
N + 1 matrix K on grids with N cells.
. p.29/35
A Representation for Operators
LEMMA If H is a discrete operator that kills the discrete function that is
identically one, then
Hf = KG f
So, we can always represent a differentiation operator by N + 1 by
N + 1 matrix K on grids with N cells.
For this presentation:
Assume that k 1, and the grid is uniform. Note that even if k = 1, K
may be non-trivial.
We will display the results for uniform grids. For general grids, use the
Mathematica notebooks on my web page.
. p.29/35
The Simplest Example
We rst write out the low-order accuracy example where K is the
identity. This method has
_
2 3 1 0 0 0 . . .
1 2 1 0 0 0 . . .
0 1 2 1 0 0 . . .
0 0 1 2 1 0 . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
_
_
.
. p.30/35
A Fourth-Order Method
We now use a computer algebra system to nd a higher-order method.
_
25
12
115
72
23
36
1
8
0 0 0
5
24
197
144
13
72
1
48
0 0 0
0
1
12
7
6
1
12
0 0 0
0 0
1
12
7
6
1
12
0 0
0 0 0
1
12
7
6
1
12
0
0 0 0
1
48
13
72
197
144
5
12
0 0 0
1
8
23
36
115
72
25
6
_
_
,
. p.32/35
A Fourth-Order Method
DKG =
1
h
2
_
_
55
12
1087
144
545
144
139
144
7
48
0 . . .
5
12
269
144
403
144
209
144
5
48
0 . . .
0
1
12
4
3
5
2
4
3
1
12
. . .
0 0
1
12
4
3
5
2
4
3
. . .
0 0 0
1
12
4
3
5
2
. . .
0 0 0 0
1
12
4
3
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
_
_
.
. p.33/35
Truncation Errors
The truncation error for the rst few rows of L = DKG are
point K = I fourth
x =
h
2
f
(2)
3
,
5 h
3
f
(5)
72
x =
3 h
2
h
2
f
(4)
12
,
h
3
f
(5)
72
x =
5 h
2
h
2
f
(4)
12
,
h
4
f
(6)
90
When K = I the scheme is inconsistent.
. p.34/35
Conclusion
The formulas for methods of any order in an arbitrary grid can be
computed using the Mathematica notebooks on my web page:
math.unm.edu/stanly
. p.35/35
Conclusion
The formulas for methods of any order in an arbitrary grid can be
computed using the Mathematica notebooks on my web page:
math.unm.edu/stanly
A preprint of a paper that solves a more general problem is available
from my web page:
A Discrete Calculus with Applications to High-Order Discretizations of
Boundary-Value Problems
. p.35/35
Conclusion
The formulas for methods of any order in an arbitrary grid can be
computed using the Mathematica notebooks on my web page:
math.unm.edu/stanly
A preprint of a paper that solves a more general problem is available
from my web page:
A Discrete Calculus with Applications to High-Order Discretizations of
Boundary-Value Problems
Questions?
Thanks!
. p.35/35