heat_eqc.mws
Solving Cauchy problems for heat equations
by
Aleksas Domarkas
Vilnius University, Faculty of Mathematics and Informatics,
Naugarduko 24, Vilnius, Lithuania
aleksas@ieva.mif.vu.lt
NOTE: In this session we solve Cauchy problems for heat equations
1 Example
Problem
> |
eq:=diff(u(x,t),t)-a^2*diff(u(x,t),x,x)=0;#x>-infinity,x<infinity,t>0;
|
> |
ic:=u(x,0)=phi(x);#x>-infinity,x<infinity;
|
> |
a:=1:
phi:=x->piecewise(x<0,0,x<1,x,x<2,2-x,x<3,x-2,x<4,4-x,0);
|
> |
plot(phi,-2..6,-1..2,axes=boxed);
|
Solving problem
> |
phi:=unapply(convert(phi(x),Heaviside),x);
|
> |
ode:=subs(fourier(u(x,t),x,w)=s(t),%);
|
> |
dsolve({ode,s(0)=fourier(phi(x),x,w)},s(t));
|
> |
invfourier(rhs(%),w,x):
sol:=collect(map(simplify,expand(%)),erf);
|
> |
plot3d(sol,x=0..4,t=0..1,orientation=[50,40],numpoints=2000,axes=framed);
|
Checking the Solution
> |
subs(u(x,t)=sol, eq):
simplify(lhs(%)-rhs(%));
|
> |
plot(limit(sol,t=0,right), x=0..4);
|
2 Example
Problem
[vlad] 13.5.8
> |
eq:=diff(u(x,t),t)-a^2*diff(u(x,t),x,x)=0;
|
> |
a:=1/2;phi:=x->sin(x)*exp(-x^2);
|
Solving by Poisson formula
By Poisson formula:
> |
sol := Int(phi(xi)*exp(-(x-xi)^2/(4*a^2*t)),
xi = -infinity .. infinity)/2/a/sqrt(Pi*t);
|
Solving using Fourier transform
> |
ode:=subs(fourier(u(x,t),x,w)=s(t),%);
|
> |
dsolve({ode,s(0)=fourier(phi(x),x,w)},s(t));
|
> |
sol2:=simplify(evalc(invfourier(rhs(%),w,x)));
|
Checking the Solution
> |
u:=unapply(sol1,(x,t)):
|
> |
simplify(lhs(eq)-rhs(eq));
|
> |
simplify(lhs(ic)-rhs(ic));
|
3 Example
Problem
[vlad] 13.6.2
> |
restart;with(linalg,laplacian);
|
> |
eq:=diff(u(x,y,t),t)-a^2*laplacian(u(x,y,t),[x,y])=sin(t)*sin(x)*sin(y);
|
> |
f:=(x,y,t)->sin(t)*sin(x)*sin(y);
|
Solving by decomposition method
I
II
solving I
> |
subs(u(x,y,t)=v(t)*sin(x)*sin(y),eq1);
|
> |
dsolve({%,v(0)=0},v(t));
|
> |
s1:=rhs(%)*sin(x)*sin(y);
|
solving II
> |
subs(u(x,y,t)=v(t)*rhs(ic2),eq2);
|
> |
dsolve({%,v(0)=1},v(t));
|
Solution
Checking the Solution
> |
u:=unapply(sol,(x,y,t)):
|
> |
simplify(convert(lhs(eq)-rhs(eq),trig));
|
> |
simplify(lhs(ic)-rhs(ic));
|
4 Example
problem
[vlad] 13.6.5.
> |
restart;with(linalg,laplacian):with(student,Doubleint):
|
> |
eq:=diff(u(x,y,t),t)-laplacian(u(x,y,t),[x,y])/8=1/8;
|
> |
ic:=u(x,y,0)=exp(-(x-y)^2);a:=sqrt(1/8):
|
I
II
solving I
> |
subs(u(x,y,t)=v(t),eq1);
|
> |
dsolve({%,v(0)=0},v(t));
|
solving II
> |
phi:=unapply(rhs(ic2),(x,y));
|
By Poisson formula
> |
1/(sqrt(4*a^2*Pi*t))^2*Doubleint(phi(xi,eta)*exp((-(x-xi)^2-(y-eta)^2)/(4*a^2*t)),xi=-infinity..infinity,eta=-infinity..infinity);
|
Solution
Checking the Solution
> |
u:=unapply(sol,(x,y,t)):
|
> |
simplify(lhs(eq)-rhs(eq));
|
> |
simplify(lhs(ic)-rhs(ic));
|
5 Example
problem
[vlad] 13.7.4
> |
restart;with(linalg,laplacian): with(student,Tripleint):
|
> |
eq:=diff(u(x,y,z,t),t)-laplacian(u(x,y,z,t),[x,y,z])=cos(x-y+z);
|
> |
ic:=u(x,y,z,0)=exp(-(x+y-z)^2);a:=1:
|
I
II
solving I
> |
subs(u(x,y,z,t)=v(t)*rhs(eq1),eq1);
|
> |
dsolve({%,v(0)=0},v(t));
|
solving II
> |
phi:=unapply(rhs(ic2),(x,y,z));
|
> |
R:=-infinity..infinity;
|
By Poisson formula
> |
1/(sqrt(4*a^2*Pi*t))^3*Tripleint(phi(xi,eta,tau)*exp((-(x-xi)^2-(y-eta)^2-(z-tau)^2)/(4*a^2*t)),xi=R,eta=R,tau=R);
|
solution
Checking the Solution
> |
u:=unapply(sol,(x,y,z,t)):
|
> |
simplify(lhs(eq)-rhs(eq));
|
> |
simplify(lhs(ic)-rhs(ic));
|
6 Example
Problem
[vlad] 13.7.5.
> |
restart;with(linalg,laplacian):with(student,Tripleint):
|
> |
eq:=diff(u(x,y,z,t),t)-laplacian(u(x,y,z,t),[x,y,z])=0;#t>0,-infinity<x,y,z<infinity
|
> |
ic:=u(x,y,z,0)=cos(x*y)*sin(z);#-infinity<x,y,z<infinity
|
Solving problem
> |
phi:=unapply(rhs(ic),(x,y,z));
|
> |
R:=-infinity..infinity;a:=1:
|
By Poisson formula
> |
1/(sqrt(4*a^2*Pi*t))^3*Tripleint(phi(xi,eta,tau)*exp((-(x-xi)^2-(y-eta)^2-(z-tau)^2)/(4*a^2*t)),xi=R,eta=R,tau=R);
|
Solution
> |
u(x,y,z,t)=simplify(evalc(%));
|
Checking the Solution
> |
u:=unapply(rhs(%),(x,y,z,t)):
|
> |
simplify(lhs(eq)-rhs(eq));
|
> |
simplify(lhs(ic)-rhs(ic));
|
7 Example
Problem
> |
with(linalg,laplacian):
|
> |
eq:=diff(u(x,y,z,t),t)-a^2*laplacian(u(x,y,z,t),[x,y,z])=f;#-infty<x,y,z<infty,t>0
|
> |
ic:=u(x,y,z,0)=phi;#-infty<x,y,z<infty
|
> |
phi:=randpoly([x, y, z]);
|
> |
f:=randpoly([x, y, z]);
|
Solving problem
> |
L:=f->laplacian(f,[x,y,z]);
|
> |
d:=max(degree(phi),degree(f),1);
|
> |
sol:=int(sum(a^(2*k)*(t-tau)^k/k!*(L@@k)(f),k=0..d),tau=0..t)+
sum(a^(2*k)*t^k/k!*(L@@k)(phi),k=0..d):
|
Solution:
Checking the Solution
> |
u:=unapply(sol,(x,y,z,t)):
|
> |
simplify(rhs(eq)-lhs(eq));
|
> |
simplify(rhs(ic)-lhs(ic));
|
Other examples
Other examples see in inttrans.mws.
While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the conevibutors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.
Back to contents