kill(all)$

solve pde (part 9), 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),x,2) =9*diff(u(x,t),t,2) , t > 0
           =========================================
           domain : x >0 , t > 0
           =========================================

 ==============================================

BC :    diff(u(x,t),x),x=0) =u(0,t) + t
IC   :    u(x,0) = exp(-x),  at(diff(u(x,0),t),t=0) =cos(5*x)

  =============================================

eq:diff(u(x,t),t,2) = 9* diff(u(x,t),x,2) ;
ic : [u(x,0) = exp(-x), at(diff(u(x,t),t),t=0) =cos(5*x)];
bc :[at(diff(u(x,t),x),x=0) =u(0,t) + t];

bc[1];

assume(x>0,t>0);

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],ic[2],p1a],p1);

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

p3:ode2(p2,v,x);

only boundary condition : select  a) %k1= 0      , %k2=%c
                                                                b) %k1=%c   , %k2 =0
================================================

a=>
------

p3a:[%k1=0];
p3b:subst(p3a,p3);

complex boundary conditions : (BC :   diff(u(x,t),x),x=0) =u(0,t) + t)
=======================================================

a1)  v => U(x,t)
============

define(U(x,t),rhs(p3b));

a2)  U(x,t) => f(t), laplacetransform
============================

p4:at(diff(U(x,t),x),x=0) =U(0,t) + laplace(t,t,s);

a3)  solve 'p4' for %k2
===================

p4a:solve(p4,%k2);

a4) subst '%k2'  into  'define'
========================

p4b:subst(p4a,U(x,t));

Menu : Calculus :Partial fraction => s:variable
----------------------------------------------------------------------

use partial fraction : 
=================

p4c:partfrac(p4b,s);

expand
======

p4d:expand(p4c);

factor
=====

p4e:factor(p4d);

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

p5:laplaceInv(p4e,s,t);

p5a:collectterms(p5,unit_step(t-x/s));

'-------------------------------------------------------------------------------------------------------------------------------------------'

rem  x <  3t  => forget(facts(x))$,assume(x<3*t)
analog: rem x  > 3*t