next up previous contents
Next: Burgers Equation Up: The advection equation Previous: Implementation of a naive   Contents

Velocity $v(x)=x$

The two forms of the advection equation that we have for $v(x)=x$ are:


$\displaystyle \frac{\partial q(x,t)}{\partial t} + v(x)\frac{\partial q(x,t)}{\partial x}=0$     (9)
$\displaystyle \frac{\partial q(x,t)}{\partial t} + \frac{\partial (v(x) q(x,t))}{\partial x}=0$     (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:

\begin{displaymath}
\frac{\partial q(x,t)}{\partial t}+v(x)\frac{\partial q(x,t)}{\partial x}=0
\end{displaymath} (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: $q_t+x q_x=0$. For arbitrary initial data, the characteristic equation to solve is $x'(t)=x$, with the initial condition $x(0)=x_0$. Solving it gives the characteristic curves $x=x_0 \exp(t)$ (step 2) Solve equation $q'(t)=0$, with initial condition $(0)=f(x_0)$. The solution is $q(t)=f(x_0)$ . (step 3) The characteristic curves are determined by $x=x_0 \exp(t)$, so $x_0=x \exp(-t)$ and the solution of the PDE in the original variables is $q(x,t)=f(x_0)=f(x \exp(-t))$.

for our initial data, which is a gaussian profile, we resume the method of characteristics as follows: (with $\eta$ as the characteristic constant):


\begin{displaymath}\nonumber
\frac{dx}{d \eta} = x
\hspace{.5cm}and\hspace{.5cm}
\frac{dt}{d\eta} = 1
\rightarrow
\frac{dx}{dt} = x
\end{displaymath}  

Then characteristic equation is
\begin{displaymath}
\eta = x \exp({-t})
\end{displaymath} (12)

the last characteristic equation is the following (in absence of source terms in 9):

\begin{displaymath}
\frac{dq}{dt} = 0
\end{displaymath} (13)

The solution is
\begin{displaymath}
q = f(\eta)
\end{displaymath} (14)

since we expect q to be linear in the variable $\xi$. With this in place we can substitute the equation for $\xi$ and get the full relationship (general initial conditions)


\begin{displaymath}
q(x,t) = f(x\exp({-t}))
\end{displaymath} (15)

We have the following initial profile (gaussian),

\begin{displaymath}
q(x,0) = \exp{(-x^2)}
\end{displaymath} (16)

So the analytic solution to equation 9 is:
\begin{displaymath}
\fbox{
\begin{minipage}{4.5cm}
$q_1(x,t) = \exp{(-\left(x e^{-t}\right)^2)}$
\end{minipage}}
\end{displaymath} (17)

Now we turn to equation 10. We use the ansatz provided in the assignment sheet,

\begin{displaymath}
q_2(x,t)=A(t)B(x)q_1(x,t)
\end{displaymath} (18)

and the solution 18 we just found. Substituting we have:
\begin{displaymath}
\frac{d A(t)}{dt}B(x)q_1 + A(t)B(x)\frac{\partial q_1}{\part...
...d B(x)}{d x}q_1 + xA(t)B(x)\frac{\partial q_1}{\partial x} = 0
\end{displaymath} (19)

where $\cdot$ is a time derivative, and $\prime$ is a spatial derivative. If we manipulate this expression we can factorize a term:
\begin{displaymath}
A(t)B(x)\left((q_1)_t + x(q_1)_x\right)
\end{displaymath} (20)

And $q_1$ is a solution to the advection equation 9, so this term vanishes and we are left with the equation:


\begin{displaymath}
\frac{d A(t)}{dt}B(x)q_1 + A(t)B(x)q_1 + xA(t)\frac{dB(x)}{dx}q_1 = 0
\end{displaymath} (21)

We consider that $q_1$ is non-zero (otherwise we have a trivial solution, useless), we factorize it and then divide by $A(t)B(x)$2. We end up with
\begin{displaymath}
\frac{1}{A(t)}\frac{d A(t)}{dt} + \frac{x}{B(x)}\frac{B(x)}{dx}+1 = 0
\end{displaymath} (22)

solving using separation of variables,
\begin{displaymath}
\frac{1}{A(t)}\frac{d A(t)}{dt} + 1 = \lambda
\end{displaymath} (23)


\begin{displaymath}
\frac{x}{B(x)}\frac{d B(x)}{dx} = -\lambda
\end{displaymath} (24)

The solution to (24) and (25) are, respectively;
$\displaystyle A(t) = \exp{((\lambda-1)t)}$     (25)
$\displaystyle B(x) = \mu\left(\frac{1}{x}\right)^\lambda$     (26)

$\lambda$ and $\mu$ are the separation and integration constants, respectively. Initial conditions will determine them, as usual. so our solution $q_2(x,t)$ takes the form:


\begin{displaymath}
\fbox{
\begin{minipage}{10cm}
$q_2(x,t) = \exp{(-\left(x e^...
...da-1)t)} \mu\left(\frac{1}{x}\right)^\lambda $
\end{minipage}}
\end{displaymath} (27)

Analysing which initial conditions are convenient we determine that $\lambda=0$, $\mu=1/\Delta$ (with $\Delta$ the variance of our gaussian profile). We end up with the solution:


\begin{displaymath}
q_2(x,t) = \exp{(-\left(x e^{-t}\right)^2)} \exp{(-t)}\left(\frac{1}{\Delta}\right)
\end{displaymath} (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 $v(x)=x$, this solution reproduces our numerical approximation. So we conclude we are solving equation (10) :
\begin{displaymath}
\frac{\partial q(x,t)}{\partial t} + \frac{\partial (v(x)
q(x,t))}{\partial x}=0
\end{displaymath} (29)


next up previous contents
Next: Burgers Equation Up: The advection equation Previous: Implementation of a naive   Contents
Benjamin Gutierrez 2005-07-23