Public Types
This section introduces the public types available in JuliaGrid. These types are designed to model and represent key components of power systems, measurements, and analyses.
To load public types into the current scope, utilize the following command:
using JuliaGrid
Power System Model
Measurement Model
Analysis
Power Flow
Optimal Power Flow
Observability Analysis
State Estimation
Power System Model
JuliaGrid.PowerSystem
— TypePowerSystem
A composite type constructed using the powerSystem
function to store power system data.
Fields
bus::Bus
: Bus-related data.branch::Branch
: Branch-related data.generator::Generator
: Generator-related data.base::BaseData
: Base power and base voltages.model::Model
: Data related to AC and DC analyses.
JuliaGrid.Bus
— TypeBus
A composite type used in PowerSystem
to store bus-related data.
Fields
label::LabelDict
: Bus labels.demand::BusDemand
: Active and reactive power demands.supply::BusSupply
: Active and reactive power supplies from generators.shunt::BusShunt
: Active and reactive power injections or demands from shunt elements.voltage::BusVoltage
: Initial voltages and voltage magnitude constraints.layout::BusLayout
: Bus layout, including bus types.number::Int64
: Total number of buses.
JuliaGrid.Branch
— TypeBranch
A composite type used in PowerSystem
to store branch-related data.
Fields
label::LabelDict
: Branch labels.parameter::BranchParameter
: Data related to the π-model of the branches.flow::BranchFlow
: Branch flow constraints.voltage::BranchVoltage
: Voltage angle difference constraints.layout::BranchLayout
: Branch layout, including operational statuses.number::Int64
: Total number of branches.
JuliaGrid.Generator
— TypeGenerator
A composite type used in PowerSystem
to store generator-related data.
Fields
label::LabelDict
: Generator labels.output::GeneratorOutput
: Active and reactive power outputs.capability::GeneratorCapability
: Power output constraints.ramping::GeneratorRamping
: Ramp rate limits.voltage::GeneratorVoltage
: Voltage magnitude setpoints.cost::GeneratorCost
: Costs associated with active and reactive power outputs.layout::GeneratorLayout
: Generator layout, including operational statuses.number::Int64
: Total number of generators.
JuliaGrid.BaseData
— TypeBaseData
A composite type used in PowerSystem
to store base data.
Fields
power::BasePower
: Base power.voltage::BaseVoltage
: Base voltages.
JuliaGrid.Model
— TypeModel
A composite type used in PowerSystem
to store vectors and matrices related to the power system's topology and parameters.
Fields
ac::ACModel
: AC model, including the nodal admittance matrix and Y-parameters of two-port branches.dc::DCModel
: DC model, including the nodal admittance matrix and branch admittances.
Measurement Model
JuliaGrid.Measurement
— TypeMeasurement
A composite type built using the measurement
function to store measurement data.
Fields
voltmeter::Voltmeter
: Data related to bus voltage magnitude measurements.ammeter::Ammeter
: Data related to branch current magnitude measurements.wattmeter::Wattmeter
: Data related to active power injection and active power flow measurements.varmeter::Varmeter
: Data related to reactive power injection and reactive power flow measurements.pmu::PMU
: Data related to bus voltage and branch current phasor measurements.
JuliaGrid.Voltmeter
— TypeVoltmeter
A composite type used in Measurement
to store voltmeter-related data.
Fields
label::LabelDict
: Voltmeter labels.magnitude::GaussMeter
: Bus voltage magnitude measurements.layout::VoltmeterLayout
: Placement indices and indicators.number::Int64
: Total number of voltmeters.
JuliaGrid.Ammeter
— TypeAmmeter
A composite type used in Measurement
to store ammeter-related data.
Fields
label::LabelDict
: Ammeter labels.magnitude::GaussMeter
: Branch current magnitude measurements.layout::AmmeterLayout
: Placement indices and indicators.number::Int64
: Total number of ammeters.
JuliaGrid.Wattmeter
— TypeWattmeter
A composite type used in Measurement
to store wattmeter-related data.
Fields
label::LabelDict
: Wattmeter labels.active::GaussMeter
: Active power injection and active power flow measurements.layout::PowermeterLayout
: Placement indices and indicators.number::Int64
: Total number of wattmeters.
JuliaGrid.Varmeter
— TypeVarmeter
A composite type used in Measurement
to store varmeter-related data.
Fields
label::LabelDict
: Varmeter labels.reactive::GaussMeter
: Reactive power injection and reactive power flow measurements.layout::PowermeterLayout
: Placement indices and indicators.number::Int64
: Total number of varmeters.
JuliaGrid.PMU
— TypePMU
A composite type used in Measurement
to store PMU-related data.
Fields
label::LabelDict
: PMU labels.magnitude::GaussMeter
: Bus voltage and branch current magnitude measurements.angle::GaussMeter
: Bus voltage and branch current angle measurements.layout::PmuLayout
: Placement indices and indicators.number::Int64
: Total number of PMUs.
Analysis
JuliaGrid.Analysis
— TypeAnalysis
An abstract type used for representing both AC and DC analyses in JuliaGrid.
JuliaGrid.AC
— TypeAC <: Analysis
An abstract type representing AC analyses in JuliaGrid.
JuliaGrid.DC
— TypeDC <: Analysis
An abstract type representing DC analyses in JuliaGrid.
JuliaGrid.LDLt
— TypeLDLt
An abstract type used for representing LDLt factorization in JuliaGrid.
JuliaGrid.LU
— TypeLU
An abstract type used for representing LU factorization in JuliaGrid.
JuliaGrid.QR
— TypeQR
An abstract type used for representing QR factorization in JuliaGrid.
Power Flow
JuliaGrid.ACPowerFlow
— TypeACPowerFlow{T} <: AC where T <: Union{NewtonRaphson, FastNewtonRaphson, GaussSeidel}
A composite type representing an AC power flow model, where the type parameter T
specifies the numerical method used to solve the power flow. Supported methods include NewtonRaphson
, FastNewtonRaphson
, and GaussSeidel
.
Fields
voltage::Polar
: Bus voltages represented in polar form.power::ACPower
: Active and reactive powers at the buses, branches, and generators.current::ACCurrent
: Currents at the buses and branches.method::T
: Vectors and matrices associated with the method used to solve the AC power flow.
JuliaGrid.NewtonRaphson
— TypeNewtonRaphson
A composite type built using the newtonRaphson
function to define the AC power flow model, which will be solved using the Newton-Raphson method.
Fields
jacobian::SparseMatrixCSC{Float64, Int64}
: Jacobian matrix.mismatch::Vector{Float64}
: Vector of mismatches.increment::Vector{Float64}
: Vector of state variable increments.factorization::Factorization{Float64}
: Factorization of the Jacobian matrix.pq::Vector{Int64}
: Indices related to demand buses.pvpq::Vector{Int64}
: Indices related to demand and generator buses.pattern::Int64
: Tracks pattern changes in entries of the Jacobian matrix.
JuliaGrid.FastNewtonRaphson
— TypeFastNewtonRaphson
A composite type built using the fastNewtonRaphsonBX
and fastNewtonRaphsonXB
functions to define the AC power flow model, which will be solved using the fast Newton-Raphson method.
Fields
active:FastNewtonRaphsonModel
: Jacobian, mismatches, and incrementes for active power equations.reactive:FastNewtonRaphsonModel
: Jacobian, mismatches, and incrementes for active power equations.pq::Vector{Int64}
: Indices related to demand buses.pvpq::Vector{Int64}
: Indices related to demand and generator buses.acmodel::Int64
: Tracks values changing in entries of the Jacobian matrices.pattern::Int64
: Tracks pattern changes in entries of the Jacobian matrices.bx::Bool
: Version of the method, either BX or XB.
JuliaGrid.GaussSeidel
— TypeGaussSeidel
A composite type built using the gaussSeidel
function to define the AC power flow model, which will be solved using the Gauss-Seidel method.
Fields
voltage::Vector{ComplexF64}
: Vector of complex voltage values.pq::Vector{Int64}
: Indices related to demand buses.pv::Vector{Int64}
: Indices related to generator buses.
JuliaGrid.DCPowerFlow
— TypeDCPowerFlow <: DC
A composite type built using the dcPowerFlow
function to define the DC power flow model.
Fields
voltage::PolarAngle
: Bus voltage angles.power::DCPower
: Active powers at the buses, branches, and generators.method::DCPowerFlowMethod
: Factorization of the nodal admittance matrix.
Optimal Power Flow
JuliaGrid.ACOptimalPowerFlow
— TypeACOptimalPowerFlow <: AC
A composite type built using the acOptimalPowerFlow
function to define the AC optimal power flow model.
Fields
voltage::Polar
: Bus voltages represented in polar form.power::ACPower
: Active and reactive powers at buses, branches, and generators.current::ACCurrent
: Currents at buses and branches.method::ACOptimalPowerFlowMethod
: The JuMP model, including variables, constraints, and objective.
JuliaGrid.DCOptimalPowerFlow
— TypeDCOptimalPowerFlow <: DC
A composite type built using the dcOptimalPowerFlow
function to define the DC optimal power flow model.
Fields
voltage::PolarAngle
: Bus voltage angles.power::DCPower
: Active powers at buses, branches, and generators.method::DCOptimalPowerFlowMethod
: The JuMP model, including variables, constraints, and objective.
Observability Analysis
JuliaGrid.Island
— TypeIsland
A composite type built using the islandTopologicalFlow
and islandTopological
functions, which holds data about observable islands.
Fields
island::Vector{Vector{Int64}}
: List of observable islands, represented by a vector of bus indices.bus::Vector{Int64}
: Positions of buses in relation to each island.tie::TieData
: Tie data associated with buses and branches.
JuliaGrid.PMUPlacement
— TypePMUPlacement
A composite type built using the pmuPlacement
function, which stores data on optimal PMU placement.
Fields
bus::LabelDict
: Phasor measurement placement at buses.from::LabelDict
: Phasor measurement placement at from-buses.to::LabelDict
: Phasor measurement placement at to-buses.
State Estimation
JuliaGrid.ACStateEstimation
— TypeACStateEstimation{T} <: AC where T <: Union{GaussNewton, LAV}
A composite type representing an AC state estimation model, where the type parameter T
specifies the estimation method. Supported methods include GaussNewton
and LAV
. The model is constructed using either the gaussNewton
or acLavStateEstimation
function.
Fields
voltage::Polar
: Bus voltages represented in polar form.power::ACPower
: Active and reactive powers at the buses and branches.current::ACCurrent
: Currents at the buses and branches.method::T
: The estimation model associated with the method used to solve the AC state estimation.
JuliaGrid.PMUStateEstimation
— TypePMUStateEstimation{T} <: AC where T <: Union{WLS, LAV}
A composite type representing a PMU state estimation model, where the type parameter T
specifies the estimation method. Supported methods include WLS
and LAV
. The model is constructed using either the pmuStateEstimation
or pmuLavStateEstimation
function.
Fields
voltage::Polar
: Bus voltages represented in polar form.power::ACPower
: Active and reactive powers at the buses and branches.current::ACCurrent
: Currents at the buses and branches.method::T
: The estimation model associated with the method used to solve the PMU state estimation.
JuliaGrid.DCStateEstimation
— TypeDCStateEstimation{T} <: DC where T <: Union{WLS, LAV}
A composite type representing a DC state estimation model, where the type parameter T
specifies the estimation method. Supported methods include WLS
and LAV
. The model is constructed using either the dcStateEstimation
or dcLavStateEstimation
function.
Fields
voltage::PolarAngle
: Bus voltage angles.power::DCPower
: Active powers at the buses and generators.method::T
: The estimation model associated with the method used to solve the DC state estimation.
JuliaGrid.GaussNewton
— TypeGaussNewton{T <: Union{Normal, Orthogonal}}
A composite type built using the gaussNewton
function to define the AC state estimation model, which will be solved using the Gauss-Newton method.
Fields
jacobian::SparseMatrixCSC{Float64, Int64}
: Jacobian matrix.precision::SparseMatrixCSC{Float64, Int64}
: Precision matrix.mean::Vector{Float64}
: Mean vector.residual::Vector{Float64}
: Residual vector.increment::Vector{Float64}
: Increment vector.factorization::Factorization{Float64}
: Factorization of the Jacobian matrix.objective::Float64
: Value of the objective function.type::Vector{Int8}
: Indicators of measurement types.index::Vector{Int64}
: Indices of buses and branches where measurements are located.range::Vector{Int64}
: Range of measurement devices.pattern::Int64
: Tracks pattern changes in the Jacobian matrix.
JuliaGrid.WLS
— TypeWLS{T <: Union{Normal, Orthogonal}}
A composite type representing a linear weighted least-squares state estimation model.
Fields
coefficient::SparseMatrixCSC{Float64, Int64}
: Coefficient matrix.precision::SparseMatrixCSC{Float64, Int64}
: Precision matrix.mean::Vector{Float64}
: Mean vector.factorization::Factorization{Float64}
: Factorization of the coefficient matrix.number::Int64
: Number of measurement devices.pattern::Int64
: Tracks pattern changes in the coefficient matrix.run::Bool
: Indicates whether factorization can be reused.
JuliaGrid.LAV
— TypeLAV
A composite type representing a least absolute value state estimation model.
Fields
jump::JuMP.Model
: The JuMP model.state::Union{StateAC, Nothing}
: State variables data.statex::Vector{VariableRef}
: References to optimization variables for bus voltages.statey::Vector{VariableRef}
: References to optimization variables for bus voltages.residualx::Vector{VariableRef}
: References to optimization variables for residuals.residualy::Vector{VariableRef}
: References to optimization variables for residuals.residual::Dict{Int64, ConstraintRef}
: References to the residual constraints.range::Vector{Int64}
: Range of measurement devices.number::Int64
: Number of measurement devices.
JuliaGrid.Normal
— TypeNormal
An abstract type representing weighted least-squares state estimation, where the normal equation is solved by factorizing the gain matrix and performing forward/backward substitutions on the right-hand-side vector. It is used as a type parameter in GaussNewton
WLS
models.
JuliaGrid.Orthogonal
— TypeOrthogonal
An abstract type representing weighted least-squares state estimation, where the normal equation is solved using an orthogonal method. It is used as a type parameter in GaussNewton
and WLS
models.