# Solving PDE with spatial and temporal derivatives on left hand side

I wish to solve an equation of the form,

$$\frac{\partial}{\partial t} \left( \frac{\partial \phi}{\partial x} \right) = -\frac{\partial}{\partial x}(\mathcal{F})$$

for the variable $$\phi$$ (e.g. mass).

On the right-hand side is the flux $$\mathcal{F}$$ of quantity $$\phi$$.

This equation "looks like" an advection-diffusion equation, but with the rate of change of the spatial derivative of $$\phi$$ appearing on the left-hand side.

Applying the finite volume approach we integrate the equation over the cell $$\Omega$$,

$$\frac{\partial}{\partial t}\int_{\Omega}\left( \frac{\partial \phi}{\partial x} \right)dx = - \int_{\Omega}\frac{\partial\mathcal{F}}{\partial x} dx$$

$$\frac{\partial}{\partial t}\left( \frac{\phi_{j+1/2}}{h_j} - \frac{\phi_{j-1/2}}{h_j}\right) = -\left( \frac{\mathcal{F}_{j+1/2}}{h_j} - \frac{\mathcal{F}_{j-1/2}}{h_j}\right)$$

where $$h_j$$ width of the cell.

Is this basic approach correct? I have never needed to solve an equation which is the time-derivative of a spatial derivative before, this is the approach I have taken, does anyone have any advice or direction? I have not yet tried to implement this numerically.

• The operator on your left hand side is second order, as is the one on the right. Therefore, it is not an advection-diffusion problem. I recommend finding out whether the result is an elliptic, hyperbolic or parabolic equation. – Guido Kanschat Jul 28 '13 at 17:03
• @GuidoKanschat I'm not too sure how to go about doing that. How can I use that information to help with writing the equation with FVM? – boyfarrell Jul 28 '13 at 17:13
• The FVM might simply not be the best approach for this equation. As for the character of the equation, one can typically guess this if one knows what kind of physical process this equation describes. – Wolfgang Bangerth Jul 28 '13 at 21:58

What I describe below is a version of the method of characteristics. Its applications are limited, but if it works in your case, it would be a fairly simple, fast, and accurate process. If you want to discretize on a mesh, it might not be that helpful.

Assuming your solutions $\phi$ are smooth, you can reduce this to a family of ODE problems. Exchange the order of derivatives on the left first, obtaining \begin{gather} \frac{\partial}{\partial x}\frac{\partial}{\partial t} \phi = -\frac{\partial}{\partial x}\frac{\partial}{\partial x} \phi. \end{gather}

Now you define $\psi = \partial_x \phi$ and solve \begin{gather} \frac{\partial}{\partial t} \psi = -\frac{\partial}{\partial x} \psi, \qquad\text{or}\qquad (\partial_t+\partial_x)\psi=0, \end{gather} which is a first order hyperbolic conservation law and linear. Thus, \begin{gather} \psi(t,x) = \psi(0,x-t), \end{gather} that is, $\psi$ is already determined by its initial values.

Finally, observing that by construction $\psi = \partial_x \phi$, you compute (boundary conditions permitting): \begin{gather} \phi = \int \psi(t,x) \,dx. \end{gather}

• This answer is saying that by making a substitution the equation can be be written in the form the conservation equation. This was my observation above, what I would like to know is how to numerically solve this equation as-is. – boyfarrell Jul 28 '13 at 20:55
• I added the line that computes the function $\psi$ from an initial value – Guido Kanschat Jul 29 '13 at 6:13
• This solution does not depend on the function F? How did this happen? Is this a typo or what? – Maxim Umansky Jul 29 '13 at 13:46
• According to the question, the function $\mathcal F$ is equal to $\partial_x \phi$. At least that's how I understood the flux of $\phi$ – Guido Kanschat Jul 29 '13 at 15:30
• The flux for the advection diffusion equation is $\mathcal{F}=a\phi-d\phi_x$ – boyfarrell Jul 29 '13 at 21:48

The equation is $\partial_{t} \psi = \partial_{x} F(\phi)$ where $\psi = \partial_x \phi$

The time-integration can be done, e.g., by explicit time-stepping:

$\psi^{j+1}_i = \psi^j_i + \frac{\tau}{2 dx} (F^j_{i+1}-F^j_{i-1})$,

which requires that $F$ is known at each grid node $i$ at the "old" time slice $j$.

This can be achieved by adding a numerical "inversion" operator $\phi(x_i)=\int_{x_0}^{x_i} \psi(x)$ used each time before evaluating the function $F$. If $\psi$ is known at each grid point $i$ at the old time-slice $j$ then the integral can be evaluated (e.g., by Gaussian quadrature) so $\phi$ can be found at each grid point $i$; therefore $F$ can be found at each grid point as well. Then the time-step can be carried out and $\psi^{j+1}$ is found. This method would work for implicit time-stepping as well.