How do I normalize inequality constraints for fmincon?

조회 수: 7 (최근 30일)
Fredrik
Fredrik 2016년 10월 21일
댓글: Fredrik 2016년 10월 31일
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

채택된 답변

Prashant Arora
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!
  댓글 수: 1
Fredrik
Fredrik 2016년 10월 31일
Yes, this was exactly the help I needed! Very good explanation, thank you! But Matlab want A in the form of a row vector in this case so it works by setting A=Pnorm (without the transpose).

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

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by