필터 지우기
필터 지우기

Set gradual parameter constraints in fmincon

조회 수: 1 (최근 30일)
Óscar
Óscar 2016년 4월 8일
댓글: Óscar 2016년 4월 8일
Hello everyone,
Here is my problem, I want to optimize a function with several parameters. Let's say that my function is: modelFun=@(a) a(1)x^2 +a(2);, so my paramers are a(1) and a(2). Therefore, I want fmincon to give me those parameters given a noise measure. Additionally, i know the bounds of the parameters lb=[0 0]; ub=[4 2]; So far, this is easy to implement: fminxon(modelFun,seed,[],[],[],[],lb,up);. However i know one more constrain for the parameters and it's that a(1)>a(2). This is the constraint I can not implement, and i'm asking for your help to implement it if possible.
I think it can not be implemented neither with inequality constraints nor nonlinear constraints.
Do you have any idea? Thank you very much, Oscar

채택된 답변

John D'Errico
John D'Errico 2016년 4월 8일
Why cannot it be implemented? This is not even a nonlinear inequality constraint. Use the linear inequality constraints.
Is your fear that they implement the constraint with an >= instead of > ?
So then just require that
a(1) >= a(2) + delta
for some REASONABLY small value of delta. I would suggest using a larger value of delta than you have for TolCon, so that any constraint violation will not be a problem.
  댓글 수: 1
Óscar
Óscar 2016년 4월 8일
Thanks John, right after you wrote this comment i realize that i can use A and b in the simples way A=[-1 1]; b=[0]; and that is equivalent to a(1)<a(2). So i dont need that delta.

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

추가 답변 (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