How can i use different solvers like ga, patternsearch, particle swarm etc in problem based Mixed integer Linear Programming
Ältere Kommentare anzeigen
How can i use different solvers like ga, patternsearch, particle swarm etc in problem based Mixed integer Linear Programming.
I am using MILP and if i try different solvers for example, ga in optimoptions, it shows that the optimization problem automatically uses linprog instead of the solver i specified.Kindly advise .
When i used patternsearch, i got a warning like below:
You have passed PATTERNSEARCH options to LINPROG. LINPROG will use the common options and ignore the PATTERNSEARCH options that do not apply.
To avoid this warning, convert the PATTERNSEARCH options using OPTIMOPTIONS.
showproblem(prob)
options = optimoptions('ga',prob.optimoptions,'Display','iter');
[values,~,exitflag] = solve(prob,'Options',options);
fval = evaluate(prob.Objective,values);
Antworten (1)
MATLAB chooses the solver that is most appropriate (usually means: fastest) for your problem.
Why solving a linear optimization problem with the slowest nonlinear solver ?
But you can choose a different solver if you like:
options = optimoptions("ga",prob.optimoptions,"Display","iter");
[values,fval,exitflag] = solve(prob,"Solver","ga","Options",options)
9 Kommentare
NN
am 30 Okt. 2022
Torsten
am 30 Okt. 2022
is it because i dont have global optimization tool?
Of course. "ga" is part of the Global Optimization Toolbox.
NN
am 30 Okt. 2022
What do you get when you type
license checkout Global_Optimization_Toolbox
?
Can you run a test example for ga, e.g.
A = [-1 -1];
b = -1;
Aeq = [-1 1];
beq = 5;
rng default % For reproducibility
fun = @ps_example;
x = ga(fun,2,A,b,Aeq,beq)
NN
am 31 Okt. 2022
NN
am 31 Okt. 2022
NN
am 31 Okt. 2022
Torsten
am 31 Okt. 2022
Seems the Global Optimization Toolbox is installed, but not licenced.
Although I don't understand that the ga testcase seems to work.
Contact Mathworks support for help.
NN
am 31 Okt. 2022
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!