Example 8.14.mw

Example 8.14 Heat Conduction in a Cylinder

Equation (8.1.30) is solved in Maple below:

> |

> | eq:=diff(u(x,t),t)=diff(u(x,t),x$2)+1/x*diff(u(x,t),x);

| (1)

> | u(x,0):=0;

| (2)

> | bc1:=diff(u(x,t),x)=0;

| (3)

> | bc2:=u(x,t)=1;

| (4)

> | eqs:=laplace(eq,t,s):

> | eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs);

| (5)

> | bc1:=laplace(bc1,t,s):

> | bc1:=subs(laplace(u(x,t),t,s)=U(x),bc1);

| (6)

> | bc2:=laplace(bc2,t,s):

> | bc2:=subs(laplace(u(x,t),t,s)=U(x),bc2);

| (7)

> | dsolve(eqs,U(x));

| (8)

Since BesselY becomes infinite x = 0_C2 should be zero and the solution is taken as:

> | U(x):=c[1]*BesselJ(0,(-s)^(1/2)*x);

| (9)

> | eq0:=eval(subs(x=0,bc1));

| (10)

> | eq1:=eval(subs(x=1,bc2));

| (11)

> | con:=solve({eq1},{c[1]}):

> | U(x):=subs(con,U(x)):

> | U(x):=factor(simplify(U(x)));

| (12)

> | P(s):=numer(U(x));

| (13)

> | Q(s):=denom(U(x));

| (14)

> | solve(Q(s),s);

| (15)

> | eig:=BesselJ(0,(-s)^(1/2));

| (16)

> | convert(eig,BesselI);

| (17)

> | eiglambda:=simplify(subs(s^(1/2)=I*lambda,(-s)^(1/2)=lambda,s=-lambda^2,eig));

| (18)

> | plot(eiglambda,lambda=0..20,thickness=3,axes=boxed):

The roots are:

> | 0,-lambda^2;

| (19)

> | N:=20;

| (20)

> | l[1]:=fsolve(eiglambda,lambda=0..3);

| (21)

> | for i from 2 to N do l[i]:=fsolve(eiglambda,lambda=l[i-1]..l[i-1]+4);od:

> | seq(l[i],i=1..N);

| (22)

> | A(s):=P(s)/diff(Q(s),s):

> | A[n]:=simplify(subs(s=mu,A(s)));

| (23)

> | A[0]:=limit(A[n],mu=0);

| (24)

> | A[n]:=simplify(subs(mu^(1/2)=I*lambda,(-mu)^(1/2)=lambda,mu^(3/2)=-I*lambda^3,mu=-lambda^2,A[n]));

| (25)

> | u0s:=A[0]*subs(mu=0,1/(s-mu));

| (26)

> | u0t:=invlaplace(u0s,s,t);

| (27)

> | uns:=A[n]/(s-mu);

| (28)

> | unt:=invlaplace(uns,s,t);

| (29)

> | unt:=subs(mu=-l[n]^2,lambda=l[n],unt);

| (30)

The following solution and plots are obtained:

> | U:=u0t+Sum(unt,n=1..infinity);

| (31)

> | u:=piecewise(t=0,0,t>0,subs(infinity=20,U)):

> | u:=evalf(u):

> | plot3d(u,x=0..1,t=0..0.5,axes=boxed,title="Figure Exp. 8.26.",labels=[x,t,"u"],orientation=[-145,60]);

> | plot([subs(t=0,u),subs(t=0.1,u),subs(t=0.2,u),subs(t=0.5,u)],x=0..1,title="Figure Exp. 8.27.",axes=boxed,thickness=5,labels=[x,"u"]);

> |