kill(all)$

heat : steady state conduction ,with heat generation 'general,BC',version 1, final
peter.vlasschaert@gmail.com,03/07/2019

HOW TO USE BC2: MAXIMA
=======================

depends(T,r);

dependencies;

declare(n,integer);

info : T : temperature
          k:thermal conductivity (also function of r)
          r: radius
          n: integer  (0≤n≤2)
          g(r): function of heat generation.

general ode , steady state with heat generation.

p1: 1/r^n*'diff(r^n*diff(T,r),r) +g(r)/k= 0;

example : heat generation by nuclear rod.

step :needed to use 'ode2' into maxima.
------------------------------------------------------

p1a:ev(p1,diff);

n values
------------

n=0 , standard,laplace equation

p1b:subst([n=0],p1a);

p1c:ode2(p1b,T,r);

n=1, cylindrical ,laplace equation, depends on 'r'

p2b:subst([n=1],p1a);

p2c:ode2(p2b,T,r);

n=2, spherical,laplace equation, depends on 'r'

p3b:subst([n=2],p1a);

p3c:ode2(p3b,T,r);

solve specific problem ; you need BC : types
============================================
1e) Dirichlet condition :  T                       = value
2e) Neuman                  : c*dT/dr             = value ('gradient')
3e) Robin                      : c1*T+c2*dT/dr = value
============================================
https://en.wikipedia.org/wiki/Boundary_value_problem
============================================
@ value 'r'

by example: r=ri , inner radius.
                      r=ro ,outer radius

Maxima : Log(x) , Math : Ln(x)

How to implement BC
------------------------------
to find : %k1,%k2  =>  'use bc2, Maxima'

BC: Boundary condition, 'example'

n=1,cylindrical (with heat generation = g(r))
============
Ti  => ri      (i: inner)
To => ro    (o:outer)
ri < ro

p4a:bc2(p2c,T=Ti,r=ri,T=To,r=ro);

p4a1:expand(p4a);

n=2,spherical(with heat generation =g(r))
============
Ti  => ri      (i: inner)
To => ro    (o:outer)
ri<ro

p5a:bc2(p3c,T=Ti,r=ri,T=To,r=ro);

p5a1:expand(p5a);

simple reduction g(r) = go,heat generation constant.

declare(go,constant);

cylindrical:'n=1'
============

p4a2:subst([g(r)=go,g(ri)=go,g(ro)=go],p4a1);

spherical:'n=2'
============

p5a2:subst([g(r)=go,g(ri)=go,g(ro)=go],p5a1);

general interpretation not so good. 'what about integrals in the expression ,'p4a2,p5a2'
and also above.

best way : use 'p2c,p3c'

assume : because or log(x>0) otherwise problems

assume(r≥0);

cylindrical
========

p6a:p2c;

heat generation : g(r) = go
------------------------------------

p6b:subst([g(r)=go],p6a);

p6c:ev(p6b,nouns);

bc2: how to use 'see above'.
---------------------------------------

p6d::bc2(p6c,T=Ti,r=ri,T=To,r=ro);

otherway : p6d
--------------------

1e) first BC : T= Ti = > r=ri
====================

p6d1:subst([T=Ti,r=ri],p6c);

2e) second BC : T= To = > r=ro
========================

p6d2:subst([T=To,r=ro],p6c);

3e) solve : %k1,%k2
================

p6d3:solve([p6d1,p6d2],[%k1,%k2]);

p6d4:flatten(p6d3);

4e) subst : {%k1,%k2} into 'p6c'

p6d5:subst(p6d4,p6c);

5e) check result
=============

p6d6:is(rhs(p6d)=rhs(p6d5));

easy way use : bc2 command from Maxima.
otherwise steps : 1e),2e),3e),4e)

spherical
========

p7a:p3c;

heat generation : g(r) = go 'constant see above'
------------------------------------

p7b:subst([g(r)=go],p7a);

p7c:ev(p7b,nouns);

implementation BC, 'see above'.
--------------------------------------------

p7d:bc2(p7c,T=Ti,r=ri,T=To,r=ro);

both cases with :constant heat generation :go =>T=T(r)