You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this code working in Julia whit the gurobi solver. But i wanna made it work whit PathSolver. Can i have any feedback on how to do it?
Thanks!!
This is my code whit gurobi
import Pkg
Pkg.add("Gurobi")
#Variables @variable(model, x>=0) #Capacidad @variable(model, Y[i in 1:5]>=0) # Produccion en escenario w @variable(model,Q[i in 1:5]>=0) # Demanda en escenario w
#Restricciones @constraint(model, demanda[i in 1:5], Y[i] == Q[i] ) @constraint(model, capacidad[i in 1:5], Y[i]-x<=0.0)
#FO @objective(model, Min, I1000x + tau*(sum(theta[i](CY[i] - A[i]Q[i] + B0.5*(Q[i]^2)) for i in 1:5) ))
But to answer your question: you have a quadratic program. PATHSolver supports complementarity problems. It does not support quadratic programs. We do not have an automatic reformulation from QP to MCP, therefore, you cannot solve this problem with PATH.
I have this code working in Julia whit the gurobi solver. But i wanna made it work whit PathSolver. Can i have any feedback on how to do it?
Thanks!!
This is my code whit gurobi
import Pkg
Pkg.add("Gurobi")
A=[300,350,400,450,500];
theta=[0.2,0.2,0.2,0.2,0.2];
B=1;
I=90;
C=60;
tau=8760;
using JuMP,Gurobi
model=Model(Gurobi.Optimizer)
#Variables
@variable(model, x>=0) #Capacidad
@variable(model, Y[i in 1:5]>=0) # Produccion en escenario w
@variable(model,Q[i in 1:5]>=0) # Demanda en escenario w
#Restricciones
@constraint(model, demanda[i in 1:5], Y[i] == Q[i] )
@constraint(model, capacidad[i in 1:5], Y[i]-x<=0.0)
#FO
@objective(model, Min, I1000x + tau*(sum(theta[i](CY[i] - A[i]Q[i] + B0.5*(Q[i]^2)) for i in 1:5) ))
#Resolver
JuMP.optimize!(model)
println("Q = ", JuMP.value.(Q))
Qlist=JuMP.value.(Q)
j=1
P=[]
while j<6
Pi=A[j]-B*Qlist[j]
append!(P, Pi)
j=j+1
end
println("P = ",P)
println("x = ", JuMP.value(x))
The text was updated successfully, but these errors were encountered: