Collecting terms / factoring out multiplied terms

3 vues (au cours des 30 derniers jours)
Zuzanna
Zuzanna le 30 Sep 2019
Commenté : Zuzanna le 30 Sep 2019
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.

Réponses (1)

John D'Errico
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.
  1 commentaire
Zuzanna
Zuzanna le 30 Sep 2019
It's not my choice, it's an assignment. I've done it by pencil already. I'm looking for help, that's all.

Connectez-vous pour commenter.

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!

Translated by