How to maximize this function: x1^2+x2^2+...+xn^2 ?
4 ビュー (過去 30 日間)
古いコメントを表示
Hello
How can I maximize the function x1^2+x2^2+...+xn^2
under some constraints which are LINEAR?
Thank you very much in advance!
Alex
0 件のコメント
回答 (2 件)
Sean de Wolski
2012 年 7 月 2 日
fmincon
1 件のコメント
Teja Muppirala
2012 年 7 月 3 日
Or how about QUADPROG?
H = identity matrix
f = zero vector
A,b = your linear constraints
Richard Brown
2012 年 7 月 3 日
編集済み: Richard Brown
2012 年 7 月 3 日
I assume you mean minimise rather than maximise, because unless you have n independent constraints, your problem is unbounded.
In this case, assuming your constraints are Ax = b, just use the QR factorisation
[Q, R] = qr(A', 0);
x = Q * (R' \ b);
1 件のコメント
Richard Brown
2012 年 7 月 3 日
just reread your question - if your constraints are inequalities, quadprog is the way to go
参考
カテゴリ
Help Center および File Exchange で Quadratic Programming and Cone Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!