Added Sept 12, 2019.
Taken from Peter Olver textbook, Introduction to Partial differential equations.
Solve for \(u(t,x)\) in \(u_t-3 u_x = 0\) with IC \(u(0,x)=e^{-x^2}\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[t, x], {t}] -3* D[u[t, x], {x}] == 0; ic = u[0,x]==Exp[-x^2]; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde,ic}, u[t, x], {t, x}], 60*10]];
Maple ✓
restart; pde := diff(u(t, x), t) - 3*diff(u(t, x),x) =0; ic:=u(0,x)=exp(-x^2); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic],u(t,x))),output='realtime'));
Hand solution
Solve
With initial conditions \(u\left ( x,0\right ) =e^{-x^{2}}\)
Solution
Let \(u=u\left ( x\left ( t\right ) ,t\right ) \). Then
Eq (3) gives \(u=u\left ( x\left ( 0\right ) \right ) \). Using the given initial conditions, this becomes
Eq (4) is now used to find \(x\left ( 0\right ) \). Soving (4) gives \(x=x\left ( 0\right ) -3t\). Hence \(x\left ( 0\right ) =x-3t\). Therefore (5) becomes
The following is an animation of the solution
| 3D |
2D |
|
|
|
Source code used for the above
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________