How do I normalize inequality constraints for fmincon?
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi!
I use fmincon with my fitting parameters normalized. It looks something like this:
Parafi = Pnorm.*fmincon('fe_multiexp8c_test1',Pin./Pnorm,sum1,Vtot,[],[],
lowbounds,upperbounds,
[],OPTIONS,Xin/Xnorm,Y0in/Y0norm,Yin/Ynorm,Pnorm,Xnorm,
Y0norm,Ynorm,D,Dnorm,
N,V0,weight_I0,weight_I);
Pin is the vector with my fitting parameters and I normalize by setting Pnorm = Pin. In the fitting function I scale back again.
I have one question: It seems that I get best results when I also scale the upper- and lower bounds by Pnorm. But how do I scale my inequality constraint? The constraint is that the sum ("sum1") of all my fitting parameters <= a constant ("Vtot")
Hope you can help! Regards Fredrik
댓글 수: 0
채택된 답변
Prashant Arora
2016년 10월 26일
From your description, I understand that you are trying to represent the sum of variables as a constraint of the form Ax < b, where variables are normalized using ‘Pnorm’.
Let’s say the fitting Parameters ‘Parafi’ are to be calculated. You are defining the “fmincon” fitting parameters (let’s say ‘x’) as ‘Parafi./Pnorm’.
The “fmincon” function now looks for constraints as a function of ‘x’. For example, if upperbound of ‘Parafi’ is ‘PUpper’, the upperbounds for ‘x’ should be specified as ‘PUpper./Pnorm’. For your specific question, the constraint is sum(Parafi) <= Vtot. As Parafi = Pnorm.*x, sum of ‘Parafi’ can be defined in terms of x as:
Pnorm’*x
Where 'Pnorm' and 'Pin' are column vectors or scalars, which becomes the form A.x. Also, Vtot is a scalar and therefore, you can represent the constraint by setting the fmincon argument A = Pnorm’ (transpose of Pnorm,) and b = Vtot.
I hope this helps!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!