Collecting terms / factoring out multiplied terms
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to convert a cartesian line element to spherical polar line element.
I'm stuck at collecting/factoring out multiplied terms from a big equation; here's what I have so far;
LineElement = collect((dx) + (dy) + (dz), [dr,dtheta*r,r * sin(theta)*dphi]); (I have all of these defined in syms accordingly);
output: (cos(theta) + cos(phi)*sin(theta) + sin(phi)*sin(theta))*dr + dtheta*r*cos(phi)*cos(theta) - dphi*r*sin(phi)*sin(theta) - dtheta*r*sin(theta) + dphi*r*cos(phi)*sin(theta) + dtheta*r*cos(theta)*sin(phi)
dr is factored out nicely, but I want the same to happen with r*dtheta and r*sin(theta)dphi
Please help as I have no idea what I'm doing.
0 commentaires
Réponses (1)
John D'Errico
le 30 Sep 2019
Be serious. That is not big. There are some things (this is one of them) that are far simpler to do by pencil and paper than to use a computer.
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!