Public API Reference
Modeling
PowerSystems.PowerSystems — ModuleModule for constructing self-contained power system objects.
PowerSystems.Component — TypeSupertype for all PowerSystems components. All subtypes must include a InfrastructureSystemsInternal member. Subtypes should call InfrastructureSystemsInternal() by default, but also must provide a constructor that allows existing values to be deserialized.
PowerSystems.Device — TypeSupertype for "devices" (bus, line, etc.)
InfrastructureSystems.supports_supplemental_attributes — Methodsupports_supplemental_attributes(_::Device) -> Bool
All PowerSystems Device types support supplemental attributes. This can be overridden for custom component types that do not support supplemental attributes.
InfrastructureSystems.supports_time_series — Methodsupports_time_series(_::Device) -> Bool
All PowerSystems Device types support time series. This can be overridden for custom component types that do not support time series.
PowerSystems.ACBranch — TypeSupertype for all AC branches connecting AC nodes (ACBus) or Areas.
Abstract subtypes include ACTransmission (AC transmission lines and transformers) and TwoTerminalHVDC (two-terminal HVDC links between AC buses).
See also: Branch, DCBranch, ACTransmission, TwoTerminalHVDC
PowerSystems.ACTransmission — TypeSupertype for all AC transmission devices connecting AC nodes only.
Concrete subtypes include Line, MonitoredLine, and DiscreteControlledACBranch. Abstract subtypes include TwoWindingTransformer and ThreeWindingTransformer.
See also: ACBranch, TwoWindingTransformer, ThreeWindingTransformer
PowerSystems.Branch — TypeSupertype for all transmission branches in a power system.
Concrete subtypes include AreaInterchange. Abstract subtypes include ACBranch (AC transmission) and DCBranch (DC transmission).
PowerSystems.DCBranch — TypeSupertype for all DC branches connecting DC nodes (DCBus) only.
Concrete subtypes include TModelHVDCLine.
See also: Branch, ACBranch, TwoTerminalHVDC
PowerSystems.ThreeWindingTransformer — TypeSupertype for all three-winding transformer types.
Concrete subtypes include Transformer3W and PhaseShiftingTransformer3W.
See also: ACTransmission, TwoWindingTransformer
PowerSystems.TwoTerminalHVDC — TypeSupertype for all two-terminal HVDC transmission devices between AC buses.
Not to be confused with DCBranch, which connects DC nodes. Concrete subtypes include TwoTerminalGenericHVDCLine, TwoTerminalLCCLine, and TwoTerminalVSCLine.
PowerSystems.TwoWindingTransformer — TypeSupertype for all two-winding transformer types.
Concrete subtypes include Transformer2W, TapTransformer, and PhaseShiftingTransformer.
See also: ACTransmission, ThreeWindingTransformer
PowerSystems.AVR — TypeSupertype for all Automatic Voltage Regulator (AVR) models for DynamicGenerator components.
Concrete subtypes include AVRFixed, AVRSimple, AVRTypeI, AVRTypeII, IEEET1, ESDC1A, ESAC1A, SEXS, SCRX, and others.
PowerSystems.Converter — TypeSupertype for all power electronic converter models for DynamicInverter components.
Concrete subtypes include AverageConverter, RenewableEnergyConverterTypeA, and RenewableEnergyVoltageConverterTypeA.
PowerSystems.DCSource — TypeSupertype for all DC source models for DynamicInverter components.
Concrete subtypes include FixedDCSource and ZeroOrderBESS.
PowerSystems.Filter — TypeSupertype for all output filter models for DynamicInverter components.
Concrete subtypes include LCLFilter, LCFilter, and RLFilter.
PowerSystems.FrequencyEstimator — TypeSupertype for all frequency estimator models for DynamicInverter components.
Concrete subtypes include KauraPLL, ReducedOrderPLL, and FixedFrequency.
PowerSystems.InnerControl — TypeSupertype for all inner control loop models for DynamicInverter components.
Concrete subtypes include VoltageModeControl, CurrentModeControl, and RECurrentControlB.
PowerSystems.Machine — TypeSupertype for all synchronous machine models for DynamicGenerator components.
Concrete subtypes include BaseMachine, OneDOneQMachine, SauerPaiMachine, MarconatoMachine, RoundRotorMachine, SalientPoleMachine, AndersonFouadMachine, FullMachine, and others.
PowerSystems.OutputCurrentLimiter — TypeSupertype for all output current limiter models for DynamicInverter components.
Concrete subtypes include MagnitudeOutputCurrentLimiter, InstantaneousOutputCurrentLimiter, PriorityOutputCurrentLimiter, SaturationOutputCurrentLimiter, and HybridOutputCurrentLimiter.
PowerSystems.PSS — TypeSupertype for all Power System Stabilizer (PSS) models for DynamicGenerator components.
Concrete subtypes include PSSFixed, PSSSimple, IEEEST, PSS2A, PSS2B, PSS2C, STAB1, and CSVGN1.
PowerSystems.Shaft — TypeSupertype for all shaft and rotor models for DynamicGenerator components.
Concrete subtypes include SingleMass and FiveMassShaft.
PowerSystems.TurbineGov — TypeSupertype for all turbine governor models for DynamicGenerator components.
Concrete subtypes include TGFixed, TGTypeI, TGTypeII, GasTG, GeneralGovModel, HydroTurbineGov, IEEETurbineGov1, SteamTurbineGov1, DEGOV, DEGOV1, and others.
PowerSystems.get_base_power — Methodget_base_power(c::Component) -> Float64
Default behavior of a component. If there is no base_power field, assume is in the system's base power.
PowerSystems.set_dynamic_injector! — Methodset_dynamic_injector!(
static_injector::StaticInjection,
dynamic_injector::Union{Nothing, DynamicInjection}
)
Set the dynamic injector for a static injection device.
Passes nothing to remove an existing dynamic injector from the device. Throws ArgumentError if the device already has a dynamic injector and a non-nothing value is provided.
Arguments
static_injector::StaticInjection: The static injection device.dynamic_injector::Union{Nothing,DynamicInjection}: The dynamic injector to set, ornothingto remove it.
See also: get_dynamic_injector
PowerSystems.clear_services! — Methodclear_services!(device::Device)
Remove all services attached to the device.
This is a no-op if the device does not support services.
Arguments
device::Device: The device.
See also: remove_service!, get_services
PowerSystems.clear_turbines! — Methodclear_turbines!(device::HydroReservoir)
Remove all turbines attached to the hydro reservoir.
Clears both upstream and downstream turbine associations from the reservoir.
Arguments
device::HydroReservoir: The hydro reservoir.
See also: get_upstream_turbines, get_downstream_turbines
PowerSystems.has_downstream_turbine — Methodhas_downstream_turbine(
reservoir::HydroReservoir,
turbine::HydroUnit
) -> Bool
Return true if turbine is among the downstream turbines of reservoir.
Arguments
reservoir::HydroReservoir: The hydro reservoir.turbine::HydroUnit: The turbine to check.
See also: has_downstream_turbine for any turbine, get_downstream_turbines
PowerSystems.has_downstream_turbine — Methodhas_downstream_turbine(reservoir::HydroReservoir) -> Bool
Return true if any downstream hydro unit is attached to the reservoir.
Arguments
reservoir::HydroReservoir: The hydro reservoir.
PowerSystems.has_service — Methodhas_service(device::Device, service::Service) -> Bool
Return true if the service is attached to the device.
Arguments
See also: has_service by type
PowerSystems.has_service — Methodhas_service(device::Device, _::Type{T<:Service}) -> Bool
Return true if a service of type T is attached to the device.
Returns false immediately if the device does not support services.
Arguments
device::Device: The device.T::Type{<:Service}: The service type to check for.
See also: has_service by instance
PowerSystems.has_upstream_turbine — Methodhas_upstream_turbine(
reservoir::HydroReservoir,
turbine::HydroUnit
) -> Bool
Return true if turbine is among the upstream turbines of reservoir.
Arguments
reservoir::HydroReservoir: The hydro reservoir.turbine::HydroUnit: The turbine to check.
See also: has_upstream_turbine for any turbine, get_upstream_turbines
PowerSystems.has_upstream_turbine — Methodhas_upstream_turbine(reservoir::HydroReservoir) -> Bool
Return true if any upstream hydro unit is attached to the reservoir.
Arguments
reservoir::HydroReservoir: The hydro reservoir.
PowerSystems.remove_service! — Methodremove_service!(device::Device, service::Service)
Remove a service from a device.
Throws ArgumentError if the service is not attached to the device.
Arguments
device::Device: The device from which to remove the service.service::Service: The service to remove.
See also: clear_services!, has_service
PowerSystems.remove_turbine! — Methodremove_turbine!(
reservoir::HydroReservoir,
device::HydroUnit
)
Remove a hydro turbine from a hydro reservoir.
Throws ArgumentError if the hydro turbine is not attached to the reservoir.
Arguments
reservoir::HydroReservoir: The hydro reservoir.device::HydroUnit: The turbine to remove.
See also: clear_turbines!, has_upstream_turbine, has_downstream_turbine
PowerSystems.ControllableLoad — TypeSupertype for all controllable electric loads.
Controllable loads can have their consumption adjusted in response to system conditions or operator dispatch. Concrete subtypes include InterruptiblePowerLoad, InterruptibleStandardLoad, and ShiftablePowerLoad.
See also: StaticLoad, ElectricLoad
PowerSystems.ElectricLoad — TypeSupertype for all electric loads.
Electric loads consume power from the grid. Abstract subtypes include StaticLoad (fixed consumption) and ControllableLoad (adjustable consumption). The concrete subtype FixedAdmittance and SwitchedAdmittance also inherit directly from ElectricLoad.
See also: StaticInjection, StaticLoad, ControllableLoad
PowerSystems.StaticLoad — TypeSupertype for all static electric loads.
Static loads have fixed consumption that cannot be controlled or curtailed. Concrete subtypes include PowerLoad, StandardLoad, ExponentialLoad, and MotorLoad.
See also: ElectricLoad, ControllableLoad
PowerSystems.ACBus — MethodACBus(
number,
name,
available,
bustype::String,
angle,
voltage,
voltage_limits,
base_voltage,
area,
load_zone;
ext
) -> ACBus
Construct an ACBus with bustype specified as a String for legacy compatibility.
The string is converted to the corresponding ACBusTypes enum value.
PowerSystems.ConstantReserve — MethodConstruct a ConstantReserve from a contributingdevices iterator, collecting it into a vector.
PowerSystems.DiscreteControlledACBranch — TypeDiscreteControlledACBranch(
name,
available,
arc,
active_power_flow,
reactive_power_flow,
r,
x,
rating,
discrete_branch_type::String,
branch_status::String
) -> DiscreteControlledACBranch
DiscreteControlledACBranch(
name,
available,
arc,
active_power_flow,
reactive_power_flow,
r,
x,
rating,
discrete_branch_type::String,
branch_status::String,
ext
) -> DiscreteControlledACBranch
DiscreteControlledACBranch(
name,
available,
arc,
active_power_flow,
reactive_power_flow,
r,
x,
rating,
discrete_branch_type::String,
branch_status::String,
ext,
internal
) -> DiscreteControlledACBranch
Construct a DiscreteControlledACBranch with enum types specified as strings for legacy compatibility.
The discrete_branch_type and branch_status strings are converted to the corresponding DiscreteControlledBranchType and DiscreteControlledBranchStatus enum values.
PowerSystems.EnergyReservoirStorage — TypeEnergyReservoirStorage(
name::AbstractString,
available::Bool,
bus,
prime_mover_type,
storage_technology_type,
storage_capacity,
storage_level_limits,
initial_storage_capacity_level,
rating,
active_power,
input_active_power_limits,
output_active_power_limits,
efficiency,
reactive_power,
reactive_power_limits,
base_power,
::Nothing
)
EnergyReservoirStorage(
name::AbstractString,
available::Bool,
bus,
prime_mover_type,
storage_technology_type,
storage_capacity,
storage_level_limits,
initial_storage_capacity_level,
rating,
active_power,
input_active_power_limits,
output_active_power_limits,
efficiency,
reactive_power,
reactive_power_limits,
base_power,
::Nothing,
services
)
EnergyReservoirStorage(
name::AbstractString,
available::Bool,
bus,
prime_mover_type,
storage_technology_type,
storage_capacity,
storage_level_limits,
initial_storage_capacity_level,
rating,
active_power,
input_active_power_limits,
output_active_power_limits,
efficiency,
reactive_power,
reactive_power_limits,
base_power,
::Nothing,
services,
dynamic_injector
)
EnergyReservoirStorage(
name::AbstractString,
available::Bool,
bus,
prime_mover_type,
storage_technology_type,
storage_capacity,
storage_level_limits,
initial_storage_capacity_level,
rating,
active_power,
input_active_power_limits,
output_active_power_limits,
efficiency,
reactive_power,
reactive_power_limits,
base_power,
::Nothing,
services,
dynamic_injector,
ext
)
EnergyReservoirStorage(
name::AbstractString,
available::Bool,
bus,
prime_mover_type,
storage_technology_type,
storage_capacity,
storage_level_limits,
initial_storage_capacity_level,
rating,
active_power,
input_active_power_limits,
output_active_power_limits,
efficiency,
reactive_power,
reactive_power_limits,
base_power,
::Nothing,
services,
dynamic_injector,
ext,
internal
)
Construct an EnergyReservoirStorage without an explicit operational cost.
Uses a default StorageCost when operation_cost is nothing.
PowerSystems.FACTSControlDevice — TypeFACTSControlDevice(
name,
available,
bus,
control_mode::String,
voltage_setpoint,
max_shunt_current,
reactive_power_required
) -> FACTSControlDevice
FACTSControlDevice(
name,
available,
bus,
control_mode::String,
voltage_setpoint,
max_shunt_current,
reactive_power_required,
services
) -> FACTSControlDevice
FACTSControlDevice(
name,
available,
bus,
control_mode::String,
voltage_setpoint,
max_shunt_current,
reactive_power_required,
services,
dynamic_injector
) -> FACTSControlDevice
FACTSControlDevice(
name,
available,
bus,
control_mode::String,
voltage_setpoint,
max_shunt_current,
reactive_power_required,
services,
dynamic_injector,
ext
) -> FACTSControlDevice
FACTSControlDevice(
name,
available,
bus,
control_mode::String,
voltage_setpoint,
max_shunt_current,
reactive_power_required,
services,
dynamic_injector,
ext,
internal
) -> FACTSControlDevice
Construct a FACTSControlDevice with control_mode specified as a string.
The string is converted to the corresponding FACTSOperationModes enum value.
PowerSystems.Line — MethodLine(
name,
available::Bool,
active_power_flow::Float64,
reactive_power_flow::Float64,
arc::Arc,
r,
x,
b,
rating,
angle_limits::Float64
) -> Line
Construct a Line accepting angle_limits as a Float64, converting it to a symmetric (min = -angle_limits, max = angle_limits) named tuple.
PowerSystems.Generator — TypeSupertype for all generation technologies
PowerSystems.HydroGen — TypeSupertype for all Hydropower generation technologies
PowerSystems.HydroUnit — TypeSupertype for hydropower generation technologies represented as units.
Subtypes include HydroTurbine and HydroPumpTurbine.
PowerSystems.RenewableGen — TypeSupertype for all renewable generation technologies
Requires the implementation of get_ratingand get_power_factor methods
PowerSystems.ThermalGen — TypeSupertype for all Thermal generation technologies
PowerSystems.get_max_active_power — Methodget_max_active_power(d::RenewableGen) -> Float64
Return the max active power for the Renewable Generation calculated as the rating * power_factor
PowerSystems.get_max_reactive_power — Methodget_max_reactive_power(d::RenewableGen) -> Float64
Return the max reactive power for the Renewable Generation calculated as the rating * sin(acos(power_factor))
PowerSystems.AbstractReserve — TypeSupertype for all reserve products, both spinning and non-spinning.
Concrete subtypes include Reserve (parameterized by ReserveDirection) and ReserveNonSpinning.
PowerSystems.Reserve — TypeAbstract parametric type for all reserve products, parameterized on direction T <: ReserveDirection (see ReserveDirection).
Use the direction subtypes ReserveUp, ReserveDown, or ReserveSymmetric to specify the direction of the reserve product, e.g., ConstantReserve{ReserveUp}.
See also: ConstantReserve, VariableReserve, ReserveDemandCurve
PowerSystems.ReserveDirection — TypeAbstract supertype used to specify if a Reserve is upwards, downwards, or symmetric.
Subtypes: ReserveUp, ReserveDown, ReserveSymmetric
PowerSystems.ReserveDown — TypeA downwards reserve to decrease generation or increase load.
Downwards reserves are used when total load falls below its expected level, typically due to forecast errors or contingencies.
A Reserve can be specified as a ReserveDown when it is defined.
See also: ReserveUp, ReserveSymmetric
PowerSystems.ReserveNonSpinning — TypeSupertype for non-spinning (quick-start) reserve products.
Non-spinning reserves can be brought online within a short time but are not currently synchronized to the grid. See also Reserve for spinning reserves.
Concrete subtypes include ConstantReserveNonSpinning and VariableReserveNonSpinning.
PowerSystems.ReserveSymmetric — TypeA symmetric reserve, procuring the same quantity (MW) of both upwards and downwards reserves.
Unlike ReserveUp and ReserveDown, which can be used to specify different quantities of upwards and downwards reserves independently, ReserveSymmetric requires equal procurement in both directions.
A Reserve can be specified as a ReserveSymmetric when it is defined.
See also: ReserveUp, ReserveDown
PowerSystems.ReserveUp — TypeAn upwards reserve to increase generation or reduce load.
Upwards reserves are used when total load exceeds its expected level, typically due to forecast errors or contingencies.
A Reserve can be specified as a ReserveUp when it is defined.
See also: ReserveDown, ReserveSymmetric
PowerSystems.Storage — TypeAbstract supertype for energy storage technologies.
Storage devices can both inject and absorb power from the grid. The concrete subtype is EnergyReservoirStorage.
See also: StaticInjection
PowerSystems.Service — TypeAbstract supertype for all system services (ancillary services).
Services represent additional requirements and support to ensure reliable electricity delivery. Examples include reserve products for responding to unexpected disturbances (such as the sudden loss of a generator or transmission line), automatic generation control, and transmission interface limits.
Subtypes: AbstractReserve, AGC, ConstantReserveGroup, TransmissionInterface
InfrastructureSystems.supports_supplemental_attributes — Methodsupports_supplemental_attributes(_::Service) -> Bool
Return true since all Service types support supplemental attributes by default.
Override this method for custom service types that do not support supplemental attributes.
InfrastructureSystems.supports_time_series — Methodsupports_time_series(_::Service) -> Bool
Return true since all Service types support time series by default.
Override this method for custom types that do not support time series.
PowerSystems.AggregationTopology — TypeAbstract supertype for geographical or electrical aggregation regions.
See also: Topology
PowerSystems.Bus — TypeAbstract supertype for all bus types in a power system network.
PowerSystems.Topology — TypeAbstract supertype for network topology elements.
Subtypes: AggregationTopology (e.g., Area, LoadZone), Bus (e.g., ACBus, DCBus), and Arc
InfrastructureSystems.supports_time_series — Methodsupports_time_series(_::AggregationTopology) -> Bool
Return true since all AggregationTopology types support time series by default.
Override this method for specific custom aggregation topology types that do not support time series.
PowerSystems.get_aggregation_topology_accessor — Methodget_aggregation_topology_accessor(
_::Type{T<:AggregationTopology}
) -> typeof(get_area)
Abstract interface method — return the accessor function to call on an ACBus to retrieve its AggregationTopology value for subtype T.
Throws an error if not implemented for T. Concrete subtypes of AggregationTopology must provide a method for this function.
See also: get_area, get_load_zone
PowerSystems.DynamicComponent — TypeAbstract type for all sub-components used to compose a DynamicInjection device.
Examples include machine models (BaseMachine), AVR models (AVRFixed), and turbine governor models (TGFixed).
See also: DynamicInjection
PowerSystems.DynamicInjection — TypeAbstract type for all Dynamic Devices.
A dynamic injection is the continuous time response of a generator, typically modeled with differential equations.
DynamicInjection models are attached to StaticInjection components, which together define all the information needed to model the device in a dynamic simulation.
See also: DynamicComponent, StaticInjection
PowerSystems.get_dynamic_components — Methodget_dynamic_components(
device::DynamicInjection
) -> Base.Generator{I, F} where {I<:(Base.Iterators.Filter{PowerSystems.var"#get_dynamic_components##2#get_dynamic_components##3", I} where I<:(Base.Iterators.Zip{Is} where Is<:Tuple{Any, Tuple})), F<:(PowerSystems.var"#get_dynamic_components##0#get_dynamic_components##1"{<:DynamicInjection})}
Return an iterator of all DynamicComponent fields of a DynamicInjection device.
PowerSystems.get_frequency_droop — Methodget_frequency_droop(_::DynamicInjection) -> Any
Return the frequency droop of a DynamicInjection device.
Throws ArgumentError if not implemented for the specific subtype.
See also: get_frequency_droop for StaticInjection, get_frequency_droop for DynamicGenerator
PowerSystems.get_states — Methodget_states(_::DynamicInjection) -> Vector{Symbol}
Return an empty vector of states for a DynamicInjection device.
PowerSystems.get_states_types — Methodget_states_types(d::DynamicComponent) -> Vector{StateTypes}
Return the StateTypes for each state of a DynamicComponent.
The default implementation returns StateTypes.Differential for all states. Subtypes may override this method to specify different state types.
PowerSystems.StaticInjection — TypeAbstract type for devices that inject power or current.
A static injection is a steady state injection, such as modeling the output power of a generator held constant over a five-minute period.
Many StaticInjection models can accept a DynamicInjection model as an optional add-on for conducting dynamic simulations.
Subtypes: Generator, ElectricLoad, Storage, StaticInjectionSubsystem
See also: Device
PowerSystems.get_dynamic_injector — Methodget_dynamic_injector(
d::StaticInjection
) -> Union{Nothing, DynamicInjection}
Return the DynamicInjection component attached to this StaticInjection device, or nothing if none is attached.
PowerSystems.get_frequency_droop — Methodget_frequency_droop(static_injector::StaticInjection) -> Any
Return the frequency droop of the device's DynamicInjection model.
Throws ArgumentError if no dynamic injector is attached.
Arguments
static_injector::StaticInjection: The static injection device.
See also: get_frequency_droop for DynamicGenerator, get_frequency_droop for DynamicInjection
PowerSystems.get_services — Methodget_services(device::Device) -> Vector{Service}
Return the services attached to a device.
Throws an error for devices that do not support services (see supports_services).
Arguments
device::Device: The device.
See also: add_service!, remove_service!, has_service
PowerSystems.supports_active_power — Methodsupports_active_power(_::StaticInjection) -> Bool
Return true if the device has active power as a controllable parameter.
PowerSystems.supports_reactive_power — Methodsupports_reactive_power(_::StaticInjection) -> Bool
Return true if the device has reactive power as a controllable parameter.
PowerSystems.supports_voltage_control — Methodsupports_voltage_control(_::StaticInjection) -> Bool
Return true if the device can control voltage at its connected bus.
InfrastructureSystems.get_component_uuids — Methodget_component_uuids(
sys::System,
subsystem_name::AbstractString
) -> Set{Base.UUID}
Return the UUIDs of all components in the given subsystem.
PowerSystems.add_component_to_subsystem! — Methodadd_component_to_subsystem!(
sys::System,
subsystem_name::AbstractString,
component::Component
)
Add a component to a subsystem.
The subsystem must already exist (see add_subsystem!). If the component is a StaticInjectionSubsystem, all of its subcomponents are also added.
Throws ArgumentError if the subsystem name is not stored.
See also: remove_component_from_subsystem!, get_subsystem_components
PowerSystems.add_subsystem! — Methodadd_subsystem!(sys::System, subsystem_name::AbstractString)
Add a new subsystem to the system.
Subsystems are named groupings of components within a System, useful for representing e.g., regional partitions or study areas. Components must be added separately via add_component_to_subsystem!.
Throws InfrastructureSystems.InvalidValue if the number of subsystems would exceed the number of buses in the system.
See also: remove_subsystem!, get_subsystems
PowerSystems.get_assigned_subsystems — Methodget_assigned_subsystems(
sys::System,
component::Component
) -> Vector
Return a Vector of subsystem name strings that contain the component.
See also: is_assigned_to_subsystem, add_component_to_subsystem!
PowerSystems.get_num_subsystems — Methodget_num_subsystems(sys::System) -> Int64
Return the number of subsystems stored in the system.
See also: get_subsystems, add_subsystem!
PowerSystems.get_subsystem_components — Methodget_subsystem_components(
sys::System,
subsystem_name::AbstractString
) -> Base.Generator{Set{Base.UUID}, InfrastructureSystems.var"#get_subsystem_components##0#get_subsystem_components##1"{InfrastructureSystems.SystemData}}
Return an iterator of all components in the subsystem.
Throws ArgumentError if the subsystem name is not stored.
See also: add_component_to_subsystem!, get_subsystems
PowerSystems.get_subsystems — Methodget_subsystems(
sys::System
) -> Base.KeySet{String, Dict{String, Set{Base.UUID}}}
Return an iterator of subsystem name strings stored in the system.
See also: add_subsystem!, get_num_subsystems, get_subsystem_components
PowerSystems.has_component — Methodhas_component(
sys::System,
subsystem_name::AbstractString,
component::Component
) -> Bool
Return true if the component is assigned to the subsystem.
See also: is_assigned_to_subsystem, get_subsystem_components, add_component_to_subsystem!
PowerSystems.has_subsystems — Methodhas_subsystems(sys::System) -> Bool
Return true if the system has one or more subsystems.
See also: get_subsystems, add_subsystem!
PowerSystems.is_assigned_to_subsystem — Methodis_assigned_to_subsystem(
sys::System,
component::Component,
subsystem_name::AbstractString
) -> Bool
Return true if the component is assigned to the named subsystem.
See also: is_assigned_to_subsystem(sys, component), get_assigned_subsystems
PowerSystems.is_assigned_to_subsystem — Methodis_assigned_to_subsystem(
sys::System,
component::Component
) -> Bool
Return true if the component is assigned to any subsystem.
See also: is_assigned_to_subsystem(sys, component, subsystem_name), get_assigned_subsystems
PowerSystems.remove_component_from_subsystem! — Methodremove_component_from_subsystem!(
sys::System,
subsystem_name::AbstractString,
component::Component
)
Remove a component from a subsystem.
If the component is a StaticInjectionSubsystem, all of its subcomponents are also removed from the subsystem.
Throws ArgumentError if the subsystem name or component is not stored.
See also: add_component_to_subsystem!, get_subsystem_components
PowerSystems.remove_component_from_subsystems! — Methodremove_component_from_subsystems!(
sys::System,
component::Component
)
Remove a component from all subsystems it belongs to.
PowerSystems.remove_subsystem! — Methodremove_subsystem!(
sys::System,
subsystem_name::AbstractString
)
Remove a subsystem from the system.
Throws ArgumentError if the subsystem name is not stored.
See also: add_subsystem!, get_subsystems
PowerSystems.StaticInjectionSubsystem — TypeAbstract type for a grouped set of StaticInjection devices treated as a single injection unit.
Subtypes must implement get_subcomponents to return the individual component members, which must be attached to the System as masked components.
See also: StaticInjection, HybridSystem
PowerSystems.copy_subcomponent_time_series! — Methodcopy_subcomponent_time_series!(
subsystem::StaticInjectionSubsystem,
subcomponent::Component
)
Copy all time series data from a subcomponent to the subsystem by copying the underlying references rather than duplicating the data.
See also: StaticInjectionSubsystem
PowerSystems.OperationalCost — TypeAbstract supertype for all operational cost representations.
Concrete subtypes:
InfrastructureSystems.get_fuel_cost — Methodget_fuel_cost(
component::HybridSystem;
start_time,
len
) -> Union{Float64, TimeSeries.TimeArray}
Get the fuel cost of a HybridSystem's thermal subunit.
HybridSystem is a StaticInjectionSubsystem that aggregates subunits; fuel cost for thermal power comes from the ThermalGen subcomponent, not the hybrid's top-level MarketBidCost. This method delegates to get_fuel_cost on the thermal subunit when present.
Arguments
component::HybridSystem: The hybrid systemstart_time: Optional start time for time series lookuplen: Optional length for time series lookup
Returns
The fuel cost from the thermal subunit (scalar or time series per get_fuel_cost).
Throws
ArgumentErrorif the hybrid has no thermal unit (get_thermal_unit(component) === nothing).
InfrastructureSystems.get_fuel_cost — Methodget_fuel_cost(
component::StaticInjection;
start_time,
len
) -> Union{Float64, TimeSeries.TimeArray}
Get the fuel cost of the component's variable cost, which must be a FuelCurve.
PowerSystems.get_decremental_initial_input — Methodget_decremental_initial_input(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, TimeSeries.TimeArray}
Retrieve the decremental_initial_input for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of Float64s; if the field is not a time series, the function returns a single Float64 or nothing.
PowerSystems.get_decremental_offer_curves — Methodget_decremental_offer_curves(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeries.TimeArray}
Retrieve the decremental_offer_curves for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of PiecewiseStepDatas; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_decremental_variable_cost — Methodget_decremental_variable_cost(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesKey, TimeSeries.TimeArray}
Retrieve the decremental variable cost bid for a StaticInjection device with a MarketBidCost. If any of the relevant fields (decremental_offer_curves, decremental_initial_input, no_load_cost) are time series, the user may specify start_time and len and the function returns a TimeArray of CostCurve{PiecewiseIncrementalCurve}s; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_export_offer_curves — Methodget_export_offer_curves(
device::StaticInjection,
cost::ImportExportCost;
start_time,
len
) -> Union{CostCurve{PiecewiseIncrementalCurve}, TimeSeries.TimeArray}
Retrieve the export_offer_curves for a StaticInjection device with a ImportExportCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of PiecewiseStepDatas; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_export_variable_cost — Methodget_export_variable_cost(
device::StaticInjection,
cost::ImportExportCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesKey, TimeSeries.TimeArray}
Retrieve the export variable cost bid for a StaticInjection device with an ImportExportCost. If export_offer_curves is a time series, the user may specify start_time and len and the function returns a TimeArray of CostCurve{PiecewiseIncrementalCurve}s; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_import_offer_curves — Methodget_import_offer_curves(
device::StaticInjection,
cost::ImportExportCost;
start_time,
len
) -> Union{CostCurve{PiecewiseIncrementalCurve}, TimeSeries.TimeArray}
Retrieve the import_offer_curves for a StaticInjection device with a ImportExportCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of PiecewiseStepDatas; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_import_variable_cost — Methodget_import_variable_cost(
device::StaticInjection,
cost::ImportExportCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesKey, TimeSeries.TimeArray}
Retrieve the import variable cost bid for a StaticInjection device with an ImportExportCost. If import_offer_curves is a time series, the user may specify start_time and len and the function returns a TimeArray of CostCurve{PiecewiseIncrementalCurve}s; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_incremental_initial_input — Methodget_incremental_initial_input(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, TimeSeries.TimeArray}
Retrieve the incremental_initial_input for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of Float64s; if the field is not a time series, the function returns a single Float64 or nothing.
PowerSystems.get_incremental_offer_curves — Methodget_incremental_offer_curves(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeries.TimeArray}
Retrieve the incremental_offer_curves for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of PiecewiseStepDatas; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve} or nothing.
PowerSystems.get_incremental_variable_cost — Methodget_incremental_variable_cost(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesKey, TimeSeries.TimeArray}
Retrieve the incremental variable cost bid for a StaticInjection device with a MarketBidCost. If any of the relevant fields (incremental_offer_curves, incremental_initial_input, no_load_cost) are time series, the user may specify start_time and len and the function returns a TimeArray of CostCurve{PiecewiseIncrementalCurve}s; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve}.
PowerSystems.get_no_load_cost — Methodget_no_load_cost(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, Float64, TimeSeries.TimeArray}
Retrieve the no-load cost data for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of Float64s; if the field is not a time series, the function returns a single Float64 or nothing.
PowerSystems.get_services_bid — Methodget_services_bid(
device::StaticInjection,
cost::MarketBidCost,
service::Service;
start_time,
len
) -> TimeSeries.TimeArray
Return service bid time series data for a StaticInjection device with a MarketBidCost. The user may specify start_time and len and the function returns a TimeArray of CostCurves.
PowerSystems.get_shut_down — Methodget_shut_down(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Float64, TimeSeries.TimeArray}
Retrieve the shutdown cost data for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of Float64s; if the field is not a time series, the function returns a single Float64.
PowerSystems.get_start_up — Methodget_start_up(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{@NamedTuple{hot::Float64, warm::Float64, cold::Float64}, TimeSeries.TimeArray}
Retrieve the startup cost data for a StaticInjection device with a MarketBidCost. If this field is a time series, the user may specify start_time and len and the function returns a TimeArray of StartUpStagess; if the field is not a time series, the function returns a single StartUpStages.
PowerSystems.get_variable_cost — Methodget_variable_cost(
service::ReserveDemandCurve;
start_time,
len
) -> Union{CostCurve{PiecewiseIncrementalCurve}, TimeSeries.TimeArray}
Retrieve the variable cost data for a ReserveDemandCurve. The user may specify start_time and len and the function returns a TimeArray of CostCurves.
PowerSystems.get_variable_cost — Methodget_variable_cost(
device::StaticInjection,
cost::MarketBidCost;
start_time,
len
) -> Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesKey, TimeSeries.TimeArray}
Retrieve the variable cost bid for a StaticInjection device with a MarketBidCost. If any of the relevant fields (incremental_offer_curves, incremental_initial_input, no_load_cost) are time series, the user may specify start_time and len and the function returns a TimeArray of CostCurve{PiecewiseIncrementalCurve}s; if the field is not a time series, the function returns a single CostCurve{PiecewiseIncrementalCurve}.
PowerSystems.set_decremental_initial_input! — Methodset_decremental_initial_input!(
sys::System,
component::StaticInjection,
data::Union{Float64, TimeSeriesData}
) -> Union{ForecastKey, StaticTimeSeriesKey}
Set the decremental_initial_input for a StaticInjection device with a MarketBidCost to either a scalar or a time series.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicetime_series_data::Union{Float64, IS.TimeSeriesData}: the data. If a time series, must be of eltypeFloat64.
PowerSystems.set_decremental_variable_cost! — Methodset_decremental_variable_cost!(
sys::System,
component::StaticInjection,
data::Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesData},
power_units::UnitSystem
)
Set the decremental variable cost bid for a StaticInjection device with a MarketBidCost.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicetime_series_data::Union{Nothing,TimeSeriesData,CostCurve{PiecewiseIncrementalCurve}}: the data. If using a time series, must be of eltypePiecewiseStepData.PiecewiseIncrementalCurveis only accepted for singleCostCurveand not accepted for time series data.power_units::UnitSystem: Units to be used for data.
PowerSystems.set_export_variable_cost! — Methodset_export_variable_cost!(
sys::System,
component::StaticInjection,
data::Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesData},
power_units::UnitSystem
)
Set the export variable cost bid for a StaticInjection device with an ImportExportCost.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicedata::Union{Nothing, IS.TimeSeriesData, [CostCurve](@ref){[PiecewiseIncrementalCurve](@ref)}}: the data. If using a time series, must be of eltypePiecewiseStepData.PiecewiseIncrementalCurveis only accepted for singleCostCurveand not accepted for time series data.power_units::UnitSystem: Units to be used for data.
PowerSystems.set_fuel_cost! — Methodset_fuel_cost!(
sys::System,
component::StaticInjection,
data::Union{Float64, TimeSeriesData}
) -> Any
Set the fuel cost of the component's variable cost, which must be a FuelCurve.
PowerSystems.set_import_variable_cost! — Methodset_import_variable_cost!(
sys::System,
component::StaticInjection,
data::Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesData},
power_units::UnitSystem
)
Set the import variable cost bid for a StaticInjection device with an ImportExportCost.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicedata::Union{Nothing, IS.TimeSeriesData, [CostCurve](@ref){[PiecewiseIncrementalCurve](@ref)}}: the data. If using a time series, must be of eltypePiecewiseStepData.PiecewiseIncrementalCurveis only accepted for singleCostCurveand not accepted for time series data.power_units::UnitSystem: Units to be used for data.
PowerSystems.set_incremental_initial_input! — Methodset_incremental_initial_input!(
sys::System,
component::StaticInjection,
data::Union{Float64, TimeSeriesData}
) -> Union{ForecastKey, StaticTimeSeriesKey}
Set the incremental_initial_input for a StaticInjection device with a MarketBidCost to either a scalar or a time series.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicetime_series_data::Union{Float64, IS.TimeSeriesData}: the data. If a time series, must be of eltypeFloat64.
PowerSystems.set_incremental_variable_cost! — Methodset_incremental_variable_cost!(
sys::System,
component::StaticInjection,
data::Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesData},
power_units::UnitSystem
)
Set the incremental variable cost bid for a StaticInjection device with a MarketBidCost.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicetime_series_data::Union{Nothing,TimeSeriesData,CostCurve{PiecewiseIncrementalCurve}}: the data. If using a time series, must be of eltypePiecewiseStepData.PiecewiseIncrementalCurveis only accepted for singleCostCurveand not accepted for time series data.power_units::UnitSystem: Units to be used for data.
PowerSystems.set_no_load_cost! — Methodset_no_load_cost!(
sys::System,
component::StaticInjection,
data::Union{Float64, TimeSeriesData}
) -> Union{Float64, ForecastKey, StaticTimeSeriesKey}
Set the no-load cost for a StaticInjection device with a MarketBidCost to either a scalar or a time series.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicetime_series_data::Union{Float64, IS.TimeSeriesData}: the data. If a time series, must be of eltypeFloat64.
PowerSystems.set_service_bid! — Methodset_service_bid!(
sys::System,
component::StaticInjection,
service::Service,
time_series_data::TimeSeriesData,
power_units::UnitSystem
)
Adds service bids time-series data to the MarketBidCost.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection deviceservice::Service: Service for which the device is eligible to contributetime_series_data::IS.TimeSeriesData: TimeSeriesData
PowerSystems.set_shut_down! — Methodset_shut_down!(
sys::System,
component::StaticInjection,
data::Union{Float64, TimeSeriesData}
) -> Union{Float64, ForecastKey, StaticTimeSeriesKey}
Set the shutdown cost for a StaticInjection device with a MarketBidCost to either a single number or a time series.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicedata::Union{Float64, IS.TimeSeriesData}: the data. If a time series, must be of eltypeFloat64.
PowerSystems.set_start_up! — Methodset_start_up!(
sys::System,
component::StaticInjection,
data::Union{Float64, @NamedTuple{hot::Float64, warm::Float64, cold::Float64}, TimeSeriesData}
) -> Union{Float64, @NamedTuple{hot::Float64, warm::Float64, cold::Float64}, ForecastKey, StaticTimeSeriesKey}
Set the startup cost for a StaticInjection device with a MarketBidCost to either a single number, a single StartUpStages, or a time series.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicedata::Union{Float64,StartUpStages,TimeSeriesData}: the data. If a time series, must be of eltypeNTuple{3, Float64}– to represent a single value in a time series, use(value, 0.0, 0.0).
PowerSystems.set_variable_cost! — Methodset_variable_cost!(
_::System,
component::ReserveDemandCurve,
data::CostCurve{PiecewiseIncrementalCurve}
) -> CostCurve{PiecewiseIncrementalCurve}
Adds fixed energy market bids to the ReserveDemandCurve.
Arguments
sys::System: PowerSystem Systemcomponent::ReserveDemandCurve: the curvetime_series_data::CostCurve{PiecewiseIncrementalCurve}: the data
PowerSystems.set_variable_cost! — Methodset_variable_cost!(
sys::System,
component::ReserveDemandCurve,
data::Union{Nothing, TimeSeriesData}
) -> Union{ForecastKey, StaticTimeSeriesKey}
Adds energy market bids time-series to the ReserveDemandCurve.
Arguments
sys::System: PowerSystem Systemcomponent::ReserveDemandCurve: the curvetime_series_data::IS.TimeSeriesData:TimeSeriesData
PowerSystems.set_variable_cost! — Methodset_variable_cost!(
sys::System,
component::StaticInjection,
data::Union{Nothing, CostCurve{PiecewiseIncrementalCurve}, TimeSeriesData},
power_units::UnitSystem
)
Set the incremental variable cost bid for a StaticInjection device with a MarketBidCost.
Arguments
sys::System: PowerSystem Systemcomponent::StaticInjection: Static injection devicetime_series_data::Union{Nothing,TimeSeriesData,CostCurve{PiecewiseIncrementalCurve}}: the data. If using a time series, must be of eltypePiecewiseStepData.PiecewiseIncrementalCurveis only accepted for singleCostCurveand not accepted for time series data.power_units::UnitSystem: Units to be used for data. Must be NATURAL_UNITS.
PowerSystems.ACBusTypesModule.ACBusTypes — TypeEnumeration of AC power system bus types (MATPOWER Table B-1). Each variant corresponds to a standard bus classification used in power flow and steady-state network models. Set on an ACBus via the bustype field.
| Value | Description |
|---|---|
ISOLATED | Disconnected from network |
PQ | Active and reactive power defined (load bus) |
PV | Active power and voltage magnitude defined (generator bus) |
REF | Reference bus (θ = 0) |
SLACK | Slack bus |
Notes
- Numeric values follow the MATPOWER convention for bus type codes.
- Use the enum members (e.g.,
ACBusTypes.PQ,ACBusTypes.SLACK) when constructing or interpreting network data to ensure compatibility with MATPOWER-based data conventions.
References
PowerSystems.AngleUnitsModule.AngleUnits — TypeAngleUnits
Enumeration of angular measurement units used throughout PowerSystems.jl.
| Value | Description |
|---|---|
DEGREES | Angles expressed in degrees |
RADIANS | Angles expressed in radians |
Notes
When performing trigonometric calculations with Julia's built-in functions (sin, cos, etc.), convert degrees to radians first (e.g., θ * π/180) if the unit is DEGREES.
PowerSystems.CombinedCycleConfigurationModule.CombinedCycleConfiguration — TypeEnumeration describing the physical layout of a combined cycle power plant.
| Value | Description |
|---|---|
SingleShaftCombustionSteam | Single combustion turbine on a common shaft with one steam turbine |
SeparateShaftCombustionSteam | One combustion turbine and one steam turbine on separate shafts |
DoubleCombustionOneSteam | Two combustion turbines exhausting into one steam turbine |
TripleCombustionOneSteam | Three combustion turbines exhausting into one steam turbine |
Other | Any other combined cycle configuration not covered by the above values |
See Also
CombinedCycleBlock: Plant attribute for combined cycle block-level configurations.CombinedCycleFractional: Plant attribute for combined cycle fractional configurations.
PowerSystems.DiscreteControlledBranchStatusModule.DiscreteControlledBranchStatus — TypeDiscreteControlledBranchStatus
Enumeration describing the controlled (commanded) status of a branch device such as a breaker or switch. Used with DiscreteControlledACBranch.
| Value | Description |
|---|---|
OPEN | The device is open (non-conducting) |
CLOSED | The device is closed (conducting) |
Notes
Represents the intended or commanded state used by control and protection logic; it may differ from the actual measured/telemetry state during faults or failures.
PowerSystems.DiscreteControlledBranchTypeModule.DiscreteControlledBranchType — TypeDiscreteControlledBranchType
Enumeration of discrete controlled branch device types.
| Value | Description |
|---|---|
SWITCH | Switching device that can be opened or closed to connect or isolate a circuit segment |
BREAKER | Circuit breaker capable of interrupting fault current |
OTHER | Other discrete branch device not covered by the above categories |
See Also
DiscreteControlledACBranch: Branch type that uses this enumeration.DiscreteControlledBranchStatus: Enumeration of the open/closed status for these devices.
PowerSystems.EmissionBasisModule.EmissionBasis — TypeEnumeration of emission rate basis types.
| Value | Description |
|---|---|
FUEL_INPUT | Mass per unit of heat input (e.g., lb/MMBtu, kg/GJ) |
POWER_OUTPUT | Mass per unit of electrical output (e.g., lb/MWh, kg/MWh) |
PowerSystems.EnergyUnitModule.EnergyUnit — TypeEnumeration of energy units for emissions rate denominator.
| Value | Description |
|---|---|
MMBTU | Million British thermal units |
GJ | Gigajoules |
MWH | Megawatt-hours |
PowerSystems.FACTSOperationModesModule.FACTSOperationModes — TypeEnumeration of operational modes for FACTS (Flexible AC Transmission System) devices, as defined in the PSS/E POM v33 Manual.
| Value | Description |
|---|---|
OOS | Out-Of-Service (i.e., Series and Shunt links open) |
NML | Normal mode of operation, where Series and Shunt links are operating |
BYP | Series link is bypassed (i.e., like a zero impedance line) and Shunt link operates as a STATCOM |
References
- PSS/E Power Operations Manual v33, FACTS device specification.
PowerSystems.HydroTurbineTypeModule.HydroTurbineType — TypeHydroTurbineType
Enumeration of hydroelectric turbine designs, used to classify hydro generating units by operating head range and flow characteristics.
| Value | Description |
|---|---|
UNKNOWN | Turbine type is not specified |
PELTON | Impulse turbine for high-head, low-flow sites |
FRANCIS | Reaction turbine, widely used for medium-head applications |
KAPLAN | Adjustable-blade propeller turbine for low-head, high-flow sites |
TURGO | Impulse turbine similar to Pelton but suitable for higher flow rates |
CROSSFLOW | Banki-Michell (crossflow) impulse turbine, robust for small hydro |
BULB | Compact Kaplan variant for low-head run-of-river plants |
DERIAZ | Diagonal flow reaction turbine with variable pitch blades |
PROPELLER | Fixed-blade propeller turbine |
OTHER | Placeholder for less common or custom turbine designs |
See Also
HydroTurbine: Hydro generator component using this enumeration.
PowerSystems.ImpedanceCorrectionTransformerControlModeModule.ImpedanceCorrectionTransformerControlMode — TypeImpedanceCorrectionTransformerControlMode
Enumeration of control modes for impedance correction in transformers, as defined in the PSS/E transformer control specifications.
| Value | Description |
|---|---|
PHASE_SHIFT_ANGLE | Impedance correction as a function of phase shift angle (phase-shifting transformers) |
TAP_RATIO | Impedance correction as a function of tap ratio (tap-changing transformers) |
See Also
ImpedanceCorrectionData: Supplemental attribute that uses this control mode.
PowerSystems.LoadConformityModule.LoadConformity — TypeWECC-defined enumeration for load conformity classification used in dynamic modeling.
Load conformity indicates whether a load follows system voltage and frequency variations according to WECC modeling standards:
| Value | Description |
|---|---|
NON_CONFORMING | Non-conforming load |
CONFORMING | Conforming load |
UNDEFINED | Undefined or unknown whether load is conforming or non-conforming |
See Also
MotorLoadTechnology: Related enumeration for motor load technology classification.
PowerSystems.MassUnitModule.MassUnit — TypeEnumeration of mass units for emissions.
| Value | Description |
|---|---|
KG | Kilograms |
LB | Pounds |
SHORT_TON | Short tons (2000 lb) |
METRIC_TON | Metric tons (1000 kg) |
PowerSystems.MotorLoadTechnologyModule.MotorLoadTechnology — TypeEnumeration of motor load technology types used in power system dynamic load modeling.
| Value | Description |
|---|---|
INDUCTION | Induction motor |
SYNCHRONOUS | Synchronous motor |
UNDETERMINED | Type is not specified or unknown |
See Also
LoadConformity: Related enumeration for load conformity classification.
PowerSystems.PollutantTypeModule.PollutantType — TypeEnumeration of pollutant types for emissions tracking.
| Value | Description |
|---|---|
CO2 | Carbon dioxide |
CO2E | Carbon dioxide equivalent |
CH4 | Methane |
N2O | Nitrous oxide |
NOX | Nitrogen oxides |
SO2 | Sulfur dioxide |
PM25 | Particulate matter (2.5 μm) |
PM10 | Particulate matter (10 μm) |
HG | Mercury |
HAP | Hazardous air pollutants |
CUSTOM | User-defined pollutant |
PowerSystems.PrimeMoversModule.PrimeMovers — TypeEnumeration of prime mover types used in electric power generation, as defined by the U.S. Energy Information Administration (EIA) Form 923 instructions.
Prime movers are the engines, turbines, water wheels, or similar machines that drive electric generators or provide mechanical energy for other purposes.
Notes
PVe is used for photovoltaic systems, renamed from the EIA code PV to avoid a naming conflict with ACBusTypes PV.
| Value | Description |
|---|---|
BA | Energy Storage, Battery |
BT | Turbines Used in a Binary Cycle (including those used for geothermal applications) |
CA | Combined-Cycle – Steam Part |
CC | Combined-Cycle - Aggregated Plant *augmentation of EIA |
CE | Energy Storage, Compressed Air |
CP | Energy Storage, Concentrated Solar Power |
CS | Combined-Cycle Single-Shaft Combustion turbine and steam turbine share a single generator |
CT | Combined-Cycle Combustion Turbine Part |
ES | Energy Storage, Other |
FC | Fuel Cell |
FW | Energy Storage, Flywheel |
GT | Combustion (Gas) Turbine (including jet engine design) |
HA | Hydrokinetic, Axial Flow Turbine |
HB | Hydrokinetic, Wave Buoy |
HK | Hydrokinetic, Other |
HY | Hydraulic Turbine (including turbines associated with delivery of water by pipeline) |
IC | Internal Combustion (diesel, piston, reciprocating) Engine |
PS | Energy Storage, Reversible Hydraulic Turbine (Pumped Storage) |
OT | Other |
ST | Steam Turbine (including nuclear, geothermal and solar steam; does not include combined-cycle turbine) |
PVe | Photovoltaic (Note: renamed from EIA PV to avoid conflict with ACBusTypes.PV) |
WT | Wind Turbine, Onshore |
WS | Wind Turbine, Offshore |
References
See Also
ThermalStandard: Uses prime mover information for generator specifications.ThermalMultiStart: Uses prime mover information for generator specifications.
PowerSystems.ReservoirDataTypeModule.ReservoirDataType — TypeEnumeration of the quantity type used to represent the state of a HydroReservoir.
| Value | Units | Description |
|---|---|---|
USABLE_VOLUME | m^3 | The volume of water that can be stored for levels between the penstock intake and the top reservoir level |
TOTAL_VOLUME | m^3 | The total volume of the reservoir considering a total depletion of the water levels. This unit system usually requires the specification of a valid minimum volume level |
HEAD | m | The difference in elevations between the top water levels. It requires a valid conversion constant to go from head to potential energy stored. |
ENERGY | MWh | Uses energy units in MWh to approximate the water storage as a generic energy reservoir. |
See Also
ReservoirLocation: Enumeration of reservoir location relative to the turbine.
PowerSystems.ReservoirLocationModule.ReservoirLocation — TypeReservoirLocation
Enumeration representing the location of a HydroReservoir relative to its associated turbine unit.
| Value | Description |
|---|---|
HEAD | Reservoir located upstream of the turbine (higher elevation) |
TAIL | Reservoir located downstream of the turbine (lower elevation) |
See Also
ReservoirDataType: Enumeration of the quantity used to represent reservoir state.
PowerSystems.StateTypesModule.StateTypes — TypeStateTypes
Categorization of state variable types for dynamic components.
| Value | Description |
|---|---|
Differential | State governed by a differential equation (evolves continuously in time) |
Algebraic | State determined by an algebraic constraint (no time derivative) |
Hybrid | State that can behave as differential or algebraic depending on operating conditions |
See Also
DynamicComponent: Abstract base type whose states are classified by this enumeration.
PowerSystems.StorageTechModule.StorageTech — TypeEnumeration of energy storage technologies used in power system modeling.
| Value | Description |
|---|---|
PTES | Pumped thermal energy storage |
LIB | LiON Battery |
LAB | Lead Acid Battery |
FLWB | Redox Flow Battery |
SIB | Sodium Ion Battery |
ZIB | Zinc Ion Battery |
HGS | Hydrogen Gas Storage |
LAES | Liquid Air Storage |
OTHER_CHEM | Other Chemical Storage |
OTHER_MECH | Other Mechanical Storage |
OTHER_THERM | Other Thermal Storage |
See Also
EnergyReservoirStorage: Storage component using this enumeration.
PowerSystems.ThermalFuelsModule.ThermalFuels — TypeEnumeration of thermal fuel types, using EIA Form 923 fuel codes for standardized reporting of fuel consumption in electric power generation.
Categories include: coal and coal-derived fuels, petroleum products, natural gas, nuclear, biomass and waste-derived fuels, geothermal, and other thermal energy sources.
| Value | EIA Fuel Code | Description |
|---|---|---|
ANTHRACITE_COAL | ANT | Anthracite Coal |
BITUMINOUS_COAL | BIT | Bituminous Coal |
LIGNITE_COAL | LIG | Lignite Coal |
SUBBITUMINOUS_COAL | SUB | Subbituminous Coal |
WASTE_COAL | WC | Waste/Other Coal (including anthracite culm, bituminous gob, fine coal, lignite waste, waste coal) |
REFINED_COAL | RC | Refined Coal (A coal product that improves heat content and reduces emissions. Excludes coal processed by coal preparation plants.) |
SYNTHESIS_GAS_COAL | SGC | Coal-Derived Synthesis Gas |
DISTILLATE_FUEL_OIL | DFO | Distillate Fuel Oil (including diesel, No. 1, No. 2, and No. 4 fuel oils) |
JET_FUEL | JF | Jet Fuel |
KEROSENE | KER | Kerosene |
PETROLEUM_COKE | PC | Petroleum Coke |
RESIDUAL_FUEL_OIL | RFO | Residual Fuel Oil (including No. 5 and No. 6 fuel oils, and bunker C fuel oil) |
PROPANE | PG | Propane, gaseous |
SYNTHESIS_GAS_PETROLEUM_COKE | SGP | Petroleum Coke Derived Synthesis Gas |
WASTE_OIL | WO | Waste/Other Oil (including crude oil, liquid butane, liquid propane, naphtha, oil waste, re-refined motor oil, sludge oil, tar oil) |
BLASTE_FURNACE_GAS | BFG | Blast Furnace Gas |
NATURAL_GAS | NG | Natural Gas |
OTHER_GAS | OG | Other Gas |
AG_BYPRODUCT | AB | Agricultural By-products |
MUNICIPAL_WASTE | MSW | Municipal Solid Waste |
OTHER_BIOMASS_SOLIDS | OBS | Other Biomass Solids |
WOOD_WASTE_SOLIDS | WDS | Wood/Wood Waste Solids (including paper, pellets, railroad ties, utility poles, wood chips, bark, and wood waste solids) |
OTHER_BIOMASS_LIQUIDS | OBL | Other Biomass Liquids |
SLUDGE_WASTE | SLW | Sludge Waste |
BLACK_LIQUOR | BLQ | Black Liquor |
WOOD_WASTE_LIQUIDS | WDL | Wood Waste Liquids excluding Black Liquor (includes red liquor, sludge wood, spent sulfite liquor, and other wood-based liquids) |
LANDFILL_GAS | LFG | Landfill Gas |
OTHEHR_BIOMASS_GAS | OBG | Other Biomass Gas (includes digester gas, methane, and other biomass gasses) |
NUCLEAR | NUC | Nuclear Uranium, Plutonium, Thorium |
WASTE_HEAT | WH | Waste heat not directly attributed to a fuel source |
TIREDERIVED_FUEL | TDF | Tire-derived Fuels |
COAL* | N/A | General Coal Fuels |
GEOTHERMAL* | GEO | Geothermal Fuels |
OTHER | OTH | Other type of fuel |
*Asterisk denotes fuel codes not directly from the current EIA 923 form but kept for compatibility with older versions of the form.
Notes
COAL (general coal) and GEOTHERMAL codes are not directly from the current EIA 923 form but are retained for compatibility with older data.
References
See Also
ThermalStandard: Generator type that uses this fuel enumeration.ThermalMultiStart: Generator type that uses this fuel enumeration.PrimeMovers: Companion enumeration for generator prime mover type.
PowerSystems.WindingCategoryModule.WindingCategory — TypeWindingCategory
Enumeration of transformer winding roles used to interpret a ImpedanceCorrectionData (Transformer Impedance Correction Table) association.
| Value | Description |
|---|---|
TR2W_WINDING | Winding of a two-winding transformer connected to ImpedanceCorrectionData |
PRIMARY_WINDING | Primary winding of a three-winding transformer connected to ImpedanceCorrectionData |
SECONDARY_WINDING | Secondary winding of a three-winding transformer connected to ImpedanceCorrectionData |
TERTIARY_WINDING | Tertiary winding of a three-winding transformer connected to ImpedanceCorrectionData |
See Also
ImpedanceCorrectionTransformerControlMode: Enumeration of control modes used alongside winding impedance corrections.
PowerSystems.WindingGroupNumberModule.WindingGroupNumber — TypeWindingGroupNumber
Enumeration of transformer winding group numbers representing the phase displacement between primary and secondary windings of three-phase transformers, per IEC 60076-1.
| Value | Description |
|---|---|
UNDEFINED | Winding group not specified |
GROUP_0 | 0° phase displacement (e.g., Yy0, Dd0, Dz0) |
GROUP_1 | −30° phase displacement (e.g., Dy1, Yd1, Yz1) |
GROUP_5 | −150° phase displacement (e.g., Dy5, Yd5, Yz5) |
GROUP_6 | 180° phase displacement (e.g., Yy6, Dd6, Dz6) |
GROUP_7 | 150° phase displacement (e.g., Dy7, Yd7, Yz7) |
GROUP_11 | 30° phase displacement (e.g., Dy11, Yd11, Yz11) |
Notes
- Phase displacement is measured from primary to secondary winding; positive angles lead and negative angles lag.
- Clock notation: each clock hour represents 30°.
References
- IEC 60076-1: Power transformers — General.
InfrastructureSystems.UnitSystemModule.UnitSystem — TypeUnit system for component data values.
Values
SYSTEM_BASE: Per-unit values on the system base powerDEVICE_BASE: Per-unit values on the device base powerNATURAL_UNITS: Values in natural units (e.g., MW, MVAR)
Supplemental Attributes
InfrastructureSystems.SupplementalAttribute — TypeBase type for structs that store supplemental attributes
Required interface functions for subtypes:
- get_internal()
Optional interface functions:
- get_uuid()
Subtypes may contain time series. Which requires
supports_time_series(::SupplementalAttribute)
All subtypes must include an instance of ComponentUUIDs in order to track components attached to each attribute.
PowerSystems.FixedForcedOutage — Typestruct FixedForcedOutage <: UnplannedOutage
outage_status::Float64
monitored_components::Set{Base.UUID}
internal::InfrastructureSystemsInternal
endSupplemental attribute for forced outages with a deterministic (fixed) outage status. The status value can be derived from stochastic process simulations or historical data, and may vary over time via attached time series data.
Arguments
outage_status::Float64: Forced outage status of the component:1.0indicates outaged (unavailable),0.0indicates available.monitored_components::Set{Base.UUID}: UUIDs of devices whose post-contingency state should be modeled when this outage occurs. Empty by default; semantics of an empty set are decided by the downstream consumer.internal::InfrastructureSystems.InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
GeometricDistributionForcedOutage: Unplanned outage type with geometric distribution transition probabilities.PlannedOutage: Scheduled outage type driven by a time series.
PowerSystems.FixedForcedOutage — MethodFixedForcedOutage(
;
outage_status,
monitored_components,
internal
)
FixedForcedOutage(; outage_status, monitored_components, internal)Construct a FixedForcedOutage.
Arguments
outage_status::Float64: Forced outage status of the component:1.0indicates outaged (unavailable),0.0indicates available.monitored_components: (default:Base.UUID[]) Any iterable ofBase.UUIDorDevice. Devices are converted to their UUIDs internally; duplicates are collapsed.internal::InfrastructureSystems.InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.GeometricDistributionForcedOutage — Typestruct GeometricDistributionForcedOutage <: UnplannedOutage
mean_time_to_recovery::Float64
outage_transition_probability::Float64
monitored_components::Set{Base.UUID}
internal::InfrastructureSystemsInternal
endSupplemental attribute for unplanned forced outages with transition probabilities modeled by geometric distributions. Both the outage probability and the recovery probability can vary over time and be attached as time series data.
Arguments
mean_time_to_recovery::Float64: Expected time elapsed to recovery after a failure, in milliseconds.outage_transition_probability::Float64: Per-timestep probability of failure; parameterizes the geometric distribution as(1 - p).monitored_components::Set{Base.UUID}: UUIDs of devices whose post-contingency state should be modeled when this outage occurs. Empty by default; semantics of an empty set are decided by the downstream consumer.internal::InfrastructureSystems.InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
FixedForcedOutage: Unplanned outage type with a fixed (deterministic) outage status.PlannedOutage: Scheduled outage type driven by a time series.
PowerSystems.GeometricDistributionForcedOutage — MethodGeometricDistributionForcedOutage(
;
mean_time_to_recovery,
outage_transition_probability,
monitored_components,
internal
) -> GeometricDistributionForcedOutage
GeometricDistributionForcedOutage(; mean_time_to_recovery, outage_transition_probability, monitored_components, internal)Construct a GeometricDistributionForcedOutage.
Arguments
mean_time_to_recovery::Float64: (default:0.0) Expected time elapsed to recovery after a failure, in milliseconds.outage_transition_probability::Float64: (default:0.0) Per-timestep probability of failure; parameterizes the geometric distribution as(1 - p).monitored_components: (default:Base.UUID[]) Any iterable ofBase.UUIDorDevice. Devices are converted to their UUIDs internally; duplicates are collapsed.internal::InfrastructureSystems.InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.Outage — TypeSupertype for outage contingencies representing planned or unplanned equipment outages.
Concrete subtypes include GeometricDistributionForcedOutage, PlannedOutage, and FixedForcedOutage.
Interface for custom subtypes
Subtypes are expected to provide the following fields, or override the matching accessors via multiple dispatch:
monitored_components::Set{Base.UUID}— UUIDs of devices whose post-contingency state should be modeled. The defaultget_monitored_componentsreadsvalue.monitored_components; override it if your subtype does not carry the field directly.internal::InfrastructureSystems.InfrastructureSystemsInternal: accessed viaget_internal.
The default supports_time_series returns true; override for custom outage types that do not support time series.
PowerSystems.PlannedOutage — Typestruct PlannedOutage <: Outage
outage_schedule::String
monitored_components::Set{Base.UUID}
internal::InfrastructureSystemsInternal
endSupplemental attribute for planned (scheduled) outages. The outage schedule is stored as a time series identified by the outage_schedule name string.
Arguments
outage_schedule::String: Name of the time series containing the outage schedule.monitored_components::Set{Base.UUID}: UUIDs of devices whose post-contingency state should be modeled when this outage occurs. Empty by default; semantics of an empty set are decided by the downstream consumer.internal::InfrastructureSystems.InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
GeometricDistributionForcedOutage: Unplanned outage type with geometric distribution transition probabilities.FixedForcedOutage: Unplanned outage type with a fixed outage status.
PowerSystems.PlannedOutage — MethodPlannedOutage(
;
outage_schedule,
monitored_components,
internal
)
PlannedOutage(; outage_schedule, monitored_components, internal)Construct a PlannedOutage.
Arguments
outage_schedule::String: Name of the time series containing the outage schedule.monitored_components: (default:Base.UUID[]) Any iterable ofBase.UUIDorDevice. Devices are converted to their UUIDs internally; duplicates are collapsed.internal::InfrastructureSystems.InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
InfrastructureSystems.supports_time_series — Methodsupports_time_series(_::Outage) -> Bool
All PowerSystems.jl Outage types support time series. This can be overridden for custom outage types that do not support time series.
PowerSystems.add_monitored_component! — Methodadd_monitored_component!(
value::Outage,
x::Union{Base.UUID, Device}
) -> Any
Add a Base.UUID or Device to the monitored-components set of an Outage. Adding an existing UUID is a no-op.
PowerSystems.add_monitored_components! — Methodadd_monitored_components!(value::Outage, items) -> Any
Add every element of items (each a Base.UUID or Device) to the monitored-components set of an Outage. Accepts any iterable, including the iterator returned by get_components. Adding an existing UUID is a no-op.
PowerSystems.clear_monitored_components! — Methodclear_monitored_components!(value::Outage) -> Any
Empty the monitored-components set of an Outage. Returns the (now empty) underlying set.
PowerSystems.get_mean_time_to_recovery — Methodget_mean_time_to_recovery(
value::GeometricDistributionForcedOutage
) -> Float64
Return the mean_time_to_recovery field of GeometricDistributionForcedOutage.
PowerSystems.get_monitored_components — Methodget_monitored_components(value::Outage) -> Any
Get the set of Device UUIDs whose post-contingency state should be modeled when this outage occurs. PowerSystems does not assign meaning to an empty set; downstream consumers (e.g., PowerSimulations) decide whether empty means "monitor nothing" or "monitor everything".
PowerSystems.get_outage_schedule — Methodget_outage_schedule(value::PlannedOutage) -> String
Return the outage_schedule field of PlannedOutage.
PowerSystems.get_outage_transition_probability — Methodget_outage_transition_probability(
value::GeometricDistributionForcedOutage
) -> Float64
Return the outage_transition_probability field of GeometricDistributionForcedOutage.
PowerSystems.remove_monitored_component! — Methodremove_monitored_component!(
value::Outage,
x::Union{Base.UUID, Device}
)
Remove a Base.UUID or Device from the monitored-components set of an Outage. No-op when the entry is not present.
PowerSystems.remove_monitored_components! — Methodremove_monitored_components!(value::Outage, items)
Remove every element of items (each a Base.UUID or Device) from the monitored-components set of an Outage. Accepts any iterable.
PowerSystems.set_monitored_components! — Methodset_monitored_components!(value::Outage, items) -> Any
Replace the monitored-components set for an Outage with the contents of items. Accepts any iterable whose elements are Base.UUID or Device (e.g., a Vector, a generator, or the iterator returned by get_components). Devices are converted to their UUIDs internally. Pass an empty iterable (or call clear_monitored_components!) to clear the set.
PowerSystems.Contingency — TypeSupertype for contingency events that can be attached to components as supplemental attributes.
Concrete subtypes include Outage and its descendants.
PowerSystems.ImpedanceCorrectionData — Typestruct ImpedanceCorrectionData <: SupplementalAttribute
table_number::Int64
impedance_correction_curve::PiecewiseLinearData
transformer_winding::WindingCategory
transformer_control_mode::ImpedanceCorrectionTransformerControlMode
internal::InfrastructureSystemsInternal
endSupplemental attribute representing a single row of a Transformer Impedance Correction Table (TICT). Adjusts transformer impedance as a piecewise-linear function of tap ratio or phase shift angle.
Arguments
table_number::Int64: Row number of the TICT, used to link this correction entry to a specific transformer component.impedance_correction_curve::PiecewiseLinearData: Piecewise-linear function defining impedance correction intervals as a function of tap ratio or phase shift angle.transformer_winding::WindingCategory: Winding of the transformer this correction entry is associated with.transformer_control_mode::ImpedanceCorrectionTransformerControlMode: Control mode determining whether correction is applied based on tap ratio or phase shift angle.internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
WindingCategory: Enumeration of transformer winding roles.ImpedanceCorrectionTransformerControlMode: Enumeration of impedance correction control modes.
PowerSystems.ImpedanceCorrectionData — MethodImpedanceCorrectionData(
;
table_number,
impedance_correction_curve,
transformer_winding,
transformer_control_mode,
internal
)
ImpedanceCorrectionData(; table_number, impedance_correction_curve, transformer_winding, transformer_control_mode, internal)Construct an ImpedanceCorrectionData.
Arguments
table_number::Int64: Row number of the TICT, used to link this correction entry to a specific transformer component.impedance_correction_curve::PiecewiseLinearData: Piecewise-linear function defining impedance correction intervals as a function of tap ratio or phase shift angle.transformer_winding::WindingCategory: Winding of the transformer this correction entry is associated with.transformer_control_mode::ImpedanceCorrectionTransformerControlMode: Control mode determining whether correction is applied based on tap ratio or phase shift angle.internal::InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.get_impedance_correction_curve — Methodget_impedance_correction_curve(
value::ImpedanceCorrectionData
) -> PiecewiseLinearData
Return the impedance_correction_curve field of ImpedanceCorrectionData.
PowerSystems.get_table_number — Methodget_table_number(value::ImpedanceCorrectionData) -> Int64
Return the table_number field of ImpedanceCorrectionData.
PowerSystems.get_transformer_control_mode — Methodget_transformer_control_mode(
value::ImpedanceCorrectionData
) -> ImpedanceCorrectionTransformerControlMode
Return the transformer_control_mode field of ImpedanceCorrectionData.
PowerSystems.get_transformer_winding — Methodget_transformer_winding(
value::ImpedanceCorrectionData
) -> WindingCategory
Return the transformer_winding field of ImpedanceCorrectionData.
PowerSystems.CombinedCycleBlock — Typestruct CombinedCycleBlock <: PowerPlant
name::String
configuration::CombinedCycleConfiguration
heat_recovery_to_steam_factor::Float64
hrsg_ct_map::Dict{Int, Vector{Base.UUID}}
hrsg_ca_map::Dict{Int, Vector{Base.UUID}}
ct_hrsg_map::Dict{Base.UUID, Vector{Int}}
ca_hrsg_map::Dict{Base.UUID, Vector{Int}}
internal::InfrastructureSystemsInternal
endSupplemental attribute representing a combined cycle plant modeled at the block level, where combustion turbines (CTs) feed heat recovery steam generators (HRSGs) that drive combined-cycle steam turbines (CAs). The internal maps capture the CT→HRSG→CA topology.
Arguments
name::String: Name of the combined cycle block.configuration::CombinedCycleConfiguration: Configuration type of the combined cycle plant.heat_recovery_to_steam_factor::Float64: Fraction of CT exhaust heat recovered by the HRSG for steam generation.hrsg_ct_map::Dict{Int, Vector{Base.UUID}}: Mapping from HRSG index to the UUIDs of CTs feeding that HRSG.hrsg_ca_map::Dict{Int, Vector{Base.UUID}}: Mapping from HRSG index to the UUIDs of CAs driven by that HRSG.ct_hrsg_map::Dict{Base.UUID, Vector{Int}}: Reverse mapping from a CT's UUID to the indices of HRSGs it feeds (a CT can feed multiple HRSGs).ca_hrsg_map::Dict{Base.UUID, Vector{Int}}: Reverse mapping from a CA's UUID to the indices of HRSGs that supply it (a CA can receive from multiple HRSGs).internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
CombinedCycleFractional: Combined cycle attribute for aggregate fractional representations.CombinedCycleConfiguration: Enumeration of combined cycle plant configurations.
PowerSystems.CombinedCycleBlock — MethodCombinedCycleBlock(
;
name,
configuration,
heat_recovery_to_steam_factor,
hrsg_ct_map,
hrsg_ca_map,
ct_hrsg_map,
ca_hrsg_map,
internal
)
CombinedCycleBlock(; name, configuration, heat_recovery_to_steam_factor, hrsg_ct_map, hrsg_ca_map, ct_hrsg_map, ca_hrsg_map, internal)Construct a CombinedCycleBlock.
Arguments
name::String: Name of the combined cycle blockconfiguration::CombinedCycleConfiguration: Configuration type of the combined cycleheat_recovery_to_steam_factor::Float64: (default:0.0) Factor for heat recovery to steam conversionhrsg_ct_map::AbstractDict: (default: empty dict) Mapping of HRSG numbers to CT unit UUIDs (CTs as HRSG inputs)hrsg_ca_map::AbstractDict: (default: empty dict) Mapping of HRSG numbers to CA unit UUIDs (CAs as HRSG outputs)ct_hrsg_map::AbstractDict: (default: empty dict) Reverse mapping from CT unit UUID to HRSG numbersca_hrsg_map::AbstractDict: (default: empty dict) Reverse mapping from CA unit UUID to HRSG numbersinternal::InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.CombinedCycleFractional — Typestruct CombinedCycleFractional <: PowerPlant
name::String
configuration::CombinedCycleConfiguration
operation_exclusion_map::Dict{Int, Vector{Base.UUID}}
inverse_operation_exclusion_map::Dict{Base.UUID, Int}
internal::InfrastructureSystemsInternal
endSupplemental attribute representing a combined cycle plant modeled at the aggregate (fractional) level, where each generator unit represents a specific plant configuration with an aggregate heat rate. Mutually exclusive operating groups are tracked via the operation exclusion maps.
Arguments
name::String: Name of the combined cycle fractional plant.configuration::CombinedCycleConfiguration: Configuration type of the combined cycle plant.operation_exclusion_map::Dict{Int, Vector{Base.UUID}}: Mapping from exclusion group index to the UUIDs of units in that group; only one unit per group may operate simultaneously.inverse_operation_exclusion_map::Dict{Base.UUID, Int}: Reverse mapping from a unit's UUID to its exclusion group index.internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
CombinedCycleBlock: Combined cycle attribute for detailed block-level representations.CombinedCycleConfiguration: Enumeration of combined cycle plant configurations.
PowerSystems.CombinedCycleFractional — MethodCombinedCycleFractional(
;
name,
configuration,
operation_exclusion_map,
inverse_operation_exclusion_map,
internal
)
CombinedCycleFractional(; name, configuration, operation_exclusion_map, inverse_operation_exclusion_map, internal)Construct a CombinedCycleFractional.
Arguments
name::String: Name of the combined cycle fractional plantconfiguration::CombinedCycleConfiguration: Configuration type of the combined cycleoperation_exclusion_map::AbstractDict: (default: empty dict) Mapping of operation exclusion group numbers to unit UUIDsinverse_operation_exclusion_map::AbstractDict: (default: empty dict) Reverse mapping from unit UUID to exclusion group numberinternal::InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.HydroPowerPlant — Typestruct HydroPowerPlant <: PowerPlant
name::String
penstock_map::Dict{Int, Vector{Base.UUID}}
reverse_penstock_map::Dict{Base.UUID, Int}
internal::InfrastructureSystemsInternal
endSupplemental attribute representing a HydroGen power plant where multiple generating units share penstocks. The penstock maps capture the unit ↔ penstock topology for hydraulic coupling constraints.
Arguments
name::String: Name of the hydro power plant.penstock_map::Dict{Int, Vector{Base.UUID}}: Mapping from penstock index to the UUIDs of units connected to that penstock (multiple units may share one penstock).reverse_penstock_map::Dict{Base.UUID, Int}: Reverse mapping from a unit's UUID to the index of its penstock.internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
HydroGen: Abstract type for hydroelectric generating units.
PowerSystems.HydroPowerPlant — MethodHydroPowerPlant(
;
name,
penstock_map,
reverse_penstock_map,
internal
)
HydroPowerPlant(; name, penstock_map, reverse_penstock_map, internal)Construct a HydroPowerPlant.
Arguments
name::String: Name of the hydro power plant.penstock_map::Dict{Int, Vector{Base.UUID}}: (default: empty dict) Mapping from penstock index to the UUIDs of units connected to that penstock.reverse_penstock_map::Dict{Base.UUID, Int}: (default: empty dict) Reverse mapping from a unit's UUID to its penstock index.internal::InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.PowerPlant — TypeSupertype for power plant supplemental attributes that group generating units.
Concrete subtypes include ThermalPowerPlant, HydroPowerPlant, RenewablePowerPlant, CombinedCycleBlock, and CombinedCycleFractional.
PowerSystems.RenewablePowerPlant — Typestruct RenewablePowerPlant <: PowerPlant
name::String
pcc_map::Dict{Int, Vector{Base.UUID}}
reverse_pcc_map::Dict{Base.UUID, Int}
internal::InfrastructureSystemsInternal
endSupplemental attribute representing a RenewableGen power plant where multiple generating units share a point of common coupling (PCC). The PCC maps capture the unit ↔ PCC topology for grid connection constraints.
Arguments
name::String: Name of the renewable power plant.pcc_map::Dict{Int, Vector{Base.UUID}}: Mapping from PCC index to the UUIDs of units connected to that PCC (multiple units may share one PCC).reverse_pcc_map::Dict{Base.UUID, Int}: Reverse mapping from a unit's UUID to the index of its PCC.internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
RenewableGen: Abstract type for renewable generating units.
PowerSystems.RenewablePowerPlant — MethodRenewablePowerPlant(
;
name,
pcc_map,
reverse_pcc_map,
internal
)
RenewablePowerPlant(; name, pcc_map, reverse_pcc_map, internal)Construct a RenewablePowerPlant.
Arguments
name::String: Name of the renewable power plant.pcc_map::Dict{Int, Vector{Base.UUID}}: (default: empty dict) Mapping from PCC index to the UUIDs of units connected to that PCC.reverse_pcc_map::Dict{Base.UUID, Int}: (default: empty dict) Reverse mapping from a unit's UUID to its PCC index.internal::InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
PowerSystems.ThermalPowerPlant — Typestruct ThermalPowerPlant <: PowerPlant
name::String
shaft_map::Dict{Int, Vector{Base.UUID}}
reverse_shaft_map::Dict{Base.UUID, Int}
internal::InfrastructureSystemsInternal
endSupplemental attribute representing a ThermalGen power plant where multiple generator units share mechanical shafts. The shaft maps capture the unit ↔ shaft topology for multi-shaft dispatch and synchronous condensing configurations.
Arguments
name::String: Name of the power plant.shaft_map::Dict{Int, Vector{Base.UUID}}: Mapping from shaft index to the UUIDs of units connected to that shaft (multiple units may share one shaft).reverse_shaft_map::Dict{Base.UUID, Int}: Reverse mapping from a unit's UUID to the index of its shaft.internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems.jl internal reference.
See Also
CombinedCycleBlock: Plant attribute for combined cycle block-level representations.ThermalGen: Abstract type for thermal generating units.
PowerSystems.ThermalPowerPlant — MethodThermalPowerPlant(
;
name,
shaft_map,
reverse_shaft_map,
internal
)
ThermalPowerPlant(; name, shaft_map, reverse_shaft_map, internal)Construct a ThermalPowerPlant.
Arguments
name::String: Name of the power plant.shaft_map::Dict{Int, Vector{Base.UUID}}: (default: empty dict) Mapping from shaft index to the UUIDs of units connected to that shaft.reverse_shaft_map::Dict{Base.UUID, Int}: (default: empty dict) Reverse mapping from a unit's UUID to its shaft index.internal::InfrastructureSystemsInternal: (default:InfrastructureSystemsInternal()) (Do not modify.) PowerSystems.jl internal reference.
InfrastructureSystems.get_name — Methodget_name(value::CombinedCycleBlock) -> String
Return the name field of CombinedCycleBlock.
InfrastructureSystems.get_name — Methodget_name(value::CombinedCycleFractional) -> String
Return the name field of CombinedCycleFractional.
InfrastructureSystems.get_name — Methodget_name(value::HydroPowerPlant) -> String
Return the name field of HydroPowerPlant.
InfrastructureSystems.get_name — Methodget_name(value::RenewablePowerPlant) -> String
Return the name field of RenewablePowerPlant.
InfrastructureSystems.get_name — Methodget_name(value::ThermalPowerPlant) -> String
Return the name field of ThermalPowerPlant.
PowerSystems.add_supplemental_attribute! — Methodadd_supplemental_attribute!(
sys::System,
component::ThermalGen,
attribute::CombinedCycleBlock;
hrsg_number
)
add_supplemental_attribute!(sys::System, component::ThermalGen, attribute::CombinedCycleBlock; hrsg_number::Int)Add a thermal generator to a CombinedCycleBlock by associating it with an HRSG number. Only generators with CT (combustion turbine as HRSG input) or CA (combined cycle steam part as HRSG output) prime mover types can be added.
Arguments
sys::System: The system containing the generator.component::ThermalGen: The thermal generator to add to the block.attribute::CombinedCycleBlock: The combined cycle block.hrsg_number::Int: The HRSG number to associate with the generator.
Throws
ArgumentError: if the generator is already associated with this block.ArgumentError: if the generator's prime mover type is notCTorCA.
See also: remove_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.add_supplemental_attribute! — Methodadd_supplemental_attribute!(
sys::System,
component::ThermalGen,
attribute::CombinedCycleFractional;
exclusion_group
)
add_supplemental_attribute!(sys::System, component::ThermalGen, attribute::CombinedCycleFractional; exclusion_group::Int)Add a thermal generator to a CombinedCycleFractional by associating it with an exclusion group number. Only generators with CC (combined cycle) prime mover type can be added.
Arguments
sys::System: The system containing the generator.component::ThermalGen: The thermal generator to add to the plant.attribute::CombinedCycleFractional: The combined cycle fractional plant.exclusion_group::Int: The exclusion group number to associate with the generator.
Throws
ArgumentError: if the generator is already associated with this plant.ArgumentError: if the generator's prime mover type is notCC.
See also: remove_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.add_supplemental_attribute! — Methodadd_supplemental_attribute!(
sys::System,
component::ThermalGen,
attribute::ThermalPowerPlant;
shaft_number
)
add_supplemental_attribute!(sys::System, component::ThermalGen, attribute::ThermalPowerPlant; shaft_number::Int)Add a thermal generator to a ThermalPowerPlant by associating it with a shaft number. This attaches the plant as a supplemental attribute to the generator and records the generator's UUID in the plant's shaft map.
Arguments
sys::System: The system containing the generator.component::ThermalGen: The thermal generator to add to the plant.attribute::ThermalPowerPlant: The thermal power plant.shaft_number::Int: The shaft number to associate with the generator.
Throws
ArgumentError: if the generator is already associated with this plant.
See also: remove_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.add_supplemental_attribute! — Methodadd_supplemental_attribute!(
sys::System,
component::Union{EnergyReservoirStorage, RenewableGen},
attribute::RenewablePowerPlant,
pcc_number::Int64
)
add_supplemental_attribute!(sys::System, component::Union{RenewableGen, EnergyReservoirStorage}, attribute::RenewablePowerPlant, pcc_number::Int)Add a renewable generator or storage to a RenewablePowerPlant by associating it with a PCC number. This attaches the plant as a supplemental attribute to the generator and records the generator's UUID in the plant's PCC map.
pcc_number is a positional argument, unlike the keyword shaft_number in the ThermalPowerPlant overload. This inconsistency is a known API issue.
Arguments
sys::System: The system containing the generator.component::Union{RenewableGen, EnergyReservoirStorage}: The renewable generator or storage to add to the plant.attribute::RenewablePowerPlant: The renewable power plant.pcc_number::Int: The PCC (point of common coupling) number to associate with the generator.
Throws
ArgumentError: if the component is already associated with this plant.
See also: remove_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.add_supplemental_attribute! — Methodadd_supplemental_attribute!(
sys::System,
component::Union{HydroPumpTurbine, HydroTurbine},
attribute::HydroPowerPlant,
penstock_number::Int64
)
add_supplemental_attribute!(sys::System, component::Union{HydroPumpTurbine, HydroTurbine}, attribute::HydroPowerPlant, penstock_number::Int)Add a hydro generator to a HydroPowerPlant by associating it with a penstock number. This attaches the plant as a supplemental attribute to the generator and records the generator's UUID in the plant's penstock map.
penstock_number is a positional argument, unlike the keyword shaft_number in the ThermalPowerPlant overload. This inconsistency is a known API issue.
Arguments
sys::System: The system containing the generator.component::Union{HydroPumpTurbine, HydroTurbine}: The hydro generator to add to the plant.attribute::HydroPowerPlant: The hydro power plant.penstock_number::Int: The penstock number to associate with the generator.
Throws
ArgumentError: if the generator is already associated with this plant.ArgumentError: ifcomponentis aHydroDispatch— useHydroTurbineinstead.
See also: remove_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.get_ca_hrsg_map — Methodget_ca_hrsg_map(
value::CombinedCycleBlock
) -> Dict{Base.UUID, Vector{Int64}}
Return the ca_hrsg_map field of CombinedCycleBlock: reverse mapping from a combined-cycle steam turbine's (CA) UUID to the indices of HRSGs that supply it.
PowerSystems.get_components_in_exclusion_group — Methodget_components_in_exclusion_group(
sys::System,
plant::CombinedCycleFractional,
exclusion_group::Int64
) -> Any
get_components_in_exclusion_group(sys::System, plant::CombinedCycleFractional, exclusion_group::Int)Return all thermal generators in exclusion group exclusion_group of a CombinedCycleFractional. Only one generator per exclusion group may operate simultaneously.
Arguments
sys::System: The system containing the components.plant::CombinedCycleFractional: The combined cycle fractional plant.exclusion_group::Int: The exclusion group number to query.
Throws
ArgumentError: ifexclusion_groupdoes not exist in the plant.
See also: add_supplemental_attribute!, get_operation_exclusion_map
PowerSystems.get_components_in_pcc — Methodget_components_in_pcc(
sys::System,
plant::RenewablePowerPlant,
pcc_number::Int64
) -> Any
get_components_in_pcc(sys::System, plant::RenewablePowerPlant, pcc_number::Int)Return all renewable generators and storage devices connected to PCC pcc_number (point of common coupling) in a RenewablePowerPlant.
Arguments
sys::System: The system containing the components.plant::RenewablePowerPlant: The renewable power plant.pcc_number::Int: The PCC number to query.
Throws
ArgumentError: ifpcc_numberdoes not exist in the plant.
See also: add_supplemental_attribute!, get_pcc_map
PowerSystems.get_components_in_penstock — Methodget_components_in_penstock(
sys::System,
plant::HydroPowerPlant,
penstock_number::Int64
) -> Any
get_components_in_penstock(sys::System, plant::HydroPowerPlant, penstock_number::Int)Return all hydro generators connected to penstock penstock_number in a HydroPowerPlant.
Arguments
sys::System: The system containing the components.plant::HydroPowerPlant: The hydro power plant.penstock_number::Int: The penstock number to query.
Throws
ArgumentError: ifpenstock_numberdoes not exist in the plant.
See also: add_supplemental_attribute!, get_penstock_map
PowerSystems.get_components_in_shaft — Methodget_components_in_shaft(
sys::System,
plant::ThermalPowerPlant,
shaft_number::Int64
) -> Any
get_components_in_shaft(sys::System, plant::ThermalPowerPlant, shaft_number::Int)Return all thermal generators connected to shaft shaft_number in a ThermalPowerPlant.
Arguments
sys::System: The system containing the components.plant::ThermalPowerPlant: The thermal power plant.shaft_number::Int: The shaft number to query.
Throws
ArgumentError: ifshaft_numberdoes not exist in the plant.
See also: add_supplemental_attribute!, get_shaft_map
PowerSystems.get_configuration — Methodget_configuration(
value::CombinedCycleBlock
) -> CombinedCycleConfiguration
Return the configuration field of CombinedCycleBlock.
PowerSystems.get_configuration — Methodget_configuration(
value::CombinedCycleFractional
) -> CombinedCycleConfiguration
Return the configuration field of CombinedCycleFractional.
PowerSystems.get_ct_hrsg_map — Methodget_ct_hrsg_map(
value::CombinedCycleBlock
) -> Dict{Base.UUID, Vector{Int64}}
Return the ct_hrsg_map field of CombinedCycleBlock: reverse mapping from a combustion turbine's (CT) UUID to the indices of HRSGs it feeds.
PowerSystems.get_heat_recovery_to_steam_factor — Methodget_heat_recovery_to_steam_factor(
value::CombinedCycleBlock
) -> Float64
Return the heat_recovery_to_steam_factor field of CombinedCycleBlock.
PowerSystems.get_hrsg_ca_map — Methodget_hrsg_ca_map(
value::CombinedCycleBlock
) -> Dict{Int64, Vector{Base.UUID}}
Return the hrsg_ca_map field of CombinedCycleBlock: mapping from HRSG index to the UUIDs of combined-cycle steam turbines (CA) driven by that HRSG.
PowerSystems.get_hrsg_ct_map — Methodget_hrsg_ct_map(
value::CombinedCycleBlock
) -> Dict{Int64, Vector{Base.UUID}}
Return the hrsg_ct_map field of CombinedCycleBlock: mapping from HRSG index to the UUIDs of combustion turbines (CT) feeding that HRSG.
PowerSystems.get_inverse_operation_exclusion_map — Methodget_inverse_operation_exclusion_map(
value::CombinedCycleFractional
) -> Dict{Base.UUID, Int64}
Return the inverse_operation_exclusion_map field of CombinedCycleFractional: reverse mapping from a unit's UUID to its exclusion group index.
PowerSystems.get_operation_exclusion_map — Methodget_operation_exclusion_map(
value::CombinedCycleFractional
) -> Dict{Int64, Vector{Base.UUID}}
Return the operation_exclusion_map field of CombinedCycleFractional: mapping from exclusion group index to the UUIDs of units in that group; only one unit per group may operate simultaneously.
PowerSystems.get_pcc_map — Methodget_pcc_map(
value::RenewablePowerPlant
) -> Dict{Int64, Vector{Base.UUID}}
Return the pcc_map field of RenewablePowerPlant: mapping from PCC (point of common coupling) index to the UUIDs of generators and storage devices connected to that PCC.
PowerSystems.get_penstock_map — Methodget_penstock_map(
value::HydroPowerPlant
) -> Dict{Int64, Vector{Base.UUID}}
Return the penstock_map field of HydroPowerPlant: mapping from penstock index to the UUIDs of generators connected to that penstock.
PowerSystems.get_reverse_pcc_map — Methodget_reverse_pcc_map(
value::RenewablePowerPlant
) -> Dict{Base.UUID, Int64}
Return the reverse_pcc_map field of RenewablePowerPlant: reverse mapping from a component's UUID to its PCC index.
PowerSystems.get_reverse_penstock_map — Methodget_reverse_penstock_map(
value::HydroPowerPlant
) -> Dict{Base.UUID, Int64}
Return the reverse_penstock_map field of HydroPowerPlant: reverse mapping from a generator's UUID to its penstock index.
PowerSystems.get_reverse_shaft_map — Methodget_reverse_shaft_map(
value::ThermalPowerPlant
) -> Dict{Base.UUID, Int64}
Return the reverse_shaft_map field of ThermalPowerPlant: reverse mapping from a generator's UUID to its shaft index.
PowerSystems.get_shaft_map — Methodget_shaft_map(
value::ThermalPowerPlant
) -> Dict{Int64, Vector{Base.UUID}}
Return the shaft_map field of ThermalPowerPlant: mapping from shaft index to the UUIDs of generators connected to that shaft.
PowerSystems.remove_supplemental_attribute! — Methodremove_supplemental_attribute!(
sys::System,
component::ThermalGen,
attribute::CombinedCycleBlock
)
remove_supplemental_attribute!(sys::System, component::ThermalGen, attribute::CombinedCycleBlock)Remove a thermal generator from a CombinedCycleBlock. The generator is removed from whichever HRSG map corresponds to its prime mover type (CT or CA).
Arguments
sys::System: The system containing the generator.component::ThermalGen: The thermal generator to remove from the block.attribute::CombinedCycleBlock: The combined cycle block.
Throws
ArgumentError: if the generator is not associated with this block.
See also: add_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.remove_supplemental_attribute! — Methodremove_supplemental_attribute!(
sys::System,
component::ThermalGen,
attribute::CombinedCycleFractional
)
remove_supplemental_attribute!(sys::System, component::ThermalGen, attribute::CombinedCycleFractional)Remove a thermal generator from a CombinedCycleFractional.
Arguments
sys::System: The system containing the generator.component::ThermalGen: The thermal generator to remove from the plant.attribute::CombinedCycleFractional: The combined cycle fractional plant.
Throws
ArgumentError: if the generator is not associated with this plant.
See also: add_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.remove_supplemental_attribute! — Methodremove_supplemental_attribute!(
sys::System,
component::ThermalGen,
attribute::ThermalPowerPlant
)
remove_supplemental_attribute!(sys::System, component::ThermalGen, attribute::ThermalPowerPlant)Remove a thermal generator from a ThermalPowerPlant.
Arguments
sys::System: The system containing the generator.component::ThermalGen: The thermal generator to remove from the plant.attribute::ThermalPowerPlant: The thermal power plant.
Throws
ArgumentError: if the generator is not associated with this plant.
See also: add_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.remove_supplemental_attribute! — Methodremove_supplemental_attribute!(
sys::System,
component::Union{EnergyReservoirStorage, RenewableGen},
attribute::RenewablePowerPlant
)
remove_supplemental_attribute!(sys::System, component::Union{RenewableGen, EnergyReservoirStorage}, attribute::RenewablePowerPlant)Remove a renewable generator or storage device from a RenewablePowerPlant.
Arguments
sys::System: The system containing the component.component::Union{RenewableGen, EnergyReservoirStorage}: The renewable generator or storage device to remove from the plant.attribute::RenewablePowerPlant: The renewable power plant.
Throws
ArgumentError: if the component is not associated with this plant.
See also: add_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.remove_supplemental_attribute! — Methodremove_supplemental_attribute!(
sys::System,
component::Union{HydroPumpTurbine, HydroTurbine},
attribute::HydroPowerPlant
)
remove_supplemental_attribute!(sys::System, component::Union{HydroPumpTurbine, HydroTurbine}, attribute::HydroPowerPlant)Remove a hydro generator from a HydroPowerPlant.
Arguments
sys::System: The system containing the generator.component::Union{HydroPumpTurbine, HydroTurbine}: The hydro generator to remove from the plant.attribute::HydroPowerPlant: The hydro power plant.
Throws
ArgumentError: if the generator is not associated with this plant.
See also: add_supplemental_attribute!, begin_supplemental_attributes_update
PowerSystems.EmissionsData — TypeEmissionsData(; name, pollutant, emission_rate, basis, energy_unit, ...)A SupplementalAttribute describing the emission of a single pollutant from a host component. Combines pollutant identity (CO2, NOx, etc.) with an emission rate expressed as a ValueCurve (supporting constant, linear, or piecewise relationships between fuel consumption / power output and emissions). One EmissionsData instance can be attached to one or many components via add_supplemental_attribute!.
Arguments
name::String: Identifier for this emissions attribute.pollutant::PollutantType: Scoped enum (CO2,CO2E,CH4,N2O,NOX,SO2,PM25,PM10,HG,HAP,CUSTOM).emission_rate::ValueCurve: Emission rate as aValueCurve, typically anIncrementalCurve. A convenience constructor accepts aRealscalar, which is wrapped in anIncrementalCurvewith constant rate.basis::EmissionBasis:FUEL_INPUT(mass per unit of heat input) orPOWER_OUTPUT(mass per unit of electrical output).energy_unit::EnergyUnit: Energy unit for the rate denominator (MMBTU,GJ, orMWH). Must be consistent withbasis.start_up_adder::Float64: (default:0.0) Per-start emission pulse, inmass_unit.mass_unit::MassUnit: (default:MassUnit.KG)KG,LB,SHORT_TON,METRIC_TON.gwp::Float64: (default:1.0) GWP100 multiplier for CO2-equivalent reporting.available::Bool: (default:true) Whether this attribute is active.ext::Dict{String, Any}: (default:Dict{String, Any}()) Extra metadata dictionary.internal::InfrastructureSystemsInternal: (Do not modify.) PowerSystems internal reference.
PowerSystems.EmissionsData — MethodEmissionsData(
;
name,
pollutant,
emission_rate,
basis,
energy_unit,
start_up_adder,
mass_unit,
gwp,
available,
ext,
internal
)
EmissionsData(; name, pollutant, emission_rate, basis, energy_unit, ...)Construct an EmissionsData with validation.
emission_rate can be any ValueCurve (e.g., IncrementalCurve, InputOutputCurve) or a scalar Real value (which is automatically wrapped in an IncrementalCurve with constant rate).
InfrastructureSystems.get_available — Methodget_available(value::EmissionsData) -> Bool
Get EmissionsData available.
InfrastructureSystems.get_name — Methodget_name(value::EmissionsData) -> String
Get EmissionsData name.
InfrastructureSystems.set_available! — Methodset_available!(value::EmissionsData, val::Bool)
Set EmissionsData available.
PowerSystems.get_basis — Methodget_basis(value::EmissionsData) -> EmissionBasis
Get EmissionsData basis.
PowerSystems.get_emission_rate — Methodget_emission_rate(value::EmissionsData) -> ValueCurve
Get EmissionsData emission_rate.
PowerSystems.get_energy_unit — Methodget_energy_unit(value::EmissionsData) -> EnergyUnit
Get EmissionsData energy_unit.
PowerSystems.get_ext — Methodget_ext(value::EmissionsData) -> Dict{String, Any}
Get EmissionsData ext.
PowerSystems.get_gwp — Methodget_gwp(value::EmissionsData) -> Float64
Get EmissionsData gwp.
PowerSystems.get_mass_unit — Methodget_mass_unit(value::EmissionsData) -> MassUnit
Get EmissionsData mass_unit.
PowerSystems.get_pollutant — Methodget_pollutant(value::EmissionsData) -> PollutantType
Get EmissionsData pollutant.
PowerSystems.get_start_up_adder — Methodget_start_up_adder(value::EmissionsData) -> Float64
Get EmissionsData start_up_adder.
PowerSystems.set_basis! — Methodset_basis!(value::EmissionsData, val::EmissionBasis)
Set EmissionsData basis, validating it against the current energy_unit. To switch between FUEL_INPUT and POWER_OUTPUT (which also requires changing energy_unit), use set_basis_and_energy_unit! instead.
PowerSystems.set_basis_and_energy_unit! — Methodset_basis_and_energy_unit!(
value::EmissionsData,
basis::EmissionBasis,
energy_unit::EnergyUnit
)
Set EmissionsData basis (EmissionBasis) and energy_unit (EnergyUnit) together, validating the combination. This is the supported way to retarget an attribute between FUEL_INPUT and POWER_OUTPUT, since neither field can be changed individually without transiently violating the basis/energy_unit invariant.
PowerSystems.set_emission_rate! — Methodset_emission_rate!(value::EmissionsData, val::Real)
Set EmissionsData emission_rate with a scalar (wraps in IncrementalCurve with constant rate).
PowerSystems.set_emission_rate! — Methodset_emission_rate!(value::EmissionsData, val::ValueCurve)
Set EmissionsData emission_rate with a ValueCurve.
PowerSystems.set_energy_unit! — Methodset_energy_unit!(value::EmissionsData, val::EnergyUnit)
Set EmissionsData energy_unit to an EnergyUnit, validating against the current basis.
PowerSystems.set_gwp! — Methodset_gwp!(value::EmissionsData, val::Real)
Set EmissionsData gwp.
PowerSystems.set_mass_unit! — Methodset_mass_unit!(value::EmissionsData, val::MassUnit)
Set EmissionsData mass_unit to a MassUnit.
PowerSystems.set_pollutant! — Methodset_pollutant!(value::EmissionsData, val::PollutantType)
Set EmissionsData pollutant to a PollutantType.
PowerSystems.set_start_up_adder! — Methodset_start_up_adder!(value::EmissionsData, val::Real)
Set EmissionsData start_up_adder.
InfrastructureSystems.GeographicInfo — TypeGeographicInfo <: SupplementalAttributeSupplemental attribute to store geographic information about system components in GeoJSON format.
Arguments
geo_json::Dict{String, Any}: dictionary containing GeoJSON data representing the geographic information of the componentinternal::InfrastructureSystemsInternal: internal infrastructure systems data for managing metadata and UUID tracking
InfrastructureSystems.GeographicInfo — MethodGeographicInfo(; geo_json, internal) -> GeographicInfo
GeographicInfo(; geo_json, internal)Construct a GeographicInfo supplemental attribute.
Arguments
geo_json::Dict{String, Any}: dictionary containing GeoJSON data. Defaults to an empty dictionary if not providedinternal::InfrastructureSystemsInternal: internal infrastructure systems data. Defaults to a new InfrastructureSystemsInternal instance if not provided
Example
# Create with default empty geo_json
geo_info = GeographicInfo()
# Create with specific geo_json data
geo_data = Dict("type" => "Point", "coordinates" => [1.0, 2.0])
geo_info = GeographicInfo(geo_json = geo_data)InfrastructureSystems.get_geo_json — Methodget_geo_json(geo::GeographicInfo) -> Dict{String, Any}
get_geo_json(geo::GeographicInfo)Get the GeoJSON dictionary from a GeographicInfo attribute.
Arguments
geo::GeographicInfo: theGeographicInfoattribute
Operating Costs
InfrastructureSystems.CostCurve — Typestruct CostCurve{T<:ValueCurve} <: ProductionVariableCostCurve{T<:ValueCurve}value_curve::ValueCurve: The underlyingValueCurverepresentation of thisProductionVariableCostCurvepower_units::UnitSystem: (default: natural units (MW)) The units for the x-axis of the curvevom_cost::LinearCurve: (default of 0) Additional proportional Variable Operation and Maintenance Cost in /(power_unit h), represented as aLinearCurve
CostCurve(value_curve, power_units, vom_cost)
CostCurve(; value_curve, power_units, vom_cost)Direct representation of the variable operation cost of a power plant in currency. Composed of a ValueCurve that may represent input-output, incremental, or average rate data. The default units for the x-axis are MW and can be specified with power_units.
InfrastructureSystems.FuelCurve — Typestruct FuelCurve{T<:ValueCurve} <: ProductionVariableCostCurve{T<:ValueCurve}value_curve::ValueCurve: The underlyingValueCurverepresentation of thisProductionVariableCostCurvepower_units::UnitSystem: (default: natural units (MW)) The units for the x-axis of the curvefuel_cost::Union{Float64, TimeSeriesKey}: Either a fixed value for fuel cost or theTimeSeriesKeyto a fuel cost time seriesstartup_fuel_offtake::LinearCurve: (default of 0) Fuel consumption at the unit startup proceedure. Additional cost to the startup costs and related only to the initial fuel required to start the unit. represented as aLinearCurvevom_cost::LinearCurve: (default of 0) Additional proportional Variable Operation and Maintenance Cost in /(power_unit h) represented as aLinearCurve
FuelCurve(value_curve, power_units, fuel_cost, startup_fuel_offtake, vom_cost)
FuelCurve(value_curve, fuel_cost)
FuelCurve(value_curve, fuel_cost, startup_fuel_offtake, vom_cost)
FuelCurve(value_curve, power_units, fuel_cost)
FuelCurve(; value_curve, power_units, fuel_cost, startup_fuel_offtake, vom_cost)Representation of the variable operation cost of a power plant in terms of fuel (MBTU, liters, m^3, etc.), coupled with a conversion factor between fuel and currency. Composed of a ValueCurve that may represent input-output, incremental, or average rate data. The default units for the x-axis are MW and can be specified with power_units.
InfrastructureSystems.ProductionVariableCostCurve — TypeSupertype for production variable cost curve representations, parameterized by a ValueCurve type.
InfrastructureSystems.get_fuel_cost — Methodget_fuel_cost(
cost::FuelCurve
) -> Union{Float64, TimeSeriesKey}
Get the fuel cost or the name of the fuel cost time series
InfrastructureSystems.get_function_data — Methodget_function_data(cost::ProductionVariableCostCurve) -> Any
Get the FunctionData representation of this ProductionVariableCostCurve's ValueCurve
InfrastructureSystems.get_initial_input — Methodget_initial_input(
cost::ProductionVariableCostCurve
) -> Union{Nothing, Float64}
Get the initial_input field of this ProductionVariableCostCurve's ValueCurve (not defined for input-output data)
InfrastructureSystems.get_power_units — Methodget_power_units(cost::ProductionVariableCostCurve) -> Any
Get the units for the x-axis of the curve
InfrastructureSystems.get_value_curve — Methodget_value_curve(cost::ProductionVariableCostCurve) -> Any
Get the underlying ValueCurve representation of this ProductionVariableCostCurve
InfrastructureSystems.get_vom_cost — Methodget_vom_cost(cost::ProductionVariableCostCurve) -> Any
Get the variable operation and maintenance cost in currency/(power_units h)
InfrastructureSystems.is_concave — Methodis_concave(cost::ProductionVariableCostCurve) -> Any
Calculate the concavity of the underlying data
InfrastructureSystems.is_convex — Methodis_convex(cost::ProductionVariableCostCurve) -> Any
Calculate the convexity of the underlying data
InfrastructureSystems.LinearCurve — TypeLinearCurve(proportional_term::Float64)
LinearCurve(proportional_term::Float64, constant_term::Float64)A linear input-output curve, representing a constant marginal rate. May have zero no-load cost (i.e., constant average rate) or not.
Arguments
proportional_term::Float64: marginal rateconstant_term::Float64: optional, cost at zero production, defaults to0.0
InfrastructureSystems.PiecewiseAverageCurve — TypePiecewiseAverageCurve(initial_input::Union{Float64, Nothing}, x_coords::Vector{Float64}, slopes::Vector{Float64})A piecewise linear curve specified by average rates between production points. May have nonzero initial value.
Arguments
initial_input::Union{Float64, Nothing}: cost at minimum production pointfirst(x_coords)(NOT at zero production), defines the start of the curvex_coords::Vector{Float64}: vector ofnproduction pointsslopes::Vector{Float64}: vector ofn-1average rates/slopes of the curve segments between the points
InfrastructureSystems.PiecewiseIncrementalCurve — TypePiecewiseIncrementalCurve(initial_input::Union{Float64, Nothing}, x_coords::Vector{Float64}, slopes::Vector{Float64})
PiecewiseIncrementalCurve(input_at_zero::Union{Nothing, Float64}, initial_input::Union{Float64, Nothing}, x_coords::Vector{Float64}, slopes::Vector{Float64})A piecewise linear curve specified by marginal rates (slopes) between production points. May have nonzero initial value.
Arguments
input_at_zero::Union{Nothing, Float64}: (optional, defaults tonothing) cost at zero production, does NOT represent a part of the curveinitial_input::Union{Float64, Nothing}: cost at minimum production pointfirst(x_coords)(NOT at zero production), defines the start of the curvex_coords::Vector{Float64}: vector ofnproduction pointsslopes::Vector{Float64}: vector ofn-1marginal rates/slopes of the curve segments between the points
InfrastructureSystems.PiecewisePointCurve — TypePiecewisePointCurve(points::Vector{Tuple{Float64, Float64}})A piecewise linear curve specified by cost values at production points.
Arguments
points::Vector{Tuple{Float64, Float64}}or similar: vector of(production, cost)pairs
InfrastructureSystems.QuadraticCurve — TypeQuadraticCurve(quadratic_term::Float64, proportional_term::Float64, constant_term::Float64)A quadratic input-output curve, may have nonzero no-load cost.
Arguments
quadratic_term::Float64: quadratic term of the curveproportional_term::Float64: proportional term of the curveconstant_term::Float64: constant term of the curve
InfrastructureSystems.get_average_rates — Methodget_average_rates(
vc::PiecewiseAverageCurve
) -> Vector{Float64}
Get the average rates that define the PiecewiseAverageCurve
InfrastructureSystems.get_constant_term — Methodget_constant_term(vc::LinearCurve) -> Float64
Get the constant term (i.e., intercept) of the LinearCurve
InfrastructureSystems.get_constant_term — Methodget_constant_term(vc::QuadraticCurve) -> Float64
Get the constant term of the QuadraticCurve
InfrastructureSystems.get_points — Methodget_points(
vc::PiecewisePointCurve
) -> Vector{@NamedTuple{x::Float64, y::Float64}}
Get the points that define the PiecewisePointCurve
InfrastructureSystems.get_proportional_term — Methodget_proportional_term(vc::LinearCurve) -> Float64
Get the proportional term (i.e., slope) of the LinearCurve
InfrastructureSystems.get_proportional_term — Methodget_proportional_term(vc::QuadraticCurve) -> Float64
Get the proportional (i.e., linear) term of the QuadraticCurve
InfrastructureSystems.get_quadratic_term — Methodget_quadratic_term(vc::QuadraticCurve) -> Float64
Get the quadratic term of the QuadraticCurve
InfrastructureSystems.get_slopes — Methodget_slopes(vc::PiecewiseIncrementalCurve) -> Vector{Float64}
Fetch the slopes that define the PiecewiseIncrementalCurve
InfrastructureSystems.get_slopes — Methodget_slopes(vc::PiecewisePointCurve) -> Vector{Float64}
Calculate the slopes of the line segments defined by the PiecewisePointCurve
InfrastructureSystems.get_x_coords — Methodget_x_coords(vc::PiecewiseAverageCurve) -> Vector{Float64}
Get the x-coordinates that define the PiecewiseAverageCurve
InfrastructureSystems.get_x_coords — Methodget_x_coords(
vc::PiecewiseIncrementalCurve
) -> Vector{Float64}
Get the x-coordinates that define the PiecewiseIncrementalCurve
InfrastructureSystems.get_x_coords — Methodget_x_coords(vc::PiecewisePointCurve) -> Vector{Float64}
Get the x-coordinates of the points that define the PiecewisePointCurve
InfrastructureSystems.get_y_coords — Methodget_y_coords(vc::PiecewisePointCurve) -> Vector{Float64}
Get the y-coordinates of the points that define the PiecewisePointCurve
InfrastructureSystems.AverageRateCurve — TypeAn average rate curve, relating the production quantity to the average cost rate from the origin: y = f(x)/x. Can be used, for instance, in the representation of a CostCurve where x is MW and y is currency/MWh, or in the representation of a FuelCurve where x is MW and y is fuel/MWh. Typically calculated by dividing absolute values of cost rate or fuel input rate by absolute values of electric power.
InfrastructureSystems.IncrementalCurve — TypeAn incremental (or 'marginal') curve, relating the production quantity to the derivative of cost: y = f'(x). Can be used, for instance, in the representation of a CostCurve where x is MW and y is currency/MWh, or in the representation of a FuelCurve where x is MW and y is fuel/MWh.
InfrastructureSystems.InputOutputCurve — TypeAn input-output curve, directly relating the production quantity to the cost: y = f(x). Can be used, for instance, in the representation of a CostCurve where x is MW and y is currency/hr, or in the representation of a FuelCurve where x is MW and y is fuel/hr.
InfrastructureSystems.InputOutputCurve — MethodEvaluate the InputOutputCurve at a given input value x.
InfrastructureSystems.ValueCurve — TypeSupertype that represents a unitless cost curve
Concrete subtypes are:
InfrastructureSystems.get_function_data — Methodget_function_data(curve::ValueCurve) -> Any
Get the underlying FunctionData representation of this ValueCurve
InfrastructureSystems.get_initial_input — Methodget_initial_input(
curve::Union{AverageRateCurve, IncrementalCurve}
) -> Union{Nothing, Float64}
Get the initial_input field of this ValueCurve (not defined for InputOutputCurve)
InfrastructureSystems.get_input_at_zero — Methodget_input_at_zero(curve::ValueCurve) -> Any
Get the input_at_zero field of this ValueCurve
InfrastructureSystems.FunctionData — TypeSupertype for all function data representations used in cost modeling.
Concrete subtypes include LinearFunctionData, QuadraticFunctionData, PiecewiseLinearData, and PiecewiseStepData.
InfrastructureSystems.LinearFunctionData — TypeStructure to represent the underlying data of linear functions. Principally used for the representation of cost functions f(x) = proportional_term*x + constant_term.
Arguments
proportional_term::Float64: the proportional term in the represented functionconstant_term::Float64: the constant term in the represented function
InfrastructureSystems.LinearFunctionData — MethodEvaluate the LinearFunctionData at a given x-coordinate
InfrastructureSystems.PiecewiseLinearData — TypeStructure to represent piecewise linear data as a series of points: two points define one segment, three points define two segments, etc. The curve starts at the first point given, not the origin. Principally used for the representation of cost functions where the points store quantities (x, y), such as (MW, /h).
Arguments
points::Vector{@NamedTuple{x::Float64, y::Float64}}: the points that define the function
InfrastructureSystems.PiecewiseLinearData — MethodEvaluate the PiecewiseLinearData or PiecewiseStepData at a given x-coordinate
InfrastructureSystems.PiecewiseStepData — TypeStructure to represent a step function as a series of endpoint x-coordinates and segment y-coordinates: two x-coordinates and one y-coordinate defines a single segment, three x-coordinates and two y-coordinates define two segments, etc. This can be useful to represent the derivative of a PiecewiseLinearData, where the y-coordinates of this step function represent the slopes of that piecewise linear function, so there is also an optional field c that can be used to store the initial y-value of that piecewise linear function. Principally used for the representation of cost functions where the points store quantities (x, dy/dx), such as (MW, /MWh).
Arguments
x_coords::Vector{Float64}: the x-coordinates of the endpoints of the segmentsy_coords::Vector{Float64}: the y-coordinates of the segments:y_coords[1]is the y-value between
x_coords[1] and x_coords[2], etc. Must have one fewer elements than x_coords.
c::Union{Nothing, Float64}: optional, the value to use for the integral from 0 tox_coords[1]of this function
InfrastructureSystems.QuadraticFunctionData — TypeStructure to represent the underlying data of quadratic functions. Principally used for the representation of cost functions f(x) = quadratic_term*x^2 + proportional_term*x + constant_term.
Arguments
quadratic_term::Float64: the quadratic term in the represented functionproportional_term::Float64: the proportional term in the represented functionconstant_term::Float64: the constant term in the represented function
InfrastructureSystems.QuadraticFunctionData — MethodQuadraticFunctionData(
data::LinearFunctionData
) -> QuadraticFunctionData
Losslessly convert LinearFunctionData to QuadraticFunctionData
InfrastructureSystems.QuadraticFunctionData — MethodEvaluate the QuadraticFunctionData at a given x-coordinate
InfrastructureSystems.get_points — Methodget_points(
data::PiecewiseLinearData
) -> Vector{@NamedTuple{x::Float64, y::Float64}}
Get the points that define the piecewise data
InfrastructureSystems.get_slopes — Methodget_slopes(pwl::PiecewiseLinearData) -> Vector{Float64}
Calculates the slopes of the line segments defined by the PiecewiseLinearData, returning one fewer slope than the number of underlying points.
InfrastructureSystems.get_x_coords — Methodget_x_coords(data::PiecewiseLinearData) -> Vector{Float64}
Get the x-coordinates of the points that define the piecewise data
InfrastructureSystems.get_x_coords — Methodget_x_coords(data::PiecewiseStepData) -> Vector{Float64}
Get the x-coordinates of the points that define the piecewise data
InfrastructureSystems.get_x_lengths — Methodget_x_lengths(
pwl::Union{PiecewiseLinearData, PiecewiseStepData}
) -> Vector{Float64}
Calculates the x-length of each segment of a piecewise curve.
InfrastructureSystems.get_y_coords — Methodget_y_coords(data::PiecewiseLinearData) -> Vector{Float64}
Get the y-coordinates of the points that define the PiecewiseLinearData
InfrastructureSystems.get_y_coords — Methodget_y_coords(data::PiecewiseStepData) -> Vector{Float64}
Get the y-coordinates of the segments in the PiecewiseStepData
Time Series
InfrastructureSystems.TimeSeriesData — TypeAbstract type for time series stored in the system. Components store references to these through TimeSeriesMetadata values so that data can reside on storage media instead of memory.
InfrastructureSystems.Deterministic — Typemutable struct Deterministic <: AbstractDeterministic
name::String
data::SortedDict
resolution::Dates.Period
interval::Dates.Period
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA deterministic forecast for a particular data field in a Component.
Arguments
name::String: user-defined namedata::SortedDict: timestamp - scalingfactorresolution::Dates.Period: forecast resolutioninterval::Dates.Period: forecast intervalscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.Deterministic — MethodDeterministic(
name::AbstractString,
input_data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray};
resolution,
interval,
normalization_factor,
scaling_factor_multiplier
) -> Deterministic
Construct Deterministic from a Dict of TimeArrays.
Arguments
name::AbstractString: user-defined nameinput_data::AbstractDict{Dates.DateTime, TimeSeries.TimeArray}: time series data.resolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, it must be the difference between each consecutive timestamps. Resolution is required if the resolution is irregular, such as with Dates.Month or Dates.Year.interval::Union{Nothing, Dates.Period} = nothing: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the interval is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp = :timestamp: If the values are DataFrames is passed then this must be the column name that contains timestamps.
InfrastructureSystems.Deterministic — MethodDeterministic(
name::AbstractString,
filename::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> Deterministic
Construct Deterministic from a CSV file. The first column must be a timestamp in DateTime format and the columns the values in the forecast window.
Arguments
name::AbstractString: user-defined namefilename::AbstractString: name of CSV file containing datacomponent::InfrastructureSystemsComponent: component associated with the datanormalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.Deterministic — MethodDeterministic(
name::AbstractString,
series_data::InfrastructureSystems.RawTimeSeries,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> Deterministic
Construct Deterministic from RawTimeSeries.
InfrastructureSystems.Deterministic — MethodDeterministic(
src::Deterministic,
name::AbstractString;
scaling_factor_multiplier
) -> Deterministic
Construct Deterministic that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attributes.
Examples
resolution = Dates.Hour(1)
data = Dict(
DateTime("2020-01-01T00:00:00") => ones(24),
DateTime("2020-01-01T01:00:00") => ones(24),
)
# Define a Deterministic for the first attribute
forecast_max_active_power = Deterministic(
"max_active_power",
data,
resolution,
scaling_factor_multiplier = get_max_active_power,
)
add_time_series!(sys, generator, forecast_max_active_power)
# Reuse time series for second attribute
forecast_max_reactive_power = Deterministic(
forecast_max_active_power,
"max_reactive_power"
scaling_factor_multiplier = get_max_reactive_power,
)
add_time_series!(sys, generator, forecast_max_reactive_power)InfrastructureSystems.Deterministic — MethodDeterministic(
forecast::Deterministic,
data
) -> Deterministic
Construct a new Deterministic from an existing instance and a subset of data.
InfrastructureSystems.get_data — Methodget_data(value::Deterministic) -> DataStructures.SortedDict
Get Deterministic data.
InfrastructureSystems.get_name — Methodget_name(value::Deterministic) -> String
Get Deterministic name.
InfrastructureSystems.get_resolution — Methodget_resolution(value::Deterministic) -> Dates.Period
Get Deterministic resolution.
InfrastructureSystems.iterate_windows — Methoditerate_windows(
forecast::Deterministic
) -> Base.Generator{I, InfrastructureSystems.var"#iterate_windows_common##0#iterate_windows_common##1"{Deterministic}} where I<:(DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K}))
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endInfrastructureSystems.set_name! — Methodset_name!(value::Deterministic, val) -> Any
Set Deterministic name.
InfrastructureSystems.DeterministicSingleTimeSeries — Typemutable struct DeterministicSingleTimeSeries <: AbstractDeterministic
single_time_series::SingleTimeSeries
initial_timestamp::Dates.DateTime
interval::Dates.Period
count::Int
horizon::Int
endA deterministic forecast that wraps a SingleTimeSeries
DeterministicSingleTimeSeries behaves exactly like a Deterministic, but instead of storing windows at each initial time it provides a view into the existing SingleTimeSeries at incrementing offsets. This avoids large data duplications when there are the overlapping windows between forecasts.
Can be used as a perfect forecast based on historical data when real forecast data is unavailable.
Arguments
single_time_series::SingleTimeSeries: wrappedSingleTimeSeriesobjectinitial_timestamp::Dates.DateTime: time series availability timeinterval::Dates.Period: time step between forecast windowscount::Int: number of forecast windowshorizon::Int: length of this time series
InfrastructureSystems.get_horizon — Methodget_horizon(
value::DeterministicSingleTimeSeries
) -> Dates.Period
Get DeterministicSingleTimeSeries horizon.
InfrastructureSystems.iterate_windows — Methoditerate_windows(
forecast::DeterministicSingleTimeSeries
) -> Union{Tuple{Any}, Base.Generator{I, InfrastructureSystems.var"#iterate_windows##0#iterate_windows##1"{DeterministicSingleTimeSeries}} where I<:(StepRangeLen{T, R, S, Int64} where {T, R>:Dates.DateTime, S})}
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endInfrastructureSystems.Probabilistic — Typemutable struct Probabilistic <: Forecast
name::String
resolution::Dates.Period
interval::Dates.Period
percentiles::Vector{Float64}
data::SortedDict
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA Probabilistic forecast for a particular data field in a Component.
Arguments
name::String: user-defined nameresolution::Dates.Period: forecast resolutioninterval::Dates.Period: forecast intervalpercentiles::Vector{Float64}: Percentiles for the probabilistic forecastdata::SortedDict: timestamp - scalingfactorscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.Probabilistic — MethodProbabilistic(
name::AbstractString,
input_data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray},
percentiles::Vector{Float64};
resolution,
interval,
normalization_factor,
scaling_factor_multiplier
) -> Probabilistic
Construct Probabilistic from a Dict of TimeArrays.
Arguments
name::AbstractString: user-defined nameinput_data::AbstractDict{Dates.DateTime, TimeSeries.TimeArray}: time series data.percentiles: Percentiles represented in the probabilistic forecastresolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, this must be the difference between each consecutive timestamps. This is required if the resolution is irregular, such as Dates.Month or Dates.Year.interval::Union{Nothing, Dates.Period} = nothing: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp = :timestamp: If the values are DataFrames is passed then this must be the column name that contains timestamps.
InfrastructureSystems.Probabilistic — MethodProbabilistic(
name::AbstractString,
data::DataStructures.SortedDict{Dates.DateTime, Matrix{Float64}},
percentiles::Vector,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> Probabilistic
Construct Probabilistic from a SortedDict of Arrays.
Arguments
name::AbstractString: user-defined namedata::AbstractDict{Dates.DateTime, Matrix{Float64}}: time series data.percentiles: Percentiles represented in the probabilistic forecastresolution::Dates.Period: The resolution of the forecast in Dates.Period`interval::Union{Nothing, Dates.Period}: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.Probabilistic — MethodProbabilistic(
name::AbstractString,
series_data::InfrastructureSystems.RawTimeSeries,
percentiles::Vector,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
)
Construct Deterministic from RawTimeSeries.
InfrastructureSystems.Probabilistic — MethodProbabilistic(
src::Probabilistic,
name::AbstractString;
scaling_factor_multiplier
) -> Probabilistic
Construct a Probabilistic that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attributes.
InfrastructureSystems.get_data — Methodget_data(value::Probabilistic) -> DataStructures.SortedDict
Get Probabilistic data.
InfrastructureSystems.get_name — Methodget_name(value::Probabilistic) -> String
Get Probabilistic name.
InfrastructureSystems.get_percentiles — Methodget_percentiles(value::Probabilistic) -> Vector{Float64}
Get Probabilistic percentiles.
InfrastructureSystems.get_resolution — Methodget_resolution(value::Probabilistic) -> Dates.Period
Get Probabilistic resolution.
InfrastructureSystems.iterate_windows — Methoditerate_windows(
forecast::Probabilistic
) -> Base.Generator{I, InfrastructureSystems.var"#iterate_windows_common##0#iterate_windows_common##1"{Probabilistic}} where I<:(DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K}))
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endInfrastructureSystems.set_name! — Methodset_name!(value::Probabilistic, val) -> Any
Set Probabilistic name.
InfrastructureSystems.Scenarios — Typemutable struct Scenarios <: Forecast
name::String
resolution::Dates.Period
interval::Dates.Period
scenario_count::Int
data::SortedDict
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA Discrete Scenario Based time series for a particular data field in a Component.
Arguments
name::String: user-defined nameresolution::Dates.Period: forecast resolutioninterval::Dates.Period: forecast intervalscenario_count::Int: Number of scenariosdata::SortedDict: timestamp - scalingfactorscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.Scenarios — MethodScenarios(
name::AbstractString,
input_data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray};
resolution,
interval,
normalization_factor,
scaling_factor_multiplier
) -> Scenarios
Construct Scenarios from a Dict of TimeArrays.
Arguments
name::AbstractString: user-defined nameinput_data::AbstractDict{Dates.DateTime, TimeSeries.TimeArray}: time series data.resolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, it must be the difference between each consecutive timestamps. Resolution is required if the type is irregular, such as with Dates.Month or Dates.Year.interval::Union{Nothing, Dates.Period} = nothing: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp = :timestamp: If the values are DataFrames is passed then this must be the column name that contains timestamps.
InfrastructureSystems.Scenarios — MethodScenarios(
name::AbstractString,
data::DataStructures.SortedDict{Dates.DateTime, Matrix{Float64}},
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> Scenarios
Construct Scenarios from a SortedDict of Arrays.
Arguments
name::AbstractString: user-defined nameinput_data::SortedDict{Dates.DateTime, Matrix{Float64}}: time series data.resolution::Dates.Period: The resolution of the forecast inDates.Periodinterval::Union{Nothing, Dates.Period}: If nothing, infer interval from the data. Otherwise, this must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.Scenarios — MethodScenarios(
src::Scenarios,
name::AbstractString;
scaling_factor_multiplier
) -> Scenarios
Construct Scenarios that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attributes.
InfrastructureSystems.get_data — Methodget_data(value::Scenarios) -> DataStructures.SortedDict
Get Scenarios data.
InfrastructureSystems.get_name — Methodget_name(value::Scenarios) -> String
Get Scenarios name.
InfrastructureSystems.get_resolution — Methodget_resolution(value::Scenarios) -> Dates.Period
Get Scenarios resolution.
InfrastructureSystems.get_scenario_count — Methodget_scenario_count(value::Scenarios) -> Int64
Get Scenarios scenario_count.
InfrastructureSystems.iterate_windows — Methoditerate_windows(
forecast::Scenarios
) -> Base.Generator{I, InfrastructureSystems.var"#iterate_windows_common##0#iterate_windows_common##1"{Scenarios}} where I<:(DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K}))
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endInfrastructureSystems.set_name! — Methodset_name!(value::Scenarios, val) -> Any
Set Scenarios name.
InfrastructureSystems.StaticTimeSeries — TypeSupertype for static time series, which has one value per time point
Current concrete subtypes are:
See also: Forecast
InfrastructureSystems.SingleTimeSeries — Typemutable struct SingleTimeSeries <: StaticTimeSeries
name::String
data::TimeSeries.TimeArray
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA single column of time series data for a particular data field in a Component.
In contrast with a forecast, this can represent one continual time series, such as a series of historical measurements or realizations or a single scenario (e.g. a weather year or different input assumptions).
Arguments
name::String: user-defined namedata::TimeSeries.TimeArray: timestamp - scalingfactorresolution::Dates.Period: Time duration between steps in the time series. The resolution must be the same throughout the time seriesscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.SingleTimeSeries — MethodSingleTimeSeries(
name::AbstractString,
filename::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent,
resolution::Dates.Period;
normalization_factor,
scaling_factor_multiplier
) -> SingleTimeSeries
Construct SingleTimeSeries from a CSV file. The file must have a column that is the name of the component.
Arguments
name::AbstractString: user-defined namefilename::AbstractString: name of CSV file containing datacomponent::InfrastructureSystemsComponent: component associated with the dataresolution::Dates.Period: resolution of the time seriesnormalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.SingleTimeSeries — MethodSingleTimeSeries(
name::AbstractString,
data::Union{DataFrame, TimeSeries.TimeArray};
normalization_factor,
scaling_factor_multiplier,
timestamp,
resolution
) -> SingleTimeSeries
Construct SingleTimeSeries from a TimeArray or DataFrame.
Arguments
name::AbstractString: user-defined namedata::Union{TimeSeries.TimeArray, DataFrames.DataFrame}: time series datanormalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp::Symbol = :timestamp: If a DataFrame is passed then this must be the column name that contains timestamps.resolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, it must be the difference between each consecutive timestamps. Resolution is required if the resolution is irregular, such as with Dates.Month or Dates.Year.
InfrastructureSystems.SingleTimeSeries — MethodSingleTimeSeries(
src::SingleTimeSeries,
name::AbstractString;
scaling_factor_multiplier
) -> SingleTimeSeries
Construct SingleTimeSeries that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attribtues.
InfrastructureSystems.SingleTimeSeries — MethodSingleTimeSeries(
time_series::SingleTimeSeries,
data::TimeSeries.TimeArray
) -> Any
Creates a new SingleTimeSeries from an existing instance and a subset of data.
InfrastructureSystems.SingleTimeSeries — MethodSingleTimeSeries(
name::String,
resolution::Dates.Period,
initial_time::Dates.DateTime,
time_steps::Int64
) -> SingleTimeSeries
Construct SingleTimeSeries after constructing a TimeArray from initial_time and time_steps.
InfrastructureSystems.get_data — Methodget_data(value::SingleTimeSeries) -> TimeSeries.TimeArray
Get SingleTimeSeries data.
InfrastructureSystems.get_name — Methodget_name(value::SingleTimeSeries) -> String
Get SingleTimeSeries name.
InfrastructureSystems.get_resolution — Methodget_resolution(value::SingleTimeSeries) -> Dates.Period
Get SingleTimeSeries resolution.
InfrastructureSystems.set_name! — Methodset_name!(value::SingleTimeSeries, val) -> Any
Set SingleTimeSeries name.
InfrastructureSystems.AbstractDeterministic — TypeSupertype for all deterministic forecast time series.
Concrete subtypes include Deterministic and DeterministicSingleTimeSeries.
InfrastructureSystems.Forecast — TypeSupertype for forecast time series Current concrete subtypes are:
Subtypes of Forecast must implement:
get_horizon_countget_initial_timesget_initial_timestampget_nameget_scaling_factor_multiplierget_windowiterate_windows
InfrastructureSystems.get_window — Methodget_window(forecast::Forecast, index::Int64; len) -> Any
Return the forecast window corresponsing to interval index.
InfrastructureSystems.ForecastCache — MethodConstruct ForecastCache to automatically control caching of forecast data. Maintains some count of forecast windows in memory based on cache_size_bytes.
Call Base.iterate or get_next_time_series_array! to retrieve data. Each iteration will return a TimeSeries.TimeArray covering one forecast window of length horizon_count.
Arguments
::Type{T}: subtype of Forecastcomponent::InfrastructureSystemsComponent: componentname::AbstractString: forecast namestart_time::Union{Nothing, Dates.DateTime} = nothing: forecast start timehorizon_count::Union{Nothing, Int} = nothing: forecast horizon countcache_size_bytes = TIME_SERIES_CACHE_SIZE_BYTES: maximum size of data to keep in memoryignore_scaling_factors = false: controls whether to ignorescaling_factor_multiplierin the time series instanceinterval::Union{Nothing, Dates.Period} = nothing: select among multiple forecasts that share(type, name)but differ in interval.resolution::Union{Nothing, Dates.Period} = nothing: select among multiple forecasts that share(type, name)but differ in resolution.
InfrastructureSystems.StaticTimeSeriesCache — MethodConstruct StaticTimeSeriesCache to automatically control caching of time series data. Maintains rows of data in memory based on cache_size_bytes.
Call Base.iterate or get_time_series_array to retrieve data. Each iteration will return a TimeSeries.TimeArray of size 1.
Arguments
::Type{T}: subtype of StaticTimeSeriescomponent::InfrastructureSystemsComponent: componentname::AbstractString: time series namecache_size_bytes = TIME_SERIES_CACHE_SIZE_BYTES: maximum size of data to keep in memoryignore_scaling_factors = false: controls whether to ignorescaling_factor_multiplierin the time series instanceresolution::Union{Nothing, Dates.Period} = nothing: select among multiple SingleTimeSeries that share(type, name)but differ in resolution.
InfrastructureSystems.get_next_time — Methodget_next_time(
cache::InfrastructureSystems.TimeSeriesCache
) -> Any
Return the timestamp for the next read with get_next_time_series_array!.
Return nothing if all data has been read.
InfrastructureSystems.get_next_time_series_array! — Methodget_next_time_series_array!(
cache::InfrastructureSystems.TimeSeriesCache
) -> Any
Return the next TimeSeries.TimeArray.
Returns nothing when all data has been read. Call reset! to restart. Call get_next_time to check the start time.
Reads from storage if the data is not already in cache.
Arguments
cache::StaticTimeSeriesCache: cached instance
Examples
cache = ForecastCache(Deterministic, component, "max_active_power")
window1 = get_next_time_series_array!(cache)
window2 = get_next_time_series_array!(cache)InfrastructureSystems.reset! — Methodreset!(cache::InfrastructureSystems.TimeSeriesCache)
Reset parameters in order to start reading data from the beginning with get_next_time_series_array!
InfrastructureSystems.copy_time_series! — Methodcopy_time_series!(
dst::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
src::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute};
name_mapping,
scaling_factor_multiplier_mapping
)
Efficiently add all time_series in one component to another by copying the underlying references.
Arguments
dst::TimeSeriesOwners: Destination ownersrc::TimeSeriesOwners: Source ownername_mapping::Dict = nothing: Optionally map src names to different dst names. If provided and src has atime_serieswith a name not present inname_mapping, thattime_serieswill not copied. Ifname_mappingis nothing then alltime_serieswill be copied with src's names.scaling_factor_multiplier_mapping::Dict = nothing: Optionally map src multipliers to different dst multipliers. If provided and src has atime_serieswith a multiplier not present inscaling_factor_multiplier_mapping, thattime_serieswill not copied. Ifscaling_factor_multiplier_mappingis nothing then alltime_serieswill be copied with src's multipliers.
InfrastructureSystems.get_time_series — Methodget_time_series(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
key::TimeSeriesKey;
start_time,
len,
count
) -> Any
Return the exact stored data in a time series, using a time series key.
This will load all forecast windows into memory by default. Be aware of how much data is stored.
Specify start_time and len if you only need a subset of data.
Does not apply a scaling factor multiplier.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series' keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype of Forecast thenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length in the time dimension. If nothing, use the entire length.count::Union{Nothing, Int} = nothing: Only applicable to subtypes of Forecast. Number of forecast windows starting atstart_timeto return. Defaults to all available.features...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series by name
InfrastructureSystems.get_time_series — Methodget_time_series(
::Type{T<:TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
name::AbstractString;
start_time,
len,
count,
resolution,
interval,
features...
) -> Any
Return the exact stored data in a time series
This will load all forecast windows into memory by default. Be aware of how much data is stored.
Specify start_time and len if you only need a subset of data.
Does not apply a scaling factor multiplier.
Arguments
::Type{T}: Concrete subtype ofTimeSeriesDatato returnowner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.interval::Union{Nothing, Dates.Period} = nothing: Required if multiple forecasts share the same resolution but differ by interval. Throws an error if omitted and ambiguous.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype of Forecast thenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length in the time dimension. If nothing, use the entire length.count::Union{Nothing, Int} = nothing: Only applicable to subtypes of Forecast. Number of forecast windows starting atstart_timeto return. Defaults to all available.features...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_array, get_time_series_values, get_time_series by key
InfrastructureSystems.get_time_series_array — Methodget_time_series_array(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
forecast::Forecast;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a TimeSeries.TimeArray for one forecast window from a cached Forecast instance
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriesforecast::Forecast: a concrete subtype ofForecaststart_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp of one of the forecast windowslen::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also get_time_series_values, get_time_series_timestamps, ForecastCache, get_time_series_array by name from storage, get_time_series_array from a StaticTimeSeriesCache
InfrastructureSystems.get_time_series_array — Methodget_time_series_array(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
time_series::StaticTimeSeries;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a TimeSeries.TimeArray from a cached StaticTimeSeries instance.
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriestime_series::StaticTimeSeries: subtype ofStaticTimeSeries(e.g.,SingleTimeSeries)start_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp to retrieve. If nothing, use theinitial_timestampof the time series.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire lengthignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_values, get_time_series_timestamps, StaticTimeSeriesCache, get_time_series_array by name from storage, get_time_series_array from a ForecastCache
InfrastructureSystems.get_time_series_array — Methodget_time_series_array(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
key::TimeSeriesKey;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a TimeSeries.TimeArray from storage, using a time series key.
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_array by name, get_time_series_values, get_time_series_timestamps
InfrastructureSystems.get_time_series_array — Methodget_time_series_array(
::Type{T<:TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
name::AbstractString;
resolution,
interval,
start_time,
len,
ignore_scaling_factors,
features...
) -> Any
Return a TimeSeries.TimeArray from storage for the given time series parameters.
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
This will load all forecast windows into memory by default. Be aware of how much data is stored.
Specify start_time and len if you only need a subset of data.
Arguments
::Type{T}: the type of time series (a concrete subtype ofTimeSeriesData)owner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.interval::Union{Nothing, Dates.Period} = nothing: Required if multiple forecasts share the same resolution but differ by interval. Throws an error if omitted and ambiguous.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theownerfeatures...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_values, get_time_series_timestamps, get_time_series_array from a StaticTimeSeriesCache, get_time_series_array from a ForecastCache
InfrastructureSystems.get_time_series_keys — Methodget_time_series_keys(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute}
) -> Vector
Return information about each time series array attached to the owner. This information can be used to call get_time_series(::TimeSeriesOwners, ::TimeSeriesKey).
InfrastructureSystems.get_time_series_multiple — Functionget_time_series_multiple(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute};
...
) -> Union{Tuple{}, Channel{Any}}
get_time_series_multiple(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
filter_func;
type,
name,
resolution,
interval
) -> Union{Tuple{}, Channel{Any}}
Returns an iterator of TimeSeriesData instances attached to the component or attribute.
Note that passing a filter function can be much slower than the other filtering parameters because it reads time series data from media.
Call collect on the result to get an array.
Arguments
owner::TimeSeriesOwners: component or attribute from which to get time_seriesfilter_func = nothing: Only return time_series for which this returns true.type::Union{Nothing, ::Type{<:TimeSeriesData}} = nothing: Only return time_series with this type.name::Union{Nothing, AbstractString} = nothing: Only return time_series matching this value.resolution::Union{Nothing, Dates.Period} = nothing: Only return time_series matching this value.
See also: get_time_series_multiple from a System
InfrastructureSystems.get_time_series_timestamps — Methodget_time_series_timestamps(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
forecast::Forecast;
start_time,
len
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from a cached Forecast instance.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriesforecast::Forecast: a concrete subtype ofForecaststart_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp of one of the forecast windowslen::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.
See also: get_time_series_array, get_time_series_values, ForecastCache, get_time_series_timestamps by name from storage, get_time_series_timestamps from a StaticTimeSeriesCache
InfrastructureSystems.get_time_series_timestamps — Methodget_time_series_timestamps(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
time_series::StaticTimeSeries;
start_time,
len
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from a cached StaticTimeSeries instance.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriestime_series::StaticTimeSeries: subtype ofStaticTimeSeries(e.g.,SingleTimeSeries)start_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp to retrieve. If nothing, use theinitial_timestampof the time series.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length
See also: get_time_series_array, get_time_series_values, StaticTimeSeriesCache, get_time_series_timestamps by name from storage, get_time_series_timestamps from a ForecastCache
InfrastructureSystems.get_time_series_timestamps — Methodget_time_series_timestamps(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
key::TimeSeriesKey;
start_time,
len
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from storage, using a time series key.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.
See also: get_time_series_timestamps by name, get_time_series_array, get_time_series_values
InfrastructureSystems.get_time_series_timestamps — Methodget_time_series_timestamps(
::Type{T<:TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
name::AbstractString;
resolution,
interval,
start_time,
len,
features...
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from storage for the given time series parameters.
Arguments
::Type{T}: the type of time series (a concrete subtype ofTimeSeriesData)owner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.interval::Union{Nothing, Dates.Period} = nothing: Required if multiple forecasts share the same resolution but differ by interval. Throws an error if omitted and ambiguous.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.features...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_array, get_time_series_values, get_time_series_timestamps from a StaticTimeSeriesCache, get_time_series_timestamps from a ForecastCache
InfrastructureSystems.get_time_series_values — Methodget_time_series_values(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
forecast::Forecast;
start_time,
len,
ignore_scaling_factors
) -> Any
Return an vector of timeseries data without timestamps for one forecast window from a cached Forecast instance.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriesforecast::Forecast: a concrete subtype ofForecaststart_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp of one of the forecast windowslen::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_array, get_time_series_timestamps, ForecastCache, get_time_series_values by name from storage, get_time_series_values from a StaticTimeSeriesCache
InfrastructureSystems.get_time_series_values — Methodget_time_series_values(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
time_series::StaticTimeSeries;
start_time,
len,
ignore_scaling_factors
) -> Any
Return an vector of timeseries data without timestamps from a cached StaticTimeSeries instance
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriestime_series::StaticTimeSeries: subtype ofStaticTimeSeries(e.g.,SingleTimeSeries)start_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp to retrieve. If nothing, use theinitial_timestampof the time series.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire lengthignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_array, get_time_series_timestamps, StaticTimeSeriesCache, get_time_series_values by name from storage, get_time_series_values from a ForecastCache
InfrastructureSystems.get_time_series_values — Methodget_time_series_values(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
key::TimeSeriesKey;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a vector of time series data without timestamps from storage, using a time series key.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_values by name, get_time_series_array, get_time_series_timestamps
InfrastructureSystems.get_time_series_values — Methodget_time_series_values(
::Type{T<:TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
name::AbstractString;
resolution,
interval,
start_time,
len,
ignore_scaling_factors,
features...
) -> Any
Return an vector of timeseries data without timestamps from storage
If the data size is small and this will be called many times, consider using the version that accepts a cached TimeSeriesData instance.
Arguments
::Type{T}: type of the time series (a concrete subtype ofTimeSeriesData)owner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.interval::Union{Nothing, Dates.Period} = nothing: Required if multiple forecasts share the same resolution but differ by interval. Throws an error if omitted and ambiguous.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will not be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theownerfeatures...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_array, get_time_series_timestamps, get_time_series, get_time_series_values from a StaticTimeSeriesCache, get_time_series_values from a ForecastCache
InfrastructureSystems.has_time_series — Methodhas_time_series(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute};
kwargs...
) -> Bool
Return true if the component or supplemental attribute has time series data.
InfrastructureSystems.has_time_series — Methodhas_time_series(
val::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute},
_::Type{T<:TimeSeriesData}
) -> Bool
Return true if the component or supplemental attribute has time series data of type T.
InfrastructureSystems.ForecastKey — TypeA unique key to identify and retrieve a Forecast
See: get_time_series_keys and get_time_series(::TimeSeriesOwners, ::TimeSeriesKey).
InfrastructureSystems.StaticTimeSeriesKey — TypeA unique key to identify and retrieve a StaticTimeSeries
See: get_time_series_keys and get_time_series(::TimeSeriesOwners, ::TimeSeriesKey).
InfrastructureSystems.TimeSeriesAssociation — TypeDefines an association between a time series owner (component or supplemental attribute) and the time series metadata.
Examples
association1 = TimeSeriesAssociation(component, time_series)
association2 = TimeSeriesAssociation(component, time_series, scenario = "high")InfrastructureSystems.TimeSeriesCounts — TypeProvides counts of time series including attachments to components and supplemental attributes.
InfrastructureSystems.TimeSeriesKey — TypeSupertype for keys that can be used to access a desired time series dataset
Concrete subtypes:
Required methods:
get_nameget_resolutionget_time_series_type
The default methods rely on the field names name and time_series_type.
InfrastructureSystems.CompressionSettings — TypeCompressionSettings(enabled, type, level, shuffle)Provides customization of HDF5 compression settings.
enabled::Bool: Controls whether compression is enabled.type::CompressionTypes: Specifies the type of compression to use.level::Int64: Supported values are 0-9. Higher values deliver better compression ratios but take longer.shuffle::Bool: Controls whether to enable the shuffle filter. Used with DEFLATE.
Refer to the HDF5.jl and HDF5 documentation for more details on the options.
Example
settings = CompressionSettings(
enabled = true,
type = CompressionTypes.DEFLATE, # BLOSC is also supported
level = 3,
shuffle = true,
)InfrastructureSystems.CompressionTypesModule.CompressionTypes — TypeHDF5 compression algorithm types for time series storage.
Values
BLOSC: Blosc compression (fast, general-purpose)DEFLATE: Deflate/zlib compression
InfrastructureSystems.NormalizationTypesModule.NormalizationTypes — TypeTypes of normalization that can be applied to time series data.
Values
MAX: Normalize by the maximum value in the time series
InfrastructureSystems.show_time_series — Methodshow_time_series(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, SupplementalAttribute}
)
Show a table with time series data attached to the component.
System
PowerSystems.System — TypeA power system
System is the main data container in PowerSystems.jl, including basic metadata (base power, frequency), components (network topology, loads, generators, and services), and time series data.
System(base_power)
System(base_power, buses, components...)
System(base_power, buses, generators, loads, branches, storage, services; kwargs...)
System(base_power, buses, generators, loads; kwargs...)
System(file; kwargs...)
System(; buses, generators, loads, branches, storage, base_power, services, kwargs...)
System(; kwargs...)Arguments
base_power::Float64: the base power value for the systembuses::Vector{ACBus}: an array of busescomponents...: Each element (e.g.,buses,generators, ...) must be an iterable containing subtypes ofComponent.file::AbstractString: Path to a Matpower, PSSE, or JSON file ending with .m, .raw, or .json
Keyword arguments
name::String: System name.description::String: System description.frequency::Float64: (default = 60.0) Operating frequency (Hz).runchecks::Bool: Run available checks on input fields and when add_component! is called. Throws InvalidValue if an error is found.generator_mapping: A dictionary mapping generator names to their corresponding topologies. This is used to associate generators with their respective buses when parsing from CSV.time_series_in_memory::Bool=false: Store time series data in memory instead of HDF5.time_series_directory::Union{Nothing, String}: Directory for the time series HDF5 file. Defaults to the tmp file system.timeseries_metadata_file: Path to a file containing time series metadata descriptors. This is used to add time series data to the system from files.time_series_read_only::Bool=false: Open the time series store in read-only mode. This is useful for reading time series data without modifying it.enable_compression::Bool=false: Enable compression of time series data in HDF5.compression::CompressionSettings: Allows customization of HDF5 compression settings.config_path::String: specify path to validation config fileunit_system::String: (Default ="SYSTEM_BASE") Set the unit system for per-unitization while getting and setting data ("SYSTEM_BASE","DEVICE_BASE", or"NATURAL_UNITS")bus_name_formatter: A function that takes aDictof bus data (with keys like"name"and"index") and returns aStringto use as the bus name when parsing PSSe or Matpower files.load_name_formatter: A function that takes aDictof load data (with key"source_id") and returns aStringto use as the load name when parsing PSSe or Matpower files.loadzone_name_formatter: A function that takes a load zone identifier (typically anInt) and returns aStringto use as the load zone name when parsing PSSe or Matpower files.gen_name_formatter: A function that takes aDictof generator data and returns aStringto use as the generator name when parsing PSSe or Matpower files.shunt_name_formatter: A function that takes aDictof shunt data and returns aStringto use as theFixedAdmittancename when parsing PSSe or Matpower files.branch_name_formatter: A function that takes aDictof branch data, a from-bus (ACBus), and a to-bus (ACBus), and returns aStringto use as the branch name when parsing PSSe or Matpower files.pm_data_corrections::Bool: A function that applies the correction to the data fromPowerModels.jl.import_all::Bool: A boolean flag to indicate whether to import all available data when parsing PSSe or Matpower files. The additional data will be stored in theextdictionary and can be retrieved usingget_extinternal::InfrastructureSystems.InfrastructureSystemsInternal: Internal structure forInfrastructureSystems.jl. This is used only during JSON de-seralization, do not pass it when building aSystemmanually.
By default, time series data is stored in an HDF5 file in the tmp file system to prevent large datasets from overwhelming system memory (see Data Storage). If the system's time series data will be larger than the amount of tmp space available, use the time_series_directory parameter to change its location. You can also override the location by setting the environment variable SIENNA_TIME_SERIES_DIRECTORY to another directory.
HDF5 compression is not enabled by default, but you can enable it with enable_compression to get significant storage savings at the cost of CPU time. CompressionSettings can be used to customize the HDF5 compression.
If you know that your dataset will fit in your computer's memory, then you can increase performance by storing it in memory with time_series_in_memory.
Examples
sys = System(100.0; name = "My Power System")
sys = System(100.0; name = "My Power System", description = "System corresponds to scenario A")
sys= System(path_to_my_psse_raw_file; # PSSE file bus names are not unique
bus_name_formatter = x -> strip(string(x["name"])) * "-" * string(x["index"]),
)
sys = System(100.0; enable_compression = true)
sys = System(100.0; compression = CompressionSettings(
enabled = true,
type = CompressionTypes.DEFLATE, # BLOSC is also supported
level = 3,
shuffle = true)
)
sys = System(100.0; time_series_in_memory = true)PowerSystems.System — MethodSystem(
sys_file::AbstractString,
dyr_file::AbstractString;
kwargs...
) -> Any
Parse static and dynamic data directly from PSS/e text files. Automatically generates all the relationships between the available dynamic injection models and the static counterpart
Each dictionary indexed by id contains a vector with 5 of its components:
- Machine
- Shaft
- AVR
- TurbineGov
- PSS
Files must be parsed from a .raw file (PTI data format) and a .dyr file.
Examples:
raw_file = "Example.raw"
dyr_file = "Example.dyr"
sys = System(raw_file, dyr_file)PowerSystems.System — MethodSystem(
file_path::AbstractString;
assign_new_uuids,
try_reimport,
kwargs...
) -> Any
Constructs a System from a file path ending with .m, .raw, or .json
If the file is JSON, then assign_new_uuids = true will generate new UUIDs for the system and all components. If the file is .raw, then try_reimport = false will skip searching for a <name>_export_metadata.json file in the same directory.
PowerSystems.System — MethodSystem(
data,
base_power::Number;
internal,
kwargs...
) -> System
Construct a System from InfrastructureSystems.SystemData
PowerSystems.System — MethodSystem(
base_power::Float64,
buses::Vector{ACBus},
components...;
kwargs...
) -> System
System constructor when components are constructed externally.
PowerSystems.System — MethodSystem(
::Nothing;
buses,
generators,
loads,
branches,
storage,
base_power,
services,
kwargs...
) -> System
Constructs a non-functional System for demo purposes.
PowerSystems.System — MethodSystem(base_power::Number; kwargs...) -> System
Construct an empty System. Useful for building a System while parsing raw data.
PowerSystems.get_associated_components — Methodget_associated_components(
sys::System,
attribute::SupplementalAttribute;
component_type
) -> Any
get_associated_components(sys::System, attribute::SupplementalAttribute; component_type)Return a vector of components attached to the given supplemental attribute.
Arguments
sys::System: The system to search.attribute::SupplementalAttribute: The supplemental attribute whose associated components are returned.component_type::Union{Nothing, Type{<:Component}}: (default:nothing) If provided, only returnComponents of this type. Can be concrete or abstract.
See also: get_associated_components(sys, attribute_type), add_supplemental_attribute!
PowerSystems.get_associated_components — Methodget_associated_components(
sys::System,
attribute_type::Type{<:SupplementalAttribute};
component_type
) -> Any
get_associated_components(sys::System, attribute_type::Type{<:SupplementalAttribute}; component_type)Return a vector of components that have at least one supplemental attribute of attribute_type attached.
Arguments
sys::System: The system to search.attribute_type::Type{<:SupplementalAttribute}: TheSupplementalAttributetype to filter by. Can be concrete or abstract.component_type::Union{Nothing, Type{<:Component}}: (default:nothing) If provided, only returnComponents of this type. Can be concrete or abstract.
See also: get_associated_components(sys, attribute), add_supplemental_attribute!
PowerSystems.get_available_component — Methodget_available_component(
sys::System,
uuid::Base.UUID
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
get_available_component(sys::System, uuid::Union{Base.UUID, String})Return the component with the given UUID if it is available, or nothing if the component exists but is unavailable. Throws ArgumentError if no component with that UUID exists. A component is available when get_available returns true.
Arguments
sys::System: The system to search.uuid::Union{Base.UUID, String}: The UUID of the component to retrieve.
See also: get_component(sys, uuid), get_available
PowerSystems.get_available_component — Methodget_available_component(
::Type{T<:Component},
sys::System,
args...;
kwargs...
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
get_available_component(::Type{T}, sys::System, name::AbstractString) where {T <: Component}Return the component of type T with the given name if it is available, otherwise return nothing. A component is available when get_available returns true.
If T is an abstract type, names must be unique across all subtypes.
Arguments
T: TheComponenttype to retrieve. Can be concrete or abstract.sys::System: The system to search.name::AbstractString: The name of the component.
See also: get_component, get_available
PowerSystems.get_available_components — Methodget_available_components(
sys::System,
attribute::SupplementalAttribute
)
get_available_components(sys::System, attribute::SupplementalAttribute)Return an iterator of available components attached to a given supplemental attribute. A component is available when get_available returns true.
Arguments
sys::System: The system to search.attribute::SupplementalAttribute: The supplemental attribute whose available associated components are returned.
See also: get_associated_components, get_available
PowerSystems.get_available_components — Methodget_available_components(
filter_func::Function,
::Type{T<:Component},
sys::System;
subsystem_name
) -> InfrastructureSystems.FlattenIteratorWrapper{var"#s236", I} where {var"#s236"<:Component, I<:(Vector)}
get_available_components(filter_func::Function, ::Type{T}, sys::System; subsystem_name) where {T <: Component}Return an iterator of available components of type T that also satisfy filter_func. A component is available when get_available returns true.
T can be a concrete or abstract Component type from the Type Tree. Call collect on the result if an array is desired.
Arguments
filter_func::Function: A single-argument function returningtruefor components to include.T: TheComponenttype to retrieve. Can be concrete or abstract.sys::System: The system to search.subsystem_name::Union{Nothing, String}: (default:nothing) If provided, restrict results to the named subsystem.
Examples
gens = get_available_components(x -> get_fuel(x) == ThermalFuels.COAL, ThermalStandard, sys)See also: get_components, get_available
PowerSystems.get_available_components — Methodget_available_components(
::Type{T<:Component},
sys::System;
subsystem_name
) -> InfrastructureSystems.FlattenIteratorWrapper{var"#s236", I} where {var"#s236"<:Component, I<:(Vector)}
get_available_components(::Type{T}, sys::System; subsystem_name) where {T <: Component}Return an iterator of available components of type T from a System. A component is available when get_available returns true. Equivalent to get_components with a filter on availability.
T can be a concrete or abstract Component type from the Type Tree. Call collect on the result if an array is desired.
Arguments
T: TheComponenttype to retrieve. Can be concrete or abstract.sys::System: The system to search.subsystem_name::Union{Nothing, String}: (default:nothing) If provided, restrict results to the named subsystem.
Examples
gens = get_available_components(ThermalStandard, sys)
gens = get_available_components(Generator, sys)See also: get_components, get_available
PowerSystems.get_component — Methodget_component(
sys::System,
uuid::Base.UUID
) -> InfrastructureSystems.InfrastructureSystemsComponent
get_component(sys::System, uuid::Union{Base.UUID, String})Return the component with the given UUID. Throws ArgumentError if no component with that UUID exists.
Arguments
sys::System: The system to search.uuid::Union{Base.UUID, String}: The UUID of the component.
See also: get_component(T, sys, name)
PowerSystems.get_component — Methodget_component(
_::Type{T<:Component},
sys::System,
name::AbstractString
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
get_component(::Type{T}, sys::System, name::AbstractString) where {T <: Component}Return the component of type T with the given name, or nothing if no match is found.
If T is an abstract type, names must be unique across all subtypes. Use get_components_by_name when names are not unique across subtypes.
Arguments
T: TheComponenttype to retrieve. Can be concrete or abstract.sys::System: The system to search.name::AbstractString: The name of the component.
Throws
ArgumentError: ifTis abstract and more than one component with the given name exists across subtypes.
See also: get_component(sys, uuid), get_components_by_name
PowerSystems.get_components — Methodget_components(
filter_func::Function,
::Type{T<:Component},
sys::System;
subsystem_name
) -> InfrastructureSystems.FlattenIteratorWrapper{var"#s236", I} where {var"#s236"<:Component, I<:(Vector)}
get_components(filter_func::Function, ::Type{T}, sys::System; subsystem_name) where {T <: Component}Return an iterator of components of type T from a System that satisfy filter_func.
T can be a concrete or abstract Component type from the Type Tree. Call collect on the result if an array is desired.
Arguments
filter_func::Function: A single-argument function returningtruefor components to include.T: TheComponenttype to retrieve. Can be concrete or abstract.sys::System: The system to search.subsystem_name::Union{Nothing, String}: (default:nothing) If provided, restrict results to the named subsystem.
Examples
iter_coal = get_components(x -> get_fuel(x) == ThermalFuels.COAL, Generator, sys)
pv_gens =
collect(get_components(x -> get_prime_mover_type(x) == PrimeMovers.PVe, Generator, sys))See also: get_components, get_available_components, get_buses
PowerSystems.get_components — Methodget_components(
::Type{T<:Component},
sys::System;
subsystem_name
) -> InfrastructureSystems.FlattenIteratorWrapper{var"#s236", I} where {var"#s236"<:Component, I<:(Vector)}
get_components(::Type{T}, sys::System; subsystem_name) where {T <: Component}Return an iterator of components of type T from a System.
T can be a concrete or abstract Component type from the Type Tree. Call collect on the result if an array is desired.
Arguments
T: TheComponenttype to retrieve. Can be concrete or abstract.sys::System: The system to search.subsystem_name::Union{Nothing, String}: (default:nothing) If provided, restrict results to the named subsystem.
Examples
iter = get_components(ThermalStandard, sys)
iter = get_components(Generator, sys)
generators = collect(get_components(Generator, sys))See also: iterate_components, get_components with a filter, get_available_components, get_buses
PowerSystems.ServiceContributingDevices — TypePowerSystems.TurbineConnectedDevices — TypeContainer associating a hydro turbine with its connected Device components (e.g., HydroReservoir units).
InfrastructureSystems.deserialize — Methoddeserialize(
::Type{System},
filename::AbstractString;
kwargs...
) -> System
Deserialize a System instance from a JSON3 file; the reverse of IS.serialize.
InfrastructureSystems.from_json — Methodfrom_json(
io::Union{IO, String},
::Type{System};
runchecks,
assign_new_uuids,
kwargs...
) -> System
If assignnewuuids = true, generate new UUIDs for the system and all components.
Warning: time series data is not restored by this method. If that is needed, use the normal process to construct the system from a serialized JSON file instead, such as with System("sys.json").
InfrastructureSystems.get_component — Methodget_component(
sys::System,
uuid::Base.UUID
) -> InfrastructureSystems.InfrastructureSystemsComponent
Get the component by UUID.
InfrastructureSystems.get_component — Methodget_component(
_::Type{T<:Component},
sys::System,
name::AbstractString
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Get the component of type T with name. Returns nothing if no component matches. If T is an abstract type then the names of components across all subtypes of T must be unique.
See get_components_by_name for abstract types with non-unique names across subtypes.
Throws ArgumentError if T is not a concrete type and there is more than one component with requested name
InfrastructureSystems.get_components — Methodget_components(
sys::System,
attribute::SupplementalAttribute
)
Return a vector of components that are attached to the supplemental attribute.
InfrastructureSystems.get_components — Methodget_components(
::Type{T<:Component},
sys::System;
subsystem_name
) -> InfrastructureSystems.FlattenIteratorWrapper{var"#s236", I} where {var"#s236"<:Component, I<:(Vector)}
Return an iterator of components of a given Type from a System.
T can be a concrete or abstract Component type from the Type Tree. Call collect on the result if an array is desired.
Examples
iter = get_components(ThermalStandard, sys)
iter = get_components(Generator, sys)
generators = collect(get_components(Generator, sys))See also: iterate_components, get_components with a filter, get_available_components, get_buses
InfrastructureSystems.get_name — Methodget_name(sys::System) -> Union{Nothing, String}
Get the name of the system.
InfrastructureSystems.get_supplemental_attribute — Methodget_supplemental_attribute(
sys::System,
uuid::Base.UUID
) -> SupplementalAttribute
Return the supplemental attribute with the given uuid.
Throws ArgumentError if the attribute is not stored.
InfrastructureSystems.get_supplemental_attributes — Methodget_supplemental_attributes(
filter_func::Function,
_::Type{T<:SupplementalAttribute},
sys::System
) -> InfrastructureSystems.FlattenIteratorWrapper{T, I} where {T<:SupplementalAttribute, I<:(Vector)}
Returns an iterator of supplemental attributes. T can be concrete or abstract. Call collect on the result if an array is desired.
Examples
iter = get_supplemental_attributes(GeometricDistributionForcedOutage, sys)
iter = get_supplemental_attributes(Outage, sys)
iter = get_supplemental_attributes(x -> get_mean_time_to_recovery(x) == >= 0.5, GeometricDistributionForcedOutage, sys)
outages = get_supplemental_attributes(GeometricDistributionForcedOutage, sys) do outage
get_mean_time_to_recovery(x) == >= 0.5
end
outages = collect(get_supplemental_attributes(GeometricDistributionForcedOutage, sys))See also: iterate_supplemental_attributes
InfrastructureSystems.get_time_series_multiple — Functionget_time_series_multiple(
sys::System;
...
) -> Channel{TimeSeriesData}
get_time_series_multiple(
sys::System,
filter_func;
type,
name,
resolution,
interval
) -> Channel{TimeSeriesData}
Return an iterator of time series attached to components in the system.
Note that passing a filter function can be much slower than the other filtering parameters because it reads time series data from media.
Call collect on the result to get an array.
Arguments
sys::System: systemfilter_func = nothing: Only return time series for which this returns true.type = nothing: Only return time series with thisTimeSeriesDatatype.name = nothing: Only return time series matching this value.resolution = nothing: Only return time series matching this resolution.interval = nothing: Only return time series matching this interval.
Examples
for time_series in get_time_series_multiple(sys)
@show time_series
end
ts = collect(get_time_series_multiple(sys; type = SingleTimeSeries))InfrastructureSystems.serialize — Methodserialize(sys::System) -> Dict{String, Any}
Serialize a System instance. Returns a Dict{String, Any} of the form Dict("data_format_version" => "1.0", "field1" => serialize(sys.field1), ...), which can then be written to a JSON3 file.
InfrastructureSystems.set_name! — Methodset_name!(
component::Component,
name::AbstractString
) -> AbstractString
Set the name of a component.
Throws an exception if the component is attached to a system.
InfrastructureSystems.set_name! — Methodset_name!(
sys::System,
name::AbstractString
) -> AbstractString
Set the name of the system.
InfrastructureSystems.set_name! — Methodset_name!(
sys::System,
component::Component,
name::AbstractString
)
Set the name for a component that is attached to the system.
InfrastructureSystems.to_json — Methodto_json(
sys::System,
filename::AbstractString;
user_data,
pretty,
force,
runchecks
)
Serializes a system to a JSON file and saves time series to an HDF5 file.
Arguments
sys::System: systemfilename::AbstractString: filename to write
Keyword arguments
user_data::Union{Nothing, Dict} = nothing: optional metadata to recordpretty::Bool = false: whether to pretty-print the JSONforce::Bool = false: whether to overwrite existing filescheck::Bool = false: whether to run system validation checks
Refer to check_component for exceptions thrown if check = true.
PowerSystems.add_component! — Methodadd_component!(
sys::System,
dyn_injector::DynamicInjection,
static_injector::StaticInjection;
kwargs...
)
Add a dynamic injector to the system.
A component cannot be added to more than one System. Throws ArgumentError if the name does not match the static_injector name. Throws ArgumentError if the static_injector is not attached to the system.
All rules for the generic add_component! method also apply.
PowerSystems.add_component! — Methodadd_component!(
sys::System,
component::Component;
skip_validation,
kwargs...
)
Add a component to the system.
A component cannot be added to more than one System. Throws ArgumentError if the component's name is already stored for its concrete type. Throws ArgumentError if any Component-specific rule is violated. Throws InvalidValue if any of the component's field values are outside of defined valid range.
Examples
sys = System(100.0)
# Add a single component.
add_component!(sys, bus)
# Add many at once.
buses = [bus1, bus2, bus3]
generators = [gen1, gen2, gen3]
foreach(x -> add_component!(sys, x), Iterators.flatten((buses, generators)))See also add_components!.
PowerSystems.add_components! — Methodadd_components!(sys::System, components)
Add many components to the system at once.
A component cannot be added to more than one System. Throws ArgumentError if the component's name is already stored for its concrete type. Throws ArgumentError if any Component-specific rule is violated. Throws InvalidValue if any of the component's field values are outside of defined valid range.
Examples
sys = System(100.0)
buses = [bus1, bus2, bus3]
generators = [gen1, gen2, gen3]
add_components!(sys, Iterators.flatten((buses, generators))PowerSystems.add_service! — Methodadd_service!(device::Device, service::Service, sys::System)
Similar to add_service! but for Service and Device already stored in the system. Performs validation checks on the device and the system
Arguments
PowerSystems.add_service! — Methodadd_service!(
sys::System,
service::ConstantReserveGroup,
contributing_services::Vector{<:Service};
skip_validation,
kwargs...
)
Similar to add_component! but for ConstantReserveGroup.
Arguments
sys::System: systemservice::ConstantReserveGroup: service to addcontributing_services: contributingServiceinstances to the group
PowerSystems.add_service! — Methodadd_service!(
sys::System,
service::ConstantReserveGroup;
skip_validation,
kwargs...
)
Similar to add_component! but for ConstantReserveGroup.
Arguments
sys::System: systemservice::ConstantReserveGroup: service to add
PowerSystems.add_service! — Methodadd_service!(
sys::System,
service::Service,
contributing_devices;
kwargs...
)
Similar to add_component! but for services.
Arguments
PowerSystems.add_service! — Methodadd_service!(
sys::System,
service::Service,
contributing_device::Device;
kwargs...
)
Similar to add_component! but for services.
Arguments
PowerSystems.add_supplemental_attribute! — Methodadd_supplemental_attribute!(
sys::System,
component::Component,
attribute::SupplementalAttribute
)
Add a supplemental attribute to the component. The attribute may already be attached to a different component.
PowerSystems.add_time_series! — Methodadd_time_series!(
sys::System,
metadata_file::AbstractString;
resolution
) -> Vector{TimeSeriesKey}
Add time series data from a metadata file or metadata descriptors.
Arguments
sys::System: systemmetadata_file::AbstractString: metadata file for timeseries that includes an array ofInfrastructureSystems.TimeSeriesFileMetadatainstances or a vector.resolution::DateTime.Period=nothing: skip time series that don't match this resolution.
PowerSystems.add_time_series! — Methodadd_time_series!(
sys::System,
components,
time_series::TimeSeriesData;
features...
) -> Union{ForecastKey, StaticTimeSeriesKey}
Add the same time series data to multiple components.
This function stores a single copy of the data. Each component will store a reference to that data. This is significantly more efficent than calling add_time_series! for each component individually with the same data because in this case, only one time series array is stored.
Throws ArgumentError if a component is not stored in the system.
PowerSystems.add_time_series! — Methodadd_time_series!(
sys::System,
component::Component,
time_series::TimeSeriesData;
features...
) -> Union{ForecastKey, StaticTimeSeriesKey}
Add time series data to a component. Assign optional features to differentiate time series of the same type with the same name but with different data.
Returns a key that can later be used to retrieve the time series data.
Throws ArgumentError if the component is not stored in the system.
Examples
ts1 = Deterministic(
name = "max_active_power",
data = deterministic_data,
resolution = Dates.Hour(1),
)
ts2 = SingleTimeSeries(
name = "max_active_power",
data = time_array_1,
)
ts3 = SingleTimeSeries(
name = "max_active_power",
data = time_array_2,
)
key1 = add_time_series!(system, component, ts1)
key2 = add_time_series!(system, component, ts2, scenario = "high")
key3 = add_time_series!(system, component, ts3, scenario = "low")
ts1_b = get_time_series(component, key1)
ts2_b = get_time_series(component, key2)
ts3_b = get_time_series(component, key3)PowerSystems.add_time_series! — Methodadd_time_series!(
sys::System,
file_metadata::Vector{InfrastructureSystems.TimeSeriesFileMetadata};
resolution
) -> Vector{TimeSeriesKey}
Add time series data from a metadata file or metadata descriptors.
Arguments
sys::System: systemtimeseries_metadata::Vector{InfrastructureSystems.TimeSeriesFileMetadata}: metadata for timeseriesresolution::DateTime.Period=nothing: skip time series that don't match this resolution.
PowerSystems.begin_supplemental_attributes_update — Methodbegin_supplemental_attributes_update(
func::Function,
sys::System
)
Begin an update of supplemental attributes. Use this function when adding or removing many supplemental attributes in order to improve performance.
If an error occurs during the update, changes will be reverted.
Examples
begin_supplemental_attributes_update(sys) do
add_supplemental_attribute!(sys, component1, attribute1)
add_supplemental_attribute!(sys, component2, attribute2)
endPowerSystems.begin_time_series_update — Methodbegin_time_series_update(func::Function, sys::System) -> Any
Begin an update of time series. Use this function when adding many time series arrays in order to improve performance.
If an error occurs during the update, changes will be reverted.
Using this function to remove time series is currently not supported.
Examples
begin_time_series_update(sys) do
add_time_series!(sys, component1, time_series1)
add_time_series!(sys, component2, time_series2)
endPowerSystems.bulk_add_time_series! — Methodbulk_add_time_series!(
sys::System,
associations;
batch_size
) -> Vector{TimeSeriesKey}
Add time series in bulk.
Prefer use of begin_time_series_update.
Examples
# Assumes `read_time_series` will return data appropriate for Deterministic forecasts
# based on the generator name and the filenames match the component and time series names.
resolution = Dates.Hour(1)
associations = (
IS.TimeSeriesAssociation(
gen,
Deterministic(
data = read_time_series(get_name(gen) * ".csv"),
name = "get_max_active_power",
resolution=resolution),
)
for gen in get_components(ThermalStandard, sys)
)
bulk_add_time_series!(sys, associations)PowerSystems.check — Methodcheck(sys::System)
Check system consistency and validity.
PowerSystems.check_ac_transmission_rate_values — Methodcheck_ac_transmission_rate_values(sys::System) -> Bool
Check that all AC transmission Line and MonitoredLine components have valid rate values relative to the system base power.
Returns true if all values are valid, false otherwise.
PowerSystems.check_component — Methodcheck_component(sys::System, component::Component)
Check the values of a component.
Throws InvalidValue if any of the component's field values are outside of defined valid range or if the custom validate method for the type fails its check.
PowerSystems.check_components — Methodcheck_components(sys::System, components)
Check the values of each component in an iterable of components. See check_component for exceptions thrown.
PowerSystems.check_components — Methodcheck_components(sys::System; check_masked_components)
Check the values of all components. See check_component for exceptions thrown.
PowerSystems.check_components — Methodcheck_components(
sys::System,
::Type{T<:Component};
check_masked_components
)
Check the values of components of a given abstract or concrete type. See check_component for exceptions thrown.
PowerSystems.check_time_series_consistency — Methodcheck_time_series_consistency(
sys::System,
_::Type{T<:TimeSeriesData}
) -> Union{Nothing, Tuple{Any, Any}}
Checks time series in the system for inconsistencies.
For SingleTimeSeries, returns a Tuple of initial_timestamp and length.
This is a no-op for subtypes of Forecast because those are already guaranteed to be consistent.
Throws InfrastructureSystems.InvalidValue if any time series is inconsistent.
PowerSystems.clear_components! — Methodclear_components!(sys::System)
Remove all components from the system.
PowerSystems.clear_ext! — Methodclear_ext!(sys::System)
Clear any value stored in ext.
PowerSystems.clear_time_series! — Methodclear_time_series!(sys::System)
Clear all time series data from the system.
If you are storing time series data in an HDF5 file, this will will delete the HDF5 file and create a new one.
See also: remove_time_series!
PowerSystems.convert_component! — Methodconvert_component!(
sys::System,
line::Line,
linetype::Type{MonitoredLine};
kwargs...
)
Converts a Line component to a MonitoredLine component and replaces the original in the system
PowerSystems.convert_component! — Methodconvert_component!(
sys::System,
line::MonitoredLine,
linetype::Type{Line};
kwargs...
)
Converts a MonitoredLine component to a Line component and replaces the original in the system.
PowerSystems.convert_component! — Methodconvert_component!(
sys::System,
old_load::PowerLoad,
new_type::Type{StandardLoad};
kwargs...
)
Converts a PowerLoad component to a StandardLoad component and replaces the original in the system. Does not set any fields in StandardLoad that lack a PowerLoad equivalent.
PowerSystems.filter_components_by_subsystem! — Methodfilter_components_by_subsystem!(
sys::System,
subsystem::AbstractString;
runchecks
)
Filter out all components that are not part of the subsystem.
PowerSystems.from_subsystem — Methodfrom_subsystem(
sys::System,
subsystem::AbstractString;
runchecks
) -> System
Construct a System from a subsystem of an existing system.
Arguments
sys::System: the base system from which the subsystems are derivedsubsystem::String: the name of the subsystem to extract from the original system
Keyword arguments
runchecks::Bool: (default = true) whether to run system validation checks.
PowerSystems.get_aggregation_topology_mapping — Methodget_aggregation_topology_mapping(
_::Type{T<:AggregationTopology},
sys::System
) -> Dict{String, Vector{ACBus}}
Return a mapping of AggregationTopology name to vector of ACBuses within it.
PowerSystems.get_associated_supplemental_attributes — Methodget_associated_supplemental_attributes(
sys::System,
::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent};
attribute_type
) -> Any
get_associated_supplemental_attributes(sys::System, ::Type{T}; attribute_type = nothing)Return the supplemental attributes associated with components of type T.
Arguments
sys::System: System containing the components.::Type{T}:Componenttype to filter by.attribute_type::Union{Nothing, Type{<:SupplementalAttribute}}: (default:nothing) Optionally restrict the result to a single supplemental attribute type.
Examples
attrs = get_associated_supplemental_attributes(
sys,
ThermalStandard;
attribute_type = GeometricDistributionForcedOutage,
)
for attr in attrs
@show summary(attr)
endPowerSystems.get_base_power — Methodget_base_power(sys::System) -> Float64
Return the system's base power.
PowerSystems.get_bus — Methodget_bus(
sys::System,
name::AbstractString
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Return ACBus with name.
PowerSystems.get_bus — Methodget_bus(sys::System, bus_number::Int64) -> Any
Return ACBus with bus_number.
PowerSystems.get_bus_numbers — Methodget_bus_numbers(sys::System) -> Vector{Int64}
Return a sorted vector of bus numbers in the system.
PowerSystems.get_buses — Methodget_buses(
sys::System,
aggregator::AggregationTopology
) -> Vector{ACBus}
Return a vector of buses contained within an AggregationTopology.
Examples
area = get_component(Area, system, "my_area"); # Get an Area named my_area
area_buses = get_buses(system, area)PowerSystems.get_buses — Methodget_buses(
sys::System,
bus_numbers::Set{Int64}
) -> Vector{ACBus}
Return ACBuses from a set of identification numbers
Examples
# View all the bus ID numbers in the System
get_number.(get_components(ACBus, system))
# Select a subset
buses_by_ID = get_buses(system, Set(101:110))PowerSystems.get_component_supplemental_attribute_pairs — Methodget_component_supplemental_attribute_pairs(
::Type{T<:Component},
::Type{U<:SupplementalAttribute},
sys::System;
components,
attributes
) -> Array{NamedTuple{(:component, :supplemental_attribute), var"#s177"}, 1} where var"#s177"<:Tuple{Component, SupplementalAttribute}
Return a vector of NamedTuples with pairs of components and supplemental attributes that are associated with each other. Limit by components and attributes if provided.
The return type is NamedTuple{(:component, :supplemental_attribute), Tuple{T, U}}[] where T is the component type and U is the supplemental attribute type.
Arguments
sys::System: System containing the components and attributes.::Type{T}: Type of theComponentto filter by. Can be concrete or abstract.::Type{U}: Type of theSupplementalAttributeto filter by. Can be concrete or abstract.components: Optional iterable. If set, filter pairs where the component is in this iterable.attributes: Optional iterable. If set, filter pairs where the supplemental attribute is in this iterable.
Examples
gen_attr_pairs = get_component_supplemental_attribute_pairs(
GeometricDistributionForcedOutage,
ThermalStandard,
sys,
)
for (gen, attr) in gen_attr_pairs
@show summary(gen) summary(attr)
end
my_generators = [gen1, gen2, gen3]
gen_attr_pairs_limited = get_component_supplemental_attribute_pairs(
GeometricDistributionForcedOutage,
ThermalStandard,
sys,
components = my_generators,
)
for (gen, attr) in gen_attr_pairs_limited
@show summary(gen) summary(attr)
endPowerSystems.get_components_by_name — Methodget_components_by_name(
_::Type{T<:Component},
sys::System,
name::AbstractString
) -> Vector{T} where T<:InfrastructureSystems.InfrastructureSystemsComponent
Get the components of abstract type T with name. Note that PowerSystems enforces unique names on each concrete type but not across concrete types.
See get_component if the concrete type is known.
Throws ArgumentError if T is not an abstract type.
PowerSystems.get_components_in_aggregation_topology — Methodget_components_in_aggregation_topology(
_::Type{T<:StaticInjection},
sys::System,
aggregator::AggregationTopology
) -> Vector{T} where T<:StaticInjection
Return a vector of components with buses in the AggregationTopology.
PowerSystems.get_compression_settings — Methodget_compression_settings(sys::System) -> CompressionSettings
Return the compression settings used for system data such as time series arrays.
PowerSystems.get_connected_head_reservoirs — Methodget_connected_head_reservoirs(
sys::System,
turbine::HydroUnit
) -> Vector
Return a vector of connected head reservoirs to the turbine. Reservoirs that have the turbine in their downstream_turbines field are head reservoirs of such turbine.
PowerSystems.get_connected_tail_reservoirs — Methodget_connected_tail_reservoirs(
sys::System,
turbine::HydroUnit
) -> Vector
Return a vector of connected tail reservoirs to the turbine. Reservoirs that have the turbine in their upstream_turbines field are tail reservoirs of such turbine.
PowerSystems.get_contributing_device_mapping — Methodget_contributing_device_mapping(
sys::System
) -> Dict{@NamedTuple{type::DataType, name::String}, ServiceContributingDevices}
Return an instance of ServiceContributingDevicesMapping.
PowerSystems.get_contributing_devices — Methodget_contributing_devices(
sys::System,
service::TransmissionInterface
) -> Vector
Return a vector of devices contributing to the service.
PowerSystems.get_contributing_devices — Methodget_contributing_devices(
sys::System,
service::Service
) -> Vector
Return a vector of devices contributing to the service.
PowerSystems.get_contributing_reserve_mapping — Methodget_contributing_reserve_mapping(
sys::System
) -> Dict{@NamedTuple{type::DataType, name::String}, PowerSystems.AGCContributingReserves}
Return an instance of AGCContributingReservesMapping.
PowerSystems.get_description — Methodget_description(sys::System) -> Union{Nothing, String}
Get the description of the system.
PowerSystems.get_existing_component_types — Methodget_existing_component_types(
sys::System
) -> Vector{DataType}
Return all the component types in the system. It does not return masked components.
PowerSystems.get_existing_device_types — Methodget_existing_device_types(sys::System) -> Vector{DataType}
Return all the device types in the system. It does not return component types or masked components.
PowerSystems.get_ext — Methodget_ext(sys::System) -> Union{Nothing, Dict{String, Any}}
Return a user-modifiable dictionary to store extra information.
PowerSystems.get_forecast_horizon — Methodget_forecast_horizon(
sys::System;
kwargs...
) -> Union{Nothing, Dates.Period}
Return the horizon for all forecasts. Use resolution and/or interval keyword arguments to filter when multiple forecast groups exist.
PowerSystems.get_forecast_initial_times — Methodget_forecast_initial_times(
sys::System;
kwargs...
) -> Union{Vector{Any}, Vector{Dates.DateTime}, StepRangeLen{T, R, S, Int64} where {T, R>:Dates.DateTime, S}}
Return the initial times for all forecasts. Use resolution and/or interval keyword arguments to filter when multiple forecast groups exist.
PowerSystems.get_forecast_initial_timestamp — Methodget_forecast_initial_timestamp(
sys::System;
kwargs...
) -> Union{Nothing, Dates.DateTime}
Return the initial timestamp for all forecasts. Use resolution and/or interval keyword arguments to filter when multiple forecast groups exist.
PowerSystems.get_forecast_interval — Methodget_forecast_interval(
sys::System;
kwargs...
) -> Union{Nothing, Dates.Period}
Return the forecast interval. Use resolution and/or interval keyword arguments to select which forecast group to query when multiple exist.
PowerSystems.get_forecast_summary_table — Methodget_forecast_summary_table(sys::System) -> DataFrame
Return a DataFrame with the number of forecasts for components and supplemental attributes.
PowerSystems.get_forecast_window_count — Methodget_forecast_window_count(
sys::System;
kwargs...
) -> Union{Nothing, Int64}
Return the window count for all forecasts. Use resolution and/or interval keyword arguments to filter when multiple forecast groups exist.
PowerSystems.get_frequency — Methodget_frequency(sys::System) -> Float64
Return the system's frequency.
PowerSystems.get_runchecks — Methodget_runchecks(sys::System) -> Bool
Return true if checks are enabled on the system.
PowerSystems.get_static_time_series_summary_table — Methodget_static_time_series_summary_table(
sys::System
) -> DataFrame
Return a DataFrame with the number of static time series for components and supplemental attributes.
PowerSystems.get_time_series_counts — Methodget_time_series_counts(sys::System) -> TimeSeriesCounts
Returns counts of time series including attachments to components and supplemental attributes.
PowerSystems.get_time_series_resolutions — Methodget_time_series_resolutions(
sys::System;
time_series_type
) -> Any
Return a sorted Vector of distinct resolutions for all time series of the given type (or all types).
PowerSystems.get_turbine_head_reservoirs_mapping — Methodget_turbine_head_reservoirs_mapping(
sys::System
) -> Dict{@NamedTuple{type::DataType, name::String}, TurbineConnectedDevices}
Return an instance of TurbineConnectedDevicesMapping.
PowerSystems.get_turbine_tail_reservoirs_mapping — Methodget_turbine_tail_reservoirs_mapping(
sys::System
) -> Dict{@NamedTuple{type::DataType, name::String}, TurbineConnectedDevices}
Return an instance of TurbineConnectedDevicesMapping.
PowerSystems.get_units_base — Methodget_units_base(system::System) -> String
Get the system's unit base)
PowerSystems.has_component — Methodhas_component(
sys::System,
T::Type{<:Component},
name::AbstractString
) -> Bool
Check to see if the component of type T with name exists.
PowerSystems.has_components — Methodhas_components(sys::System, T::Type{<:Component}) -> Bool
Check to see if the component of type T exists.
PowerSystems.is_component_in_aggregation_topology — Methodis_component_in_aggregation_topology(
comp::Component,
aggregator::AggregationTopology
) -> Union{Missing, Bool}
Return whether the given component's bus is in the AggregationTopology
PowerSystems.iterate_components — Methoditerate_components(
sys::System
) -> InfrastructureSystems.FlattenIteratorWrapper{InfrastructureSystems.InfrastructureSystemsComponent, I} where I<:(Vector)
Iterates over all components.
Examples
for component in iterate_components(sys)
@show component
endSee also: get_components
PowerSystems.iterate_supplemental_attributes — Methoditerate_supplemental_attributes(
sys::System
) -> Base.Iterators.Flatten{Base.Generator{Base.ValueIterator{Dict{DataType, Dict{Base.UUID, <:SupplementalAttribute}}}, InfrastructureSystems.var"#iterate_container##0#iterate_container##1"}}
Iterates over all supplemental_attributes.
Examples
for supplemental_attribute in iterate_supplemental_attributes(sys)
@show supplemental_attribute
endSee also: get_supplemental_attributes
PowerSystems.open_time_series_store! — Functionopen_time_series_store!(
func::Function,
sys::System;
...
) -> Any
open_time_series_store!(
func::Function,
sys::System,
mode,
args...;
kwargs...
) -> Any
Open the time series store for bulk additions or reads
This is recommended before calling add_time_series! many times because of the overhead associated with opening and closing an HDF5 file.
This is not necessary for an in-memory time series store.
Examples
# Assume there is a system with an array of Components and SingleTimeSeries
# stored in the variables components and single_time_series, respectively
open_time_series_store!(sys, "r+") do
for (component, ts) in zip(components, single_time_series)
add_time_series!(sys, component, ts)
end
endYou can also use this function to make reads faster. Change the mode from "r+" to "r" to open the file read-only.
See also: begin_time_series_update
PowerSystems.remove_component! — Methodremove_component!(sys::System, component::Component)
Remove a component from the system by its value.
Throws ArgumentError if the component is not stored.
PowerSystems.remove_component! — Methodremove_component!(
_::Type{T<:Component},
sys::System,
name::AbstractString
)
Remove a component from the system by its name.
Throws ArgumentError if the component is not stored.
PowerSystems.remove_components! — Methodremove_components!(
filter_func::Function,
sys::System,
_::Type{T<:Component}
) -> Vector{T} where T<:Component
Remove all components of type T that match filter_func from the system.
PowerSystems.remove_components! — Methodremove_components!(
sys::System,
_::Type{T<:Component}
) -> Base.ValueIterator{T} where T<:(Dict{String, <:InfrastructureSystems.InfrastructureSystemsComponent})
Remove all components of type T from the system.
Throws ArgumentError if the type is not stored.
PowerSystems.remove_supplemental_attribute! — Methodremove_supplemental_attribute!(
sys::System,
component::Component,
attribute::SupplementalAttribute
)
Remove the supplemental attribute from the component. The attribute will be removed from the system if it is not attached to any other component.
PowerSystems.remove_supplemental_attributes! — Methodremove_supplemental_attributes!(
_::Type{T<:SupplementalAttribute},
sys::System
) -> Base.ValueIterator{T} where T<:(Dict{Base.UUID, <:SupplementalAttribute})
Remove all supplemental attributes with the given type from the system.
PowerSystems.remove_time_series! — Methodremove_time_series!(
sys::System,
::Type{T<:TimeSeriesData},
owner::Union{SupplementalAttribute, Component},
name::String;
resolution,
interval,
features...
)
Remove the time series data for a component or supplemental attribute and time series type.
Use resolution, interval, and features keyword arguments to disambiguate when multiple time series of the same type and name exist with different resolutions, intervals, or user-defined feature tags.
PowerSystems.remove_time_series! — Methodremove_time_series!(
sys::System,
::Type{T<:TimeSeriesData};
resolution,
interval
)
Remove all the time series data for a time series type.
See also: clear_time_series!
If you are storing time series data in an HDF5 file, remove_time_series! does not actually free up file space (HDF5 behavior). If you want to remove all or most time series instances then consider using clear_time_series!. It will delete the HDF5 file and create a new one. PowerSystems has plans to automate this type of workflow.
PowerSystems.replace_dynamic_injector! — Methodreplace_dynamic_injector!(
sys::System,
static_injector::StaticInjection,
new_dynamic_injector::DynamicInjection
)
Replace the dynamic injector in a static component.
Safely removes the old dynamic injector from the system if no other component references it. If another component references the old dynamic injector, it is kept in the system and an info message is logged.
Throws ArgumentError if the static injector is not attached to the system. Throws ArgumentError if the static injector does not have a dynamic injector. Throws ArgumentError if the new dynamic injector name does not match the static injector name.
PowerSystems.sanitize_component! — Methodsanitize_component!(component::Component, sys::System)
Sanitize component values.
PowerSystems.set_bus_number! — Methodset_bus_number!(sys::System, bus::Bus, number::Int64)
Set the number of a bus.
PowerSystems.set_contributing_services! — Methodset_contributing_services!(
sys::System,
service::ConstantReserveGroup,
val::Vector{<:Service}
)
Set ConstantReserveGroup contributing_services with check
PowerSystems.set_description! — Methodset_description!(
sys::System,
description::AbstractString
) -> AbstractString
Set the description of the system.
PowerSystems.set_runchecks! — Methodset_runchecks!(sys::System, value::Bool)
Enable or disable system checks. Applies to component addition as well as overall system consistency.
PowerSystems.set_units_base_system! — Methodset_units_base_system!(
system::System,
units::Union{UnitSystem, String}
)
Sets the units base for the getter functions on the devices. It modifies the behavior of all getter functions
Examples
set_units_base_system!(sys, "NATURAL_UNITS")set_units_base_system!(sys, UnitSystem.SYSTEM_BASE)PowerSystems.transform_single_time_series! — Methodtransform_single_time_series!(
sys::System,
horizon::Dates.Period,
interval::Dates.Period;
resolution,
delete_existing
)
Transform all instances of SingleTimeSeries in a System to DeterministicSingleTimeSeries
This can be used to generate a perfect forecast from historical measurements or realizations when actual forecasts are unavailable, without unnecessarily duplicating data.
If all SingleTimeSeries instances cannot be transformed then none will be.
By default, any existing DeterministicSingleTimeSeries forecasts will be deleted before the transform (delete_existing = true). Set delete_existing = false to preserve existing DeterministicSingleTimeSeries; entries with matching name, resolution, features, horizon, and interval are skipped, allowing multiple calls with different resolutions to coexist.
Arguments
sys::System: System containing the components.horizon::Dates.Period: desired horizon of each forecast windowinterval::Dates.Period: desired interval between forecast windowsresolution::Union{Nothing, Dates.Period} = nothing: If set, only transform time series with this resolution.delete_existing::Bool = true: Iftrue, delete all existingDeterministicSingleTimeSeriesbefore transforming.
PowerSystems.validate_component — Methodvalidate_component(component::Component) -> Bool
Validate the component fields using only those fields. Refer to validate_component_with_system to use other System data for the validation.
Return true if the instance is valid.
PowerSystems.validate_component_with_system — Methodvalidate_component_with_system(
component::Component,
sys::System
) -> Bool
Validate a component against System data. Return true if the instance is valid.
Refer to validate_component if the validation logic only requires data contained within the instance.
PowerSystems.with_units_base — Methodwith_units_base(
f::Function,
c::Component,
units::Union{UnitSystem, String}
) -> Any
A "context manager" that sets the Component's units base to the given value, executes the function, then sets the units base back.
Examples
active_power_mw = with_units_base(component, UnitSystem.NATURAL_UNITS) do
get_active_power(component)
end
# now active_power_mw is in natural units no matter what units base the system is inPowerSystems.with_units_base — Methodwith_units_base(
f::Function,
sys::System,
units::Union{UnitSystem, String}
) -> Any
A "context manager" that sets the System's units base to the given value, executes the function, then sets the units base back.
Examples
active_power_mw = with_units_base(sys, UnitSystem.NATURAL_UNITS) do
get_active_power(gen)
end
# now active_power_mw is in natural units no matter what units base the system is inInfrastructureSystems.show_time_series — Methodshow_time_series(sys::System)
Show a table with the summary of time series attached to the system.
PowerSystems.show_components — Functionshow_components(
sys::System,
component_type::Type{<:Component};
...
)
show_components(
sys::System,
component_type::Type{<:Component},
additional_columns::Union{Dict, Vector};
kwargs...
)
Show all components of the given type in a table.
Arguments
sys::System: System containing the components.component_type::Type{<:Component}: Type to display. Must be a concrete type.additional_columns::Union{Dict, Vector}: Additional columns to display. The Dict option is a mapping of column name to function. The function must accept a component. The Vector option is an array of field names for thecomponent_type.
Extra keyword arguments are forwarded to PrettyTables.pretty_table.
Examples
show_components(sys, ThermalStandard)
show_components(sys, ThermalStandard, Dict("has_time_series" => x -> has_time_series(x)))
show_components(sys, ThermalStandard, [:active_power, :reactive_power])PowerSystems.generate_struct_file — Methodgenerate_struct_file(
definition::StructDefinition;
filename,
output_directory
)
Generate a Julia source code file for one struct from a StructDefinition.
Refer to StructDefinition and StructField for descriptions of the available fields.
Arguments
definition::StructDefinition: Defines the struct and all fields.filename::AbstractString: Add the struct definition to this JSON file. Defaults tosrc/descriptors/power_system_structs.jsonoutput_directory::AbstractString: Generate the files in this directory. Defaults tosrc/models/generated
PowerSystems.generate_struct_files — Methodgenerate_struct_files(
definitions;
filename,
output_directory
)
Generate Julia source code files for multiple structs from a iterable of StructDefinition instances.
Refer to StructDefinition and StructField for descriptions of the available fields.
Arguments
definitions: Defines the structs and all fields.filename::AbstractString: Add the struct definition to this JSON file. Defaults tosrc/descriptors/power_system_structs.jsonoutput_directory::AbstractString: Generate the files in this directory. Defaults tosrc/models/generated
InfrastructureSystems.StructDefinition — MethodStructDefinition(
;
struct_name,
fields,
supertype,
docstring,
is_component
)
Construct a StructDefinition for code auto-generation purposes.
Arguments
struct_name::AbstractString: Struct namefields::Vector{StructField}: Struct fields. Refer toStructField.docstring::AbstractString: Struct docstring. Defaults to an empty string.supertype::Union{String, DataType}: Struct supertype. Defaults to no supertype.is_component::Bool: Set to true for component types that will be attached to a system. Do not set to Default to true.
InfrastructureSystems.StructField — MethodStructField(
;
name,
data_type,
default,
comment,
needs_conversion,
exclude_setter,
valid_range,
validation_action,
null_value,
internal_default
)
Construct a StructField for code auto-generation purposes.
Arguments
name::String: Field namedata_type::Union{DataType, String}: Field typedefault::Any: The generated constructors will define this as a default value.comment::String: Include this comment above the field name. Defaults to empty string.needs_conversion::Bool: Set to true if the getter and setter functions need to apply unit conversion. The type must implementget_value(::Component, ::Type)andset_value(::Component, ::Type)for this combination of component type and field type.exclude_setter::Bool: Do not generate a setter function for this field. Defaults to false.valid_range::Union{Nothing, String, Dict}: Enables range validation when the component is added to a system. Define this as a Dict with "min" and "max" or as a String with the field name in the struct that defines this field's valid range and InfrastructureSystems will validate any value against that range. Usenothingif one doesn't apply, such as if there is no max limit.validation_action: Define this as "error" or "warn". If it is "error" then InfrastructureSystems will throw an exception if the validation code detects a problem. Otherwise, it will log a warning.null_value::Any: Value to indicate the field is zero or empty, such as 0.0 for Float64. If all members in the struct define this field then a "demo" constructor will be generated. This allows enteringval = MyType(nothing)in the REPL to see the layout of a struct without worrying about valid values.internal_default: Set to true for non-user-facing fields likeInfrastructureSystemsInternalthat have default values.
InfrastructureSystems.generate_struct_file — Methodgenerate_struct_file(
definition::StructDefinition;
filename,
output_directory
)
Generate a Julia source code file for one struct from a StructDefinition.
Refer to StructDefinition and StructField for descriptions of the available fields.
Arguments
definition::StructDefinition: Defines the struct and all fields.filename::AbstractString: Add the struct definition to this JSON file. Defaults tosrc/descriptors/structs.jsonoutput_directory::AbstractString: Generate the files in this directory. Defaults tosrc/generated
InfrastructureSystems.generate_struct_files — Methodgenerate_struct_files(
definitions;
filename,
output_directory
)
Generate Julia source code files for multiple structs from a iterable of StructDefinition instances.
Refer to StructDefinition and StructField for descriptions of the available fields.
Arguments
definitions: Defines the structs and all fields.filename::AbstractString: Add the struct definition to this JSON file. Defaults tosrc/descriptors/power_system_structs.jsonoutput_directory::AbstractString: Generate the files in this directory. Defaults tosrc/generated
Advanced Component Selection
The primary way to retrieve components in PowerSystems.jl is with the get_components and similar get_* methods above. The following ComponentSelector interface offers advanced, repeatable component selection primarily for multi-scenario post-processing analytics. See PowerAnalytics.jl.
InfrastructureSystems.ComponentSelector — TypeGiven some ComponentContainer-like source of components to draw from, such as a PowerSystems.System, a ComponentSelector picks out a certain subset of them based on some user-defined selection criteria. A ComponentSelector can also be used to name that subset of components or to split it up into groups. The same ComponentSelector can be used to apply the same set of selection criteria to multiple sources of components. The primary use case for ComponentSelector is to support repeatable multi-scenario post-processing analytics (see e.g. PowerAnalytics.jl).
Formally, instances of ComponentSelector represent lazy, partitioned, named, source-independent collections of InfrastructureSystemsComponents.
Core Interface
make_selector: factory function to handleComponentSelectorcreation; end users should use this rather than calling the constructors directly.get_groups: get the groups that make up aComponentSelector, which will themselves be represented asComponentSelectors.get_components: get all the components that make up aComponentSelector, ignoring how they are grouped. A component should appear in theget_componentsof a given selector if and only if it appears in theget_componentsof at least one of that selector's groups.get_name: get the name of theComponentSelector. AllComponentSelectors have a name, whether it is specified by the user or created automatically.rebuild_selector: create a newComponentSelectorfrom an existing one with some details (e.g., the name or the grouping behavior) tweaked.
Availability Filtering
Besides the core interface, also provided are get_component for ComponentSelector subtypes that can only refer to at most one component; and get_available_component, get_available_components, and get_available_groups, which work the same as the corresponding functions without available except they only consider components for which get_available is true.
scope_limiter Filtering
The ComponentSelector methods of get_component, get_components, and get_groups, and the corresponding _available_ variants, take an optional first argument scope_limiter::Union{Function, Nothing}. If a function is passed in here, it will be used as a filter function to limit the components under consideration before the ComponentSelector's criteria are evaluated.
InfrastructureSystems.get_name — Methodget_name(selector::ComponentSelector) -> Any
Get the name of the ComponentSelector. This is either a user-specified name passed in at creation or a name automatically generated from the selector's specification.
Examples
sel = make_selector(RenewableDispatch)
get_name(sel) # "RenewableDispatch"InfrastructureSystems.make_selector — FunctionFactory function to create the appropriate subtype of ComponentSelector given the arguments. Users should call this rather than manually constructing ComponentSelectors.
Arguments
Several methods of this function have a parameter groupby::Union{Symbol, Function}, which specifies how the selector is grouped for the purposes of get_groups. The groupby argument has the following semantics:
groupby = :each(default): each component that makes up the selector forms its own group. The number of groups fromget_groupswill be equal to the number of components fromget_components.groupby = :all: all components that make up the selector are put into the same group.get_groupswill yield one group.groupby = partition_function: if the argument is a user-supplied function, the function will be applied to each component; all components with the same result under the function will be grouped together, with the name of the group specified by the function's output.
Other arguments are documented on a per-method basis.
Examples
See the methods.
InfrastructureSystems.make_selector — Methodmake_selector(
filter_func::Function,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent};
name,
groupby
) -> InfrastructureSystems.FilterComponentSelector
Make a ComponentSelector from a filter function and a type of component. The filter function must accept instances of component_type as a sole argument and return a Bool. Optionally provide a grouping behavior and/or name for the selector. Selectors constructed this way point to all the components of the given type that satisfy the filter function, grouped by the groupby argument (see the base make_selector documentation).
Arguments
filter_func::Function: the filter function to apply to componentscomponent_type::Type{<:InfrastructureSystemsComponent}: the type of component to selectgroupby::Union{Symbol, Function} = :each: the grouping behavior (see the basemake_selectordocumentation)name::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(RenewableDispatch, x -> get_prime_mover_type(x) == PrimeMovers.PVe)
sel2 = make_selector(RenewableDispatch, x -> get_prime_mover_type(x) == PrimeMovers.PVe; groupby = :all)
sel3 = make_selector(RenewableDispatch, x -> get_prime_mover_type(x) == PrimeMovers.PVe; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Methodmake_selector(
component::InfrastructureSystems.InfrastructureSystemsComponent;
name
) -> InfrastructureSystems.NameComponentSelector
Make a ComponentSelector from a component, pointing to a single component with the same type and name as the one given. Optionally provide a name for the selector. Selectors constructed this way contain exactly one group, which contains one component if the target component exists and zero if it doesn't.
Arguments
component::InfrastructureSystemsComponent: the component whose type and name specify the target of this selectorname::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(my_component)
sel2 = make_selector(my_component; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Methodmake_selector(
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
component_name::AbstractString;
name
) -> InfrastructureSystems.NameComponentSelector
Make a ComponentSelector pointing to a single component with the given type and name. Optionally provide a name for the selector. Selectors constructed this way contain exactly one group, which contains one component if the target component exists and zero if it doesn't.
Arguments
component_type::Type{<:InfrastructureSystemsComponent}: the type of the target componentcomponent_name::AbstractString: the name of the target componentname::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(ThermalStandard, "322_CT_6")
sel2 = make_selector(ThermalStandard, "322_CT_6"; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Methodmake_selector(
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent};
groupby,
name
) -> InfrastructureSystems.TypeComponentSelector
Make a ComponentSelector from a type of component. Optionally provide a grouping behavior and/or name for the selector. Selectors constructed this way point to all the components of the given type, grouped by the groupby argument (see the base make_selector documentation).
Arguments
component_type::Type{<:InfrastructureSystemsComponent}: the type of component to selectgroupby::Union{Symbol, Function} = :each: the grouping behavior (see the basemake_selectordocumentation)name::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(RenewableDispatch)
sel2 = make_selector(RenewableDispatch; groupby = :all)
sel3 = make_selector(RenewableDispatch; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Methodmake_selector(
content::ComponentSelector...;
name
) -> InfrastructureSystems.ListComponentSelector
Make a ComponentSelector from several existing ComponentSelectors. Optionally provide a name for the selector. Selectors constructed this way contain one group for each of the selectors they were constructed with.
Arguments
content::ComponentSelector...: the list of selectors that should form the groupsname::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(make_selector(ThermalStandard), make_selector(RenewableDispatch))
sel2 = make_selector(make_selector(ThermalStandard), make_selector(RenewableDispatch); name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.rebuild_selector — Methodrebuild_selector(
selector::InfrastructureSystems.ListComponentSelector;
name,
groupby
) -> InfrastructureSystems.ListComponentSelector
Returns a ComponentSelector functionally identical to the input selector except with the changes to its fields specified in the keyword arguments. It is not guaranteed that the result will have the same concrete type.
Examples
Suppose you have a selector with manual groups and you want to group by :each:
sel = make_selector(make_selector(ThermalStandard), make_selector(RenewableDispatch))
sel_each = rebuild_selector(sel; groupby = :each) # will be a RegroupedComponentSelectorInfrastructureSystems.rebuild_selector — Methodrebuild_selector(
selector::ComponentSelector;
name
) -> InfrastructureSystems.ListComponentSelector
Returns a ComponentSelector functionally identical to the input selector except with the changes to its fields specified in the keyword arguments.
Examples
Suppose you have a selector with name = "my_name. If you instead wanted name = "your_name:
sel = make_selector(ThermalStandard, "322_CT_6"; name = "my_name")
sel_yours = rebuild_selector(sel; name = "your_name")InfrastructureSystems.rebuild_selector — Methodrebuild_selector(
selector::DynamicallyGroupedComponentSelector;
name,
groupby
) -> Any
Returns a ComponentSelector functionally identical to the input selector except with the changes to its fields specified in the keyword arguments.
Examples
Suppose you have a selector with groupby = :all. If you instead wanted groupby = :each:
sel = make_selector(ThermalStandard; groupby = :all)
sel_each = rebuild_selector(sel; groupby = :each)PowerSystems.get_available_component — Methodget_available_component(
selector::SingularComponentSelector,
sys::System
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Like get_component but only operates on components for which get_available is true.
PowerSystems.get_available_component — Methodget_available_component(
scope_limiter::Union{Nothing, Function},
selector::SingularComponentSelector,
sys::System
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Like get_component but only operates on components for which get_available is true.
PowerSystems.get_available_components — Methodget_available_components(
selector::ComponentSelector,
sys::System
) -> Any
Like get_components but only operates on components for which get_available is true.
PowerSystems.get_available_components — Methodget_available_components(
scope_limiter::Union{Nothing, Function},
selector::ComponentSelector,
sys::System
) -> Any
Like get_components but only operates on components for which get_available is true.
PowerSystems.get_available_groups — Methodget_available_groups(
selector::ComponentSelector,
sys::System
) -> Any
Like get_groups but only operates on components for which get_available is true.
PowerSystems.get_available_groups — Methodget_available_groups(
scope_limiter::Union{Nothing, Function},
selector::ComponentSelector,
sys::System
) -> Any
Like get_groups but only operates on components for which get_available is true.
PowerSystems.get_component — Methodget_component(
selector::SingularComponentSelector,
sys::System
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Return the component of the System that makes up the SingularComponentSelector; nothing if there is none.
PowerSystems.get_component — Methodget_component(
scope_limiter::Union{Nothing, Function},
selector::SingularComponentSelector,
sys::System
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Return the component of the System that makes up the SingularComponentSelector; nothing if there is none. Optionally specify a filter function scope_limiter as the first argument to limit the components that should be considered.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::SingularComponentSelector: theSingularComponentSelectorwhose component to retrievesys::System: the system from which to draw components
PowerSystems.get_components — Methodget_components(
selector::ComponentSelector,
sys::System
) -> Any
Return the components of the System that make up the ComponentSelector.
PowerSystems.get_components — Methodget_components(
scope_limiter::Union{Nothing, Function},
selector::ComponentSelector,
sys::System
) -> Any
Return the components of the System that make up the ComponentSelector. Optionally specify a filter function scope_limiter as the first argument to limit the components that should be considered.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::ComponentSelector: theComponentSelectorwhose components to retrievesys::System: the system from which to draw components
PowerSystems.get_groups — Methodget_groups(selector::ComponentSelector, sys::System) -> Any
Return the groups that make up the ComponentSelector.
PowerSystems.get_groups — Methodget_groups(
scope_limiter::Union{Nothing, Function},
selector::ComponentSelector,
sys::System
) -> Any
Return the groups that make up the ComponentSelector. Optionally specify a filter function scope_limiter as the first argument to limit the components that should be considered.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::ComponentSelector: theComponentSelectorwhose groups to retrievesys::System: the system from which to draw components
InfrastructureSystems.DynamicallyGroupedComponentSelector — TypePluralComponentSelectors whose grouping is determined by a groupby field. The semantics of this field are described at make_selector.
InfrastructureSystems.PluralComponentSelector — TypeComponentSelector subtype that may refer to multiple components.
InfrastructureSystems.SingularComponentSelector — TypeComponentSelector subtype that can only refer to zero or one components. get_components will always return zero or one components; get_component will return the component directly if there is one and return nothing if there is not.
InfrastructureSystems.component_to_qualified_string — Methodcomponent_to_qualified_string(
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
component_name::AbstractString
) -> Any
Canonical way to turn an InfrastructureSystemsComponent specification/instance into a unique-per-system string.
InfrastructureSystems.subtype_to_string — Methodsubtype_to_string(
subtype::Type{<:InfrastructureSystems.InfrastructureSystemsComponent}
) -> Any
Canonical way to turn an InfrastructureSystemsComponent subtype into a unique string.
Additional Component Methods
PowerSystems.get_active_power_limits — Methodget_active_power_limits(
_::Device
) -> @NamedTuple{min::Float64, max::Float64}
Generic fallback — throws ArgumentError for devices that do not implement get_active_power_limits.
See also: get_active_power_limits
PowerSystems.get_aggregation_topology_accessor — Methodget_aggregation_topology_accessor(
_::Type{Area}
) -> typeof(get_area)
Return the appropriate accessor function for the given aggregation topology type. For Area types, returns get_area; for LoadZone types, returns get_load_zone.
PowerSystems.get_aggregation_topology_accessor — Methodget_aggregation_topology_accessor(
_::Type{LoadZone}
) -> typeof(get_load_zone)
Return the appropriate accessor function for the given aggregation topology type. For Area types, returns get_area; for LoadZone types, returns get_load_zone.
PowerSystems.get_base_voltage — Methodget_base_voltage(
line::Union{Line, MonitoredLine}
) -> Union{Nothing, Float64}
Return the base voltage (kV) of a Line or MonitoredLine by reading the base_voltage from both endpoints of the line's Arc.
If the two bus voltages are identical, that value is returned directly. If they differ but are within BRANCH_BUS_VOLTAGE_DIFFERENCE_TOL (percent), the value with fewer significant figures is returned (i.e., the rounder number). If the difference exceeds the tolerance, an error is thrown.
Arguments
line::Union{Line, MonitoredLine}: The transmission line.
PowerSystems.get_from_to_flow_limit — Methodget_from_to_flow_limit(a::AreaInterchange) -> Float64
Return the flow limit from the source Area to the destination Area for an AreaInterchange.
See also: get_to_from_flow_limit, get_flow_limits
PowerSystems.get_high_voltage — Methodget_high_voltage(t::TwoWindingTransformer) -> Float64
Return the high-side base voltage (kV) of a TwoWindingTransformer as the maximum of base_voltage_primary and base_voltage_secondary.
See also: get_low_voltage
PowerSystems.get_low_voltage — Methodget_low_voltage(t::TwoWindingTransformer) -> Float64
Return the low-side base voltage (kV) of a TwoWindingTransformer as the minimum of base_voltage_primary and base_voltage_secondary.
See also: get_high_voltage
PowerSystems.get_max_active_power — Methodget_max_active_power(d::StaticInjection) -> Float64
Return the maximum active power for a StaticInjection device as the max field of the named tuple returned by get_active_power_limits.
See also: get_max_reactive_power, get_active_power_limits
PowerSystems.get_max_active_power — Methodget_max_active_power(
d::Union{InterruptibleStandardLoad, StandardLoad}
) -> Float64
Return the maximum active power for a StandardLoad or InterruptibleStandardLoad by summing constant, impedance, and current components at unit voltage.
See also: get_max_active_power
PowerSystems.get_max_active_power_flow_limit — Methodget_max_active_power_flow_limit(
tx::TransmissionInterface
) -> Float64
Return the maximum active power flow limit for a TransmissionInterface.
See also: get_min_active_power_flow_limit, get_active_power_flow_limits
PowerSystems.get_max_reactive_power — Methodget_max_reactive_power(d::RenewableDispatch) -> Float64
Return the maximum reactive power for a RenewableDispatch generator. If reactive_power_limits is nothing, the value is calculated as rating × sin(acos(power_factor)).
See also: get_max_reactive_power
PowerSystems.get_max_reactive_power — Methodget_max_reactive_power(d::StaticInjection) -> Float64
Return the maximum reactive power for a StaticInjection device as the max field of the named tuple returned by get_reactive_power_limits. Returns Inf if reactive_power_limits is nothing.
See also: get_max_active_power, get_reactive_power_limits
PowerSystems.get_min_active_power_flow_limit — Methodget_min_active_power_flow_limit(
tx::TransmissionInterface
) -> Float64
Return the minimum active power flow limit for a TransmissionInterface.
See also: get_max_active_power_flow_limit, get_active_power_flow_limits
PowerSystems.get_power_factor — Methodget_power_factor(_::Device) -> Float64
Generic fallback — throws ArgumentError for devices that do not implement get_power_factor.
PowerSystems.get_rating — Methodget_rating(_::Device) -> Float64
Generic fallback — throws ArgumentError for devices that do not implement get_rating.
PowerSystems.get_reactive_power_limits — Methodget_reactive_power_limits(
_::Device
) -> Union{Nothing, @NamedTuple{min::Float64, max::Float64}}
Generic fallback — throws ArgumentError for devices that do not implement get_reactive_power_limits.
See also: get_reactive_power_limits
PowerSystems.get_to_from_flow_limit — Methodget_to_from_flow_limit(a::AreaInterchange) -> Float64
Return the flow limit from the destination Area to the source Area for an AreaInterchange.
See also: get_from_to_flow_limit, get_flow_limits
PowerSystems.get_α — Methodget_α(t::Union{TapTransformer, Transformer2W}) -> Float64
Return the phase shift angle α (radians) for a TapTransformer or Transformer2W based on its winding group number, calculated as -(π/6) × winding_group_number.
Returns 0.0 and logs a debug message if the winding group number is WindingGroupNumber.UNDEFINED.
See also: get_α_primary, get_winding_group_number
PowerSystems.get_α_primary — Methodget_α_primary(t::Transformer3W) -> Float64
Return the primary winding phase shift angle α (radians) for a Transformer3W based on its primary winding group number, calculated as -(π/6) × primary_group_number.
Returns 0.0 and issues a warning if the primary winding group number is WindingGroupNumber.UNDEFINED.
See also: get_α_secondary, get_α_tertiary, get_primary_group_number
PowerSystems.get_α_secondary — Methodget_α_secondary(t::Transformer3W) -> Float64
Return the secondary winding phase shift angle α (radians) for a Transformer3W based on its secondary winding group number, calculated as -(π/6) × secondary_group_number.
Returns 0.0 and issues a warning if the secondary winding group number is WindingGroupNumber.UNDEFINED.
See also: get_α_primary, get_α_tertiary, get_secondary_group_number
PowerSystems.get_α_tertiary — Methodget_α_tertiary(t::Transformer3W) -> Float64
Return the tertiary winding phase shift angle α (radians) for a Transformer3W based on its tertiary winding group number, calculated as -(π/6) × tertiary_group_number.
Returns 0.0 and issues a warning if the tertiary winding group number is WindingGroupNumber.UNDEFINED.
See also: get_α_primary, get_α_secondary, get_tertiary_group_number
PowerSystems.set_area! — MethodPowerSystems.set_load_zone! — MethodPowerSystems.set_downstream_turbine! — Methodset_downstream_turbine!(
reservoir::HydroReservoir,
turbine::HydroUnit
)
Set a single downstream turbine for a HydroReservoir.
This is a convenience wrapper around set_downstream_turbines! for the single-turbine case.
Arguments
reservoir::HydroReservoir: The hydro reservoir.turbine::HydroUnit: The turbine to set as the downstream unit.
See also: set_upstream_turbine!, get_downstream_turbines
PowerSystems.set_upstream_turbine! — Methodset_upstream_turbine!(
reservoir::HydroReservoir,
turbine::HydroUnit
)
Set a single upstream turbine for a HydroReservoir.
This is a convenience wrapper around set_upstream_turbines! for the single-turbine case.
Arguments
reservoir::HydroReservoir: The hydro reservoir.turbine::HydroUnit: The turbine to set as the upstream unit.
See also: set_downstream_turbine!, get_upstream_turbines
Deprecated Methods
PowerSystems.TwoTerminalHVDCLine — FunctionTwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss,
services
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss,
services,
ext
) -> TwoTerminalGenericHVDCLine
Deprecated method for the old TwoTerminalHVDCLine that returns the new TwoTerminalGenericHVDCLine. This constructor is used for some backward compatibility and will be removed in a future version.
PowerSystems.TwoTerminalHVDCLine — FunctionTwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::@NamedTuple{l0::Float64, l1::Float64}
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::@NamedTuple{l0::Float64, l1::Float64},
services
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::@NamedTuple{l0::Float64, l1::Float64},
services,
ext
) -> TwoTerminalGenericHVDCLine
Deprecated method for the old TwoTerminalHVDCLine that returns the new TwoTerminalGenericHVDCLine. This constructor is used for some backward compatibility and will be removed in a future version.
PowerSystems.TwoTerminalHVDCLine — FunctionTwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::Union{LinearCurve, PiecewiseIncrementalCurve}
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::Union{LinearCurve, PiecewiseIncrementalCurve},
services
) -> TwoTerminalGenericHVDCLine
TwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::Union{LinearCurve, PiecewiseIncrementalCurve},
services,
ext
) -> TwoTerminalGenericHVDCLine
Deprecated method for the old TwoTerminalHVDCLine that returns the new TwoTerminalGenericHVDCLine. This constructor is used for some backward compatibility and will be removed in a future version.
PowerSystems.TwoTerminalHVDCLine — MethodTwoTerminalHVDCLine(
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss::@NamedTuple{l0::Float64, l1::Float64},
services,
ext,
internal
) -> TwoTerminalGenericHVDCLine
Deprecated method for the old TwoTerminalHVDCLine that returns the new TwoTerminalGenericHVDCLine. This constructor is used for some backward compatibility and will be removed in a future version.
PowerSystems.TwoTerminalHVDCLine — MethodTwoTerminalHVDCLine(
;
name,
available,
active_power_flow,
arc,
active_power_limits_from,
active_power_limits_to,
reactive_power_limits_from,
reactive_power_limits_to,
loss,
services,
ext,
internal
)
Deprecated method for the old TwoTerminalHVDCLine that returns the new TwoTerminalGenericHVDCLine. This constructor is used for some backward compatibility and will be removed in a future version.
Parsing
PowerSystems.PowerSystemTableData — MethodPowerSystemTableData(
directory::AbstractString,
base_power::Float64,
user_descriptor_file::AbstractString;
descriptor_file,
generator_mapping_file,
timeseries_metadata_file
) -> PowerSystemTableData
Reads in all the data stored in csv files in a directory
This parser is planned for deprecation. PowerSystems.jl will be moving to a database solution for handling data. There are plans to eventually include utility functions to translate from .csv files to the database, but there will probably be a gap in support. Users are recommended to write their own custom Julia code to import data from their unique data formats, rather than relying on this parsing code. See How-to Build a System from CSV Files for an example.
Arguments
directory::AbstractString: directory containing CSV filesbase_power::Float64: base power for the constructedSystemuser_descriptor_file::AbstractString: customized input descriptor file. Exampledescriptor_file=POWER_SYSTEM_DESCRIPTOR_FILE:PowerSystems.jldescriptor file. Defaultgenerator_mapping_file=GENERATOR_MAPPING_FILE_CDM: generator mapping configuration file. Defaulttimeseries_metadata_file = joinpath(directory, "timeseries_pointers"): Time series pointers .json file. Example
The general format for data in the directory is:
- bus.csv (required)
- columns specifying
areaandzonewill create a corresponding set ofAreaandLoadZoneobjects. - columns specifying
max_active_powerormax_reactive_powerwill createPowerLoadobjects when nonzero values are encountered and will contribute to thepeak_active_powerandpeak_reactive_powervalues for the correspondingLoadZoneobject.
- columns specifying
- branch.csv
- dc_branch.csv
- gen.csv
- load.csv
- reserves.csv
- storage.csv
Custom construction of generators
Each generator will be defined as a concrete subtype of Generator, based on the fuel and type columns in gen.csv and the generator_mapping_file. The default mapping file is src/parsers/generator_mapping.yaml. You can override this behavior by specifying your own file.
Custom Column names
PowerSystems provides am input mapping capability that allows you to keep your own column names. For example, when parsing raw data for a generator the code expects a column called name. If the raw data instead defines that column as GEN UID then you can change the custom_name field under the generator category to GEN UID in your YAML file.
To enable the parsing of a custom set of csv files, you can generate a configuration file (such as user_descriptors.yaml) from the defaults, which are stored in src/descriptors/power_system_inputs.json.
python ./bin/generate_config_file.py ./user_descriptors.yamlNext, edit this file with your customizations.
Note that the user-specific customizations are stored in YAML rather than JSON to allow for easier editing. The next few sections describe changes you can make to this YAML file. Do not edit the default JSON file.
Per-unit conversion
PowerSystems defines whether it expects a column value to be per-unit system base, per-unit device base, or natural units in power_system_inputs.json. If it expects a per-unit convention that differs from your values then you can set the unit_system in user_descriptors.yaml and PowerSystems will automatically convert the values. For example, if you have a max_active_power value stored in natural units (MW), but power_system_inputs.json specifies unit_system: device_base, you can enter unit_system: natural_units in user_descriptors.yaml and PowerSystems will divide the value by the value of the corresponding entry in the column identified by the base_reference field in power_system_inputs.json. You can also override the base_reference setting by adding base_reference: My Column to make device base per-unit conversion by dividing the value by the entry in My Column. System base per-unit conversions always divide the value by the system base_power value instantiated when constructing a System.
PowerSystems provides a limited set of unit conversions. For example, if power_system_inputs.json indicates that a value's unit is degrees but your values are in radians then you can set unit: radian in your YAML file. Other valid unit entries include GW, GWh, MW, MWh, kW, and kWh.
Examples
data_dir = "/data/my-data-dir"
base_power = 100.0
descriptors = "./user_descriptors.yaml"
timeseries_metadata_file = "./timeseries_pointers.json"
generator_mapping_file = "./generator_mapping.yaml"
data = PowerSystemTableData(
data_dir,
base_power,
descriptors;
timeseries_metadata_file = timeseries_metadata_file,
generator_mapping_file = generator_mapping_file,
)
sys = System(data; time_series_in_memory = true)PowerSystems.create_poly_cost — Methodcreate_poly_cost(
gen,
cost_colnames
) -> Union{Tuple{LinearCurve, Float64}, Tuple{QuadraticCurve, Float64}}
create_poly_cost(gen, cost_colnames)Return a Polynomial function cost based on the coeffiecients provided on gen.
Three supported cases,
- If three values are passed then we have data looking like:
a2 * x^2 + a1 * x + a0, - If
a1anda0are passed then we have data looking like:a1 * x + a0, - If only
a1is passed then we have data looking like:a1 * x.
PowerSystems.PowerModelsData — TypeContainer for data parsed by PowerModels
PowerSystems.PowerModelsData — MethodPowerModelsData(
file::Union{IO, String};
kwargs...
) -> PowerModelsData
Constructs PowerModelsData from a raw file. Currently Supports MATPOWER and PSSE data files parsed by PowerModels.
PowerSystems.add_dyn_injectors! — Methodadd_dyn_injectors!(sys::System, dyr_file::AbstractString)
Add to a system already created the dynamic components. The system should already be parsed from a .raw file.
Examples:
dyr_file = "Example.dyr"
add_dyn_injectors!(sys, dyr_file)PowerSystems.parse_file — Methodparse_file(
io::IO;
import_all,
validate,
correct_branch_rating,
filetype
) -> Any
Parses the iostream from a file
PowerSystems.parse_file — Methodparse_file(
file::String;
import_all,
validate,
correct_branch_rating
) -> Any
parse_file(
file;
import_all = false,
validate = true,
correct_branch_rating = true,
)Parses a Matpower .m file or PTI (PSS(R)E-v33) .raw file into a PowerModels data structure. All fields from PTI files will be imported if import_all is true (Default: false).
PowerSystems.parse_matlab_file — Methodparse_matlab_file(
file_string::String;
kwargs...
) -> Union{Dict{String, Any}, Tuple{Dict{String, Any}, Union{Nothing, SubString}, Dict{String, Any}}}
Parse a MATLAB .m file into a Dict.
PowerSystems.parse_matlab_string — Methodparse_matlab_string(
data_string::String;
extended
) -> Union{Dict{String, Any}, Tuple{Dict{String, Any}, Union{Nothing, SubString}, Dict{String, Any}}}
Parse a MATLAB data string into a Dict, extracting function definitions and matrix assignments.
Logging
PowerSystems.configure_logging — Methodconfigure_logging(
;
console_level,
file_level,
filename
) -> MultiLogger
Creates console and file loggers.
Note: Log messages may not be written to the file until flush() or close() is called on the returned logger.
Arguments
console_level = Logging.Error: level for console messagesfile_level = Logging.Info: level for file messagesfilename::Union{Nothing, AbstractString} = "power-systems.log": log file; pass nothing to disable file logging
Example
logger = configure_logging(console_level = Logging.Info)
@info "log message"
close(logger)