How to use minlp with non analytic optimization function
3 views (last 30 days)
Show older comments
Im trying to formulate an optimization problem that minimizes the total passengers time of passengers on buses.
My objective function Z=f(x) in non linear and not analytical, in such that it changes every loop.
I have 72 decision variables (x), 48 are continous and 24 are binary.
I think that minlp is the best method to use here, but I cannot set the optimization function.
Opt = opti('fun',function2optimize,'ineq',A,b,'bounds',min_b_val,max_b_val,...
'xtype',xtype);
My function2optimize contains a lot of calculations and in the final part of its there is the formulation of Z.
My question is how to set the function2optimize? I have wrote:
function2optimize = @ (Z) but have the error:
??? Error: File: function2Optimize.m Line: 1 Column: 27
Expression or statement is incomplete or incorrect.
Thanks a lot,
Hend
0 Comments
Answers (3)
Alan Weiss
on 30 Apr 2015
I am not sure what you are asking. The only MATLAB solver I know for MINLP problems is ga from Global Optimization Toolbox. Use the Mixed Integer Optimization documentation to guide you in setting up the problem.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
0 Comments
Alan Weiss
on 26 May 2015
You did not state how you included the constraints such as
x(10) <= x(19);
I do not understand what you mean when you say "the matlab did not consider the constraints." I can assure you that, if you formulate your problem properly, solvers generally return feasible solutions, and warn you if they do not find feasible points.
For more help you will have to be more explicit in describing exactly how you set up your constraints.
Alan Weiss
MATLAB mathematical toolbox documentation
6 Comments
Alan Weiss
on 5 Jun 2015
Of course ga checks other values of the variables. That is what it does to optimize.
But you cannot rely on ga to find the global optimum. The algorithm is stochastic, and cannot guarantee that it finds anything.
If you really want to stick with ga, then I suggest again that you give a much larger initial population, and run it multiple times.
But you would probably do yourself a favor to look carefully at the travelling salesman example I pointed you to earlier, and see whether you can reformulate your problem to be MILP instead of MINLP.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!