top of page
Music Apps


Updated: Jul 14, 2021

Mathematical Definition

Input Domain

The function is defined on input domain i.e. x ∈ [−32, 32] and y ∈ [−32, 32].

Global Minima

The function has two global minima at f(z) = −195.629028238419 located at z =

(±0.682584587365898, -0.36075325513719).


The function is convex.

The function is differentiable.

The function is non-separable.

The function is defined on 2-dimensional space.

Python Implementation

% Please forward any comments or bug reports in chat
Copyright 2021. INDUSMIC PRIVATE LIMITED.THERE IS NO WARRANTY, EXPRESS OR IMPLIED. WE DO NOT ASSUME ANY LIABILITY FOR THE USE OF THIS PROGRAM. If software is modified to produce derivative works, such modified software should be clearly marked. Additionally, user can redistribute it and/or modify it under the terms of the GNU General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. See the GNU General Public License for more details.
% for any support connect with us on
% Author: Yamini Jain

from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm

def f(x,y):
    return -200*np.exp(-0.2*np.sqrt(x**2 + y**2)) + 

X = np.linspace(-32,32)
Y = np.linspace(-32,32)
x,y = np.meshgrid(X,Y)
F = f(x,y)
fig = plt.figure(figsize=(9,9))
ax = plt.axes(projection='3d')
ax.contour3D(x,y, F,450, cmap=cm.flag_r)
ax.set_title('Ackley N.3 Function')


[1] Jamil, Momin, and Xin-She Yang. "A literature survey of benchmark functions for global optimization problems." International Journal of Mathematical Modelling and Numerical Optimization 4.2 (2013): 150-194.

430 views1 comment

1 Comment

karun dukka
karun dukka
Jun 01, 2022

Please provide how to print the minimum values of x and y

bottom of page