Example 11.1-2 Heating of a Finite slab: Part a
Using Maple for Separation of Variables to verify eq. 11.1-31
> restart;
> eq1:=D[2](T)(y,t)-alpha*D[1](D[1](T))(y,t); Eq. 11.1-2 for
one dimensional transient heat conduction in the y direction
> with(PDEtools,dchange); Used to switch to dimensionless
variables.
> tr:={T=T1-Theta*(T1-T0),y=b*eta,t=b^2*tau/alpha}; Note the
first transformation as specified in eq. 11.1-11. This is written so
that Theta will be zero ar the two boundaries and Theat will be 1
for t=0.
> eq2:=dchange(tr,eq1,[Theta(tau,eta),tau,eta]);
> eq3:=simplify(-eq2*b^2/(alpha*(T1-T0))); eq. 11.1-14
> pdsolve(eq3); Seeing what the latest partial differential
equation solver does.
That tells us to try separation of variables and gives the ODE
that each one must satisfy. _c1 is the separation constant.
We will call the function of eta f and the separation constant -c^2
as BS&L does.
> s:=dsolve(D(D(f))(eta)=-c^2*f(eta),f(eta));
> assign(s);f:=unapply(f(eta),eta);
> eq1:=f(1)=0;eq2:=f(-1)=0; Here are the BC that f must satisfy.
> _C2:=0; Since the BC are symmetric in eta, we anticipate f must
be also and eliminate the sin term.
> _EnvAllSolutions:='true'; This will give us all solutions to
the next equation when we use solve.
> eq1;
> solve(eq1,c);
> about(_Z1); Maple does not tell us anything specific about _Z1.
> c:=(n+1/2)*Pi; assume(n,integer); But we know it had better
be an integer.
> eq1;eq2; Then both our BC will be satisfied.
> f(eta);
> s:=dsolve(D(g)(tau)=-c^2*g(tau),g(tau)); Moving on to find
g(tau)
> assign(s);g:=unapply(g(tau),tau);
> g(tau)*f(eta); This agrees with 11.1-25 except _C1 was used as
the constant for both f and g.
> fn:=unapply(f(eta)/_C1,eta,n); The spacial functions without
a constant in front.
> Thetan:=(tau,eta,n)->g(tau)/_C1*fn(eta,n);
> Thetan(tau,eta,n); Here are the functions we want to sum to get
our answer.
> Theta:=(tau,eta)->sum(D1[n]*Thetan(tau,eta,n),n=0...infinity);
We can not call our coefficients D since that implies differentiation.
> Theta(tau,eta); This agrees with 11.1-26
> about(n);
> IC:=1=Theta(0,eta); Here is the initial condition as shown in 11.1-27.
> assume(m,integer);
> int(lhs(IC)*fn(eta,m),eta=-1...1); This is the integral of the LHS*fn
of our initial condition.
> int(rhs(IC)*fn(eta,m),eta=-1...1); It would be nice if Maple would
do the same thing to the RHS.
> int(fn(eta,m)^2,eta=-1...1); We need to take it one step at a time.
The fn functions are normalized on the interval.
> int(fn(eta,n)*fn(eta,m),eta=-1...1); The fn form an orthonormal set
of functions on the interval -1 to 1.
> D1[n]:=int(lhs(IC)*fn(eta,n),eta=-1...1); Thus this gives the
coefficients in our series.
> Theta(tau,eta); This agrees with 11.1-31.
>