How do I normalize inequality constraints for fmincon?

7 Ansichten (letzte 30 Tage)
Fredrik
Fredrik am 21 Okt. 2016
Kommentiert: Fredrik am 31 Okt. 2016
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

Akzeptierte Antwort

Prashant Arora
Prashant Arora am 26 Okt. 2016
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 Kommentar
Fredrik
Fredrik am 31 Okt. 2016
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).

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by