Simplification of an equation using MATLAB
이전 댓글 표시
y=((2/9)*(1-(x.*y)).*(2-(1-x.*y).^3).*(1+(2./(1-x.*y).^3)))./((3-2.*(1-x.*y).^3).*(1-x)) ----eqn1
x=2./(1+w) ----eqn2
x & y are matrices which vary with w.
I want to simplify the equation 1 to get y in terms of x or in terms w by using equation 2 also. How to proceed in MATLAB ?
답변 (1개)
Walter Roberson
2011년 3월 1일
syms x y w
eqn1 = ((2/9)*(1-(x.*y)).*(2-(1-x.*y).^3).*(1+(2./(1-x.*y).^3)))./((3-2.*(1-x.*y).^3).*(1-x)) - y;
eqn2 = 2./(1+w) - x;
s1 = solve(eqn1,y);
s2 = solve(eqn2,x);
ysoln = subs(s1,x,s2);
However, equation #1 is a 6th order polynomial that does not factor, and so the only general algebraic information available for the combined equations is that they are singular if w=-1 .
There happens to be algebraic solutions for y when w=1, but not when w=0 or w=2. There are no real solutions at all for w=0, but there are 2 real solutions for w=2.
댓글 수: 2
Bhagat
2011년 3월 1일
Walter Roberson
2011년 3월 1일
Then you are not able to do it algebraically in your version of Matlab.
For numeric solutions, you can give w *one* specific value (not a vector!) and use
ysoln = (w+1) * roots([576*w-448, -1440*w + 1056, 1440*w - 960, -612*w + 292, 72*w + 48, 9*w - 33, 6])
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!