diff --git a/requirements.txt b/requirements.txt index 96b34d6..befd24e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ numpy == 2.4.3 black == 26.3.1 ipykernel == 7.2.0 sympy == 1.14.0 -pandas == 3.0.2 \ No newline at end of file +pandas == 3.0.2 +scipy == 1.17.1 \ No newline at end of file diff --git a/src/downhill_simplex/2d_optimierungsproblem_1.py b/src/downhill_simplex/2d_optimierungsproblem_1.py new file mode 100644 index 0000000..ffe15d4 --- /dev/null +++ b/src/downhill_simplex/2d_optimierungsproblem_1.py @@ -0,0 +1,8 @@ +from scipy import optimize + +def f(x0): + x1, x2 = x0 + return (x1 ** 2 + x2 - 11) ** 2 + (x1 + x2 ** 2 - 7) ** 2 + +minimum = optimize.fmin(f, [-100,-100]) +print(minimum)