CoCalc Shared Files2017-06-20-131254.ipynbOpen in CoCalc with one click!
Authors: Kyle Kelley, Peggy Rayzis, William A. Stein
Views : 8
In [9]:
from scipy import optimize def f(x): return 3 * (1 - x) + (x - 2)**2 res = optimize.minimize_scalar(f) print(res.x) print(f(res.x))
3.5000000000000004 -5.25
In [ ]: