JuMP variable definition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JuMP variable definition

ar.shefaei
hello, I decided to implement Power Flow problem in julia, but while i cannot been determined the variable because when i defined, a set of special type of busess active powers(or other variables), the previously defined active powers are eliminated.
@variable(PF, P[i=1:nGen; bus[:,2][i] == 2] == gen[:,2][i]/baseMVA)
@variable(PF, P[i=1:nBus; bus[:,2][i] == 1] == -bus[:,3][i]/baseMVA)
can you help me?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JuMP variable definition

Carleton Coffrin
Hi,

I can see two options,

1) Precompute a p_delta for each bus, which is the sum of generator output and bus load.  Then post KCL for each bus of the form,

for i in buses
  @constraint(p_delta[i] == sum{ p[(i,j)] for (i,j) in  bus_edges[i] })
end


2) Break up your p values into demands and generation, then you can post,

for i in buses
  @constraint(p_gen[i] - p_load[i] == sum{ p[(i,j)] for (i,j) in  bus_edges[i] })
end


Depending on your use case, you might also consider using PowerModels.jl 

It supports both AC and DC power flow computations.

Cheers,
-Carleton


On Tuesday, December 6, 2016 at 10:35:46 AM UTC-7, [hidden email] wrote:
hello, I decided to implement Power Flow problem in julia, but while i cannot been determined the variable because when i defined, a set of special type of busess active powers(or other variables), the previously defined active powers are eliminated.
@variable(PF, P[i=1:nGen; bus[:,2][i] == 2] == gen[:,2][i]/baseMVA)
@variable(PF, P[i=1:nBus; bus[:,2][i] == 1] == -bus[:,3][i]/baseMVA)
can you help me?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JuMP variable definition

ar.shefaei
thanks for your help


On Wednesday, December 7, 2016 at 4:26:50 AM UTC+3:30, Carleton Coffrin wrote:
Hi,

I can see two options,

1) Precompute a p_delta for each bus, which is the sum of generator output and bus load.  Then post KCL for each bus of the form,

for i in buses
  @constraint(p_delta[i] == sum{ p[(i,j)] for (i,j) in  bus_edges[i] })
end


2) Break up your p values into demands and generation, then you can post,

for i in buses
  @constraint(p_gen[i] - p_load[i] == sum{ p[(i,j)] for (i,j) in  bus_edges[i] })
end


Depending on your use case, you might also consider using PowerModels.jl 

It supports both AC and DC power flow computations.

Cheers,
-Carleton


On Tuesday, December 6, 2016 at 10:35:46 AM UTC-7, [hidden email] wrote:
hello, I decided to implement Power Flow problem in julia, but while i cannot been determined the variable because when i defined, a set of special type of busess active powers(or other variables), the previously defined active powers are eliminated.
@variable(PF, P[i=1:nGen; bus[:,2][i] == 2] == gen[:,2][i]/baseMVA)
@variable(PF, P[i=1:nBus; bus[:,2][i] == 1] == -bus[:,3][i]/baseMVA)
can you help me?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JuMP variable definition

Miles Lubin
In reply to this post by ar.shefaei
Repeated definition of a variable with the same name will generate a warning in the next release of JuMP.

On Tuesday, December 6, 2016 at 12:35:46 PM UTC-5, [hidden email] wrote:
hello, I decided to implement Power Flow problem in julia, but while i cannot been determined the variable because when i defined, a set of special type of busess active powers(or other variables), the previously defined active powers are eliminated.
@variable(PF, P[i=1:nGen; bus[:,2][i] == 2] == gen[:,2][i]/baseMVA)
@variable(PF, P[i=1:nBus; bus[:,2][i] == 1] == -bus[:,3][i]/baseMVA)
can you help me?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JuMP variable definition

ar.shefaei
how i can defined different bounds or fixed values to elements of a vector variable?

On Sunday, December 11, 2016 at 6:02:15 AM UTC+3:30, Miles Lubin wrote:
Repeated definition of a variable with the same name will generate a warning in the next release of JuMP.

On Tuesday, December 6, 2016 at 12:35:46 PM UTC-5, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZSnSiPFYCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ar.sh...@... wrote:
hello, I decided to implement Power Flow problem in julia, but while i cannot been determined the variable because when i defined, a set of special type of busess active powers(or other variables), the previously defined active powers are eliminated.
@variable(PF, P[i=1:nGen; bus[:,2][i] == 2] == gen[:,2][i]/baseMVA)
@variable(PF, P[i=1:nBus; bus[:,2][i] == 1] == -bus[:,3][i]/baseMVA)
can you help me?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Loading...