PowerSystems.jl
PowerSystems.jl copied to clipboard
Discrepancy between pretty print and getter functions of unattached components
- It is unclear if the expected behavior of the
get_
functions is to return in natural units or device or system base. We've just added natural units (MW) to many of the docstrings - There is a discrepancy between the component print out and the getter functions of unattached components
- In the example below, we are trying to define a 30 MW generator:
-
rating
is defined in Device Base as 1.0 with abase_power
of 30 - The print statement reports the
rating
in Natural Units as 30.0 - The getter function returns 1.0 (on device base)
- After attaching the generator to the system, the print statement reports
rating
on the system base as 0.3 - The getter function returns 0.3 (on system base)
-
A different example is attached -- for Line
, which doesn't have a device_base
, it's unclear how to define the rating
. Inputting it as natural units (200 MW) appears to get multiplied by System Base.
julia> gas2 = ThermalStandard(
"gas_in_db",
true,
true,
bus2,
0.0,
0.0,
1.0,
(min=0.30, max=1.0),
nothing,
(up=.10, down=.10),
ThermalGenerationCost(nothing),
30.0,
(up=0.3, down=0.3),
false,
PrimeMovers.CC,
ThermalFuels.NATURAL_GAS)
┌ Warning: SystemUnitSetting not defined, using NATURAL_UNITS for displaying device specification.
└ @ PowerSystems ~/Documents/repos/Public_Github/PowerSystems.jl/src/utils/print.jl:192
ThermalStandard: gas_in_db:
name: gas_in_db
available: true
status: true
bus: ACBus: bus2
active_power: 0.0
reactive_power: 0.0
rating: 30.0
active_power_limits: (min = 9.0, max = 30.0)
reactive_power_limits: nothing
ramp_limits: (up = 3.0, down = 3.0)
operation_cost: ThermalGenerationCost composed of variable: CostCurve{LinearCurve}
base_power: 30.0
time_limits: (up = 0.3, down = 0.3)
must_run: false
prime_mover_type: PrimeMovers.CC = 4
fuel: ThermalFuels.NATURAL_GAS = 7
services: 0-element Vector{Service}
time_at_status: 10000.0
dynamic_injector: nothing
ext: Dict{String, Any}()
internal: InfrastructureSystems.InfrastructureSystemsInternal
has_supplemental_attributes: false
has_time_series: false
julia> get_rating(gas2)
1.0
julia> add_component!(sys, gas2)
julia> gas2
ThermalStandard: gas_in_db:
name: gas_in_db
available: true
status: true
bus: ACBus: bus2
active_power: 0.0
reactive_power: 0.0
rating: 0.3
active_power_limits: (min = 0.09, max = 0.3)
reactive_power_limits: nothing
ramp_limits: (up = 0.03, down = 0.03)
operation_cost: ThermalGenerationCost composed of variable: CostCurve{LinearCurve}
base_power: 30.0
time_limits: (up = 0.3, down = 0.3)
must_run: false
prime_mover_type: PrimeMovers.CC = 4
fuel: ThermalFuels.NATURAL_GAS = 7
services: 0-element Vector{Service}
time_at_status: 10000.0
dynamic_injector: nothing
ext: Dict{String, Any}()
InfrastructureSystems.SystemUnitsSettings:
base_value: 100.0
unit_system: UnitSystem.SYSTEM_BASE = 0
has_supplemental_attributes: false
has_time_series: false
julia> get_rating(gas2)
0.3