I have a function of the form
def tmp(x,n):
R, s, a, T = x[0], x[1], x[2], x[3]
which returns a float, after a long block of calculations.
I need to minimize this function and for that I used the scipy.optimize.minimize():
minimize(tmp,[0,0,3,60000], args=(n,),tol =1e-15)
The above code looks for the minimum of the function tmp() with the starting values as shown.
Now I need to minimize the same function tmp, but keeping the variables R,T out of the minimization, as parameters. In other words I want the function to be written like:
def tmp(x,n,R,T):
s, a = x[0], x[1]
How is it possible to create a function like the above without editing my first function?