Skip to content

Commit

Permalink
Add w ref dera (#901)
Browse files Browse the repository at this point in the history
* add references to dera

* add w-ref to dera

Co-authored-by: Jose Daniel Lara <[email protected]>
  • Loading branch information
m-bossart and jd-lara authored Jul 6, 2022
1 parent f6bc3c8 commit bb836f0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
11 changes: 11 additions & 0 deletions src/descriptors/power_system_structs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13073,6 +13073,17 @@
"min": 0,
"max": null
}
},
{
"name": "ω_ref",
"comment": "Reference frequency",
"null_value": 0,
"default": "1.0",
"data_type": "Float64",
"valid_range": {
"min": 0,
"max": null
}
},
{
"name": "Q_ref",
Expand Down
2 changes: 1 addition & 1 deletion src/models/dynamic_loads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end

function get_AggregateDistributedGenerationA_states(Freq_Flag::Int)
if Freq_Flag == 0
return [:Vmeas, :Pmeas, :Q_V, :Iq, :Mult, :Fmeas, :dPord, :Pord, :Ip], 9
return [:Vmeas, :Pmeas, :Q_V, :Iq, :Mult, :Fmeas, :Ip], 7
elseif Freq_Flag == 1
return [:Vmeas, :Pmeas, :Q_V, :Iq, :Mult, :Fmeas, :Power_PI, :dPord, :Pord, :Ip], 10
else
Expand Down
17 changes: 13 additions & 4 deletions src/models/generated/AggregateDistributedGenerationA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This file is auto-generated. Do not edit.
Iq_lim::NamedTuple{(:min, :max), Tuple{Float64, Float64}}
V_ref::Float64
Pfa_ref::Float64
ω_ref::Float64
Q_ref::Float64
P_ref::Float64
base_power::Float64
Expand Down Expand Up @@ -92,6 +93,7 @@ Parameters of the DERA1 model in PSS/E
- `Iq_lim::NamedTuple{(:min, :max), Tuple{Float64, Float64}}`: Reactive current injection limits (Iqll, Iqhl)
- `V_ref::Float64`: User defined voltage reference. If 0, PSID initializes to initial terminal voltage, validation range: `(0, nothing)`
- `Pfa_ref::Float64`: Reference power factor, validation range: `(0, nothing)`
- `ω_ref::Float64`: Reference frequency, validation range: `(0, nothing)`
- `Q_ref::Float64`: Reference reactive power, in pu, validation range: `(0, nothing)`
- `P_ref::Float64`: Reference active power, in pu, validation range: `(0, nothing)`
- `base_power::Float64`: Base power
Expand Down Expand Up @@ -174,6 +176,8 @@ mutable struct AggregateDistributedGenerationA <: DynamicInjection
V_ref::Float64
"Reference power factor"
Pfa_ref::Float64
"Reference frequency"
ω_ref::Float64
"Reference reactive power, in pu"
Q_ref::Float64
"Reference active power, in pu"
Expand All @@ -189,12 +193,12 @@ mutable struct AggregateDistributedGenerationA <: DynamicInjection
internal::InfrastructureSystemsInternal
end

function AggregateDistributedGenerationA(name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref=1.0, Pfa_ref=0.0, Q_ref=0.0, P_ref=1.0, base_power=100.0, ext=Dict{String, Any}(), )
AggregateDistributedGenerationA(name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref, Pfa_ref, Q_ref, P_ref, base_power, ext, PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[1], PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[2], InfrastructureSystemsInternal(), )
function AggregateDistributedGenerationA(name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref=1.0, Pfa_ref=0.0, ω_ref=1.0, Q_ref=0.0, P_ref=1.0, base_power=100.0, ext=Dict{String, Any}(), )
AggregateDistributedGenerationA(name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref, Pfa_ref, ω_ref, Q_ref, P_ref, base_power, ext, PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[1], PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[2], InfrastructureSystemsInternal(), )
end

function AggregateDistributedGenerationA(; name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref=1.0, Pfa_ref=0.0, Q_ref=0.0, P_ref=1.0, base_power=100.0, states=PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[1], n_states=PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[2], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), )
AggregateDistributedGenerationA(name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref, Pfa_ref, Q_ref, P_ref, base_power, states, n_states, ext, internal, )
function AggregateDistributedGenerationA(; name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref=1.0, Pfa_ref=0.0, ω_ref=1.0, Q_ref=0.0, P_ref=1.0, base_power=100.0, states=PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[1], n_states=PowerSystems.get_AggregateDistributedGenerationA_states(Freq_Flag)[2], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), )
AggregateDistributedGenerationA(name, Pf_Flag, Freq_Flag, PQ_Flag, Gen_Flag, Vtrip_Flag, Ftrip_Flag, T_rv, Trf, dbd_pnts, K_qv, Tp, T_iq, D_dn, D_up, fdbd_pnts, fe_lim, P_lim, dP_lim, Tpord, Kpg, Kig, I_max, vl_pnts, vh_pnts, Vrfrac, fl, fh, tfl, tfh, Tg, rrpwr, Tv, Vpr, Iq_lim, V_ref, Pfa_ref, ω_ref, Q_ref, P_ref, base_power, states, n_states, ext, internal, )
end

