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

5 visualizaciones (últimos 30 días)
Alex
Alex el 2 de Jul. de 2012
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

Respuestas (2)

Sean de Wolski
Sean de Wolski el 2 de Jul. de 2012
fmincon
  1 comentario
Teja Muppirala
Teja Muppirala el 3 de Jul. de 2012
Or how about QUADPROG?
H = identity matrix
f = zero vector
A,b = your linear constraints

Iniciar sesión para comentar.


Richard Brown
Richard Brown el 3 de Jul. de 2012
Editada: Richard Brown el 3 de Jul. de 2012
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 comentario
Richard Brown
Richard Brown el 3 de Jul. de 2012
just reread your question - if your constraints are inequalities, quadprog is the way to go

Iniciar sesión para comentar.

Categorías

Más información sobre Quadratic Programming and Cone Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by