I am trying to optimize a cost function EL_c
EL_c=-300.49858410695*C_0 - 301*C_1 - 60.2000000000003*C_2
After confirming the free variables by using
EL_c.free_symbols={C_0,C_1,C_2}
I have tried to use
ff=lambdify(("C_0","C_1","C_2"),EL_c)
and then
x0=(1,1,1)
scipy.optimize.minimize(ff,x0,method="Nelder-Mead")
However, I get the error
TypeError: <lambda>() missing 2 required positional arguments: 'C_1'
and 'C_2'
Ideally, I would like to be able to optimize the function using the above method.