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 Center および File ExchangeGet 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