Quadratic Objective with two Quadratic Constraints
Show older comments
Hii,
My programming knowledge is limited. I would like to solve a quadratic objective function with two quadratic constraints. I read and understood the concepts and examples given in https://in.mathworks.com/help/optim/ug/linear-or-quadratic-problem-with-quadratic-constraints.html?s_tid=mwa_osa_a, but I am having difficulty in implementing this for my problem.
Matrices A, B and C be
symmetric positive semi-definite matrices. How to find the
subject to the constraints
and
? The documentation deals with a single quadratic constraint only. But my problem has two quadratic constraints. How can I code the second constraint as per the documentation in the link above?
subject to the constraints Thank You..
Answers (1)
What about
function [y,yeq,grady,gradyeq] = quadconstr(x,B,C)
y = [];
yeq(1) = x.'*B*x - 1;
yeq(2) = x.'*C*x - 1;
if nargout > 2
grady = [];
gradyeq(:,1) = 2*B*x; % Assumes B is symmetric, otherwise (B+B.')*x
gradyeq(:,2) = 2*C*x; % Assumes C is symmetric, otherwise (C+C.')*x
end
end
10 Comments
Krishnendu K
on 8 Nov 2023
Torsten
on 8 Nov 2023
My guess is
function hess = quadhess(x,lambda,A,B,C)
hess = -2*A + lambda.eqnonlin(1)*2*B + lambda.eqnonlin(2)*2*C;
end
Krishnendu K
on 8 Nov 2023
I hope you defined
function [y,grady] = quadobj(x,A)
y = -x.'*A*x ;
if nargout > 1
grady = -2*A*x ;
end
end
If you want us to check for possible problems, we need A, B and C.
Torsten
on 9 Nov 2023
Matrices A and C have complex entries. Something like max(x.'*A*x) does not exist for complex numbers.
Krishnendu K
on 9 Nov 2023
Edited: Krishnendu K
on 9 Nov 2023
Krishnendu K
on 9 Nov 2023
Torsten
on 9 Nov 2023
What I meant is I tried to solve it by using eigen value decomposition.
You formulated an optimization problem. Obviously, the problem is not well-posed because the objective function is not real-valued.
What is the underlying problem that you tried to solved via this optimization formulation ? (You again talk of "I tried to solve it", but you don't explain what "it" is).
Categories
Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!