Example 10.6-1 Heat conduction through composite Cylindrical Walls
>  restart;
>  Nol:=3;  Number of concentric layers: reset this in a session for different cases.
>  A:=r->2*Pi*r*L;  The area perpendicular to the direction of heat conduction
>  Q:= (r,k)-> -k*A(r)*D(t)(r); Both k and r determine the heat flow rate
>  deq:=limit((Q(r+dr,k)-Q(r,k))/(k*dr),dr=0)=0;  The heat into any element at r must equal the amount that leaves ar r+dr
>  R:=array(0...Nol); T:=array(0...Nol);  Defining R and T as vectors with Nol+1 elements in each one
>  s:=dsolve({deq,t(R[m])=T[m],t(R[m+1])=T[m+1]},t(r));  Solving the DE with BC at R[m] and R[m+1].
>  assign(s); t:=unapply(t(r),r);  Making t a function of r
>  eqs:=array(0...Nol+1);ks:=array(1...Nol); Making eqs and ks vectors
>  Qv(m):=Q(r,ks[m+1]);  The heat transfer rate in each interval is a constant independent of r and must also be equal to some common value in all intervals since heat is not lost or gained at the interfaces. Making Qv a function of m
>  Qv:=unapply(Qv(m),m);
If Q0 is the common value of Q in the intervals then, we should have the following hold for the first interval:
>  m:=1;
>  eq:=Qv(m)=Q0;
>  for j from 0 to Nol-1 do  We will set our equations so the LHS equals the temperature difference in it.
>   eqs[j+1]:=simplify((Qv(j)=Q0)*(log(R[j+1])-log(R[j]))/(2*Pi*L*ks[j+1]));
>  od;  This specifies the equations for each of the intervals in the solid
>  eqs[0]:=Ta-T[0]=Q0/(h0*A(R[0])); eqs[Nol+1]:=T[Nol]-Tb=Q0/(h3*A(R[Nol]));  Now we will add the equations for each position where h0 and h3 are heat transfer coefficients
>  eq:=sum(eqs[k],k=0...Nol+1);  Summing all Nol+1 equations
>  Q0:=solve(eq,Q0);
>  U0:=Q0/A(R[0])/(Ta-Tb);
>  LHS31:=simplify(1/(U0*R[0]),assume=positive);
>  LHSbook:=1/(h0*R[0])+sum(log(R[n]/R[n-1])/ks[n],n=1...Nol)+1/(R[Nol]*h3);
>  diff0:=simplify(LHS31-LHSbook,assume=positive);
[Maple Math]
[Maple Math] > expand(%); > combine(%); > assume(R[0]>0); Maple Vr4 does not allow this. > R:=[r0,r1,r2,r3,r4,r5]; > R:=array(0...5,[r0,r1,r2,r3,r4,r5]); > assume(r0>0,r1>0,r2>0,r3>0,r4>0,r5>0); > diff0; [Maple Math]
[Maple Math] > expand(%);
[Maple Math]