1+1-D Linear Advection Demo
MSSRC
The linear advection equation is

+
A
= 0
where
and A is an
n×n matrix with real entries. The Cauchy problem asks
for the solution
given the initial function

(
x) =

(
x, 0).
It is well known that when n = 1, so that the matrix
A has only one entry a, the unique solution u is
u(x, t) = u0(x -
at).
It is possible to construct the solution for general n if
it is assumed that A has real eigenvalues
,...,
with
corresponding eigenvalues
v1,..., vn that are linearly
independent. With this hypothesis, the matrix P whose
ith column is vi is invertible
and
P-1AP = D
where D is diagonal with entries
,...,
.
Setting

=
P-1
so that
= P
, we have
P-1
+
P-1A
= 0
i.e.

+
P-1AP
= 0
or

+
D
= 0.
This completely decouples the equations into n
one-dimensional advection equations and hence the solution is
where
wi0(x) =
P-1
(x, 0). The
desired solution is therefore

=
P
.
ExprLib will be used to solve the linear advection equation given
by the
2×2 matrix
and initial function
u10, u20.
It is assumes that u10 and
u20 are expressions in x (in the
sense of ExprLib) and that a and b are expressions that
do not contain the variables x or t, i.e. are constant
in x and t. Thus we will be solving the system of PDEs
Make sure that u_0^1 and u_0^2 are functions of
x only.
Make sure that a and b are free of x and t.