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?

 Accepted Answer

Use FMINCON

3 Comments

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.

Sign in to comment.

More Answers (0)

Categories

Asked:

on 6 Sep 2020

Commented:

on 7 Sep 2020

Community Treasure Hunt

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

Start Hunting!