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
Walter Roberson 2011년 3월 1일

0 개 추천

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
Bhagat 2011년 3월 1일
Getting the following errors:
??? Error using ==> solve at 162
Unable to find closed form solution.
Error in ==> sym.solve at 49
[varargout{1:max(1,nargout)}] = solve(S{:});
Error in ==> nwc at 4
s1 = solve(eqn1,y);
??? Error using ==> solve at 162
Unable to find closed form solution.
Error in ==> sym.solve at 49
[varargout{1:max(1,nargout)}] = solve(S{:});
Error in ==> nwc at 4
s1 = solve(eqn1,y);
Walter Roberson
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에 대해 자세히 알아보기

질문:

2011년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by