top of page

BIRD FUNCTION

Updated: Jul 18, 2021







Mathematical Definition



Input Domain


It is evaluated on: x ∈ [-2π, 2π] and y ∈ [-2π,2π]


Global Minima


The function has two global minima at f(x*)= −106.764537 located at x*= (4.70104 ,3.15294) and x*= (−1.58214 ,−3.13024)


Description and Features


  • The function is not convex.

  • The function is define on 2D space.

  • The function is non-separable.

  • The function is differentiable.


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 help.indusmic@gmail.com
% Author: Rajpriya Tiwari

%matplotlib inline
import math
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

%matplotlib notebook
plt.rcParams['figure.figsize'] = (6,4)
plt.rcParams['figure.dpi']=150
fig=plt.figure()
ax=fig.add_subplot(111,projection='3d')

def z_function(x,y):
 return np.sin(x)*(np.exp(1-np.cos(y))**2)+np.cos(y)*(np.exp(1-np.sin(x))**2)+(x-y)**2

x= np.linspace(-2*math.pi,2*math.pi,100)
y= np.linspace(-2*math.pi,2*math.pi,100)
X,Y= np.meshgrid(x,y)
Z= z_function(X,Y)
ax.set_xlabel("(x-axis)")
ax.set_ylabel("(y-axis)")
ax.set_zlabel("(z-axis)")
ax.plot_surface(X,Y,Z,cmap='plasma')
ax.contour3D(X,Y,Z)
def plotter(E,A):
 ax.view_init(elev=E,azim=A)
 plt.title("Bird Function")
 plt.show()
 plt.contour(X,Y,Z)
#plotter(45,45)
 
from ipywidgets import interactive
iplot= interactive(plotter,E=(-90,90,5),A=(-90,90,5))
iplot

References:


[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.




#optimization #benchmarkfunction

582 views0 comments
bottom of page