Next: Burgers Equation
Up: The advection equation
Previous: Implementation of a naive
Contents
The two forms of the advection equation that we have for
are:
 |
|
|
(9) |
 |
|
|
(10) |
First we modified the code in calc_flux.f and spec_decomp.f. Then we calculated a exact solution using the
Method of Characteristics.
Applying the method to equation 9:
 |
(11) |
The wave speed depends on the spatial coordinate, x. Thus, the speed of a point on the solution profile will depend on the horizontal coordinate, x, of the point:
.
For arbitrary initial data, the characteristic equation to solve is
, with the initial condition
. Solving it gives the characteristic curves
(step 2) Solve equation
, with initial condition
. The solution is
. (step 3) The characteristic curves are determined by
, so
and the solution of the PDE in the original variables is
.
for our initial data, which is a gaussian profile, we resume the
method of characteristics as follows: (with
as the
characteristic constant):
Then characteristic equation is
 |
(12) |
the last characteristic equation is the following (in absence of
source terms in 9):
 |
(13) |
The solution is
 |
(14) |
since we expect q to be linear in the variable
. With this in
place we can substitute the equation for
and get the full
relationship (general initial conditions)
 |
(15) |
We have the following initial profile (gaussian),
 |
(16) |
So the analytic solution to equation 9 is:
 |
(17) |
Now we turn to equation 10. We use the ansatz provided in the
assignment sheet,
 |
(18) |
and the solution 18 we just found. Substituting we have:
 |
(19) |
where
is a time derivative, and
is a spatial
derivative. If we manipulate this expression we can factorize a term:
 |
(20) |
And
is a solution to the advection equation
9, so this term vanishes and we are left with the equation:
 |
(21) |
We consider that
is non-zero (otherwise we have a trivial
solution, useless), we factorize it and
then divide by
2. We end up with
 |
(22) |
solving using separation of variables,
 |
(23) |
 |
(24) |
The solution to (24) and (25) are, respectively;
 |
|
|
(25) |
 |
|
|
(26) |
and
are the separation and integration constants,
respectively. Initial conditions will determine them, as usual. so our
solution
takes the form:
 |
(27) |
Analysing which initial conditions are convenient we determine that
,
(with
the variance of our gaussian
profile). We end up with the solution:
 |
(28) |
We evolved this solution coding it into exac_sol.f and, as shown in the web site under exact solution to the Advection
equation with
, this solution
reproduces our numerical approximation. So we conclude we are
solving equation (10) :
 |
(29) |
Next: Burgers Equation
Up: The advection equation
Previous: Implementation of a naive
Contents
Benjamin Gutierrez
2005-07-23