Query about simulanneal.m Function (Simulated Annealing Optimization).
10 views (last 30 days)
Show older comments
I have minimization problem which got a nonlinear objective function, a couple of equality constraints, and dozens of nonlinear constraints. There is a very simple given in MATLAB which does not contian any constraints other than objective function and starting point.
In this example inputs are only two things a function and strating points.
[x,fval,exitFlag,output] = simulannealbnd(ObjectiveFunction,x0)
Whereas I want to use following kind of function
function [x, fval, exitflag, output] = simulanneal(FUN, x0, Aineq, bineq, Aeq, beq, lb, ub, options)
which is given in the MATLAB documentations with the name of "simulanneal.m" file. Since, I want to give Aineq, bineq, lb, ub as well along with FUN and x0.
How can I implement such kind problem in MATLAB Simulated Annealig Optimization Toolbox?
Thanks
0 Comments
Answers (4)
Alan Weiss
on 10 Jun 2020
Global Optimization Toolbox provides the simulannealbnd funciton, which does not provide linear constraints, though it does allow bounds.
My question would be, why do you need simulated annealing? If what you are trying to do is optimize something, then I suggest that you follow the guidance in Table for Choosing a Solver, which does not suggest using simulannealbnd.
Alan Weiss
MATLAB mathematical toolbox documentation
5 Comments
Alan Weiss
on 12 Jun 2020
surrogateopt ganed nonlinear constraint handling in R2020a. If you don't have that version, then look in your version of the documentation for an example tiitled Surrogate Optimization with Nonlinear Constraint.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Muhammad Umair Javed
on 23 Jun 2020
2 Comments
Alan Weiss
on 23 Jun 2020
Perhaps you could try to fit your problem into the MILP framework. Your objective is linear and the constraints I see are bounds, though I do not see the code for your unitdisk constraint function. Is it possible that you could use a set of linear inequalities for the nonlinear inequality constraint, along the lines of this example? Then you could use intlinprog to solver your problem.
To answer your question though, I don't know where the 'trialData' variable might be referenced. To find out for sure, you could use the debugger.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Muhammad Umair Javed
on 23 Jun 2020
3 Comments
tareq waheshy
on 4 Jan 2023
The working principle of GA is binary coding by using MATLAB code
Single variable function example
Maximize y = sqrt𝑥 subject to
Subject to 1.0 𝑥 ≤ 16.0
We know that the maximum is at y = 4.0 when x = 16
tareq waheshy
on 4 Jan 2023
The working principle of GA is binary coding by using MATLAB code
Single variable function example
Maximize y = sqrt𝑥 subject to
Subject to 1.0 𝑥 ≤ 16.0
We know that the maximum is at y = 4.0 when x = 16
1 Comment
Steven Lord
on 4 Jan 2023
Since this does not appear to be an answer to the original question, but a new question, please ask it in its own thread using the Ask button at the top of this page.
See Also
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


