substitute into a set of inequalities
Show older comments
Hello!
Could you please help me with the following problem. Let's say that I have the following equations:
x1+x2<=17
x1+x3<=27
x2+x3<=21
Here we have 3 unknowns. In matrixform: Ax<=b where
A=
1 1 0
1 0 1
0 1 1
b=
17
27
21
Now I get the new information saying that x1+x2+x3=22 (equation). Then I can isolate x3=22-x1-x2. Then I can substitute this into the previous inequalities, which gives me:
x1+x2<=17
-x2<=5
-x1<=-1
which again can be written in the matrixform Ax<=b where
A=
1 1
0 -1
-1 0
and
b=
17
5
-1
This time there are only 2 unknowns, namely x1 and x2. Once I have them, x3 can be calculated by x3=22-x1-x2. This is just one example. I would like to be able to do this for a general problem. In this example, I would like to give matlab the matrices
1 1 0
1 0 1
0 1 1
and
17
27
21
and the information stating that x1+x2+x3=22.
Then I would like to get the folowing matrices as output:
1 1
0 -1
-1 0
and
17
5
-1
Is it possible to do that in Matlab?
Thank you very much for your time and consideration!
Best regards,
Alex
Accepted Answer
More Answers (0)
Categories
Find more on PHY Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!