How to use minlp with non analytic optimization function
古いコメントを表示
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
回答 (3 件)
Alan Weiss
2015 年 4 月 30 日
0 投票
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
hend ma
2015 年 5 月 26 日
編集済み: Walter Roberson
2015 年 6 月 5 日
0 投票
Alan Weiss
2015 年 5 月 26 日
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 件のコメント
Alan Weiss
2015 年 5 月 29 日
There are many reasons why ga might not have converged to a satisfactory answer.
- You have a lot of variables. ga might need a larger population size.
- ga is random. If you run it multiple times does it come up with different answers?
- Did you try seeding ga with a partial initial population? If not, please try doing so with your better final point. If so, did ga improve the answer, or return a poorer solution?
Finally, I suspect that you could reformulate your problem somewhat along the lines of the travelling salesman example to convert it to a MILP. Then you would be able to use the faster and more reliable intlinprog solver instead of ga.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
hend ma
2015 年 6 月 3 日
Alan Weiss
2015 年 6 月 3 日
Did you try putting in a partial population with the better solution as an initial point? If so, what happened?
I suspect that your "better" point does not satisfy your linear inequalities. You can check by evaluating
A*x - b
where x is your better point, and checking whether the maximum entry is positive.
Alan Weiss
MATLAB mathematical toolbox documentation
hend ma
2015 年 6 月 5 日
Alan Weiss
2015 年 6 月 5 日
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
カテゴリ
ヘルプ センター および File Exchange で Get Started with Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!