when I minimize a function using scipy.optimize.minimize I get a big list of things as a result, but I would like to only get the value of my variable, this is my code :
import scipy.optimize as so
def func_AC(r):
return 1/((r**2)+1)
guess = 0
minimo = so.minimize(func_AC,guess)
print(minimo)
and this is what I get:
fun: array([1.])
hess_inv: array([[1]])
jac: array([-1.49011612e-08])
message: 'Optimization terminated successfully.'
nfev: 3
nit: 0
njev: 1
status: 0
success: True
x: array([0.])
with only this values I would be really happy
success: True
x: array([0.])
also I need my function to have bounds but I dont know how to, could anybody help me have the same code but with the bound r>=1? thanks in advanced
scipy.optimize
. And then you mention that you want to modify an optimization problem that you have not explicitly described. $\endgroup$