CoCalc Public Files2017-06-20-131254.ipynbOpen with one click!
Authors: Kyle Kelley, Peggy Rayzis, William A. Stein
Views : 53
Compute Environment: Ubuntu 18.04 (Deprecated)
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 [ ]: