I'm trying to get the shadow values of the constraints in the 'for' loop:
using JuMP
using GLPK
CI = [30, 70];
d = 170;
Pmin = [ 0, 0];
Pmax = [100, 150];
N = length(CI)
m = Model(GLPK.Optimizer)
@variable(m, 0 <= P[1:N] )
@objective(m, Min, sum(CI[i] * P[i] for i in 1:N))
@constraint(m, c1, sum(P[1:N]) == d)
for i in 1:N
@constraint(m, Pmin[i] <= P[i] <= Pmax[i])
end
optimize!(m)
Does anyone know how to make it print the shadow value of all constraints? D:
I was trying to develop a economic dispatch problem (I'm new on Julia)
Option 1: use the specialized JuMP syntax to create a container:
Option 2: use Julia
I'd actually write your model differently though:
You might be interested in the tutorial:
https://jump.dev/JuMP.jl/stable/tutorials/applications/power_systems/#Economic-dispatch
Hi there! The other place to get help for JuMP/Julia related things is http://jump.dev/forum. It's a bit easier to have a back-and-forth conversation there if you have more questions than StackOverflow.