필터 지우기
필터 지우기

Defining different bounds to each variable in fmincon

조회 수: 15 (최근 30일)
Gábor Dupák
Gábor Dupák 2021년 4월 18일
댓글: Gábor Dupák 2021년 4월 18일
Hi!
I have a nonlinear optimalization problem with 2 equality constraints and 3 variables (x1, x2, x3):
x1+0.13*x2*x3=50000;
0.7*x2-0.25x2*x3=60000;
where x1,x2 >=0 and 0>=x3>=1 are the uppern and lower bounds.
My objective function is MIN f(x)=0.4*x1+0.6*x2.
My question is how to define these bounds if i use fmincon?

채택된 답변

Clayton Gotberg
Clayton Gotberg 2021년 4월 18일
The documentation for fmincon has the answer: you are allowed to pass upper and lower bounds as vectors.
For example,
lower_bound = [0 0 0];
upper_bound = [1 2 1];
Defines the boundaries for three inputs: the first between 0 and 1, the second between 0 and 2, and the third between 0 and 1. I believe that you can fill in Inf or -Inf for a boundary as well.
I would also check on the boundaries you quote in your post. 0>=x3>=1 is impossible, as it says that x3 must be less than or equal to 0 but also greater than or equal to 1.
  댓글 수: 1
Gábor Dupák
Gábor Dupák 2021년 4월 18일
Thanks for you help! Yes, I miswrote the x3 bounds, of course I wanted as: 0<=x3<=1.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by