필터 지우기
필터 지우기

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 CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by