Movies for 
  Introduction to Partial Differential Equations
      by Peter J. Olver

Movies can be viewed at    
         http : // www.math.umn.edu/~olver/mov.html

Heat Equation Movies:   Figures 4.1, 4.2, and page 131.

General plotting routine

pl[t_] := Print[Plot[u[t,x],{x,(Subscript[x, 0]),(Subscript[x, 1])},PlotRange ->{(Subscript[y, 0]),(Subscript[y, 1])},AspectRatio -> asp,Ticks -> None,PlotStyle -> {Thickness[th],Hue[hu]}]]

th = .004; hu = .6;

Figure 4.1. A solution to the heat equation

Set initial data

f[x_] := Which[x < .2,-x, x < .7, x -.4,True, -x+1]

Determine Fourier coefficients

b //ClearAll;

b[n_] :=2. Integrate[f[x] Sin[n π x],{x,0,1}]

ns= Range[30];
bs =  b /@ ns;

Determine corresponding Fourier series solution

bt[n_] := E^(-n^2π^2t) Sin[n π x]
bts = bt /@ ns;

u//ClearAll;

u[t_,x_] = bs.bts;
u[0,x_] = u[0.,x_] = f[x];

Set plotting parameters

(Subscript[x, 0]) =0;(Subscript[x, 1])=1;(Subscript[y, 0]) = -.3; (Subscript[y, 1]) = .31; asp = Automatic;

Set time range

ti= 0;tf =.3; δt = .0025;ts = Range[ti,tf,δt];

Plot movie  — evaluate Notebook to generate output

pl /@ ts;

Figure 4.2. Denoising a signal with the heat equation

Define initial signal

ff[x_] := -(x(2 π -x)/10)^5 (x +1.5)(x +2.5)(x - 4)/5

fa[x_] := ff[x + π]+2

Add noise

f[x_] := fa[x] + 1.1(Random[] - .5)

Find Fourier coefficients by sampling noisy signal and using numerical integration to approximate

a//ClearAll; b//ClearAll;

ϵ = .01;xs = Range[-π,π,ϵ];

fs = f /@ xs;fxs = {xs,fs}//Transpose;

a[n_] := (ϵ/π)fs .  (Cos[n  #]&/@ xs)
b[n_] := (ϵ/π)fs . (Sin[n  #]&/@ xs);

ns = Range[100];
(Subscript[a, 0]) = a[0]; as =  a /@ ns; bs =  b /@ ns;

Determine corresponding Fourier series solution

ah[n_] := E^(-n^2t) Cos[n  x];bh[n_] := E^(-n^2t) Sin[n  x];

ag = ah/@ ns;
bg = bh /@ ns;

u//ClearAll;

u[t_,x_] =  ((Subscript[a, 0])/2) +ag.as +  bg . bs;

Set plotting parameters

(Subscript[x, 0]) =-π;(Subscript[x, 1])=π;(Subscript[y, 0]) = 0; (Subscript[y, 1]) = 7.5; asp = .6;th = .001;

Plot movie  — evaluate Notebook to generate output

Slow time scale

ti = δt = .0001; tf =150δt;ts = Range[ti,tf,δt];

Print[ListPlot[fxs,PlotRange ->{(Subscript[y, 0]), (Subscript[y, 1])},PlotStyle ->{ Hue[hu], Thickness[th]},Ticks -> None, Joined -> True, AspectRatio -> asp]];pl /@ ts;

Faster time scale

ti = δt = .001; tf =150δt;ts = Range[ti,tf,δt];

Print[ListPlot[fxs,PlotRange ->{(Subscript[y, 0]), (Subscript[y, 1])},PlotStyle ->{ Hue[hu], Thickness[th]},Ticks -> None, Joined -> True, AspectRatio -> asp]];pl /@ ts;

Page 131:  Heat equation with periodic boundary conditions

Set initial data

f[x_] := 1.2+Which[x<-2,-1,x < 2,x/2,True,-1]

Determine Fourier coefficients

a //ClearAll; b //ClearAll;

a[n_] := (1/π)NIntegrate[f[x] Cos[n  x],{x,-π,π}];b[n_] := (1/π)NIntegrate[f[x] Sin[n  x],{x,-π,π}];

ns = Range[30];
(Subscript[a, 0]) = a[0]; as =  a /@ ns; bs =  b /@ ns;

Determine corresponding solution

at[n_] := E^(-n^2t) Cos[n  x];bt[n_] := E^(-n^2t) Sin[n  x];

ats = at/@ ns; bts = bt /@ ns;

u//ClearAll;

u[t_,x_]   = ((Subscript[a, 0])/2) +(as . ats)+  (bs . bts);
u[0.,x_]  = u[0,x_]  = f[x];

Set plotting parameters

(Subscript[x, 0]) =-π;(Subscript[x, 1])=π;(Subscript[y, 0]) = 0; (Subscript[y, 1]) = 2.35; asp = .5;th = .004;

Set time range

ti= 0;tf =3; δt = .01;ts = Range[ti,tf,δt];

Plot movie  — evaluate Notebook to generate output

pl /@ ts;