Question: How seperate Linear and nonlinear term in equation?

sometime this code i use make a problem for me and sometime they work very good how i can get something general for use in all equation 

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

_local(gamma)

Warning, A new binding for the name `gamma` has been created. The global instance of this name is still accessible using the :- prefix, :-`gamma`.  See ?protect for details.

 

``

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

(1)

declare(u(x, y, z, w, t))

u(x, y, z, w, t)*`will now be displayed as`*u

(2)

declare(f(x, y, z, w, t))

f(x, y, z, w, t)*`will now be displayed as`*f

(3)

pde := 4*(diff(u(x, y, z, w, t), x, t))-(diff(u(x, y, z, w, t), `$`(x, 3), y))+diff(u(x, y, z, w, t), x, `$`(y, 3))+12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(u(x, y, z, w, t), x, y))-6*(diff(u(x, y, z, w, t), z, w)) = 0

4*(diff(diff(u(x, y, z, w, t), t), x))-(diff(diff(diff(diff(u(x, y, z, w, t), x), x), x), y))+diff(diff(diff(diff(u(x, y, z, w, t), x), y), y), y)+12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(diff(u(x, y, z, w, t), x), y))-6*(diff(diff(u(x, y, z, w, t), w), z)) = 0

(4)

oppde := [op(expand(pde))]; u_occurrences := map(proc (i) options operator, arrow; numelems(select(has, [op([op(i)])], u)) end proc, oppde); linear_op_indices := ListTools:-SearchAll(1, u_occurrences); pde_linear := add(oppde[[linear_op_indices]]); pde_nonlinear := expand(simplify(expand(pde)-pde_linear))

0

 

4*(diff(diff(u(x, y, z, w, t), t), x))-(diff(diff(diff(diff(u(x, y, z, w, t), x), x), x), y))+diff(diff(diff(diff(u(x, y, z, w, t), x), y), y), y)+12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(diff(u(x, y, z, w, t), x), y))-6*(diff(diff(u(x, y, z, w, t), w), z)) = 0

(5)

pde_linear, pde_nonlinear := selectremove(proc (term) options operator, arrow; not has((eval(term, u(x, y, z, w, t) = a*u(x, y, z, w, t)))/a, a) end proc, expand(pde))

() = 0, 4*(diff(diff(u(x, y, z, w, t), t), x))-(diff(diff(diff(diff(u(x, y, z, w, t), x), x), x), y))+diff(diff(diff(diff(u(x, y, z, w, t), x), y), y), y)+12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(diff(u(x, y, z, w, t), x), y))-6*(diff(diff(u(x, y, z, w, t), w), z)) = ()

(6)
 

NULL

Download seperate_L-NL.mw

Please Wait...