How can I solve for two constants in a polynomial with two variables?

2 views (last 30 days)
I have the following equation:
f = w^3 + (y+x)*w^2 + y*z*w - y*z*x == 0;
I need to input combinations of w and x (8 combinations in total), then solve for y and z. y and z should be real and positive - examples of the type of number I would expect are:
y = 3.1E+6
z = 1.3E-2
How can this be done? I've tried using subs() but to no avail.

Answers (1)

Walter Roberson
Walter Roberson on 8 Sep 2015
y = -w^2*(w+x)/(w^2+w*z-x*z) but you do not know z, so you cannot uniquely determine y.
In each of your 8 cases, you are trying to solve a single equation for 2 variables. The system will be underdetermined and it will not be possible to solve for both simultaneously. Not unless perhaps there is some constraint you have not told us about (such as all of the values being required to be integers, and even then there will be cases where there are multiple values)
  2 Comments
Dan G
Dan G on 8 Sep 2015
Thanks for your answer Walter - my apologies for the mistake I made in my original question - I have edited my question above. Does this make what I am looking for more clear?
Walter Roberson
Walter Roberson on 8 Sep 2015
Taking into account that you want y and z to be real and positive:
If we assume that w and x are also real and positive (negative would lead to a different analysis), then we can find that y will be real and positive provided that x > w and z > w^2/(x-w) (the inequalities are strict), and we can show that z will be real and positive provided that x > w. Beyond that there are an infinite number of solutions. y and z vary inversely: large z lead to small y and smaller z will lead to larger y.
If w or x can be negative then it would be necessary to re-analyze; in such a case I would want to know whether one or both is strictly negative.
In cases where x < w then there are no positive real solutions if x and w are both positive reals.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!