kill(all)$

solve pde (part 4), use laplace transform. 'version 1.0'
peter.vlasschaert@gmail.com,11/12/2018

load 'packages'
------------------------

load(orthopoly)$
load(lrats)$
load(facexp)$
load(odes)$

load("C:/math/laplaceInv.mac");

assume(s>0);

pde : diff(u(x,t),t) = diff(u(x,t),x,2)  , t > 0
           ===========================
           domain : 0 < x < 2

BC :   u(0,t)  = 0,u(2,t)= 0
IC   :   u(x,0) = 3*sin(2*π*x)

eq: diff(u(x,t),t) = diff(u(x,t),x,2);
bc :[u(0,t)  = 0,u(2,t)= 0];
ic : [u(x,0) = 3*sin(2*π*x)];

solve : pde with bc,ic
--------------------------------

1e) laplace transformation 'eq'
=========================

p1:laplace(eq,t,s);

p1a:laplace(u(x,t),t,s) =v;

2e) subst ic into 'p1'
=================

p2:subst([ic[1],p1a],p1);

3e) solve ode2 , 'p2'
================

p3:ode2(p2,v,x);

use :  BC
--------------

1e)   x=0 => v=0
2e)   x=2 => v=0

1e)   x=0 => v=0

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

2e)   x=2 => v=0

p3b:subst([x=2,v=0],p3);

p3c:linsolve([p3a, p3b], [%k1,%k2]);

p3d:subst(p3c,p3);

4e) inverse laplace transform 'p3d'
=============================

p4:u(x,t) = laplaceInv(rhs(p3d),s,t);

5e) check solution : 'p4' into 'eq'
===========================

p5:subst([p4],eq);

p5a:ev(p5,nouns);

p5b:is(p5a);

special here: BC we find  %k1,%k2