Solving nonlinear inhomogeneous first-order PDE using method of characteristics

I am trying to solve the partial differential equation

$$\frac{\partial \rho}{\partial t}+(A+2B\rho)\frac{\partial \rho }{\partial x}=0$$ where $$A$$ and $$B$$ are constants. This is meant to model the density of traffic $$x$$ metres behind some traffic lights $$t$$ seconds after the light turns green.

My characteristics are the following:

$$\frac{\mathrm{d}t}{\mathrm{d}s}=1,\qquad \frac{\mathrm{d}x}{\mathrm{d}s}=A+2B\rho,\qquad\frac{\mathrm{d}\rho}{\mathrm{d}s}=0.$$

This means that $$t=t_0+s$$ and that $$\rho = \rho_0$$. Since $$t_0=0$$ (the initial time), $$t = s$$.

I want to impose that the density is a constant (say $$\rho_{\max}$$) at $$t=0$$, as in, the cars are all as close to each other as possible behind the traffic light before they start moving. However, to me this suggests that $$\rho_0 = \rho_{\max}$$, which suggests that $$\rho\equiv\rho_{\max}$$. This doesn't make sense to me in the context of the problem.

Is this a problem with using the method, or have I simply not set up my initial condition correctly?

You did pose the system well, but maybe it's easier to get the general solution by means of the following auxiliar system of ODEs:

$$\dfrac{dt}{1}=\dfrac{dx}{A+2B\rho}=\dfrac{d\rho}{0}$$

The last ratio means that $$\rho=c_1$$ for some constant $$c_1$$. We can use this fact and the first proportion to solve it.

$$\dfrac{dt}{1}=\dfrac{dx}{A+2Bc_1}$$

$$(A+2B\rho)t=x+c_2$$

At last, a relation between $$c_1$$ and $$c_2$$ must exist: $$c_2=f(c_1)$$ (differentiable, single variable function $$f$$), leading to the general solution:

$$(A+2B\rho)t=x+f(\rho)$$

Your questions about change in density only can be answered when the initial conditions are known. E.g. a constant density for some range for $$x$$, at $$t=0$$, and $$0$$ elsewhere. That kind of problems need some amount of extra assumptions to be solved.

• Thanks! I have tried imposing the condition that $\rho(x,0)=\rho_{\max}$ if $x \ge 0$ and $0$ otherwise. If I put all that into the solution I get $x + f(\rho_{\max}=0$ and $x + f(0) = 0$ which means that $f$ must be a constant. I am unsure how to proceed with this, because another condition I want to impose is that once the first car moves away, the one behind it starts moving in the same way, so that $\rho(x+\Delta x,0) = \rho(x,\Delta t)$. If $\rho$ is a constant all the time then I have no idea what to do. – omegaSQU4RED Oct 20 '18 at 18:50
• Search in this site or google for "Burgers' equation" for examples on how to treat weak solutions arising from these initial conditions. Shock waves appear (in some models it can be interpreted as the traffic, vehicles moving). – Rafa Budría Oct 20 '18 at 19:13

Making $$u = A+2B \rho$$ we have an equivalent PDE

$$u_t + u u_x = 0$$

now making $$u(x,t) = X(x)T(t)$$ we have

$$X(x)T'(t)+X(x)T(t) X'(x)T(t)=0$$

or

$$\frac{T'(t)}{T^2(t)}+X'(x) = 0\Rightarrow \frac{T'(t)}{T^2(t)} = k = -X'(x)$$

etc.