Defining constraints in the Quadratic Programming

2 ビュー (過去 30 日間)
Philipp Siebel
Philipp Siebel 2020 年 1 月 14 日
回答済み: Matt J 2020 年 1 月 14 日
Hi,
I have a question to the quadprog command of matlab. Is it possible to declare single constraints?? For example I have x1,x2,x3 and I know the value of the x1 and x3. Now, I need the optimal value for the x2.
Thanks ahead,
Philipp

回答 (2 件)

Alan Weiss
Alan Weiss 2020 年 1 月 14 日
You can try setting equal upper and lower bounds for those variables. For example,
lb = [3, -inf,5];
ub = [3,inf,5];
sets x(1) = 3 and x(3) = 5, while leaving x(2) unconstrained.
Of course, it might be even better to just reformulate your problem to have fewer variables, but I know that is sometimes difficult.
Alan Weiss
MATLAB mathematical toolbox documentation

Matt J
Matt J 2020 年 1 月 14 日
If you have a quadratic function of only 1 unknown variable, it should be possible to find the minimum analytically - no iterative optimization required.

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by