Thursday, July 8, 2021

Method of Characteristics

First-order partial differential equations may be analyzed (and sometimes, even solved) by using the Method of Characteristics. We consider a family of curves, along which the solution to the partial differential equation is constant. (At least, intuitively.)

When we cannot solve a first-order PDE, we can still extract useful information about it using the method of characteristics. This post will just give some intuition and basic algorithms for the linear case, and generalize it to the semilinear and quasilinear cases.

Linear Partial Differential Equations

Example 1. Suppose we are working in 2-dimensions and we have a first-order partial differential equation, say the transport equation: \begin{equation} L[u] = \partial_{t}u(x,t) + c\partial_{x}u(x,t)=0. \end{equation} Here $c$ is a nonzero constant (the wave speed). How can we solve it?

We could consider a curve $x(s)$, $y(s)$ such that the total derivative of the solution to our PDE along this curve is our original partial differential equation: \begin{equation} \frac{\D}{\D s}u(x(s),y(s)) = \left.L[u]\right|_{\vec{x}=\vec{x}(s)}=0 \end{equation} This means we have several ordinary differential equations to solve \begin{equation} \frac{\D}{\D s}t(s) = 1 \end{equation} and \begin{equation} \frac{\D}{\D s}x(s) = c. \end{equation} These have solutions of the form \begin{equation} t(s) = s + k_{1},\quad\mbox{and}\quad x(s)=cs + k_{2} \end{equation} where $k_{1}$, $k_{2}$ are constants of integration.

In particular, observe that $x(s) - ct(s)$ is a constant. This means that any (sufficiently smooth) function $f(-)$ satisfies the transport equation: \begin{equation} (\partial_{t} - c\partial_{x})f(x - ct) = 0. \end{equation} This seems like some black magic, or bizarre accident. What's going on?

Example 1'. Let's try solving the transport equation with a different scheme. Let's try to change coordinates to make the transport equation of the form \begin{equation} b(\xi,\eta)\partial_{\xi}u(\xi,\eta)=0. \end{equation} How can we do this?

Step 1: Find direction. We want $\xi$ to point in the direction of $(t,x)=(1,c)$. Why? Well, we could then treat the PDE as the directional derivative $(1,c)\cdot\nabla u = 0$. We can construct the line through the origin and $(1,c)$ using the formula $t=x/c$. Supposing we didn't know how to construct a line (or it's impossible for some reason), we could determine the direction $\theta(t)$ by the differential equation \begin{equation} \frac{\D\theta(t)}{\D t} = \frac{c}{1} \end{equation} which gives the solution $\theta(t) = ct + k$ for some constant of integration $k$.

Step 2: Construct axes. We then want to use $\theta(t)$ as the formula for $x$, i.e., we want to construct lines \begin{equation} g(x,t) = x - ct \end{equation} so when we plug in $x=\theta(t)$ we have \begin{equation} g(\theta(t),t) = k \end{equation} be constant. Now we assert this is the $\xi$-axis for $k=0$.

The $\eta$-axis would be perpendicular to this, i.e., $x=-t/c$ or $t=-cx$ is the $\eta$-axis.

Step 3: Cleaning up. Along the $\eta$-axis, $\xi$ is constant. Along $\{(t,x)\in\RR^{2}\mid t=-cx+k\}$ (for some "intercept parameters" $k$) parallel to the $\eta$-axis, we expect $\xi$ to be constant. That is to say, we have \begin{equation} \xi(t,x) = t+cx \end{equation} and similar reasoning suggests $\eta$ is constant along lines $\{(t,x)\in\RR^{2}\mid t=k + x/c\}$ parallel to $\xi$, which is equivalent to asserting \begin{equation} \eta(t,x) = x - ct. \end{equation} Why? Well, given any point in the line $(t_{k},x_{k})\in\{(t,x)\in\RR^{2}\mid t=k + x/c\}$, we see $\eta(t_{k},x_{k})=k$ is constant. Similarly, for any point $(t_{k}',x_{k}')\in\{(t,x)\in\RR^{2}\mid t=-cx+k\}$, we find $\xi(t_{k}',x_{k}')=k$ is constant, too.

