Skip to content

Commit

Permalink
FIX: bug in add_setpoint functions for MLD
Browse files Browse the repository at this point in the history
add_setpoint_demand, add_setpoint_shunt needed to be converted to conductorless properly.

Adds unit test to ensure this remains fixed.

Updates README.md to indicate ACP works with MLD

Updates CHANGELOG.md in preparation for release v0.5.1
  • Loading branch information
pseudocubic committed Aug 1, 2019
1 parent a12dfc9 commit ba09a03
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ PowerModelsDistribution.jl Change Log
===================================

### staged
- none

### v0.5.1
- Add continuous load shedding problem (mld)

### v0.5.0
Expand All @@ -24,7 +27,6 @@ PowerModelsDistribution.jl Change Log
- Fix bug in OpenDSS parse of Capacitors [zbase factor and wrong sign] (#138)
- Add voltage balance constraints (#129)


### v0.3.0
- Update to JuMP v0.19/MathOptInterface

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ Dev:
[![codecov](https://codecov.io/gh/lanl-ansi/PowerModelsDistribution.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/lanl-ansi/PowerModelsDistribution.jl)
[![docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://lanl-ansi.github.io/PowerModelsDistribution.jl/latest/)


PowerModelsDistribution.jl is an extention package of PowerModels.jl for Steady-State Power Distribution Network Optimization. It is designed to enable computational evaluation of emerging power network formulations and algorithms in a common platform. The code is engineered to decouple problem specifications (e.g. Power Flow, Optimal Power Flow, ...) from the power network formulations (e.g. AC, linear-approximation, SOC-relaxation, ...).
This enables the definition of a wide variety of power network formulations and their comparison on common problem specifications.

**Core Problem Specifications**

* Power Flow (pf)
* Optimal Power Flow (opf), for the Bus Injection Model (BIM) as well as the Branch Flow Model (BFM)
* Continuous load shed, minimum load delta (mld), for the Branch Flow Model (LPLinUBFPowerModel) and Network Flow Approximation (NFAPowerModel)
* Continuous load shed, minimum load delta (mld), for the Branch Flow Model (LPLinUBFPowerModel), AC Polar (ACPPowerModel), and Network Flow Approximation (NFAPowerModel)

**Core Network Formulations**

Expand All @@ -36,7 +35,6 @@ This enables the definition of a wide variety of power network formulations and

Community-driven development and enhancement of PowerModelsDistribution are welcome and encouraged. Please fork this repository and share your contributions to the master with pull requests.


## Acknowledgments

This code has been developed as part of the Advanced Network Science Initiative at Los Alamos National Laboratory. The primary developers are David Fobes(@pseudocubic) and Carleton Coffrin(@ccoffrin) with support from the following contributors:
Expand Down
8 changes: 4 additions & 4 deletions src/core/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,16 @@ end

"add load setpoints for load shed problem"
function add_setpoint_load!(sol, pm::_PMs.GenericPowerModel{T}) where T
_PMs.add_setpoint!(sol, pm, "load", "pd", :z_demand; scale = (x,item,cnd) -> x*item["pd"][cnd])
_PMs.add_setpoint!(sol, pm, "load", "qd", :z_demand; scale = (x,item,cnd) -> x*item["qd"][cnd])
_PMs.add_setpoint!(sol, pm, "load", "pd", :z_demand; scale = (x,item,cnd) -> x*item["pd"], conductorless=true)
_PMs.add_setpoint!(sol, pm, "load", "qd", :z_demand; scale = (x,item,cnd) -> x*item["qd"], conductorless=true)
_PMs.add_setpoint!(sol, pm, "load", "status", :z_demand; default_value = (item) -> if (item["status"] == 0) 0.0 else 1.0 end, conductorless=true)
end


"add shunt setpoints for load shed problem"
function add_setpoint_shunt!(sol, pm::_PMs.GenericPowerModel{T}) where T
_PMs.add_setpoint!(sol, pm, "shunt", "gs", :z_shunt; scale = (x,item,cnd) -> x*item["gs"][cnd])
_PMs.add_setpoint!(sol, pm, "shunt", "bs", :z_shunt; scale = (x,item,cnd) -> x*item["bs"][cnd])
_PMs.add_setpoint!(sol, pm, "shunt", "gs", :z_shunt; scale = (x,item,cnd) -> x.*item["gs"], conductorless=true)
_PMs.add_setpoint!(sol, pm, "shunt", "bs", :z_shunt; scale = (x,item,cnd) -> x.*item["bs"], conductorless=true)
_PMs.add_setpoint!(sol, pm, "shunt", "status", :z_shunt; default_value = (item) -> if (item["status"] == 0) 0.0 else 1.0 end, conductorless=true)
end

Expand Down
2 changes: 2 additions & 0 deletions test/tp_mld.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

@test result["termination_status"] == PMs.LOCALLY_SOLVED
@test isapprox(result["objective"], 0.3295; atol = 1e-4)
@test all(isapprox(result["solution"]["load"]["1"]["pd"], [3.0, 3.0, 3.0]; atol=1e-4))
@test all(isapprox(result["solution"]["load"]["1"]["qd"], [0.9861, 0.9861, 0.9861]; atol=1e-4))

@test isapprox(result["solution"]["load"]["1"]["status"], 1.000; atol = 1e-3)
end
Expand Down

2 comments on commit ba09a03

@pseudocubic
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/2447

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.1 -m "<description of version>" ba09a0375d7ad948193535b4bd53f962a3802080
git push origin v0.5.1

Please sign in to comment.