I'm using the CVX modeling system in MATLAB. I would like to solve a series of problems where the structure/format of the optimization problem remains the same, but the value of specific parameters changes.
This answer states that CVXPY (for the Python programming language) allows you to specify parameters for this purpose. Using parameters can make solving times "substantially faster" than repeatedly solving new problems from scratch. More information is in the CVXPY Python documentation.
I can't find any similar functionality in the CVX MATLAB documentation. Does CVX have parameters similar to CVXPY?
Related
Is it possible to extract the ODE System from OpenModelica?
Using the nice GUI of OpenModelica to generate an ODE System which can be solved for further processings for example in Python would be really nice!
I know about the FMI interface, which we use at the moment for our simulations, but due to many bugs and problems which occur especially by the usage of PyFMI, just using ODE system might give us more control and stability in our further research.
I am a (almost) beginner with CPLEX and optimization. I am trying to set up an optimization problem in Matlab using the newly added feature of CPLEX (12.7.1), which enables the definition of piecewise linear (PWL) constraints.
However, it is not clear to me how to do it in Matlab. The documentation on this is quite sparse. IBM has only one example (transport.m) , which defines the piecewise linear constraint as a combination of linear equalities and SOSs of type 2. However, this is not really using the newly added feature to directly specify a piecewise linear function. And the procedure in matlab can become quite cumbersome as the number of variables and piecewise constraints increase.
Do you know if there is a way to express it differently, in Matlab?
Thank you
The new piecewise linear constraint support you mention was announced in the release notes here (In version 12.7.0). The MATLAB API was not included in that list. If having the functionality directly in MATLAB is important to you, you could add a request for it in the IBM RFE Community. In the meantime, you'll need to use one of the other APIs (C, C++, Java, .NET, Python).
You could call another executable from within MATLAB using the system command. On the other hand, besides requiring a bit more work, your current technique should be fine.
I am very new to MatLab. Thus I am sorry if this is very basic.
I use a function called fmincon to do find a solution for minimizing a function. Why do I get different solutions for running fmincon?
I would like to know a satisfying or convincing mathematical or programming explanation for having different solutions using fmincon.
Check these limitations in the MATLAB documentation.
fmincon is a gradient-based method that is designed to work on problems where the objective and constraint functions are both continuous and have continuous first derivatives.
The function is very delicate and it is best if you can avoid it. It only works neatly on problems that are neatly defined to begin with. Any deviation can lead to local instead of global minima, and these can depend (among other things) on your initial solution estimate or starting point.
As fmincon is sensitive to initial point, If you set different start point for the fmincon, you might get a different solution in each apply. You can find one of the algorithms of fmincon here.
I am using CPLEX for MATLAB toolbox wherein I formulate my MILP as a huge matrix and use the function cplexmilp to call the solver. Since the model I am solving is really huge, I intend to set the option of using multiple processors to speed up the solving of the MILP. I went through the manual but I could not find any specific solution for my case. I'd be grateful if anyone could help me find a solution to this issue.
CPLEX Toolbox Function
Thanks Everyone
As far as I understand, CPLEX, LP_solve and GLPK, among other LP solvers, offer sensitivity analysis.
I have the above three solvers installed on my machine, along with these two MATLAB wrappers:
CPLEX for MATLAB API (for CPLEX)
YALMIP (a general MATLAB wrapper for several solvers)
I looked in the documentation of these two wrappers but could not find a way of running sensitivity analysis from them. Do they support it? If not, are there any LP solvers that offer MATLAB support for their sensitivity analysis?
What do I mean by sensitivity analysis?
I mean sensitivity analysis with respect to the cost function and constraints. Conceptually speaking, sensitivity analysis tries to address the following question:
How would the solution change if some aspect of the problem is
changed?
For example:
What is the range of values the coefficient for the variable j can
take without affecting the optimality of the solution?
More specifically, here is a list of the Java, C++ and C APIs that CPLEX provides for sensitivity analysis.
Here is information about the sensitivity analysis provided by LP_solve. You can find the help text for the previous link within LP_solve's main reference guide by searching for "sensitivity" here.