Constrained mixed integer optimization: genetic algorithm used with SimEvents. How can I set a simulation output as a constraint? - matlab

I'm using the genetic algorithm from the MATLAB Global Optimization Toolbox with SimEvents, in order to implement a mixed integer optimization making use of simulation outputs to evaluate the fitness function. My model is pretty similar to the one described in this video from MathWorks website:
http://www.mathworks.it/videos/optimizing-manufacturing-production-processes-68961.html
Reading the documentation, I found that ga can solve constrained problems only if such constraints are linear inequalities. The constraints are supposed to be written as functions of the problem's variables, that in this case are the number of resources used during the simulation.
I would like, instead, to set a constraint that takes into account another simulation output (e.g. the drain utilization), i.e. minimize
objfun = backlog*10000 + cost
where backlog is a simulation output (obtained using simOut.get), considering the following constraint:
drain_utilization > 0.7
where drain_ utilization is another simulation output (again, obtained using simOut.get).
Is it possible or this feature is not supported by the Global Optimization Toolbox?
Thank you in advance and forgive me for any improper term, but I'm new to the Global Optimization Toolbox.

Related

Interior-point linear programing solver in MATLAB, with target barrier parameter option

Is there any linear programing solver, written for MATLAB, that (a) solves with the primal-dual interior point method, (b) the user has the options to set the target barrier parameter (he lowest value of barrier parameter for which the KKT system is solved)?
I currently use IPOPT, which has the target barrier parameter options.
However, at convergence, the product of dual*slack seems to only be approximately satisfied (with an error of say (+-)1e-7 for a target parameter of 1e-5).
I have tried to play around with the tolerances, but to no avail.
For MATLAB use, I recommend using CVX, which includes Gurobi, MOSEK, GLPK, and SDPT3. All of those can solve the linear program very efficiently.
CVX is very easy to use in MATLAB.

Optimization of multivariable function In Matlab

I have a function fun(x,y,z), such that say, x=1:10, y=50:60, z=100:105. Which optimization method (and how) I can use to get the minimum of this function, for example, where (x,y,z)=(3,52,101). I am working in Matlab.
Thank you for any help
Algorithms
There are many many algorithms out there that you can use for direct search optimization such as Nelder-Mead, Particle Swarm, Genetic Algorithm, etc.
I believe Nelder-Mead is a simplex optimization method which is used by fminsearch function in MATLAB.
Also, there is Genetic Algorithm which comes with MATLAB Global Optimization toolbox. You may want to give that a try as well.
Particle Swarm Optimization (PSO) is another direct search method that you can use. However, there is no official toolbox for Particle Swarm method built by Mathworks. The good news is there is quite a few PSO toolbox developed by other people. I personally have used this one and am quite happy with the performance. Its syntax is similar to Genetic Algorithm functions that come with Global Optimization Toolbox.
Discrete Optimization
Regarding your question that you are looking for a set of integer values namely x,y, and z corresponding to the minimum objective function value, I would add a part at the beginning of the objective function that rounds the variables to the closest integers and then feeds them to your main function fun(x,y,z). This way you would discretize your function space.
I hope my answer helps.

Patternsearch discrete variables

I want to optimize a multi-variable function with the patternsearch function in MATLAB. The function requires a lower and upper boundary and looks within the boundaries in a continuous domain.
I however have a discrete set of values in an excel file and would like the algorithm to search within this discrete domain instead of in the continuous domain.
Is this possible with patternsearch?
Maybe I don't understand correctly your question but if you have a (discret and finite) set of values, why don't you compute the function's value at these points and return the minium?
In short, no. That is not what patternsearch is intended for. Optimization techniques for discrete and continuous search spaces are quite expectedly different.
If you're looking for an approximate answer however, it is possible to use spline, polyfit, etc. to arrive at an approximate continuous function for your data and then apply patternsearch on it.
If you provide greater detail about your problem, I or someone else may be able to suggest a more suitable way of working with your data.
The best optimization tool for this is the Genetic Algorithm. This optimization tool comes with Matlab's global optimization toolbox and allows for optimization of both continuous and discrete variables at the same time.
In the genetic algorithm variables that are integers have to be declared as such. Non-declared variables are continuous by default.
Check the Global Optimization Toolbox guide for information on how it works: http://it.mathworks.com/help/pdf_doc/gads/gads_tb.pdf.

Sensitivity analysis in LP solvers from MATLAB

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.

Deterministic Annealing Code

I would like to find an open source example of a code for deterministic annealing. It can be in almost any language: C, C++, MatLab/Octave, Fortran. I have already found a MatLab code for simulated annealing, so MatLab would be best. Here is a paper that describes the algorithm.
Deterministic annealing is an
optimization technique that attempts
to find a global minimum of a cost
function. The technique is designed to
be able to explore a large portion of
the cost surface using randomness,
while still performing optimization
using local information. The procedure
starts with changing the cost function
to introduce a notion of randomness,
allowing a large area to be explored.
Each iteration the amount of
randomness (measured by Shannon
Entropy [2]) is constrained, and a
local optimization of performed.
Gradually, the amount of imposed
randomness is lowered so that upon
termination the algorithm optimizes
over the original cost function,
yielding a solution to the original
problem
The figures in the paper you link to look like Matlab figures. I suggest you contact the authors whether they're willing to share their code with you.