How to maximize this function: x1^2+x2^2+...+xn^2 ?

5 次查看(过去 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

回答(2 个)

Sean de Wolski
Sean de Wolski 2012-7-2
fmincon
  1 个评论
Teja Muppirala
Teja Muppirala 2012-7-3
Or how about QUADPROG?
H = identity matrix
f = zero vector
A,b = your linear constraints

请先登录,再进行评论。


Richard Brown
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
Richard Brown 2012-7-3
just reread your question - if your constraints are inequalities, quadprog is the way to go

请先登录,再进行评论。

类别

Help CenterFile 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!

Translated by