MATH 330 Differential Equations II
14 September 2023

Characteristic Lines

Plot3D[Exp[-(x-t+10)^2],{x,-10,10},{t,0,20},PlotRange->{-1,2},AxesLabel->Automatic]

ContourPlot[Exp[-(x-t+10)^2],{x,-10,10},{t,0,20},PlotRange->{0,1.1},FrameLabel->{"t","x"}]

Transport with Decay

Verify the solution from Problem 5

u[t_,x_]:=

Plot the solution

Animate[Plot[u[t,x],{x,-5,15},PlotRange->{-1,2},AxesLabel->Automatic],{t,0,10}]

Plot3D[u[t,x],{x,-5,15},{t,0,10},PlotRange->{-1,2},AxesLabel->Automatic]

Nonuniform Transport

Example: ((∂u)/(∂t))+(1/((x^2)+1))((∂u)/(∂x))=0

Plot a slope field of the wave speed c(x)=(1/((x^2)+1)) in the tx-plane:

VectorPlot[{1,(1/((x^2)+1))},{t,-3,3},{x,-3,3},VectorStyle->"Segment",VectorScale->{Tiny,Tiny,None},Axes->True]

ContourPlot[((x^3)/3)+x-t,{t,-3,3},{x,-3,3},Axes->True,Contours->20,ContourShading->None]

Animation corresponding to Figure 2.8 in the textbook

Code modified from Peter Olver (http://www.math.umn.edu/~olver/mp4pde/fig2l.nb)

General plotting routine

pl[t_] :=Plot[u[t,x],{x,x0,x1},PlotRange ->{y0,y1},AspectRatio -> asp,Ticks -> None,PlotStyle -> {Thickness[th],Hue[hu]},AxesLabel->{"t","x"}]

th = .004; hu = .6;

Set initial wave profile

p=.;x=.;t=.;u//ClearAll;

p[ξ_] := (1/(1 + (ξ^2)));
u0[x_] := p[x + 2.75];

Determine corresponding solution

g[x_] := (x^3)/3 + x ;
y[t_,x_] := g[x] - t;

** h[x] is the inverse of g[x], which is obtained by sampling g[x], switching the axes, and then interpolating the resulting data points to generate h[x]

hs = Table[{g[x],x},{x,-12.,12,.1}];
h= Interpolation[hs];

u[t_,x_] :=u0[h[y[t,x]]]

Set plotting parameters

x0 = -10;x1=10;y0 = -.2; y1 = 1.2; asp = .3;

Set time range

ti = 0; tf = 70;δt = 1.;ts = Range[ti,tf,δt];

Now plot the movie

Animate[pl[t],{t,ts}]