Message Boards Message Boards

Solve for a linear system with equalities and ineqaulities

Posted 1 year ago

Hi there,

Need help on solving for x5 in the following system:
x2 == 3 (5-x5) && x3 == 2 (3-x5) && x2>=0 && x3 >=0 && x5 >=0

I expect to have something like x5 <= 3, but Reduce gives the following solution:
(x2==6 && x3==0 && x5 ==3) || ....

Any suggestions on how to let MMA give x5 <= 3 as the solution?

Many thanks!
Xiangyang

POSTED BY: Xiangyang Zhou
4 Replies

Another way:

Reduce[Exists[{x2, x3},
  x2 == 3 (5 - x5) && x3 == 2 (3 - x5) &&
   x2 >= 0 && x3 >= 0 && x5 >= 0]]
POSTED BY: Gianluca Gorni

Solved the problem. Many thanks!

POSTED BY: Xiangyang Zhou
Posted 1 year ago
Simplify[
  Reduce[x2==3(5-x5)&&x2>=0&&x5>=0]&&
  Reduce[x3==2(3-x5)&&x3>=0&&x5>=0],
  x2==3(5-x5)&&x2>=0&&x3==2(3-x5)&&x3>=0]

returns

0<=x5<=3
POSTED BY: Bill Nelson

Thanks for the help!

POSTED BY: Xiangyang Zhou
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract