I have an expression $$\dot{r}\dot{\eta}+r^{2}\dot{\theta}\dot{\xi}=0$$ where $\eta$ and $\xi$ are both functions of $r,\theta$. In MM I wrote this as
de = Dt[r, t] Dt[eta[r, th], t] + r^2 Dt[th, t] Dt[xi[r, th], t]
What I wish to do now is solve this equation by separating it into a set of PDEs for each power of $\dot{r}, \dot{\theta}$ and then integrating each to find the functions $\xi,\eta$. What I need is an equivalent of CoefficientArrays for each power of the co-ordinate derivatives.
For instance, the $\dot{r}\dot{\theta}$ term would be $$ \eta_{\theta} +r^2\xi_r$$ where the subscript denotes partial differentiation. Is there a way to do this? I tried the linked answer but couldn't get it to work for my purposes. Thank you!
EDIT: The answer provided by @kglr works perfectly! Simply Normal@Rest@CoefficientArrays[de, {Dt[r, t] , Dt[th, t]}]
which for some reason I couldn't get to work.
As an extension to this problem, what happens if xi
and eta
are also functions of Dt[r,t]
and Dt[th,t]
? Now coefficient array returns the error "not a polynomial" because it is trying to pattern match inside the functions when I don't want it to. Any ideas?
P.S the Dt[r,{t,2}]
and Dt[th,{t,2}]
terms that result can be ignored because in practise they are replaced by their respective equations of motion which are functions of Dt[r,t]
and Dt[th,t]
. For all intents and purposes we can simply use a replace rule to set Dt[r,{t,2}]
and Dt[th,{t,2}]
equal to 0.
Normal@Rest@CoefficientArrays[de, {Dt[r, t] , Dt[th, t]}]
? $\endgroup$Normal@Rest@ CoefficientArrays[de, {Dt[r, t] , Dt[th, t], Dt[eta, t], Dt[xi, t]}]?
$\endgroup$xi
andeta
are also functions ofDt[r,t]
andDt[th,t]
? Now coefficient array returns the error "not a polynomial" because it is trying to pattern match inside the functions when I don't want it to. Any ideas? I will edit my question with your answer and this followup. $\endgroup$