How to optimise five equations and four unknowns?

Hi, I am looking to find the optimal power output for four generators given the equations and conditions:
0.31246x1 + 0.15x2 + 0.15x3 + 0.15x4 = 46,
0.15x1 + 0.3x2 + 0.15x3 + 0.15x4 = 40,
0.15x1 + 0.15x2 + 0.3x3 + 0.15x4 = 55,
0.15x1 + 0.15x2 + 0.15x3 + 0.3x4 = 50.5,
x1+x2+x3+x4=200
25<=x1<=100
5.5<=x2<=30
20<=x3<=130
25.5<=x4<=160
To maximise x1, x2, x3 and x4.
Please help.

2 commentaires

Torsten
Torsten le 17 Août 2018
Modifié(e) : Torsten le 17 Août 2018
You can only maximize a single value, not four of them (here: x1,x2,x3,x4) simultaneously.
Sophie Cai
Sophie Cai le 19 Août 2018
How do I maximise one single value? Do you have an example?

Connectez-vous pour commenter.

 Réponse acceptée

Alan Weiss
Alan Weiss le 17 Août 2018
Modifié(e) : Alan Weiss le 17 Août 2018
You have five equations in four unknowns, which means that you probably have no solution to your problem as stated. Consider solving the first four equations:
A = [0.31246 0.15 0.15 0.15
0.15 0.3 0.15 0.15
0.15 0.15 0.3 0.15
0.15 0.15 0.15 0.3 ];
b = [46
40
55
50.5];
c = A\b
c =
48.1346
12.1330
112.1330
82.1330
sum(c)
ans =
254.5337
So you cannot satisfy all of your equations. What would you like to do? Find a least-squares solution? Something else?
Here is a least-squares solution:
A = [A;1 1 1 1];
b = [b;200];
c = A \ b
c =
40.1980
-1.1451
98.8549
68.8549
sum(c)
ans =
206.7627
Alan Weiss
MATLAB mathematical toolbox documentation

1 commentaire

Sophie Cai
Sophie Cai le 19 Août 2018
How do I maximise one single value? Do you have an example?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by