Handling Product of Continuous Decision Variables in MATLAB Optimization Toolbox with Gurobi
Answeredam using Gurobi through MATLAB’s Optimization Toolbox to solve a MILP problem. However, I am facing an issue with my objective function, which includes the product of two continuous decision variables, both of which vary over time.
Since this introduces a non linearity, I would like to ask if there is a way to handle this type of nonlinearity within Gurobi while continuing to use MATLAB. Are there any recommended reformulation techniques, or does Gurobi support any specific approach to deal with such constraints?
-
Hi Fabiana,
my objective function, which includes the product of two continuous decision variables
Our example qp.m may help, as the objective has several product terms of continuous variables:
https://docs.gurobi.com/projects/examples/en/current/examples/matlab/qp.html#subsubsectionqp-mIf you are facing issues with products of continuous variables then this sounds like it could be a restriction by the Optimization Toolbox.
- Riley
0 -
Thank you Riley.
If you are facing issues with products of continuous variables then this sounds like it could be a restriction by the Optimization Toolbox.
What is the alternative?
0 -
Hi Fabiana,
I'd first check that the Optimization Toolbox is up to date. If it is then there are three options:
i) use Gurobi's matlab API, or
ii) use a different 3rd party Matlab tools such as YALMIP, or
iii) use a different language- Riley
0 -
Hi Riley,
I think that the Optimization Toolbox is updated.
use a different language
Are you saying me that If I use a different language, I could manage the product?
0 -
Hi Fabiana,
Yes, if you take a look at the qp example you can see all the different API languages we support. Python is the most popular choice for Gurobi users by a very long amount. Matlab is not used much at all.
These examples will work straight out of the box. You will note there is an example for matlab - this is our matlab API and does not use the Optimization Toolbox.
- Riley
0
Please sign in to leave a comment.
Comments
5 comments