# Constructor for demo purposes; non-functional.
Expand Down Expand Up @@ -237,6 +241,7 @@ function AggregateDistributedGenerationA(::Nothing)
Iq_lim=(min=0.0, max=0.0),
V_ref=0,
Pfa_ref=0,
ω_ref=0,
Q_ref=0,
P_ref=0,
base_power=0,
Expand Down Expand Up @@ -318,6 +323,8 @@ get_Iq_lim(value::AggregateDistributedGenerationA) = value.Iq_lim
get_V_ref(value::AggregateDistributedGenerationA) = value.V_ref
"""Get [`AggregateDistributedGenerationA`](@ref) `Pfa_ref`."""
get_Pfa_ref(value::AggregateDistributedGenerationA) = value.Pfa_ref
"""Get [`AggregateDistributedGenerationA`](@ref) `ω_ref`."""
get_ω_ref(value::AggregateDistributedGenerationA) = value.ω_ref
"""Get [`AggregateDistributedGenerationA`](@ref) `Q_ref`."""
get_Q_ref(value::AggregateDistributedGenerationA) = value.Q_ref
"""Get [`AggregateDistributedGenerationA`](@ref) `P_ref`."""
Expand Down Expand Up @@ -405,6 +412,8 @@ set_Iq_lim!(value::AggregateDistributedGenerationA, val) = value.Iq_lim = val
set_V_ref!(value::AggregateDistributedGenerationA, val) = value.V_ref = val
"""Set [`AggregateDistributedGenerationA`](@ref) `Pfa_ref`."""
set_Pfa_ref!(value::AggregateDistributedGenerationA, val) = value.Pfa_ref = val
"""Set [`AggregateDistributedGenerationA`](@ref) `ω_ref`."""
set_ω_ref!(value::AggregateDistributedGenerationA, val) = value.ω_ref = val
"""Set [`AggregateDistributedGenerationA`](@ref) `Q_ref`."""
set_Q_ref!(value::AggregateDistributedGenerationA, val) = value.Q_ref = val
"""Set [`AggregateDistributedGenerationA`](@ref) `P_ref`."""
Expand Down
2 changes: 2 additions & 0 deletions src/models/generated/includes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ export get_θp_rad
export get_τ_limits
export get_τ_ref
export get_ω_lp
export get_ω_ref
export get_ωad
export get_ωf
export get_ωz
Expand Down Expand Up @@ -1062,6 +1063,7 @@ export set_θp_rad!
export set_τ_limits!
export set_τ_ref!
export set_ω_lp!
export set_ω_ref!
export set_ωad!
export set_ωf!
export set_ωz!

0 comments on commit bb836f0

Please sign in to comment.