kill(all)$

load packages

load(lrats);

heat : steady , no heat generation ,variable area( =surface insulated), version 1.0
peter.vlasschaert@gmail.com, 11/07/2019

1e)  fourier law (  = variable area,variable conductivity)
=========================================
k(T) : thermal conductivity (temperature dependent)
A(x) : variable area            (distance       dependent)
T(x) : temperature              (distance       dependent)
Q     : heat  (  = heat transfer rate = joule/s).
========================================

depends(T,x);

dependencies;

p1:Q= -k(T)*A(x)*diff(T,x);

p2:ode2(p1,T,x);

easy way : copy and paste : output 'p2'
==============================
modified integration values {a1,a2,b1,b2}, remove : %c

p2a:-integrate(k(T),T,a1,a2)/Q=integrate(1/A(x),x,b1,b2);

conduction variable area :  A(x)
===================
change by : linear relation  'ax+b'
=>  truncated cylinder with variable area.( = example truncated solid)
       with total length = L

R=a*x+b  ( radius of truncated cylinder)

p3: R = a*x+b;

x=0 ('b1')  =>  R = r1         with   T = T1 ('a1')

p3a:subst([x=0,R=r1], p3);

x=L('b2') =>  R = r2       with   T = T2 ('a2')

integration values 'p2a'
==================

p3a1:[b1=0,b2=L,a1=T1,a2=T2];

p3b:subst([x=L,R=r2], p3);

find a,b => R
==========

p4:solve([p3a,p3b],[a,b]);

p4a:flatten(p4);

p4b:subst(p4a,p3);

find  A(x), 'cutting circle' =  cross section
==================
area : π*r^2

p5:A(x) = π*(rhs(p4b))^2;

p5a:[p5];

find Q:
=====

all values for integration 'p2a'
======================

p6:[p3a1,p5a];

p6a:flatten(p6);

assume(L>0);

assume(L>0,r2>r1,r2>0,r1>0);

assume(T2<T1,T2>0);

p7:subst(p6a,p2a);

p7a:ev(p7,nouns);

T2 < T1 (temperature)
=====

p8:solve(p7a,Q);

p8a:p8[1];

k(T)
===

k(T) = kk , constant.
---------------------------

declare(kk,constant);

p9a:[k(T) =kk];

p9b:subst(p9a,p8a);

k(T) ≠ constant.
---------------------------

example:

p10a: k(T) = c*T+d;

p10b:subst(p10a,p8a);

1e)  option :specific
===============

p10c:ev(p10b,integrate);

2e) option : general
===============

p10d:ev(p10b,nouns);

p10d1:expand(p10d);

=>  both gives same : result

How determine temperature distribution: T(x)
==================================
integration variable : a1: T1  and a2: T(x)
rem : b1=0 (x=0), b2=L (x=x).
!  Q  constant  ,  k(T) = kk = constant.
reason : distance :x   we get  temperature  T=T(x).

1e) values for integration
===================

p11a:[a1=T1,a2=T(x),b1=0,b2=x];

p11b:[p11a,p5a,k(T)=kk];

p11c:flatten(p11b);

2e) integration of 'p2a'
=================

assume(x>0);

p12a:subst(p11c,p2a);

p12b:ev(p12a,nouns);

3e)  solve for Q
============

p13:solve(p12b,Q);

p13a:p13[1];

p3b:factor(p13a);

4e)  T=T(x)  ?
===========
Q = constant
==========
first  : Q for (k(T)) =kk , 'final domain'  => (T1=>T2)   , eq:p9b
sec :  Q for  k(T)  = kk , ' domain      '   => (T1=> T(x)), eq: p13a

p14:rhs(p9b) =rhs(p13a);

p14a:solve(p14,T(x));

p14b:p14a[1];

check solution : p14a
================
x=0,  T=T1
x=L    T=T2

p15a:subst([x=0],p14b);
p15b:expand(subst([x=L],p14b));

solution :every thing before allowed.

?  What be temperature in the mid of the cylinder.  x = L/2
============================================
kk = constant.

p15c:subst([x=L/2],p14b);

p15d:expand(p15c);

rem : k(T) ≠ constant  , show below here  T =T(x)
=====================================
equation :k(T) = c*T+d

1e)  Q : use  'p10d1'
===============

p16:p10d1;

2e)  Q : use 'p11c' and  'p2a'
======================

integration ranges
==============

p17a:p11c;

p17b:subst([kk=c*T+d],p17a);

put in integration ranges 'p2a'
=======================

p17c:subst(p17b,p2a);

p17d:ev(p17c,nouns);

p17e:solve(p17d,Q);

p17f:p17e[1];

suppose  1e) Q = 2e)Q
==================

p18:rhs(p16) =rhs(p17f);

find T = T(x) >0
============

p18a:solve(p18,T(x));

T(x) => first solution       , no physical meaning      [1]
             second solution, physical meaning            [2]

p18b:p18a[2];

x=0  ?   T= ?    =>  T(0)
==========

p19a:subst([x=0],p18b);

x=L  ?   T= ?    =>  T(L)
==========

p19b : subst([x=L],p18b);

find temperature @ mid-plane  x=L/2
============================

p19c:subst([x=L/2],p18b);