Skip to content

Commit

Permalink
add global-min to math. test-funcions in latex
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Dec 30, 2023
1 parent 912bad1 commit e7c1838
Show file tree
Hide file tree
Showing 23 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/ackley_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class AckleyFunction(MathematicalFunction):
_name_ = "ackley_function"
__name__ = "AckleyFunction"

dimensions = "2"
formula = r"f(x, y) = -20 \exp\left[-0.2\sqrt{0.5(x^2+y^2)} \right] -\exp\left[ 0.5(\cos2\pi x + cos2\pi y) \right] + e + 20"
global_minimum = r"f(\vec{x}=0) = 0"

def __init__(
self, A=20, angle=2 * np.pi, metric="score", input_type="dictionary", sleep=0
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/beale_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ class BealeFunction(MathematicalFunction):
_name_ = "beale_function"
__name__ = "BealeFunction"

dimensions = "2"
formula = (
r"""f(x,y) = (1.5 - x + xy)^2 + (2.25 - x + xy^2)^2 + (2.625 - x + xy^3)^2"""
)
global_minimum = r"""f(3, 0.5) = 0"""

def __init__(
self, A=1.5, B=2.25, C=2.652, metric="score", input_type="dictionary", sleep=0
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/booth_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class BoothFunction(MathematicalFunction):
_name_ = "booth_function"
__name__ = "BoothFunction"

dimensions = "2"
formula = r"""f(x,y) = (x + 2y - 7)^2 + (2x + y - 5)^2"""
global_minimum = r"""f(1,3)=0"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/bukin_function_n6.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ class BukinFunctionN6(MathematicalFunction):
_name_ = "bukin_function_n6"
__name__ = "BukinFunctionN6"

dimensions = "2"
formula = (
r"""f(x,y) = 100 \sqrt{\left| y-0.01x^2 \right|} + 0.01 \left|x+10\right|"""
)
global_minimum = r"""f(-10,1)=0"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
7 changes: 7 additions & 0 deletions surfaces/mathematical_functions/cross_in_tray_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ class CrossInTrayFunction(MathematicalFunction):
_name_ = "cross_in_tray_function"
__name__ = "CrossInTrayFunction"

dimensions = "2"
formula = r"""f(x,y) = -0.0001 \left[ \left| \sin x \sin y \exp\left( \left| 100 - \frac{\sqrt{x^2+y^2}}{\pi} \right| \right) \right| +1 \right]^{0.1}"""
global_minimum = r"""
f(1.34941, -1.34941) = -2.06261 \\
f(1.34941, 1.34941) = -2.06261 \\
f(-1.34941, 1.34941) = -2.06261 \\
f(-1.34941, -1.34941) = -2.06261 \\
"""

def __init__(
self,
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/drop_wave_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class DropWaveFunction(MathematicalFunction):
_name_ = "drop_wave_function"
__name__ = "DropWaveFunction"

dimensions = "2"
formula = r"""f(x, y) = -\frac{1+\cos (12\sqrt{x^2+y^2})}{0.5 (x^2 + y^2) + 2}"""
global_minimum = r"""f(0, 0)= -1"""

def __init__(self, *args, **kwargs):
super().__init__(args, **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/easom_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class EasomFunction(MathematicalFunction):
_name_ = "easom_function"
__name__ = "EasomFunction"

dimensions = "2"
formula = r"""f(x, y) = -\cos (x) \cos (y) \ exp\left[- \left((x-\pi)^2 + (y-\pi)^2 \right) \right]"""
global_minimum = r"""f(\pi, \pi) = -1"""

def __init__(
self, A=-1, B=1, angle=1, metric="score", input_type="dictionary", sleep=0
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/eggholder_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class EggholderFunction(MathematicalFunction):
_name_ = "eggholder_function"
__name__ = "EggholderFunction"

dimensions = "2"
formula = r"""f(x, y) = - (y + 47) \sin \sqrt{\left| \frac{x}{2} + (y + 47) \right|} - x \sin \sqrt{\left| x- (y + 47) \right|}"""
global_minimum = r"""f(512, 404.2319) = -959.6407"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/goldstein_price_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class GoldsteinPriceFunction(MathematicalFunction):
_name_ = "goldstein_price_function"
__name__ = "GoldsteinPriceFunction"

dimensions = "2"
formula = r"""f(x,y) = \left[1+\left(x+y+1\right)^{2}\left(19-14x+3x^{2}-14y+6xy+3y^{2}\right)\right]\left[30+\left(2x-3y\right)^{2}\left(18-32x+12x^{2}+48y-36xy+27y^{2}\right)\right]"""
global_minimum = r"""f(0,-1) = 3"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/gramacy_and_lee_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class GramacyAndLeeFunction(MathematicalFunction):
_name_ = "gramacy_and_lee_function"
__name__ = "GramacyAndLeeFunction"

dimensions = "1"
formula = r"""f(x) = \frac{\sin(10\pi x)}{2x} + (x - 1)^4"""
global_minimum = r"""-"""

def __init__(self, *args, **kwargs):
super().__init__(args, **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/griewank_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class GriewankFunction(MathematicalFunction):
_name_ = "griewank_function"
__name__ = "GriewankFunction"

dimensions = "n"
formula = r"""f(\vec x) = \sum^d_{i=1} \frac{x_i^2}{4000} - \prod_{i=1}^d\cos (\frac{x_i}{\sqrt i}) + 1"""
global_minimum = r"""f(\vec x = 0) = 0"""

def __init__(self, *args, n_dim, **kwargs):
super().__init__(args, **kwargs)
Expand Down
7 changes: 7 additions & 0 deletions surfaces/mathematical_functions/himmelblaus_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ class HimmelblausFunction(MathematicalFunction):
_name_ = "himmelblaus_function"
__name__ = "HimmelblausFunction"

dimensions = "2"
formula = r"""f(x, y) = (x^2+y-11)^2 + (x+y^2-7)^2"""
global_minimum = r"""
f(3.0, 2.0) = 0.0 \\
f(-2.805118, 3.131312) = 0.0 \\
f(-3.779310, -3.283186) = 0.0 \\
f(3.584428, -1.848126) = 0.0
"""

def __init__(self, A=-11, B=-7, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
7 changes: 7 additions & 0 deletions surfaces/mathematical_functions/hoelder_table_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ class HölderTableFunction(MathematicalFunction):
_name_ = "hölder_table_function"
__name__ = "HölderTableFunction"

dimensions = "2"
formula = r"""f(x,y) = - \left|\sin x \cos y \exp \left(\left|1 - \frac{\sqrt{x^{2} + y^{2}}}{\pi} \right|\right)\right|"""
global_minimum = r"""
f(8.05502, 9.66459) = -19.2085 \\
f(-8.05502, 9.66459) = -19.2085 \\
f(8.05502,-9.66459) = -19.2085 \\
f(-8.05502,-9.66459) = -19.2085
"""

def __init__(self, A=10, angle=1, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/langermann_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class LangermannFunction(MathematicalFunction):
_name_ = "langermann_function"
__name__ = "LangermannFunction"

dimensions = "2"
formula = r"""f(\vec x) = \sum^m_{i=1} c_i \exp \left[-\frac{1}{\pi}\sum_{j=1}^d(x_j - A_{ij})^2 \right] \cos \left[\pi \sum_{j=1}^d (x_j - A_{ij})^2 \right]"""
global_minimum = r"""TODO"""

c = np.array([1, 2, 5, 2, 3])
m = 5
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/levi_function_n13.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class LeviFunctionN13(MathematicalFunction):
_name_ = "levi_function_n13"
__name__ = "LeviFunctionN13"

dimensions = "2"
formula = r"""f(x,y) = \sin^{2} 3\pi x + \left(x-1\right)^{2}\left(1+\sin^{2} 3\pi y\right)+\left(y-1\right)^{2}\left(1+\sin^{2} 2\pi y\right)"""
global_minimum = r"""f(1,1)=0"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/matyas_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class MatyasFunction(MathematicalFunction):
_name_ = "matyas_function"
__name__ = "MatyasFunction"

dimensions = "2"
formula = r"""f(x,y) = 0.26 \left( x^{2} + y^{2}\right) - 0.48 xy"""
global_minimum = r"""f(0,0) = 0"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/mccormick_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ class McCormickFunction(MathematicalFunction):
_name_ = "mccormick_function"
__name__ = "McCormickFunction"

dimensions = "2"
formula = (
r"""f(x,y) = \sin \left(x+y\right) + \left(x-y\right)^{2} - 1.5x + 2.5y + 1"""
)
global_minimum = r"""f(-0.54719, -1.54719) = -1.9133"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/rastrigin_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ class RastriginFunction(MathematicalFunction):
_name_ = "rastrigin_function"
__name__ = "RastriginFunction"

dimensions = "n"
formula = r"""f(\vec{x}) = An + \sum^n_{i=1} \left[x_i^2 - A\cos(2\pi x_i)\right]
\newline
\text{where:} A = 10"""
global_minimum = r"""f(\vec x = 0) = 0"""

def __init__(
self,
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/rosenbrock_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class RosenbrockFunction(MathematicalFunction):
_name_ = "rosenbrock_function"
__name__ = "RosenbrockFunction"

dimensions = "2"
formula = r"""f(\vec {x}) = \sum_{i=1}^{n-1} \left[ 100 \left(x_{i+1} - x_{i}^{2}\right)^{2} + \left(1 - x_{i}\right)^{2}\right]"""
global_minimum = r"""f(1,1) = 0"""

def __init__(self, A=1, B=100, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/schaffer_function_n2.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class SchafferFunctionN2(MathematicalFunction):
_name_ = "schaffer_function_n2"
__name__ = "SchafferFunctionN2"

dimensions = "2"
formula = r"""f(x,y) = 0.5 + \frac{\sin^{2}\left(x^{2} - y^{2}\right) - 0.5}{\left[1 + 0.001\left(x^{2} + y^{2}\right) \right]^{2}}"""
global_minimum = r"""f(0,0) = 0"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
1 change: 1 addition & 0 deletions surfaces/mathematical_functions/simionescu_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SimionescuFunction(MathematicalFunction):
x^2+y^2\le\left[r_{T}+r_{S}\cos\left(n \arctan \frac{x}{y} \right)\right]^2
\newline
\text{where: } r_{T}=1, r_{S}=0.2 \text{ and } n = 8"""
global_minimum = r"""f(\pm 0.84852813,\mp 0.84852813) = -0.072"""

def __init__(
self,
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/styblinski_tang_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ class StyblinskiTangFunction(MathematicalFunction):
_name_ = "styblinski_tang_function"
__name__ = "StyblinskiTangFunction"

dimensions = "n"
formula = (
r"""f(\vec {x}) = \frac{\sum_{i=1}^{n} x_{i}^{4} - 16x_{i}^{2} + 5x_{i}}{2}"""
)
global_minimum = r"""-39.16617n < f(\underbrace{-2.903534, \ldots, -2.903534}_{n \text{ times}} ) < -39.16616n"""

def __init__(self, n_dim, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down
2 changes: 2 additions & 0 deletions surfaces/mathematical_functions/three_hump_camel_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class ThreeHumpCamelFunction(MathematicalFunction):
_name_ = "three_hump_camel_function"
__name__ = "ThreeHumpCamelFunction"

dimensions = "2"
formula = r"""f(x,y) = -\cos \left(x\right)\cos \left(y\right) \exp\left[-\left(\left(x-\pi\right)^{2} + \left(y-\pi\right)^{2}\right)\right]"""
global_minimum = r"""f(0,0)= 0"""

def __init__(self, metric="score", input_type="dictionary", sleep=0):
super().__init__(metric, input_type, sleep)
Expand Down

0 comments on commit e7c1838

Please sign in to comment.