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.PowerSystemType
PowerSystem

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.
source
JuliaGrid.BusType
Bus

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.
source
JuliaGrid.BranchType
Branch

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.
source
JuliaGrid.GeneratorType
Generator

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.
source
JuliaGrid.ModelType
Model

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.
source

Measurement Model

JuliaGrid.MeasurementType
Measurement

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.
source
JuliaGrid.VoltmeterType
Voltmeter

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.
source
JuliaGrid.AmmeterType
Ammeter

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.
source
JuliaGrid.WattmeterType
Wattmeter

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.
source
JuliaGrid.VarmeterType
Varmeter

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.
source
JuliaGrid.PMUType
PMU

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.
source

Analysis

JuliaGrid.ACType
AC <: Analysis

An abstract type representing AC analyses in JuliaGrid.

source
JuliaGrid.DCType
DC <: Analysis

An abstract type representing DC analyses in JuliaGrid.

source
JuliaGrid.LDLtType
LDLt

An abstract type used for representing LDLt factorization in JuliaGrid.

source
JuliaGrid.LUType
LU

An abstract type used for representing LU factorization in JuliaGrid.

source
JuliaGrid.QRType
QR

An abstract type used for representing QR factorization in JuliaGrid.

source

Power Flow

JuliaGrid.ACPowerFlowType
ACPowerFlow{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.
source
JuliaGrid.NewtonRaphsonType
NewtonRaphson

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.
source
JuliaGrid.FastNewtonRaphsonType
FastNewtonRaphson

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.
source
JuliaGrid.GaussSeidelType
GaussSeidel

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.
source
JuliaGrid.DCPowerFlowType
DCPowerFlow <: 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.
source

Optimal Power Flow

JuliaGrid.ACOptimalPowerFlowType
ACOptimalPowerFlow <: 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.
source
JuliaGrid.DCOptimalPowerFlowType
DCOptimalPowerFlow <: 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.
source

Observability Analysis

JuliaGrid.IslandType
Island

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.
source
JuliaGrid.PMUPlacementType
PMUPlacement

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.
source

State Estimation

JuliaGrid.ACStateEstimationType
ACStateEstimation{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.
source
JuliaGrid.PMUStateEstimationType
PMUStateEstimation{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.
source
JuliaGrid.DCStateEstimationType
DCStateEstimation{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.
source
JuliaGrid.GaussNewtonType
GaussNewton{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.
source
JuliaGrid.WLSType
WLS{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.
source
JuliaGrid.LAVType
LAV

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.
source
JuliaGrid.NormalType
Normal

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.

source
JuliaGrid.OrthogonalType
Orthogonal

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.

source