maximizing objective function with equality and inequality constraints

조회 수: 3 (최근 30일)
Az.Sa
Az.Sa 2023년 1월 20일
댓글: Torsten 2023년 6월 23일
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
Torsten
Torsten 2023년 1월 20일
편집: Torsten 2023년 1월 23일
x1=x2=x3=0, x4=1
Should be obvious because the coefficient of x4 has the maximum value of all coefficients.
And your objective function is convex.

댓글을 달려면 로그인하십시오.

채택된 답변

Aditya
Aditya 2023년 1월 23일
편집: Aditya 2023년 1월 23일
Hi,
I understand that you want to solve this linear programming problem.
The solution for your example is trivial, as pointed out by @Torsten in comments.
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.
Based on the documentation of linprog, I have defined the variables:
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
Aditya Mahamuni
Aditya Mahamuni 2023년 6월 23일
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."

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by