maximizing objective function with equality and inequality constraints
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I want to estimate x_1 ,...,x_4 by maximizing
subject to and ,
which function can help me to solve this problem ,
Also, how can I convert this objective function to be convex if that is possible.
Thanks in advance
1 commentaire
Réponse acceptée
Aditya
le 23 Jan 2023
Modifié(e) : Aditya
le 23 Jan 2023
Hi,
I understand that you want to solve this linear programming problem.
In general, you can also use the linprog function to solve such problems. Here is an example to arrive at the trivial solution for your example.
f = [4.22117991, 4.21111679, 4.22994893, 4.23060394];
Aeq = [1, 1, 1, 1];
lb = [0, 0, 0, 0];
beq = [1];
x = linprog(-f, [], [], Aeq, beq, lb, []);
You can see that the variable x is [0;0;0;1] which is the trivial solution to this problem.
The reason why I have passed negative f ( -f ) is because linprog minimizes the objective function. So, in order to maximize f, we minimize -f.
8 commentaires
Aditya Mahamuni
le 23 Juin 2023
And what can i do if i want to use the linprog function in simulink and use it at every time step ? Because when i use it, it shows me an error that "the function 'linprog' is not supported for code generation."
Torsten
le 23 Juin 2023
I have no experience with this coupling, but this contribution might be helpful:
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!