-
Notifications
You must be signed in to change notification settings - Fork 70
/
GasTG.jl
153 lines (144 loc) · 5.41 KB
/
GasTG.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#=
This file is auto-generated. Do not edit.
=#
#! format: off
"""
mutable struct GasTG <: TurbineGov
R::Float64
T1::Float64
T2::Float64
T3::Float64
AT::Float64
Kt::Float64
V_lim::Tuple{Float64, Float64}
D_turb::Float64
P_ref::Float64
ext::Dict{String, Any}
states::Vector{Symbol}
n_states::Int
states_types::Vector{StateTypes}
internal::InfrastructureSystemsInternal
end
Parameters of Gas Turbine-Governor. GAST in PSSE and GAST_PTI in PowerWorld.
# Arguments
- `R::Float64`: Speed droop parameter, validation range: `(eps(), 0.1)`
- `T1::Float64`: Governor time constant in s, validation range: `(eps(), 0.5)`
- `T2::Float64`: Combustion chamber time constant, validation range: `(eps(), 0.5)`
- `T3::Float64`: Load limit time constant (exhaust gas measurement time), validation range: `(eps(), 5)`
- `AT::Float64`: Ambient temperature load limit, validation range: `(0, 1)`
- `Kt::Float64`: Load limit feedback gain, validation range: `(0, 5)`
- `V_lim::Tuple{Float64, Float64}`: Operational control limits on fuel valve opening (V_min, V_max)
- `D_turb::Float64`: Speed damping coefficient of gas turbine rotor, validation range: `(0, 0.5)`
- `P_ref::Float64`: Reference Load Set-point, validation range: `(0, nothing)`
- `ext::Dict{String, Any}`
- `states::Vector{Symbol}`: The states of the GAST model are:
x_g1: Fuel valve opening,
x_g2: Fuel flow,
x_g3: Exhaust temperature load
- `n_states::Int`: GasTG has 3 states
- `states_types::Vector{StateTypes}`: GAST has 3 differential states
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct GasTG <: TurbineGov
"Speed droop parameter"
R::Float64
"Governor time constant in s"
T1::Float64
"Combustion chamber time constant"
T2::Float64
"Load limit time constant (exhaust gas measurement time)"
T3::Float64
"Ambient temperature load limit"
AT::Float64
"Load limit feedback gain"
Kt::Float64
"Operational control limits on fuel valve opening (V_min, V_max)"
V_lim::Tuple{Float64, Float64}
"Speed damping coefficient of gas turbine rotor"
D_turb::Float64
"Reference Load Set-point"
P_ref::Float64
ext::Dict{String, Any}
"The states of the GAST model are:
x_g1: Fuel valve opening,
x_g2: Fuel flow,
x_g3: Exhaust temperature load"
states::Vector{Symbol}
"GasTG has 3 states"
n_states::Int
"GAST has 3 differential states"
states_types::Vector{StateTypes}
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end
function GasTG(R, T1, T2, T3, AT, Kt, V_lim, D_turb, P_ref=1.0, ext=Dict{String, Any}(), )
GasTG(R, T1, T2, T3, AT, Kt, V_lim, D_turb, P_ref, ext, [:x_g1, :x_g2, :x_g3], 3, [StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], InfrastructureSystemsInternal(), )
end
function GasTG(; R, T1, T2, T3, AT, Kt, V_lim, D_turb, P_ref=1.0, ext=Dict{String, Any}(), states=[:x_g1, :x_g2, :x_g3], n_states=3, states_types=[StateTypes.Differential, StateTypes.Differential, StateTypes.Differential], internal=InfrastructureSystemsInternal(), )
GasTG(R, T1, T2, T3, AT, Kt, V_lim, D_turb, P_ref, ext, states, n_states, states_types, internal, )
end
# Constructor for demo purposes; non-functional.
function GasTG(::Nothing)
GasTG(;
R=0,
T1=0,
T2=0,
T3=0,
AT=0,
Kt=0,
V_lim=(0.0, 0.0),
D_turb=0,
P_ref=0,
ext=Dict{String, Any}(),
)
end
"""Get [`GasTG`](@ref) `R`."""
get_R(value::GasTG) = value.R
"""Get [`GasTG`](@ref) `T1`."""
get_T1(value::GasTG) = value.T1
"""Get [`GasTG`](@ref) `T2`."""
get_T2(value::GasTG) = value.T2
"""Get [`GasTG`](@ref) `T3`."""
get_T3(value::GasTG) = value.T3
"""Get [`GasTG`](@ref) `AT`."""
get_AT(value::GasTG) = value.AT
"""Get [`GasTG`](@ref) `Kt`."""
get_Kt(value::GasTG) = value.Kt
"""Get [`GasTG`](@ref) `V_lim`."""
get_V_lim(value::GasTG) = value.V_lim
"""Get [`GasTG`](@ref) `D_turb`."""
get_D_turb(value::GasTG) = value.D_turb
"""Get [`GasTG`](@ref) `P_ref`."""
get_P_ref(value::GasTG) = value.P_ref
"""Get [`GasTG`](@ref) `ext`."""
get_ext(value::GasTG) = value.ext
"""Get [`GasTG`](@ref) `states`."""
get_states(value::GasTG) = value.states
"""Get [`GasTG`](@ref) `n_states`."""
get_n_states(value::GasTG) = value.n_states
"""Get [`GasTG`](@ref) `states_types`."""
get_states_types(value::GasTG) = value.states_types
"""Get [`GasTG`](@ref) `internal`."""
get_internal(value::GasTG) = value.internal
"""Set [`GasTG`](@ref) `R`."""
set_R!(value::GasTG, val) = value.R = val
"""Set [`GasTG`](@ref) `T1`."""
set_T1!(value::GasTG, val) = value.T1 = val
"""Set [`GasTG`](@ref) `T2`."""
set_T2!(value::GasTG, val) = value.T2 = val
"""Set [`GasTG`](@ref) `T3`."""
set_T3!(value::GasTG, val) = value.T3 = val
"""Set [`GasTG`](@ref) `AT`."""
set_AT!(value::GasTG, val) = value.AT = val
"""Set [`GasTG`](@ref) `Kt`."""
set_Kt!(value::GasTG, val) = value.Kt = val
"""Set [`GasTG`](@ref) `V_lim`."""
set_V_lim!(value::GasTG, val) = value.V_lim = val
"""Set [`GasTG`](@ref) `D_turb`."""
set_D_turb!(value::GasTG, val) = value.D_turb = val
"""Set [`GasTG`](@ref) `P_ref`."""
set_P_ref!(value::GasTG, val) = value.P_ref = val
"""Set [`GasTG`](@ref) `ext`."""
set_ext!(value::GasTG, val) = value.ext = val
"""Set [`GasTG`](@ref) `states_types`."""
set_states_types!(value::GasTG, val) = value.states_types = val