Example 8.15.mw

Example 8.15 Heat Conduction in a Rectangle with a Time Dependent Boundary Condition

Equation (8.1.35) is solved in Maple below for a general time dependent function, w(t), and plots are obtained for a particular step function.

> |

> | eq:=diff(u(x,t),t)=diff(u(x,t),x$2);

| (1)

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

| (2)

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

| (3)

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

| (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),laplace(w(t),t,s)=W(s),bc1);

| (6)

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

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

| (7)

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

| (8)

> | U(x):=c[1]*cosh(s^(1/2)*x)+c[2]*sinh(s^(1/2)*x);

| (9)

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

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

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

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

| (10)

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

| (11)

Next U1(x) is written as a product of two functions (see equations (8.1.31) and (8.1.33)):

> | U1(x):=simplify(U(x)/W(s)/s);

| (12)

U1(x) is chosen so that q(s) is a higher order than p(s) (see equation (8.1.32)):

> | G(s):=W(s)*s;

| (13)

where W(s) is the Laplace transform of the time dependent boundary condition w(t) in equation (8.11.35.). Next, U1(X) is inverted to the time domain as illustrated in section 8.1.7 to obtain f(t) as:

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

| (14)

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

| (15)

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

| (16)

> | _EnvAllSolutions := true;

| (17)

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

| (18)

> | 0,0,-n^2*Pi^2;

| (19)

> | mu0:=0;

| (20)

> | b[2]:=(s-mu0)^2*P(s)/Q(s);

| (21)

> | B[2]:=limit(b[2],s=0);

| (22)

> | b[1]:=diff(b[2],s):

> | B[1]:=limit(b[1],s=0);

| (23)

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

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

| (24)

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

> | vars:={sin(n*Pi)=0};

| (25)

> | A[n]:=simplify(subs(vars,A[n])):

> | A[n]:=simplify(subs(vars,expand(A[n])));

| (26)

> | b1s:=B[1]*subs(mu0=0,1/(s-mu0));

| (27)

> | b1t:=invlaplace(b1s,s,t);

| (28)

> | b2s:=B[2]*subs(mu0=0,1/(s-mu0)^2);

| (29)

> | b2t:=invlaplace(b2s,s,t);

| (30)

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

| (31)

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

| (32)

> | unt:=subs(mu=-n^2*Pi^2,unt);

| (33)

> | f(t):=b1t+b2t+Sum(unt,n=1..infinity);

| (34)

Next, a step function is chosen for w(t) and plotted:

> | w(t):=Heaviside(t-1)-1/2*Heaviside(t-2);

| (35)

> | plot(w(t),t=0..5,thickness=3,title="Figure Exp. 8.28.",axes=boxed);

The Laplace transform of w(t) is:

> | W(s):=laplace(w(t),t,s);

| (36)

The function g(t) is obtained by inverting G(s):

> | G(s):=s*W(s);

| (37)

> | g(t):=invlaplace(G(s),s,t);

| (38)

Next, the convolution integral is carried out to obtain the final time domain solution as:

> | gtau:=subs(t=tau,g(t));

| (39)

> | ftau:=subs(t=t-tau,f(t));

| (40)

> | U:=int(ftau*gtau,tau=0..t);

| (41)

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

> | plot3d(simplify(u),x=0..1,t=0..5,axes=boxed,title="Figure Exp. 8.29.",labels=[x,t,"u"],orientation=[135,45]);

The dimensionless temperature at different points inside the rectangle are plotted as:

> | plot([simplify(subs(x=1,u)),simplify(subs(x=0.75,u)),simplify(subs(x=0.5,u)),simplify(subs(x=0.25,u)),simplify(subs(x=0.0,u))],t=0..5.,thickness=3,axes=boxed,title="Figure Exp. 8.30.",labels=[t,"u"]);

> |