kill(all);

maxima :modified TRAM ODE-BVP problem ,version 1,part 1
peter.vlasschaert@gmail.com,17/11/2020

problem :6.23 pg 274
------------------------------
book :New Age
           Numerical Methods for engineers,THird Edition
           SANTOSH KGUPTA

load(lrats)$

ODE : TRAM equation .BVP ( = Boundary Value Problem)

p1:1/6*'diff(y,x,2)+'diff(y,x)-2*y^2 =0;

→ BC1: @ x=0

p1a:'diff(y,x) =0;

→ BC2: @ x=1

p1b:'diff(y,x) = -6*(y-1);

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

1e)  suppose : solution 'p2' for 'p1' above  (BC1 ,@ x= 0,dy/dx=0)
==================================================

p2:y = d1+d2*x+d3*x^2;

 find :d2
======

→ use BC1

p2a:p1a;

p2a1:subst([p2],p2a);

p2a2:ev(p2a1,nouns);

→ @ x= 0

p2a3:[subst([x=0],p2a2)];

find : d1,d3,d4,......
===============

find :d3  ( rem : d2=0,see above)
---------------------------------------------

→  solution :polynoom 'p2'  into ODE  = 'p1'

p3:lratsubst([p2],p1);

p3a:expand(ev(p3,nouns));

dy/dx = 0  @ x=0  → d2 =0,see above.,'p2a3'

p3a1:subst([d2=0],p3a);

1e)  @ x =0 ,BC1 , dy/dx =0

p3a2:subst([x=0],p3a1);

p3a21:solve(p3a2,d3);

2e)  suppose : solution 'p4' for 'p1' above  (BC1 ,@ x= 0, BC2, @ x=1)
======================================================

p4:y = d1+d2*x+d3*x^2+d4*x^3;

a) → BC1 :@x = 0,dy/dx = 0

p4a:lratsubst([p4],p1)$
p4a1:ev(p4a,nouns)$
p4a2:expand(subst([d2=0],p4a1));
p4a3:subst([x=0],p4a2);
p4a4:solve(p4a3,d3);

rem :same result ,p3a2 for p4a4.

b) → BC2 :@x =1, dy /dx = -6*(y-1)

dy/dx  from 'p4'

p4b:p1b;

p4b1:subst([p4],p4b);

p4b2:ev(p4b1,nouns);

p4b3:subst([d2=0],p4b2);

p4b4:subst([p3a21],p4b3);

p4b5:expand(p4b4);

→  equality : equal powers  on  x^2, on both sides.

p4b6:[coeff(p4b5,x,2)/3];

final result  : y ?
============
use :{p2a3,p4a4,p4b6} use this in 'p4'

m:[p2a3,p4a4,p4b6];

ma:flatten(m);

mb:subst(ma,p4);

mb1:factor(mb);

result y =f(d1,x)