If I have a function func(x1,x2,x3)
, can I use the minimize function scipy.optimize.minimize
with excluding x3
from the optimization process, where x3
is defined as numpy array
.
How can I define the argument in this case?. I'm supposed to get an array containing the minimum values of func
for each value of x3
.
For example:
def func(thet1,phai1,thet2,phai2,c2):
RhoABC = np.array([[1,0,thet1,0,0,0,0,c1],[0,1,0,0,phai2,0,c2,0],[0,0,1,0,0,c2,thet2,0],[0,0,0,1,c2,0,0,0],[0,phai1,0,c2,1,0,0,0],[0,0,c2,0,0,1,0,thet2],[0,c2,0,0,0,0,1,0],[c1,0,0,phai1,0,0,0,1]])
w, v = np.linalg.eig(RhoABC)
return w[1]
I want to minimize it where c2 = linspace(-1,1,10)
and the angles belong to (0,2pi)