Toplotna enačba

Animacija ohlajanja palice na intervalu [0,4] pri fiksni temperaturi na robu palice.

f[x_]=If[x>1,4/3-x/3,x];

c=1;

b[n_]=FourierSinCoefficient[f[x],x,n,FourierParameters->{1,Pi/4}];

g[x_,t_]=Sum[b[n]*E^(-(n*Pi/4*c)^2*t)*Sin[n*Pi/4*x],{n,1,15}];

Animate[Plot[g[x,t],{x,0,4},PlotRange->{-0.5,1.2},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]],{{t,0,"Čas (t)"},0,20,AnimationRate->1,AnimationRunning->False}]

Rešitev toplotne enačbe (Subscript[u, t])=(Subscript[u, xx]) na realni osi pri začetnem pogoju  u(x,0) =(Subscript[χ, [-1,1]]).

resitev[t_,x_]=1/2 (Erf[(1-x)/(Sqrt[4t])]-Erf[(-1-x)/(Sqrt[4t])]);

f[t_]=If[Abs[t]>1,0,1];

Animate[{a=Plot[f[x],{x,-1,1},PlotStyle->{Blue,Thickness[0.007]},AxesStyle->Arrowheads[{0.04}]];b=Plot[resitev[t,x],{x,-10,10},PlotRange->{0,1},PlotStyle->{{Dashed,Blue}}]};
Show[a,b,PlotRange->{{-10,10},{0,1.1}}],
{{t,0.01,"Čas (t)"},0.01,20,AnimationRate->1,AnimationRunning->False}]