Algebraic simultaneous equations using symbolic toolbox
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to use the symbolic toolbox of MATLAB to solve the following systems of equations. Given the following 3 equations w+x+y+z=k1; (w^2)+(x^2)+(y^2)+(z^2)=k2; w*x*y*z=k3; where (k1,k2,k3) are constants and (w,x,y,z) are variables. The objective is to obtan p and q in terms of each other only where p=w+z; q=(w*z)-(x*y); That is, all the w,x,y,z should get eliminated in the (p,q) equations to get a single function f(p,q,k1,k2,k3). I am using the code in the following manner:
syms w x y z p q
eqn1 = w+x+y+z==k1;
eqn2 = w*x*y*z==k2;
eqn3 = (w^2)+(x^2)+(y^2)+(z^2)==k3;
eqn4 = w+z-p==0;
eqn5 = (w*z)-(x*y)-q==0;
solve(eqn1,eqn2,eqn3,eqn4)
But the output is for w,x etc instead of one equation in terms of variables (p,q) and the constants (k1,k2,k3). How to achieve this single function equation?
Réponses (0)
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!