NREL-Sienna / PowerSystems.jl

Data structures in Julia to enable power systems analysis. Part of the Scalable Integrated Infrastructure Planning Initiative at the National Renewable Energy Lab.
https://www.nrel.gov/analysis/sienna.html
BSD 3-Clause "New" or "Revised" License
306 stars 76 forks source link

Discrepancy between pretty print and getter functions of unattached components #1128

Open kdayday opened 3 months ago

kdayday commented 3 months ago

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

Screenshot 2024-06-20 at 3 27 16 PM