How I can solve linear programming with multiple quadratic and linear constraints?

Hello, I have a programming problem, with linear objective function and some quadratic and linear constraints. the way to solve a problem with quadratic constraints is to form it in matrix form:
X'.Q.X = b
But I can not form multiple quadratic constrains in this form and I think it can be used for just one constraint? how can I solve such a problem?

 채택된 답변

Bruno Luong
Bruno Luong 2020년 9월 6일
Use FMINCON

댓글 수: 3

Thank you I will check.
There is not any way to use that form? I am using this toolbox:
And here "quadratic constraints" is written several times, so it should be possible, and I prefer to do that because of some considerations.
I'm not aware any MATLAB stock optimization function that can deal specifically with quadratic constraints.
Such constraint is considered like generic non-linear constraints by MATLAB (nonlcon argument of FMINCON), and user must provide the code . You just need to compute a bunch of
ceqi = x'*Qi*x - bi
and put them in the vector.
This is quite straighforward formatting if you have Qi and bi available in some form, for example cell array for Qi, and standard array for bi:
function [c,ceq] = mycon(x, ...)
% Bring in somehow
% Qc = { Q1, Q2, ... Qn }
% b = [b1, b2, ... bn]
% x is your decision variable
ceq = arrayfun(@(Qci,bi) x'*Qci{1}*x - bi, Qc, b);
...
end
I am going to use fmincon for my problem. thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

질문:

2020년 9월 6일

댓글:

2020년 9월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by