I would like to solve the 1D nonlinear advection equation with the method of characteristics. Here is my notation:

\begin{equation} \begin{cases} \rho_t + (1+\rho)\rho_x = 0\\ \rho = \rho(x,t); \quad \rho(x,0) = \frac{1}{1+x^2} \end{cases} \end{equation} What I have been up to is the following, using the parameter s: \begin{align} &\frac{d\rho}{dt} = \frac{dx}{ds}\frac{\partial \rho}{\partial x} + \frac{dt}{ds}\frac{\partial \rho}{\partial t} = 0\\ \Longrightarrow \; & \frac{dt}{ds} = 1 ;\quad t(0)=0 \; \Longrightarrow \; t=s \\ \Longrightarrow \; & \frac{d\rho}{ds} = 0 ;\quad \rho(0)=\rho_0 \; \Longrightarrow \; \rho = \rho_0 \\ \Longrightarrow \; & \frac{dx}{ds}=1+\rho= 1+\rho_0 ;\quad x(0) = f(\rho_0) \; \Longrightarrow \; x = (1+\rho_0)s + f(\rho_0) \end{align} So that I end up with \begin{equation} f(\rho) = x - (1+\rho)t \; \Longrightarrow \; \rho = F(x - [1+\rho]t ) \end{equation} I tried to apply several techniques I found to find the solution of the above Riemann problem using the method of characteristics. I have the general form of the solution as F but I would like to have the analytic solution for this case so I can plot for several times and see the shockwave.

Note: This problem comes from this online document, chapter 11.

  • $\begingroup$ You must provide a condition on the "inflow" boundary, for instance $\rho(0,t)=1$. If you just want to visualize the solution I can provide two lines of Wolfram code that will do the trick. $\endgroup$ – PierreCarre Jan 31 at 9:43
  • $\begingroup$ I think you haven't used the initial condition on $\rho$ yet, which yields $\rho_0 = \frac{1}{1+f(\rho_0)^2}$? $\endgroup$ – Christoph Jan 31 at 9:54
  • $\begingroup$ As J.Jacquelin did below, using the unitial condition on $\rho$ leads to a cubic equation that I have no idea how to solve. $\endgroup$ – Dash Jan 31 at 14:48

Your calculus is correct. You found the general solution : $$\rho=F\left(x-(1+\rho)t\right)$$ Condition : $$\rho(x,0)=\frac{1}{1+x^2}=F\left(x-(1+\rho)0\right)=F\left(x\right)$$ The function $F$ is determined : $$F(X)=\frac{1}{1+X^2}$$ We put this function into the general solution where $X=x-(1+\rho)t$ $$\rho=\frac{1}{1+(x-(1+\rho)t)^2}$$ This is the solution on implicit form.

In order to obtain the explicit solution, solve the cubic equation for $\rho$ : $$(1+(x-(1+\rho)t)^2)\rho-1=0$$

ADITION after the discussion in comments.

There is no difficulty to plot the figures that you saw in the document : https://courses.physics.ucsd.edu/2011/Spring/physics221a/LECTURES/CH11_SHOCKS.pdf

For exemple, to plot the curves corresponding tu figure 11.1 : $$x=(1+\rho)t\pm\sqrt{\frac{1}{\rho}-1}$$ Plot the two branches with signs $+$ and $-$.

enter image description here

Inverse the axis if you want it in the standard position.

  • $\begingroup$ Thamks for answering. I actually came to the same conclusion a few minutes ago. My next problem is when I'm computing the $\delta = b^2 - 4ac$ of this equation, which sign is undetermined because, well, in (x,t) parameters are supposed to be both varying parameters and though $\delta$ is not a scalar but a space of solutions. $\endgroup$ – Dash Jan 31 at 14:26
  • $\begingroup$ Apologies, I had a slightly different in mind indeed.. Still you are right, the formula cannot be written explicitly. Why I would like to have a explicit formula is to plot the solution for several time step to compare with what is shown in the book I mentionned. Another contributor kindly proposed a Wolfram code to do that but I wanted to do it on gnuplot or python. You know, the old way.. $\endgroup$ – Dash Jan 31 at 15:08
  • $\begingroup$ There is no need for an explicit formula to plot $\rho(x,t)$ as a function of $t$ for given $x$. Compute the formula of $t$ as a function of $\rho$ which is an explicit equation. Plot $t$ as a function of $\rho$ with $t$ on horizontal axis and $\rho$ on vertical axis. $\endgroup$ – JJacquelin Jan 31 at 15:25
  • $\begingroup$ If I rewrite the equation as \begin{equation} \frac{1}{\rho}-1=[x−(1+ρ)t]^2 \end{equation} Then I cannot isolate t from ρ because of the square $\endgroup$ – Dash Jan 31 at 17:02
  • $\begingroup$ Here the advection velocity depends on $\rho$ itself, which is the problem when I look for an explicit analytic solution. Perhaps I should quit looking for a beautiful formula, but do you have an idea of how they did in fig. 11 of the book to plot the solution ? $\endgroup$ – Dash Jan 31 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.