Solving Cauchy problem PDE and drawing the solution graph

51 Views Asked by At

I want to solve and draw the solution of PDE such that

\begin{align} \rho_t +2\rho\rho_x=0 \end{align}

and with initial condition

\begin{align} \rho(x,0)= \begin{cases} 1 & \text{if $x<0 $}\\ 2 & \text{if $0\le x \le1$}\\ 1 &\text{if $x >1$}\\ \end{cases} \end{align}

This is a form of Cauchy problem, I reparametrized it as:

$\xi'(z,t)=2\rho(x,t) \implies \xi(z,t) =2\rho t+z$

Then I got

\begin{align} \xi(z,t)= \begin{cases} 2t+z &\text{if $z<0$}\\ 4t+z &\text{if $0\le z\le 1$}\\ 2t+z &\text{if $z>1$}\\ \end{cases} \end{align}

Until this, is it all correct?

Also, I tried to draw the solution, but how can I do it?