Question: Modifying an Algorithm for Multiple Variables

How to modify the ND procedure to handle derivatives with respect to more than three independent variables for higher-dimensional PDEs, it is work for [x,t] i want  it work for [x,y,z,t] , 

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

alias(F=F(x, t), G=G(x, t))

F, G

(2)

with(PDEtools):
undeclare(prime):

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(3)

ND := proc(F, G, U)
  local v, w, f, g, a:
  v := op(F):
  if v[1] in U then w := -v[1] else w := v[1] end if:
  if v[2] in U then w := w, -v[2] else w := w, v[2] end if:
  f := op(0, F):
  g := op(0, G):
  a := diff(f(w)*g(v), U);
  convert(subs([w]=~[v], a), diff)
end proc:

ND(F, G, [x]);
ND(F, G, [t]);

-(diff(F, x))*G+F*(diff(G, x))

 

-(diff(F, t))*G+F*(diff(G, t))

(4)

ND(F, F, [x]);
ND(F, F, [x, x]);

0

 

2*F*(diff(diff(F, x), x))-2*(diff(F, x))^2

(5)

ND(F, G, [x$3]);

-(diff(diff(diff(F, x), x), x))*G+3*(diff(diff(F, x), x))*(diff(G, x))-3*(diff(F, x))*(diff(diff(G, x), x))+F*(diff(diff(diff(G, x), x), x))

(6)

ND(F, F, [x$3, t]);

2*F*(diff(diff(diff(diff(F, t), x), x), x))-2*(diff(diff(diff(F, x), x), x))*(diff(F, t))-6*(diff(diff(diff(F, t), x), x))*(diff(F, x))+6*(diff(diff(F, x), x))*(diff(diff(F, t), x))

(7)

NULL

NULL

#if i collect P1+P1+...+P7 it must get equation 26 in paper so i want define the up proc to open but is not for (3+1) dimesnion,

P1 := 9*ND(F, F, [x, t])

18*F*(diff(diff(F, t), x))-18*(diff(F, x))*(diff(F, t))

(8)

NULL

P2 := -5*ND(F, F, [`$`(x, 3), y])

0

(9)

P3 := ND(F, F, [`$`(x, 6)])

2*F*(diff(diff(diff(diff(diff(diff(F, x), x), x), x), x), x))-12*(diff(diff(diff(diff(diff(F, x), x), x), x), x))*(diff(F, x))+30*(diff(diff(diff(diff(F, x), x), x), x))*(diff(diff(F, x), x))-20*(diff(diff(diff(F, x), x), x))^2

(10)

P4 := -5*ND(F, F, [`$`(y, 2)])

0

(11)

P5 := alpha*ND(F, F, [`$`(x, 2)])

alpha*(2*F*(diff(diff(F, x), x))-2*(diff(F, x))^2)

(12)

P6 := beta*ND(F, F, [x, y])

0

(13)

P7 := gamma*ND(F, F, [x, z])

0

(14)

Download define.mw

Please Wait...