If we change coordinates, then we have \begin{equation} \xi=\xi(x,t)=Ax+Bt \end{equation} and \begin{equation} \eta=\eta(x,t)=Cx+Dt. \end{equation} Using the chain rule, we find \begin{equation} \begin{split} \partial_{x} &= \partial_{x}\xi(x,t)\partial_{\xi} + \partial_{x}\eta(x,t)\partial_{\eta}\\ &= A\partial_{\xi} + C\partial_{\eta} \end{split} \end{equation} and similarly \begin{equation} \begin{split} \partial_{t} &= \partial_{t}\xi(x,t)\partial_{\xi} + \partial_{t}\eta(x,t)\partial_{\eta}\\ &= B\partial_{\xi} + D\partial_{\eta}. \end{split} \end{equation} We then have \begin{equation} (B\partial_{\xi} + D\partial_{\eta})u + c(A\partial_{\xi} + C\partial_{\eta})u=0. \end{equation} Rearranging terms, we have \begin{equation} (cA + B)\partial_{\xi}u + (cC + D)\partial_{\eta}u=0. \end{equation} Erm, progress?

Yes, progress! Because we have discovered what $A$, $B$, $C$, and $D$ are! We did it in step 1. We see $B=C=1$, $A=c$, and $D=-c$. This tells us that \begin{equation} (cC + D)\partial_{\eta}u=(c-c)\partial_{\eta}u=0 \end{equation} identically.

Our partial differential equation becomes \begin{equation} \boxed{(c^{2}+1)\partial_{\xi}u = 0.} \end{equation} And we conclude that a generic solution must look like \begin{equation} u(\xi, \eta) = f(\eta) = f(x - ct) \end{equation} for sufficiently smooth $f(-)$. This is precisely the result we got before.

Example 2. Let's consider a harder PDE, with variable coefficients: \begin{equation} a(x,y)\partial_{x}u(x,y) + b(x,y)\partial_{y}u(x,y)=0. \end{equation} There are two ways to tackle this:

  1. Geometrically, find curves $x(s)$ and $y(s)$ such that $\D u(x(s),y(s))/\D s$ is our original PDE; or
  2. Algorithmically change variables, so we have $\eta=\eta(x,y)$ and $\xi=\xi(x,y)$ such that we choose $\eta$ to satisfy $a(x,y)\partial_{x}\eta + b(x,y)\partial_{y}\eta=0$ identically, and $\xi$ is whatever works, so our PDE becomes $(\mbox{stuff})\partial_{\xi}u=0$.

The algorithm changes slightly, because now we have variable coefficients, but it is morally the same.

Step 1. Find the direction $\theta(x)$ such that \begin{equation} \frac{\D\theta(x)}{\D x} = \frac{b(x,\theta(x))}{a(x,\theta(x))}. \end{equation} Before this was easy because $\theta(x)=(b/a)x$ for constant coefficients, which was used as the slope of the $\xi$-direction.

Step 2. Since $\theta(x)$ from step 1 is unique up to some constant of integration $k$, "invert it" to produce some function $g(x,y)$ such that \begin{equation} g(x,\theta(x))=k \end{equation} it produces the constant of integration.

Step 3. Set $\eta$ equal to this function obtained in step 2: \begin{equation} \eta(x,y) = g(x,y). \end{equation} The assertion is that $\eta$ is constant in the $(a(x,y), b(x,y))$ direction, and so any arbitrary (but sufficiently smooth) function $f(\eta)$ satisfies the original PDE.

If you look back at example 1', you'll see that $\eta=g(x,y)$, too. You'll also see the steps carried out as described.

So how do these two methods relate to each other? Well, if we parametrize $y=y(x)$ instead of $y=y(s)$ and $x=x(s)$, then we recover the algorithmic method from the geometric method. In other words, the geometric method is more general and contains (as a special case) the algorithmic method.

More general case with variable coefficients. If we have something of the form \begin{equation} a(x,y)\partial_{x}u + b(x,y)\partial_{y}u + c(x,y)u = f(x,y) \end{equation} then everything we did can carry over. The only difference is our partial differential equation becomes \begin{equation} A(\xi,\eta)\partial_{\xi}u + C(\xi,\eta)u = F(\xi,\eta) \end{equation} which is a first-order ODE. We know how to solve them!

