kill(all)$

maxima : heat :application (composite cylindrical shell),version 1a
peter.vlasschaert@gmail.com,19/07/2021

Model : composite Cylindrical Shell (with heat generation)
============================

odes : (o)rdinary (d)ifferential (e)quation(s)
====

pa:1/r*'diff(r*'diff(T[1],r),r)+g[1]/k[1]=0;

pb:1/r*'diff(r*'diff(T[2],r),r)+g[2]/k[2]=0;

rem : solve {pa,pb} with ode2

bc : (b)oundary (c)onditions
===

→ r = r1

bc1:h*(T[1]-Tinf)-k[1]*'diff(T[1],r) = 0;

→ r = r2

bc2:T[1]-T[2]=0;
bc3:k[1]*'diff(T[1],r)-k[2]*'diff(T[2],r) = 0;

→ r = r3

bc4:'diff(T[2],r) = 0;

solve odes :{pa,pb}
===============

→ convert : T[1] → T1, T[2] → T2 (needed : ode2)

p1:[T[1]=T1,T[2]=T2];

p1a:makelist(rhs(p1[i])=lhs(p1[i]),i,1,length(p1));

depends([T1,T2],r);/* problem here*/

→ first ode :

pa1:subst(p1,pa);

pa2:ev(pa1,diff);

pa3:sort(listofvars(pa2));

pa4:ode2(pa2,T1,r);

pa4a:sort(listofvars(rhs(pa4)));

→solution : first ode : pa

pa5:subst(p1a,pa4);

pa6:rhs(pa5);

definition :

pa7:T[1](r):=''pa6;

→ second ode : 'same form: first ode'

p2:[T1=T2,%k1=%k3,%k2=%k4,g[1]=g[2],k[1]=k[2]];;

pb4:subst(p2,pa4);

pb4b:sort(listofvars(rhs(pb4)));

→solution : second ode : pb

pb5:subst(p1a,pb4);

pb6:rhs(pb5);

definition:

pb7:T[2](r):=''pb6;

→ unknown values(T[1](r),T[2](r)) ,( find from bci, i=1,2,3,4), 'see above'

p1c:makelist(concat(%k,i),i,1,4);

→ implementation : BC conditions
:

→ bc1 : bc1a  (r = r1)

bc1a:subst([pa5],bc1);

bc1a:ev(bc1a,diff);

bc1a:subst([r=r1],bc1a);

→bc2:bc2a (r = r2)

bc2a:pa6-pb6=0;

bc2a:subst([r=r2],bc2a);

→bc3:bc3a (r = r2)

p1e:[pa5,pb5];

bc3a:subst(p1e,bc3);

bc3a:ev(bc3a,diff);

→bc4:bc4a (r = r3)
use : p1e

bc4a:subst(p1e,bc4);

bc4a:ev(bc4a,diff);

final solution : ode2=(first,second ) with bc ={bc1a,bc2a,bc3a,bc4a}
====================================================
use :p1c

p1f:solve([bc1a,bc2a,bc3a,bc4a],p1c);

p1fa:ratsimp(flatten(p1f));

sol: first ode ( temperature distribution ,'inner shell')
------------------
use : pa5

paa:ratsimp(subst(p1fa,pa5));

paa1:rhs(paa);

→ definition

TT[1](r):=''paa1;

sol: second ode  ( temperature distribution ,'outer shell')
------------------
use : pb5

pbb:ratsimp(subst(p1fa,pb5));

pbb1:rhs(pbb);

→ definition

TT[2](r):=''pbb1;

fixed temperature inside => Tinf = Tinside=constant,h= ∞

→ inner shell  (T[1])
------------------

→ first step 

limit(paa1,h,∞);

→ second step

eqa:subst([Tinf =Tinside],%);

→ outer shell(T[2])
-------------------------

→ first step 

limit(pbb1,h,∞);

→ second step

eqb:subst([Tinf =Tinside],%);

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------