Example 8.7.mw

Example 8.7 Heat Conduction with an Insulator Boundary Condition

Example (8.1.17) is solved in Maple below:

> |

First, the governing equations and boundary conditions are converted to the Laplace domain and solved in the Laplace domain:

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

| (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)

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

| (9)

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

| (10)

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

| (11)

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

| (12)

The solution obtained in the Laplace domain is:

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

| (13)

The polynomials are:

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

| (14)

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

| (15)

Note that the order of q(s) is greater than the order of p(s).

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

| (16)

The roots of Q(s) are found as:

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

| (17)

> | _EnvAllSolutions := true;

| (18)

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

| (19)

The roots can be taken as:

> | 0,-((2*n-1)*Pi/2)^2;

| (20)

Next, the coefficients are found:

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

| (21)

First A0 is found:

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

| (22)

The coefficient An for values n = 1..∞ can be found as:

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

| (23)

An is simplified as:

> | vars:={cos(1/2*(2*n-1)*Pi)=0,sin(1/2*(2*n-1)*Pi)=(-1)^(n-1)};

| (24)

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

| (25)

The general terms in the Laplace domain solution are (see equation (8.1.16)):

> | u0s:=A[0]*1/s;

| (26)

The inverse Laplace transform is:

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

| (27)

The term in the infinite series is

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

| (28)

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

| (29)

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

| (30)

The final solution is obtained as:

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

| (31)

As in chapter 7, the initial condition is used at time, t = 0, to avoid Gibb’s phenomenon:

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

| (32)

The following plots are obtained:

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

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

> |