Example 8.7.mw

Example 8.7 Heat Conduction with an Insulator Boundary Condition 

Example (8.1.17) is solved in Maple below: 

> `*`(r, `*`(e, `*`(sta, `*`(rt)))); -1; with(inttrans); -1; with(plots); -1
 

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

diff(u(x, t), t) = diff(diff(u(x, t), x), x) (1)
 

> u(x,0):=0;
 

0 (2)
 

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

diff(u(x, t), x) = 0 (3)
 

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

u(x, t) = 1 (4)
 

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

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

`*`(s, `*`(U(x))) = diff(diff(U(x), x), x) (5)
 

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

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

diff(U(x), x) = 0 (6)
 

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

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

U(x) = `/`(1, `*`(s)) (7)
 

> dsolve(eqs,U(x));
 

U(x) = `+`(`*`(_C1, `*`(exp(`*`(`^`(s, `/`(1, 2)), `*`(x))))), `*`(_C2, `*`(exp(`+`(`-`(`*`(`^`(s, `/`(1, 2)), `*`(x)))))))) (8)
 

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

`+`(`*`(c[1], `*`(cosh(`*`(`^`(s, `/`(1, 2)), `*`(x))))), `*`(c[2], `*`(sinh(`*`(`^`(s, `/`(1, 2)), `*`(x)))))) (9)
 

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

`*`(c[2], `*`(`^`(s, `/`(1, 2)))) = 0 (10)
 

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

`+`(`*`(c[1], `*`(cosh(`*`(`^`(s, `/`(1, 2)))))), `*`(c[2], `*`(sinh(`*`(`^`(s, `/`(1, 2))))))) = `/`(1, `*`(s)) (11)
 

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

{c[1] = `/`(1, `*`(cosh(`*`(`^`(s, `/`(1, 2)))), `*`(s))), c[2] = 0} (12)
 

The solution obtained in the Laplace domain is: 

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

`/`(`*`(cosh(`*`(`^`(s, `/`(1, 2)), `*`(x)))), `*`(cosh(`*`(`^`(s, `/`(1, 2)))), `*`(s))) (13)
 

The polynomials are: 

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

cosh(`*`(`^`(s, `/`(1, 2)), `*`(x))) (14)
 

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

`*`(cosh(`*`(`^`(s, `/`(1, 2)))), `*`(s)) (15)
 

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

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

`/`(`*`(cosh(`*`(`^`(s, `/`(1, 2)), `*`(x)))), `*`(`+`(`*`(`/`(1, 2), `*`(sinh(`*`(`^`(s, `/`(1, 2)))), `*`(`^`(s, `/`(1, 2))))), cosh(`*`(`^`(s, `/`(1, 2))))))) (16)
 

The roots of Q(s) are found as: 

> solve(Q(s),s);
 

`+`(`-`(`*`(`/`(1, 4), `*`(`^`(Pi, 2))))), 0 (17)
 

> _EnvAllSolutions := true;
 

true (18)
 

> solve(Q(s),s);
 

`+`(`-`(`*`(`/`(1, 4), `*`(`^`(Pi, 2), `*`(`^`(`+`(1, `*`(2, `*`(_Z1))), 2)))))), 0 (19)
 

The roots can be taken as: 

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

0, `+`(`-`(`*`(`/`(1, 4), `*`(`^`(`+`(`*`(2, `*`(n)), `-`(1)), 2), `*`(`^`(Pi, 2)))))) (20)
 

Next, the coefficients are found: 

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

`+`(`/`(`*`(2, `*`(cosh(`*`(`^`(mu, `/`(1, 2)), `*`(x))))), `*`(`+`(`*`(sinh(`*`(`^`(mu, `/`(1, 2)))), `*`(`^`(mu, `/`(1, 2)))), `*`(2, `*`(cosh(`*`(`^`(mu, `/`(1, 2)))))))))) (21)
 

First A0 is found: 

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

1 (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]));
 

`+`(`-`(`/`(`*`(4, `*`(cos(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi, `*`(x)))))))), `*`(`+`(`*`(2, `*`(sin(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi))))), `*`(Pi, `*... (23)
 

An is simplified as: 

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

{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]));
 

`+`(`/`(`*`(4, `*`(`^`(-1, `+`(`-`(n))), `*`(cos(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi, `*`(x))))))))), `*`(Pi, `*`(`+`(`*`(2, `*`(n)), `-`(1)))))) (25)
 

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

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

`/`(1, `*`(s)) (26)
 

The inverse Laplace transform is: 

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

1 (27)
 

The term in the infinite series is 

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

`+`(`/`(`*`(4, `*`(`^`(-1, `+`(`-`(n))), `*`(cos(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi, `*`(x))))))))), `*`(Pi, `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(`+`(s, `-`(mu))))))) (28)
 

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

`+`(`/`(`*`(4, `*`(`^`(-1, `+`(`-`(n))), `*`(cos(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi, `*`(x)))))), `*`(exp(`*`(mu, `*`(t))))))), `*`(Pi, `*`(`+`(`*`(2, `*`(n)), `-`(1)))))) (29)
 

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

`+`(`/`(`*`(4, `*`(`^`(-1, `+`(`-`(n))), `*`(cos(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi, `*`(x)))))), `*`(exp(`+`(`-`(`*`(`/`(1, 4), `*`(`^`(`+`(`*`(2, `*`(n)), `-`(1)), 2), `*`(`^... (30)
 

The final solution is obtained as: 

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

`+`(1, Sum(`+`(`/`(`*`(4, `*`(`^`(-1, `+`(`-`(n))), `*`(cos(`+`(`*`(`/`(1, 2), `*`(`+`(`*`(2, `*`(n)), `-`(1)), `*`(Pi, `*`(x)))))), `*`(exp(`+`(`-`(`*`(`/`(1, 4), `*`(`^`(`+`(`*`(2, `*`(n)), `-`(1)),... (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));
 

`:=`(u, piecewise(t = 0, 0, `<`(0, t), `+`(1, Sum(`+`(`/`(`*`(4, `*`(`^`(-1, `+`(`-`(n))), `*`(cos(`*`(`*`(`/`(1, 2), `+`(`*`(2, `*`(n)), `-`(1))), `*`(Pi, `*`(x)))), `*`(exp(`+`(`-`(`*`(`/`(1, 4), `*... (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
 

> 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"]);
 

Plot_2d
 

>