Semilinear Equations

For a semilinear PDE of the form \begin{equation} a(x,y)\partial_{x}u + b(x,y)\partial_{y}u = f(x,y,u) \end{equation} the geometric method carries over. But we now have the system of ODEs: \begin{equation} \frac{\D x(s)}{\D s} = a(x(s),y(s)) \end{equation} \begin{equation} \frac{\D y(s)}{\D s} = b(x(s),y(s)) \end{equation} as before, and also \begin{equation} \frac{\D w(s)}{\D s} = f(x(s),y(s),w(s)). \end{equation} This new equation intuitively encodes the characteristic of the solution: $w(s) = u(x(s), y(s))$.

Our PDE along this curve is then such that \begin{equation} \frac{\D}{\D s} (u(x(s),y(s)) - w(s)) = 0. \end{equation} Care must be taken if working with initial conditions or boundary values.

Quasilinear Equations

For a quasilinear PDE of the form \begin{equation} a(x,y,u)\partial_{x}u + b(x,y,u)\partial_{y}u = f(x,y,u) \end{equation} the geometric method carries over. But we now have the system of ODEs: \begin{equation} \frac{\D x(s)}{\D s} = a(x(s),y(s),w(s)) \end{equation} \begin{equation} \frac{\D y(s)}{\D s} = b(x(s),y(s),w(s)) \end{equation} \begin{equation} \frac{\D w(s)}{\D s} = f(x(s),y(s),w(s)). \end{equation} Unlike the semilinear case, we have more complications to deal with, which I'll discuss in another post. What sort of complications? Let's look at an example.

Example 3. Consider the nonlinear transport equation (where wave-speed is the magnitude of the wave): \begin{equation} \partial_{t}u + u\partial_{x}u = 0. \end{equation} The characteristics satisfy the system of equations \begin{equation} \frac{\D t(s)}{\D s} = 1 \end{equation} \begin{equation} \frac{\D x(s)}{\D s} = w(s) \end{equation} \begin{equation} \frac{\D w(s)}{\D s} = 0. \end{equation} We can solve these equations \begin{equation} t(s) = t_{0} + s \end{equation} \begin{equation} x(s) = x_{0} + w_{0}s \end{equation} \begin{equation} w(s) = w_{0}. \end{equation} We have \begin{equation} s = t(s) - t_{0} \end{equation} and hence \begin{equation} x(s) - w_{0}(t(s) - t_{0}) = x_{0} \end{equation} or more precisely: \begin{equation} x(s) - w(s)t(s) = \mbox{constant}. \end{equation} This tells us the generic solution looks like \begin{equation} u(x,t) = f(x - ut) \end{equation} which is an implicit equation. Here $f(-)$ is determined by the initial conditions. There is no general solution beyond this.

Exercise 1. Plug in this "solution" $u(x,t) = f(x - ut)$ to the nonlinear transport equation. Is it really a solution?

References

  1. Walter Strauss, Partial Differential Equations: An Introduction.
  2. Julie Levandosky, First-Order Equations: Method of Characteristics. Handout, Stanford University, Math 220A, Fall 2002.

Monday, July 5, 2021

Lagrangian Description of Fluids

I'd like to just summarize the Lagrangian description of fluids quickly, because some texts have horrible typos and errors.

We begin with describing the position of fluid parcels using a function $\vec{x} = \vec{x}(\vec{x}_{0}, t)$ parametrized by position $\vec{x}_{0}$ at time $t=t_{0}$. Time evolution is described by the function \begin{equation} \vec{x}(\vec{x}_{0}, t) = \phi_{t}(\vec{x}_{0}) \end{equation} such that (locally) $\phi_{t}$ is invertible; i.e., we can write \begin{equation} \vec{x}_{0}(\vec{x}, t) = {\phi_{t}}^{-1}(\vec{x}(\vec{x}_{0},t)). \end{equation} Now we may introduce the Fluid Velocity in the Lagrangian description as \begin{equation} \vec{q} = \frac{\partial\vec{x}(\vec{x}_{0},t)}{\partial t}. \end{equation}

