heat 1: intro math.(1D),ODE 
peter.vlasschaert@gmail.com,19/12/2017

restart =>

kill(all)$

solve: ODE :  d/dx(du/dx)=0;  x=0 => u=u1 , x=L => u=u2

How to solve : above (B)oundary (C)ondition.

1e) Depends u on x

depends(u,x);

p1:diff(u,x,2)=0;

Menu :Equations:Solve ODE

p2:ode2(p1, u, x);

insert BC: from above

a) find : %k2,%k1

bc1: x=0 => u=u1

p3:ev(p2,u=u1,x=0);
p4:ev(p2,rhs(p3)=lhs(p3));

bc2:x=L => u=u2
rem: find  %k2 from bc2

p5:ev(p4,x=L,u=u2);
p6:solve(p5,%k2)[1];

b) solution : ODE 'p2'

p7:ev(p4,p6);

c) check x=0, x= L

p8:ev(p7,x=0);
p9:ev(p7,x=L);

u = temperature for heat ODE

k= thermal conductivity
1e) k = k(x) function from distance 'x'         , see above :bc1,bc2
2e) k = k(u) function from temperature 'u'  ,see above :bc1,bc2

kill(all)$

1e) k = k(x) function from distance 'x'

p2;

depends(u,x);

depends(k,x);

solve : ODE , k=k(x)

p1:diff(k*u,x,2)=0;
p2:ode2(p1,u,x);

a) find : %k2,%k1

bc2: x=L => u=u2
k=a*x+b

p3:k = a*x+b;

p4:ev(p2,p3,diff);

p5:ev(p4,x=L,u=u2);

p6:solve(p5,%k2)[1];

p7:ev(p4,p6);

bc1: x=0 => u=u1
k=a*x+b

p8:ev(p7,u=u1);
p9:solve(p8,%k1)[1];

find u: %k1,%k2

p10:ev(p7,p9);

kill(all)$

depends(u,x);

p1:k=a*x+b;

p2:'diff(rhs(p1)*u,x,2)=0;

p3:diff(u*rhs(p1),x)=%k1;

p4:ode2(p3, u, x);
p5:ev(p4,%c=%k2);

a) find : %k2,%k1

bc1: x=0 => u=u1
k=a*x+b

p6:ev(p5,x=0,u=u1);
p7:solve(p6,%k2)[1];
p8:ev(p5,p7);

bc2: x=L => u=u2
k=a*x+b

p9:ev(p8,x=L,u=u2);
p10:solve(p9,%k1)[1];

b) find : u=u(x)

p11:ev(p8,p10);

c) check : x=0 and x=L

p12:ev(p11,x=0);
p13:ev(p11,x=L);

rem : see before,some mathematical inside can help.

2e) k = k(u) function from temperature 'u'

kill(all)$

depends(u,x);

p1:k=a*u+b;

ODE : diff(k(u)*u,x,2) =0, see above bc1,bc2

non-linear differential equation

p2:diff(rhs(p1)*u,x,2)=0;

try to solve:

p3:diff(rhs(p1)*u,x)=%k1;
p4:ode2(p3,u,x)$
p5:ev(p4,%c=%k2);

bc1: x=0 => u=u1
k=a*u+b

p6:ev(p5,x=0,u=u1);
p7:part(p6,1,2);
p8:p6*p7;
p9:lhs(p8)-rhs(p8)=0;
p10:solve(p9,u1);

p11:p10[1];
p12:p10[2];

=>  error found : no result

solve([p11,p12], [%k1,%k2]);

to_poly_solve([p11,p12], [%k1,%k2]);

bc2: x=L => u=u2
k=a*u+b

p13:ev(p5,x=L,u=u2);
p14:part(p13,1,2);
p15:p13*p14;
p16:lhs(p15)-rhs(p15)=0;
p17:solve(p16,u2);

p18:p17[1];
p19:p17[2];

solve([p18,p19], [%k1,%k2]);

to_poly_solve([p18,p19], [%k1,%k2]);

=>  error found : no result