Get from Ico-github-logo

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Test functions for global optimization algorithms

  • zettl.m
  • ackley.m
  • beale.m
  • bird.m
  • booth.m
  • bukin4.m
  • bukin6.m
  • carromtable.m
  • chichinadze.m
  • crossfunc.m
  • crossintray.m
  • crosslegtable.m
  • crownedcross.m
  • cube.m
  • easom.m
  • eggholder.m
  • giunta.m
  • goldsteinprice.m
  • griewank.m
  • helicalvalley.m
  • himmelblau.m
  • wood.m
  • leon.m
  • levi13.m
  • matyas.m
  • mccormick.m
  • modschaffer1.m
  • modschaffer2.m
  • modschaffer3.m
  • modschaffer4.m
  • penholder.m
  • powell.m
  • rastrigin.m
  • rosenbrock.m
  • schweffel.m
  • sinenvsin.m
  • sixhumpcamel.m
  • styblinskitang.m
  • testtubeholder.m
  • threehumpcamel.m
  • trigonometric.m
  • holdertable.m
  • ezimage(fun)
    Please report bugs and inquiries to:
  • View all files

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

3.8 | 4 ratings Rate this file 74 Downloads (last 30 days) File Size: 44.9 KB File ID: #23147 Version: 1.4
image thumbnail

Test functions for global optimization algorithms


Rody Oldenhuis (view profile)


28 Feb 2009 (Updated )

Test functions for global optimization algorithms

| Watch this File

File Information

This is a set of test functions which can be used to test the effectiveness of global optimization algorithms. Some are rather easy to optimize (rosenbruck, leon, ...), others next to impossible (crosslegtable, bukin6, ...).
All the test-functions are taken from either [1], [2] or [3] (see below). All functions may be called in two ways:
[dims, lb, ub, sol, fval_sol] = fun
(e.g., no input arguments) This returns the number of dimensions of the function, the default lower and upper bounds, the solution vectors for all global minima and the corresponding function values. To calculate the function value for input X, use:

val = fun( [x1, x2, ..., xn] )

with the dimension [n] depending on the specific function [fun] (for most functions, n=2). Note the single vector argument--this is done in order to easily insert the function into a global optimizer that inserts a [N x n] matrix of trial vectors in these functions.

I also included a function to display most of the functions. This is called EZIMAGE, and can be called with a function handle argument:

ezimage(@himmelblau) (to plot the himmelblau function)
ezimage(@sinenvsin) (see screenshot)

or just as-is:


which lists all functions and waits for user input. This is meant to get a first impression of what the challenges are the test function has to offer.

- constrained single-objective functions
- (constrained ) multi-objective functions

[1] Mishra, Sudhanshu. "Some new test functions for global optimization and performance of repulsive particle swarm method". MPRA, 23rd august 2006.

[2] Z.K. Silagadze. "Finding two-dimensional peaks". 11th mar 2004. arXiv preprint: arXiv:physics/0402085v3

[3] W. Sun, Ya-X. Yuan. "Optimization theory and Methods. Nonlinear Programming". Springer verlag, 2006. ISBN-13:978-0-387-24975-9.

If you find this work useful, please consider a donation:


This file inspired Constrained Particle Swarm Optimization.

MATLAB release MATLAB 7.9 (R2009b)
Other requirements None that I know of
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
27 Oct 2016 Jiajian Huang  
04 Oct 2016 mukund

mukund (view profile)

23 Sep 2016 maryam

maryam (view profile)

22 Mar 2012 Gilberto A. Ortiz  
11 Feb 2010 1.1

- updated all functions to automate finding its dimensions/bounds
- cleaned up EZIMAGE() , and made it suitable for future extentions

14 Feb 2014 1.2

- Corrected bug in leon function (square -> cube)
- Contact info updated

18 Aug 2015 1.3

[linked to Github]

08 Sep 2016 1.4

Fixed all bugs found by Jeffrey Larson (thanks!)

Contact us