The Eulerian picture may be obtained by writing \begin{equation} \vec{u}(\vec{x}, t) = \vec{q}(\vec{x}_{0}(\vec{x},t), t) = \left.\frac{\partial\vec{x}(\vec{x}_{0},t)}{\partial t}\right|_{\vec{x}_{0}={\phi_{t}}^{-1}(\vec{x})} \end{equation}

Example 1. Consider a flow on the unit disc, with trajectories described by \begin{equation} \begin{pmatrix} x(t)\\ y(t) \end{pmatrix} = \begin{pmatrix}\cos(\omega t) & -\sin(\omega t)\\ \sin(\omega t) & \cos(\omega t) \end{pmatrix} \begin{pmatrix} x_{0}\\ y_{0} \end{pmatrix}. \end{equation} Observe that $x(0)=x_{0}$ and $y(0)=y_{0}$. We find we can invert this equation to determine the initial positions from the trajectory: \begin{equation} \begin{pmatrix} x_{0}\\ y_{0} \end{pmatrix} = \begin{pmatrix}\cos(\omega t) & \sin(\omega t)\\ -\sin(\omega t) & \cos(\omega t) \end{pmatrix} \begin{pmatrix} x(t)\\ y(t) \end{pmatrix} \end{equation} which permits us to write the Lagrangian parameters (initial positions) in terms of the current position of the fluid parcel. We find the time derivative of the trajectories \begin{equation} \vec{q} = \frac{\D}{\D t} \begin{pmatrix} x(t)\\ y(t) \end{pmatrix} = \omega\begin{pmatrix}-\sin(\omega t) & -\cos(\omega t)\\ \cos(\omega t) & -\sin(\omega t) \end{pmatrix} \begin{pmatrix} x_{0}\\ y_{0} \end{pmatrix}. \end{equation} Plugging in the equations relating $x_{0}$ and $y_{0}$ in terms of $x(t)$ and $y(t)$ gives us (after some simple matrix multiplication): \begin{equation} \begin{pmatrix}u(x,y,t)\\ v(x,y,t)\end{pmatrix} =\left.\frac{\D}{\D t} \begin{pmatrix} x(t)\\ y(t) \end{pmatrix}\right|_{\vec{x}_{0}=\vec{x}_{0}(\vec{x},t)} = \begin{pmatrix} -\omega y\\ \omega x \end{pmatrix}. \end{equation} This is a steady flow (since time doesn't explicit appear in the equation for $u(x,y,t)$ or $v(x,y,t)$), and just a rotation. If we want to generalize this, we could replace $\omega t$ with a dimensionless, strictly increasing function of time $f(t)$, which would usually not be steady (e.g., if $f(t) = \omega t + \alpha t^{2}$ for positive constants $\omega$, $\alpha$, then $u=-(\omega + 2\alpha t)y$ and $v=(\omega + 2\alpha t)x$).

Exercise 1. Find the density $\rho(x,y,t)$ for the flow from example 1 by solving the continuity equation, or some other way. If you do it some other way, prove your solution satisfies the equation of continuity.

Exercise 2. Is the flow from example 1 compressible or incompressible?

Example 2 (Childress, Example 2.2). Consider the one-dimensional flow with $u(x,t) = 2xt/(1 + t^{2})$. Suppose we want to find the Lagrangian description of the flow, then we can rewrite this as \begin{equation} \frac{\D x(t)}{\D t} = \frac{2x(t)\cdot t}{1 + t^{2}} \end{equation} with initial condition $x(0)=a$. This has the obvious solution \begin{equation} x(t) = a(1 + t^{2}). \end{equation} This illustrates how to translate a solution in the Euler description to find the trajectories in the Lagrangian description.

Exercise 3. Solve the Euler flow equations and continuity equation for both the pressure and density. "Someone on the internet" asserts $\rho(x,t)=x$ is a valid solution: is it? [Hint: use method of characteristics to determine density.]

References

  1. C.C. Mei, Methods of Describing Fluid Motion. MIT course notes for 1.63 "Advanced Fluid Mechanics", 2001.
  2. Lei Li, Math 575-Lecture 1. Duke University
  3. Stephen Childress, An Introduction to Theoretical Fluid Mechanics. AMS Press, 2009.