Simplification of an equation using MATLAB
Afficher commentaires plus anciens
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 ?
Réponses (1)
Walter Roberson
le 1 Mar 2011
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 commentaires
Bhagat
le 1 Mar 2011
Walter Roberson
le 1 Mar 2011
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])
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!