fmincon
11 ビュー (過去 30 日間)
古いコメントを表示
If the matrix Aeq in linear constraint Aeq*x=beq have parameters,how can this kind of problem be solved using the function fmincon to obtain the optimized parameters in matrix A?
0 件のコメント
採用された回答
Titus Edelhofer
2011 年 7 月 20 日
Hi Ashley,
do I understand correctly: there are two entries in Aeq which you want to optimize as well? In this case Walter is right: you would need to put into the non linear constraint function (and add to the variables), i.e., your x will be in fact [x_1,...,x_n,A_1,A_2], where A_1 and A_2 do nothing in the objective function, but will be used in the constraint function (something like)
function [c,ceq] = mynonlin(xAll)
x = xAll(1:end-3);
Aeq = [1 xAll(end-1); 0 xAll(end)]; % example
beq = ...;
ceq = Aeq*x-beq;
Titus
2 件のコメント
Walter Roberson
2011 年 7 月 21 日
Lower bound should be passed in as the 7th parameter of fmincon, lb. Use 0 for lb(K) if the K'th parameter is to have a lower bound of 0. Use -inf as a place holder for any parameter which is not to have a lower bound.
Upper bounds go in to the 8th parameter; use +inf as a placeholder for any parameter which is not to have an upper bound.
Use [] as the vector of bounds if none of the parameters have that kind of bound.
その他の回答 (2 件)
Chirag Gupta
2011 年 7 月 18 日
I would start with typing doc fmincon for the documentation on the function.
Walter Roberson
2011 年 7 月 18 日
If you need to provide parameters instead of definite matrices for Aeq, then fmincon() is not appropriate for your purposes.
What kind of parametrization are you hoping to do?
3 件のコメント
Walter Roberson
2011 年 7 月 19 日
Is there a reason this could not be checked in the non-linear constraint function ?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!