Frequently, I come across the following problem: How to rewrite a complicated partial differential equation in a more clear way? I would like to create some order by collecting terms that are equal.
For example, this rather messy equation $0 = \frac{1}{4} l^4 m^4 y F^{(0,1)}(x,y)-6 l^2 M^2 y F^{(0,1)}(x,y)+\Lambda F^{(0,1)}(x,y)$,
can be written more clear as
$0 = \text{newform} = a_{0001} F^{(0,1)}(x,y)+a_{0101} y F^{(0,1)}(x,y)$
with $a_{0101}=\frac{l^4 m^4}{4}-6 l^2 M^2$ and $a_{0001}=\Lambda$.
My question is how to determine the coefficients from a given PDE? To make it more tangible, suppose I have a partial differential equation of f(x,y) that is quadratic in f and has order 6 derivatives in derivatives. It can be written as
$0 = \sum_{i,j,k,l} a_{i j k l} x^i y^{j}F^{(k,l)}(x,y) + \sum_{i,j,k,l,m,n} b_{i j k l m n} x^i y^{j}F^{(k,l)}(x,y)F^{(m,n)}(x,y)$
I want to use Mathematica to
- Rewrite the PDE into the above form; i.e. replace calculate all the coefficients
- Do not include terms with that have a zero coefficient in this new form
- Create a replacement rule for each coefficient.
- Check that this new form of writing eq is indeed equivalent.
How can I do this? If point 1 - 3 are established, then point 4 is easy: Just check that the following adds up to zero
oldform - newform /. substitutionrule
To give you an idea, these are some of the terms that appear in my PDE. $\small{l^4 m^4 F(x,y) -57 l^4 \Lambda M^2 F(x,y) + l^4 m^4 y F^{(0,1)}(x,y)+ 57 l^4 \Lambda M^2 y F^{(0,1)}(x,y)-24 l^2 M^2 y F^{(0,1)}(x,y)}$ $+ \small{2 M^2 y^8 F^{(0,1)}(x,y) F^{(0,5)}(x,y)-4 M^2 y^8 F^{(2,4)}(x,y)+4 M^2 y^6 F(x,y) F^{(0,4)}(x,y) = 0}$
Here is the InputForm of this 'toy PDE'
eqn = l^4*m^4*F[x, y] - 57*l^4*Lambda*M^2*F[x, y] + l^4*m^4*y*Derivative[0, 1][F][x, y]
- 24*l^2*M^2*y*Derivative[0, 1][F][x, y]
+ 57*l^4*Lambda*M^2*y*Derivative[0, 1][F][x, y]
+ 4*M^2*y^6*F[x, y]*Derivative[0, 4][F][x, y]
+ 2*M^2*y^8*Derivative[0, 1][F][x, y]*Derivative[0, 5][F][x, y]
- 4*M^2*y^8*Derivative[2, 4][F][x, y]
And more convenient to copy into a notebook is this form
eqn = l^4*m^4*F[x, y] - 57*l^4*Lambda*M^2*F[x, y] + l^4*m^4*y*Derivative[0, 1][F][x, y] - 4*l^2*M^2*y*Derivative[0, 1][F][x, y] + 57*l^4*Lambda*M^2*y*Derivative[0, 1][F][x, y] + 4*M^2*y^6*F[x, y]*Derivative[0, 4][F][x, y] + 2*M^2*y^8*Derivative[0, 1][F][x,y]*Derivative[0, 5][F][x, y] - 4*M^2*y^8*Derivative[2, 4][F][x, y]
Update:
Pillsy gave a nice solution that does exactly (1)-(4). To see what kind of powers of x, y, $\partial_x$ and $\partial_y$ are contained in the example PDE I use his code, and I add
Total[coeffRules /. {(a[i_, j_, k_, l_] -> coeff_) :>
Subscript[a, i, j, k, l]*x^i*y^j*
Derivative[k, l][F], (b[i_, j_, k_, l_, m_, n_] -> coeff_) :>
Subscript[b, i, j, k, l, m, n]*x^i*y^j*
Derivative[k, l][F] Derivative[m, n][F]}]
This gives $\small{y^8 a_{0,8,2,4} F^{(2,4)}+3 y a_{0,1,0,1} F^{(0,1)}+2 F a_{0,0,0,0}+y^8 b_{0,8,0,1,0,5} F^{(0,1)} F^{(0,5)}+F y^6 b_{0,6,0,0,0,4} F^{(0,4)}}$
Now it is much easer to see what kind of PDE this is. There is one more thing I would like to ask. How can I avoid the double counting of terms that results for example in the factor 3 in $3 y a_{0,1,0,1} F^{(0,1)}$?
This works, I think
% /. {Times[a_Integer, b_] -> b, Times[b_, a_Integer] -> b}
$\small{y^8 a_{0,8,2,4} F^{(2,4)}+y a_{0,1,0,1} F^{(0,1)}+F a_{0,0,0,0}+y^8 b_{0,8,0,1,0,5} F^{(0,1)} F^{(0,5)}+F y^6 b_{0,6,0,0,0,4} F^{(0,4)}}$
InputFormof the expression in youreq. Please check if it correctly represents the expression you intended. – kglr Feb 22 '12 at 11:52xwith1by a mistake. – Artes Feb 22 '12 at 12:16