Algebraic simultaneous equations using symbolic toolbox

1 回表示 (過去 30 日間)
b
b 2015 年 11 月 10 日
コメント済み: b 2015 年 11 月 10 日
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?
  1 件のコメント
b
b 2015 年 11 月 10 日
sorry, the last line of code is solve(eqn1,eqn2,eqn3,eqn4,eqn5)

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by