Suppose I have an objective function f(a,b,c). I want to find the value of b that minimizes it, holding a and c constant, and to experiment with different combinations of a and c, I prefer not to write f(a,b,c) as g(b).
from scipy.optimize import minimize
def f(a,b,c):
return((a+1)**2 + b + c/2)
res = minimize(f, x0=1, args=(a,c,),)
print(res.x)
Then how do I specify that b is the parameter that f(a,b,c) should be minimized with respect to? Does that parameter have to be expressed as x? Or should I make b the first argument of f?