Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
dadefbe
WIP: ravens to math converter for PMD.
juanjospina Aug 5, 2024
542f3dd
WIP: add bases to certain elements - debugging changes
juanjospina Aug 5, 2024
b5dea97
WIP: revise case3 ravens to math model code.
juanjospina Aug 7, 2024
d616a1e
WIP: case3 balanced working. Still missing transformers, shunts, gene…
juanjospina Aug 7, 2024
15d72f8
Revise ravens schema (#2)
juanjospina Aug 8, 2024
bbfa2d7
ADD: generator or rotating machine parser for ravens2math
juanjospina Sep 5, 2024
03a55d4
ADD: pv or photovoltaic unit parser for ravens2math.
juanjospina Sep 5, 2024
05f483e
ADD: storage or battery unit parser for ravens2math
juanjospina Sep 5, 2024
1021d87
REF: combined PVs and Battery Units in Ravens parser to avoid multipl…
juanjospina Sep 5, 2024
d7559d7
REF: ravens2math parser to fix impedance calculations and support fil…
juanjospina Sep 26, 2024
e7b082c
REF: add haskey check when looking for gens and power electronics
juanjospina Sep 26, 2024
8bb608d
WIP: Switches - still missing connection to virtual bus and branches.
juanjospina Sep 26, 2024
248210b
REF: OperationalLimitType parsing with new style.
juanjospina Oct 3, 2024
dda9e4a
FIX: storage ravens2math parser.
juanjospina Oct 7, 2024
a5d54a4
REF: a function that extracts the name of a ravens string.
juanjospina Oct 7, 2024
2fb384d
REF: replace SvStatus with Equipment.inService
juanjospina Oct 7, 2024
b54fbc5
FIX: charge and discharge on BatteryUnit.
juanjospina Oct 10, 2024
8ee4faa
WIP: Add Parser for PowerTransformer based on PowerTransformerEnd. Er…
juanjospina Oct 10, 2024
f6698b9
WIP: debig powertransformer issues related to terminals and bus_type …
juanjospina Oct 10, 2024
86f3f47
FIX: powertransformer issue related to fnode when creating virtual br…
juanjospina Oct 11, 2024
8726941
REF: phasecode in transformers.
juanjospina Oct 11, 2024
4688964
ADD: ShuntCompensator ravens parser.
juanjospina Oct 14, 2024
5f89b05
FIX: issues to be able to run test case with switches.
juanjospina Nov 7, 2024
6aa181d
REF: ravens2math by removing if statements and using phasecode map in…
juanjospina Nov 8, 2024
e04a1f0
REF: ravens2math to reduce if levels.
juanjospina Nov 8, 2024
86fa5be
ADD: unit tests for ravens parser.
juanjospina Nov 8, 2024
70b5b74
ADD: support for basic multinetwork functionality using RAVENS schema…
juanjospina Jan 30, 2025
ba64f3b
ADD: TransformerTank support and minor modeling fixes (#3)
juanjospina Feb 26, 2025
589ef50
RM: print out statements for debugging.
juanjospina Feb 26, 2025
82d6091
FIX: correct max sm for transformertank individual.
juanjospina Feb 26, 2025
cfe3bd0
REF: Handle default grounding for buses.
juanjospina Feb 26, 2025
ff43f82
FIX: LoadResponseCharacteristic to LoadResponse
juanjospina Feb 27, 2025
732895e
FIX: issues related to Equipment.inService and loads with multiple ph…
juanjospina Feb 27, 2025
9ac1abe
FIX: name changes for LoadForecast -> LoadProfile and add support for…
juanjospina Feb 27, 2025
c979b5b
FIX: issues with loadprofiles multipliers and correct dimensions of p…
juanjospina Feb 27, 2025
dfc3859
FIX: load and gen Q not being parsed correctly for multiple phases.
juanjospina Feb 28, 2025
674fe4e
FIX: admittance computation.
juanjospina Mar 3, 2025
a40f457
REF: pmax and pmin for rotating machine generating units.
juanjospina Mar 4, 2025
d9745f9
REF: operational limit for lines to be emerg instead of nominal.
juanjospina Mar 4, 2025
b70769a
REF: multinetwork support for new ravens schema using UnitSymbol.w/var
juanjospina Mar 4, 2025
60f1cdb
Add ravens schema add line geometry (#4)
juanjospina Mar 10, 2025
9056a66
FIX: BatteryUnitEfficiency and add newly converted ravens test cases.
juanjospina Mar 10, 2025
b15bf8e
FIX: issues related to Switch.open, default angles for energy source,…
juanjospina Mar 19, 2025
ff88346
ADD: ratiotapchanger regulators to transformers.
juanjospina Mar 24, 2025
62e5bef
ADD: RatioTapChanger operations and control ravens parsing.
juanjospina Mar 25, 2025
dca0510
ADD: SwitchInfo support.
juanjospina Mar 25, 2025
3ae8b5d
FIX: minor changes to assigning terminals in edge elements.
juanjospina Mar 26, 2025
df8ef48
FIX: bug on constraint_mc_transformer_power_dy for LPUBFDiagModel.
juanjospina Mar 26, 2025
800368d
Revise ravens parser (#5)
juanjospina Mar 28, 2025
2b388d6
FIX: sign convention issues in rotatingmachines.
juanjospina Mar 31, 2025
5bfa64d
FIX: gens rated information.
juanjospina Apr 1, 2025
8564b53
FIX: small typo in energyconsumer mn ravens definition.
juanjospina Apr 2, 2025
13a2325
FIX: typo for qmin in gens.
juanjospina Apr 3, 2025
b6f5fe8
ADD: support for tape shield cables and fix issue to handle three pha…
juanjospina Apr 8, 2025
ab492ce
FIX: bugs in transformer impedance and conductance calculations, kron…
juanjospina Apr 9, 2025
9c399eb
FIX: issues with sequence numbers in JSON files missing, and exciting…
juanjospina Apr 10, 2025
1125180
FIX: comment out eng2math block of code that needs to always run.
juanjospina Apr 10, 2025
3da4023
FIX: operational limit set to get the largest one in lines.
juanjospina Apr 10, 2025
069e989
FIX: minor fixes to switches and pecs.
juanjospina Apr 11, 2025
b7f3325
FIX: unmapping funcs for converting back to ENG model.
juanjospina Apr 15, 2025
234b9cc
ADD: option to do Kron reduction to the Linecodes when kron=y is pass…
juanjospina Apr 25, 2025
4c9c98f
RM: deprecated redundant separation of TransformerTanks in ravens2math.
juanjospina Apr 25, 2025
71e397f
FIX: issue of not computing rs and xsc for second winding correctly d…
juanjospina Apr 28, 2025
a4e4ea1
FIX: bug for considering neutral phase.
juanjospina Apr 29, 2025
d25545d
FIX: missing division by 2 when parsing Transformer MeshImpedance or …
juanjospina Apr 29, 2025
f5884c7
REF: revise powerelectronicsconnection to compute basevoltage when no…
juanjospina May 6, 2025
e0cea53
REF: TapChangerRatio values using new UML schema.
juanjospina May 8, 2025
c6b6676
FIX: issue related to transformer reactance computation when doing ra…
juanjospina May 14, 2025
62913c1
FIX: Fix and refactor computation of resistances and reactances for t…
juanjospina May 15, 2025
d022615
FIX: computation of b_sh and g_sh for TransformerTanks.
juanjospina May 15, 2025
afbfd62
DOC: removed TODO for noloadloss unit in ravens2math.
juanjospina May 19, 2025
c8d6fcc
FIX: get func missing when getting p and q from load forecast EnergyC…
juanjospina May 20, 2025
c7079ee
ADD: check for mathematical model type before instantiating model.
juanjospina May 21, 2025
36f4fa8
ADD: util function to apply voltage bounds to MATH model in pu.
juanjospina May 21, 2025
bf1e600
REF: switch state and dispatchable information parsing from RAVENS JS…
juanjospina May 29, 2025
f094e37
REF: switch status definition to assume open when not specified.
juanjospina Jun 19, 2025
961153d
REF: switch and fuses open or close by default.
juanjospina Jun 23, 2025
3837480
TEST: basemva=1
juanjospina Jun 26, 2025
2f154b6
FIX: parsing errors derived from 3 winding xfrmrs and single-phase li…
juanjospina Jun 30, 2025
d412503
REF: source id names for MATH objects based on RAVENS names.
juanjospina Jul 2, 2025
0b2990c
ADD: dispatchability status of switch based on RAVENS locked bool.
juanjospina Jul 2, 2025
f929250
ADD: support for PV forecast to be considered in multinetwork problem…
juanjospina Jul 3, 2025
fd3dc6f
WIP: add base voltage calculator for ravens model
pseudocubic Jul 9, 2025
b0a07d8
WIP: ADD: voltage bounds for some objects
pseudocubic Jul 9, 2025
1f743fc
RM: old code for computing base voltages.
juanjospina Jul 10, 2025
6a9573b
FIX: find voltages function that was assigning incorrect voltage base…
juanjospina Sep 4, 2025
1c75a74
REF: Calculation of impedance in EnergySource.
juanjospina Sep 5, 2025
fcf37bc
FIX: vbase kv for loads.
juanjospina Sep 9, 2025
6d8ee03
FIX: voltage limits loads.
juanjospina Sep 9, 2025
7d7423d
Add ravens output (#6)
juanjospina Sep 24, 2025
7c950e3
REF: trasnform solution from math to ravens. Fix issue with vg in PV …
juanjospina Sep 26, 2025
0d5b87d
ADD: fix function for numerical errors in states coming from solvers …
juanjospina Sep 29, 2025
0a1f48a
ADD: function to round floats to integer in switch states, e.g., 0.99…
juanjospina Sep 30, 2025
62c4ecf
FIX: increase tol for integers conversion in switch states.
juanjospina Oct 1, 2025
f6fe6d0
FIX: modify bus type of MATH model based on element status. Correctly…
juanjospina Oct 6, 2025
9cc2961
REF: default status of buses to bus type = 4 assuming they are disabl…
juanjospina Oct 7, 2025
5ac12f3
FIX: reduce tolerance for rounding Gurobi solutions.
juanjospina Oct 9, 2025
e26956a
ADD: capability to add GFM bus type of bus connected to battery with …
juanjospina Oct 9, 2025
6c204d9
FIX: filter virtual buses in OPF solutions RAVENS.
juanjospina Oct 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PolyhedralRelaxations = "2e741578-48fa-11ea-2d62-b52c946f73a0"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
CSV = "0.8.5, 0.9, 0.10"
Expand All @@ -34,6 +35,7 @@ LoggingExtras = "0.4.7, 1"
PolyhedralRelaxations = "0.3.5"
SCS = "0.9, 1.0, 1.1"
SpecialFunctions = "2"
UUIDs = "1.11.0"
julia = "1.6"

[extras]
Expand Down
4 changes: 4 additions & 0 deletions src/PowerModelsDistribution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module PowerModelsDistribution
import LinearAlgebra
import Statistics
import SparseArrays
import UUIDs

import LinearAlgebra: diagm, factorize
import Statistics: mean, std
Expand Down Expand Up @@ -69,8 +70,10 @@ module PowerModelsDistribution
include("data_model/transformations/dss2eng.jl")
include("data_model/transformations/eng2math.jl")
include("data_model/transformations/math2eng.jl")
include("data_model/transformations/math2ravens.jl")
include("data_model/transformations/utils.jl")
include("data_model/transformations/reduce.jl")
include("data_model/transformations/ravens2math.jl")

include("core/data.jl")
include("core/ref.jl")
Expand Down Expand Up @@ -113,6 +116,7 @@ module PowerModelsDistribution
include("io/common.jl")

include("data_model/utils.jl")
include("data_model/utils_ravens.jl")
include("data_model/checks.jl")
include("data_model/components.jl")
include("data_model/multinetwork.jl")
Expand Down
18 changes: 18 additions & 0 deletions src/data_model/transformations/dss2eng.jl
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,24 @@ function _dss2eng_linecode!(data_eng::Dict{String,<:Any}, data_dss::OpenDssDataM
_import_all!(eng_obj, dss_obj)
end

# kron reduction on linecode only if kron key is found
reduce = get(dss_obj, "kron", false)
if reduce == true
nphases = nphases - 1
Z = eng_obj["rs"] + im*eng_obj["xs"]
Y = (eng_obj["g_fr"].* 2.0) + (im*eng_obj["b_fr"] .* 2.0)
z, y = _kron(Z, Y, nphases)
rs, xs = real(z), imag(z)
g, b = real(y), imag(y)
eng_obj["rs"] = rs
eng_obj["xs"] = xs
eng_obj["b_fr"] = b ./ 2.0
eng_obj["b_to"] = b ./ 2.0
eng_obj["g_fr"] = g ./ 2.0
eng_obj["g_to"] = g ./ 2.0
eng_obj["cm_ub"] = fill(dss_obj["emergamps"], nphases)
end

_add_eng_obj!(data_eng, "linecode", id, eng_obj)
end
end
Expand Down
1 change: 1 addition & 0 deletions src/data_model/transformations/eng2math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ function _map_eng2math_transformer!(data_math::Dict{String,<:Any}, data_eng::Dic
# 2-WINDING TRANSFORMER
# make virtual bus and mark it for reduction
tm_nom = eng_obj["configuration"][w]==DELTA ? eng_obj["vm_nom"][w]*sqrt(3) : eng_obj["vm_nom"][w]

transformer_2wa_obj = Dict{String,Any}(
"name" => "_virtual_transformer.$name.$w",
"source_id" => "_virtual_transformer.$(eng_obj["source_id"]).$w",
Expand Down
Loading
Loading