kill(all)$

maxima : pde : general analysis advection pde :u't+c*u'x = 0,version 1.0,part 1
peter.vlasschaert@gmail.com,20/02/2023

load: packages.

load(lrats)$

→ 1e) advection pde equation 
→ 2e) diffusion   pde equation ( ? what when diffusion negative .)
→ 3e) dispersion pde equation

fourier series : u(x,t) 
---------------------------
uA = amplitude of a wave
k = 2*%pi*m/l  m ∈ [-∞,∞],wavenumber.

s1:u(x,t) = 'sum(uA[k]*exp(%i*b*t)*exp(%i*k*x),k,-inf,inf);

x =space
t  = time
u = depent variable ,{x,t}
b = coef.

→ first step :

set :uA[k] = exp(a*t)

s1a:subst([uA[k] = exp(a*t)],s1);

→ second step :

set : q=a+%i*b ,complex number.

s1b:expand(exp((a+%i*b)*t)=exp(q*t));
s1b:lratsubst([s1b],s1a);

→ thrid step :

linear pde : only one wave number

s1c:lhs(s1a) =args(rhs(s1b));

s1c:rhs(s1c)[1];

s1d:u = s1c;

general pde :
----------------

s2:'diff(u,t) =sum(a[i]*'diff(u,x,i),i,1,n);

How to find them : a[i] ?
reason study : general pde s2,numerical methods solve modified equation.(explain : later)

s2a:subst([n=3],s2),simpsum;

s2b1:reverse(args(rhs(s2a)));

s2b2:sort(listofvars(s2b1));

coef : a[i], i=1,2,3 ; linear pde,s2a

s2b3:makelist(s2b2[i],i,1,length(s2b1));

→ 1e) advection pde equation : i = 1,[1,0,0]→ s3

s3:[a[1],0,0];
s3:map("=",s2b3,s3);

s3a:lhs(s2a) =subst(s3,apply("+",s2b1));

→ subst :u ,s1d

s3b:subst([s1d],s3a);

s3b1:ev(s3b,diff);

→ solve : q

s3b2:solve(s3b1,q);

→ find : u ,use :s1d

s3b3:gfactor(subst(s3b2,s1d));

s3b3a:facsum(args(rhs(s3b3)));

k =wavenumber
x = space                          :[m]
t  = time                            :[s]
a[1 ]= speed ( = velocity)  :
-------------------------------------------
x = [m] =[m/s]*[s] =a[1]*t
-------------------------------------------

all frequency : with the same speed.
use :s1b,s3b2

s3c:s1b;

s3c1:subst(s3b2,s3c);

s3c1:lhs(s3c1)=sum(exp(s3b3a[2]),k,-inf,inf);

=>  most books :diff(u,t)+c*diff(u,x) = 0

→ 2e) diffusion   pde equation : i = 2,[0,1,0]→ s4

s4:[0,a[2],0];
s4:map("=",s2b3,s4);

s4a:lhs(s2a) =subst(s4,apply("+",s2b1));

→ subst :u ,s1d

s4b:subst([s1d],s4a);

s4b1:ev(s4b,diff);

→ solve : q

s4b2:solve(s4b1,q);

q = real number only impact on time.

→ find : u ,use :s1d

s4b3:gfactor(subst(s3b2,s1d));

s4b3a:facsum(args(rhs(s4b3)));

s4c:s1b;

s4c1:subst(s4b2,s3c);

higher frequency : k → faster diffusion
a[2] < 0, solution unbounded,reson exponential growth.
----------------------------------------------------------------------------------------------
rem :diffusion : will kill noise an a wave (use : as a filter)
rem :difusion acts on all frequency ,by modifying the amplitude on time.
-----------------------------------------------------------------------------------------------

=>  most books :diff(u,t)-D*diff(u,x,2) = 0

→ 3e) dispersion pde equation,: i = 3,[0,0,1]→ s5

s5:[0,0,a[3]];
s5:map("=",s2b3,s5);

s5a:lhs(s2a) =subst(s5,apply("+",s2b1));

→ subst :u ,s1d

s5b:subst([s1d],s5a);

s5b1:ev(s5b,diff);

→ solve : q

s5b2:solve(s5b1,q);

q = complex number only impact on space

→ find : u ,use :s1d

s5b3:gfactor(subst(s5b2,s1d));

s5b3a:facsum(args(rhs(s5b3)));

k =wavenumber
x = space                                  :[m]
t  = time                                    :[s]
a[3 ]*k^2= speed ( = velocity)  :[m/s]
-------------------------------------------
x = [m] =[m/s]*[s] =a[3]*k^2*t
-------------------------------------------

s5c:s1b;

s5c1:subst(s5b2,s3c);

s5c1:lhs(s5c1) =sum(exp(s5b3a[2]),k,-inf,inf);

higher frequency : k → faster dispersion ( = moves faster)
rem :Dispersion , doesn't not cause instability, may cause phase shift.

=>  most books :diff(u,t)-d*diff(u,x,3) = 0

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