How to solve an optimization problem in Gurobi Python where decision variables are established within defined functions?
Hello everyone,
I'm trying to implement a optimization problem in Python but using Gurobi module. In a first stage I found the solution for my optimization problem but using a Python own function named scipy.optimize 'Minimize'. However, I have desired to resolve the same problem but with gurobi module from python.
The specific problem is I have some defined functions that are neccesary to calculate some parameters to the cost function.
My function cost has the way as is presented below:
Ppv, PchDh, SoC, Pred, Pout, ens = calcularPotencias(Pinst, Ebat, Pbat) #This line is required to call calcularPotencias function
Exit = np.sum(Cred * Pred)*deltaT + Cpv * Pinst + Ckwh * Ebat + Ckw * Pbat + np.sum(Cens * ens)*deltaT - np.sum(Cout * Pout)*deltaT #This line represents cost function
Pinst, Ebat, Pbat are decision variables. Cred, Cpv, Ckw, Cens and Cout are coefficients. Pred and Pout are parameters that depend on Ppv, PchDh, SoC.
I would like you for any tip that allow me resolve the problem using Gurobi module
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
Post is closed for comments.
Comments
1 comment