Problem 1.2 #5(a)

Bump

u0[x_]=Piecewise[{{1,-1<x<1}}]

Plot[u0[x],{x,-5,5}]

u[x_,t_]=u0[x*Exp[-t^2/2]]

Plot3D[u[x,t],{x,-10,10},{t,0,2},Mesh->None]

Animate[Plot[u[x,t],{x,-10,10},PlotPoints->100,PlotRange->{-0.1,1.1},PlotStyle->Thick],{t,0,2},AnimationRunning->False]

Gaussian

u0[x_]=Exp[-x^2]

Plot[u0[x],{x,-5,5}]

u[x_,t_]=u0[x*Exp[-t^2/2]]

Plot3D[u[x,t],{x,-10,10},{t,0,2},Mesh->None]

Animate[Plot[u[x,t],{x,-10,10},PlotPoints->100,PlotRange->{-0.1,1.1},PlotStyle->Thick],{t,0,5},AnimationRunning->False]

Cosine

u0[x_]=Cos[x]

Plot[u0[x],{x,-20,20}]

u[x_,t_]=u0[x*Exp[-t^2/2]]

Plot3D[u[x,t],{x,-20,20},{t,0,2},Mesh->None]

Animate[Plot[u[x,t],{x,-20,20},PlotPoints->100,PlotRange->{-1.1,1.1},PlotStyle->Thick],{t,0,5},AnimationRunning->False]

Problem 1.2 #5(b)

Bump

u0[x_]=Piecewise[{{1,-1<x<1}}]

Plot[u0[x],{x,-5,5}]

u[x_,t_]=u0[x*Exp[-t]]+Exp[t]-1

Plot3D[u[x,t],{x,-10,10},{t,0,2},Mesh->None]

Animate[Plot[u[x,t],{x,-10,10},PlotPoints->100,PlotRange->{-0.1,10.1},PlotStyle->Thick],{t,0,3},AnimationRunning->False]

Gaussian

u0[x_]=Exp[-x^2]

Plot[u0[x],{x,-5,5}]

u[x_,t_]=u0[x*Exp[-t]]+Exp[t]-1

Plot3D[u[x,t],{x,-10,10},{t,0,2},Mesh->None]

Animate[Plot[u[x,t],{x,-10,10},PlotPoints->100,PlotRange->{-0.1,10},PlotStyle->Thick],{t,0,3},AnimationRunning->False]

Cosine

u0[x_]=Cos[x]

Plot[u0[x],{x,-20,20}]

u[x_,t_]=u0[x*Exp[-t]]+Exp[t]-1

Plot3D[u[x,t],{x,-20,20},{t,0,2},Mesh->None]

Animate[Plot[u[x,t],{x,-20,20},PlotPoints->100,PlotRange->{-1.1,10.1},PlotStyle->Thick],{t,0,3},AnimationRunning->False]

Problem 1.2 #6

u[x_,t_]=((x-t)^2+1/9)*Exp[3t]-t/3-1/9

Plot3D[u[x,t],{x,-2,2},{t,0,0.5},PlotRange->All]

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