I want to use minimization with scipy.optimize using Symbolized charactors
from scipy.optimize import minimize
from sympy.utilities.lambdify import lambdify
import sympy as sp
x1, x2, x3, x4 = sp.symbols('x1 x2 x3 x4')
FormulaMain = sp.symbols('-2*x1**2*x3+6*x1**2*x4+13*x1**2-3*x1*x2**2+x1*x2+3*x1*x3**2-3*x4+103')
HandleMain = lambdify((x1,x2,x3,x4),FormulaMain,'numpy')
bnds = ((-1, 1), (-1, 1), (-1, 1), (-1, 1))
PrintParams = minimize(HandleMain,[1,1,1,1],method='SLSQP',bounds=bnds)
print PrintParams
When I run the code, I get
<lambda>() takes exactly 4 arguments (1 given)
I think I have input 4 argument with [1,1,1,1] Are there anything I have to change with the code?