File Exchange

image thumbnail

Simulated Annealing for Constrained Optimization

version (5.03 KB) by Xin-She Yang
Continuous constrained optimization using simulated annealing.


Updated 07 Feb 2011

View License

Two programs are attached: sa_demo demonstrates how the simualted annealing works for simple functions, while sa_mincon solves a welded beam design problem using simulated annealing, which can easily be used to solve other constrained optimization problems in engineering design.

Cite As

Xin-She Yang (2020). Simulated Annealing for Constrained Optimization (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Adisorn Owatsiriwong

The code works as expected. Thank you.

Marcelo Fernandes

Donald Hume

The main loop checks the following:

((T > T_min) && (j <= max_rej) && E_new>F_min)

but as far as I can see j is not incremented in any place and is only set back to zero if a solution is accepted. Any easy fix, but something to note if you plan to use this code.


a nice one


Please use the latest version as the update (a more robust version is provided)

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux