diff --git a/src/downhill_simplex/2d_optimierungsproblem_1.py b/src/downhill_simplex/2d_optimierungsproblem_1.py index ffe15d4..e2e7f0c 100644 --- a/src/downhill_simplex/2d_optimierungsproblem_1.py +++ b/src/downhill_simplex/2d_optimierungsproblem_1.py @@ -4,5 +4,9 @@ def f(x0): x1, x2 = x0 return (x1 ** 2 + x2 - 11) ** 2 + (x1 + x2 ** 2 - 7) ** 2 -minimum = optimize.fmin(f, [-100,-100]) +def f_2(x0): + x1, x2 = x0 + return ((x1-1)**2+(x2-2)**2-9)**2+((x1-2)**2+x2**2-4)**2 + +minimum = optimize.fmin(f_2, [4,1]) print(minimum)