fmincon or linprog use in minimization?

조회 수: 1 (최근 30일)
bus14
bus14 2019년 4월 17일
편집: Torsten 2019년 4월 17일
Hi community,
As I am busy trying to optimize the function I encouter quite some difficulties. As I am not certain which optimization function to use( fmincon or linprog)? The letters are vectors and A is a m*n matrix. I am trying to optimize the values of Z & Y. In which antother problem arises as well, since z and y have different dimensions. Z is a 1x1 vector ( a number) and Y is a 2x1 vector. Does someone has a tip on which function to use and how to deal with the dimensional problems of the decision variables? Thankyou
min (l-q).'*z-s.'*y
s.t. y=x-A.'*z
0<z<d , y>0
  댓글 수: 1
Torsten
Torsten 2019년 4월 17일
편집: Torsten 2019년 4월 17일
x, A, l, q and s are given ?

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

채택된 답변

Torsten
Torsten 2019년 4월 17일
편집: Torsten 2019년 4월 17일
l = 0.25;
q = 2;
s = 1;
A = 1;
x = 20;
d = 15;
f= [-s, l-q];
Aeq = [1, A];
beq = x;
lb = [0, 0];
ub = [Inf, d];
sol = linprog(f,[],[],Aeq,beq,lb,ub);
y = sol(1)
z = sol(2)
  댓글 수: 2
bus14
bus14 2019년 4월 17일
thank you a lot, one question that remains is how you came to the formulation of Aeq[1, A] and beq=x as for me it is vague how Aeq and beq are constructed from the given constraint.
Torsten
Torsten 2019년 4월 17일
편집: Torsten 2019년 4월 17일
1*y + A*z = x <-> [1, A]*[y;z] = x <-> Aeq*[y;z] = beq

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

추가 답변 (2개)

bus14
bus14 2019년 4월 17일
for the first instance my goal is to let the optimization problem work with the following values for x,A,l,q
L=[0.25]
Q=[2 ]
S=[1 ]
A= [1]
X= [20]

bus14
bus14 2019년 4월 17일
thank you a lot, so linprog is indeed the one to use as my objective function is a linear function.

카테고리

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