API Reference

Power Flow Algorithm

TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.adaptive_damped_newtonFunction
adaptive_damped_newton(baseMVA, bus, gen, load, pvarray, Ybus, V0, ref, p, tol0, max_it0, alg="")

Solve power flow using an adaptive damped Newton-Raphson method.

This function implements a Newton-Raphson method with adaptive damping factor to improve convergence in difficult cases. The damping factor is automatically adjusted based on the mismatch norm during iterations.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix
  • gen: Generator data matrix
  • load: Load data matrix
  • pvarray: PV array data
  • Ybus: Bus admittance matrix
  • V0: Initial voltage vector
  • ref: Reference bus index
  • p: Vector of bus indices
  • tol0: Convergence tolerance
  • max_it0: Maximum number of iterations
  • alg: Linear solver algorithm (optional)

Returns

  • V: Final voltage solution vector
  • converged: Boolean indicating convergence status
  • i: Number of iterations performed
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.currentinjectionpfFunction
currentinjectionpf(baseMVA, bus, gen, load, pvarray, Ybus, V0, ref, p, tol0, max_it0, alg="")

Solve power flow using the Current Injection method, particularly suitable for resistive networks.

Arguments

  • baseMVA: Base MVA for power system normalization
  • bus: Matrix containing bus data
  • gen: Matrix containing generator data
  • load: Matrix containing load data
  • pvarray: Array of PV bus information
  • Ybus: Bus admittance matrix
  • V0: Initial voltage vector
  • ref: Reference (slack) bus index
  • p: Array of PQ bus indices
  • tol0: Convergence tolerance
  • max_it0: Maximum number of iterations
  • alg: Algorithm variant (optional)

Returns

  • V: Final complex voltage vector solution
  • converged: Boolean indicating whether the algorithm converged
  • i: Number of iterations performed

Description

This function implements the Current Injection power flow method, which is particularly effective for networks with high R/X ratios (resistive networks). The method works by:

  1. Converting power injections to current injections
  2. Calculating current mismatches
  3. Solving for voltage updates using the real part of the admittance matrix
  4. Iterating until convergence or maximum iterations reached
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.newtonpfFunction
newtonpf(baseMVA::Float64, bus::Matrix{Float64}, gen::Matrix{Float64}, 
         Ybus::SparseArrays.SparseMatrixCSC{ComplexF64}, V0::Vector{ComplexF64}, 
         ref::Vector{Int}, pv::Vector{Int}, pq::Vector{Int}, 
         tol0::Float64, max_it0::Int, alg::String="bicgstab")

Solve AC power flow using Newton-Raphson method.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix
  • gen: Generator data matrix
  • Ybus: Bus admittance matrix
  • V0: Initial voltage vector
  • ref: Reference bus indices
  • pv: PV bus indices
  • pq: PQ bus indices
  • tol0: Convergence tolerance
  • max_it0: Maximum number of iterations
  • alg: Algorithm specification for linear solver (default: "bicgstab")

Returns

  • V: Final voltage vector solution
  • converged: Boolean indicating whether the algorithm converged
  • i: Number of iterations performed
  • norm_history: Array of norm values for each iteration

Description

This function implements the Newton-Raphson method to solve AC power flow equations. It iteratively updates voltage magnitudes and angles until the power mismatch falls below the specified tolerance or the maximum number of iterations is reached.

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.newtonpfFunction
newtonpf(baseMVA::Float64, bus::Matrix{Float64}, gen::Matrix{Float64}, 
    load::Matrix{Float64}, pvarray, Ybus::SparseArrays.SparseMatrixCSC{ComplexF64}, V0::Vector{ComplexF64}, 
    ref::Vector{Int}, pv::Vector{Int}, pq::Vector{Int}, 
    tol0::Float64, max_it0::Int, alg::String="bicgstab")

Solve AC power flow using Newton-Raphson method with load and PV array models.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix
  • gen: Generator data matrix
  • load: Load data matrix
  • pvarray: PV array data
  • Ybus: Bus admittance matrix
  • V0: Initial voltage vector
  • ref: Reference bus indices
  • pv: PV bus indices
  • pq: PQ bus indices
  • tol0: Convergence tolerance
  • max_it0: Maximum number of iterations
  • alg: Algorithm specification for linear solver (default: "bicgstab")

Returns

  • V: Final voltage vector solution
  • converged: Boolean indicating whether the algorithm converged
  • i: Number of iterations performed
  • norm_history: Array of norm values for each iteration

Description

This function implements the Newton-Raphson method to solve AC power flow equations with load and PV array models. It iteratively updates voltage magnitudes and angles until the power mismatch falls below the specified tolerance or the maximum number of iterations is reached.

source

DC Power Flow Algorithm

TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.newtondcpfFunction
newtondcpf(baseMVA, bus, gen, load, pvarray, Ybus, V0, ref, p, tol0, max_it0, alg="")

Solve DC power flow using Newton's method.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix
  • gen: Generator data matrix
  • load: Load data matrix
  • pvarray: PV array data
  • Ybus: Bus admittance matrix
  • V0: Initial voltage vector
  • ref: Reference bus index
  • p: Vector of indices for buses to be included in the calculation
  • tol0: Convergence tolerance
  • max_it0: Maximum number of iterations
  • alg: Algorithm specification for linear solver (optional)

Returns

  • V: Final voltage vector solution
  • converged: Boolean indicating whether the algorithm converged
  • i: Number of iterations performed

Description

This function implements the Newton-Raphson method to solve DC power flow equations. It iteratively updates voltage values until the power mismatch falls below the specified tolerance or the maximum number of iterations is reached.

The algorithm:

  1. Initializes voltage values from the provided starting point
  2. Calculates initial power mismatches
  3. Constructs the Jacobian matrix for each iteration
  4. Updates voltage values using Newton's method
  5. Checks convergence based on power mismatch norm

Notes

  • The Jacobian matrix represents the partial derivatives of power with respect to voltage
  • This implementation handles both real power balance constraints
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.newtondcpf_spFunction
newtondcpf_sp(baseMVA, bus, gen, load, pvarray, Ybus, V0, ref, p, tol0, max_it0, alg="")

Solve DC power flow using Newton's method with sparse matrices.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix
  • gen: Generator data matrix
  • load: Load data matrix
  • pvarray: PV array data
  • Ybus: Bus admittance matrix
  • V0: Initial voltage vector
  • ref: Reference bus index
  • p: Vector of indices for buses to be included in the calculation
  • tol0: Convergence tolerance
  • max_it0: Maximum number of iterations
  • alg: Algorithm specification (optional)

Returns

  • V: Final voltage vector solution
  • converged: Boolean indicating whether the algorithm converged
  • i: Number of iterations performed

Description

This function solves DC power flow using Newton's method. In DC systems, power P = V * I, where I = G * V (G is the conductance matrix). The function iteratively updates voltage magnitudes until the power mismatch falls below the specified tolerance or the maximum number of iterations is reached.

The algorithm:

  1. Initializes voltage values from the provided starting point
  2. Calculates initial power mismatches
  3. Constructs the Jacobian matrix for each iteration
  4. Updates voltage values using Newton's method
  5. Checks convergence based on power mismatch norm

Notes

  • For DC systems, only active power is considered
  • The Jacobian matrix represents the partial derivatives of power with respect to voltage
source

Linear Problem Solution Algorithm

GPU Acceleration

Other Functions

TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.calculate_pv_powerMethod
calculate_pv_power(pvarray, bus, Vm, baseMVA)

Calculate power injection from PV arrays and its derivative with respect to voltage magnitude.

Arguments

  • pvarray: PV array data matrix with columns representing PV parameters
  • bus: Bus data matrix with columns representing bus parameters
  • Vm: Vector of bus voltage magnitudes
  • baseMVA: Base MVA for the system

Returns

  • Spv: Vector of complex power injections from PV arrays
  • dSpv_dVm: Sparse matrix of partial derivatives of PV power injections with respect to voltage magnitude

Description

This function calculates the power injection from PV arrays based on a modified power function model that accounts for the PV array characteristics including open circuit voltage, short circuit current, and maximum power point voltage. It also computes the derivatives of these injections with respect to bus voltage magnitudes, which are needed for power flow Jacobian calculations.

The PV model uses a modified power function with correction terms to better represent the current-voltage characteristics of PV panels: I = Isc * (1 - (V/Voc)^a)^b * (1 - c * ((V/Vmpp) - 1)^2)

Notes

  • Only active PV arrays (PVINSERVICE > 0) are considered
  • The function maps PV arrays to their respective buses using the bus numbering
  • Power output is converted to per-unit on system MVA base
  • Only real power (no reactive power) is considered for PV arrays
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.makeSbusFunction
makeSbus(baseMVA, bus, gen, Vm, Sg=nothing, return_derivative=false)

Build the vector of complex bus power injections (simplified version without PV arrays).

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix with columns representing bus parameters
  • gen: Generator data matrix with columns representing generator parameters
  • Vm: Vector of bus voltage magnitudes

Keyword Arguments

  • Sg: Optional pre-computed generator complex power injections (default: nothing)
  • return_derivative: Boolean indicating whether to return derivative of Sbus with respect to Vm (default: false)

Returns

  • If return_derivative=false: Vector of complex bus power injections (Sbus)
  • If return_derivative=true: Sparse matrix of partial derivatives of power injections with respect to voltage magnitude (dSbus_dVm)

Description

This is a simplified version of the makeSbus function that does not include PV array contributions. It computes the vector of complex bus power injections (Sbus) for power flow analysis, accounting for ZIP load models and generator injections.

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.makeSbusMethod
makeSbus(baseMVA, bus, gen, Vm, load::Matrix{Float64}, pvarray; dc=false, Sg=nothing, return_derivative=false)

Build the vector of complex bus power injections, including PV array contributions.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix with columns representing bus parameters
  • gen: Generator data matrix with columns representing generator parameters
  • Vm: Vector of bus voltage magnitudes
  • load: Load data matrix with columns representing load parameters
  • pvarray: PV array data matrix with columns representing PV parameters

Keyword Arguments

  • dc: Boolean indicating whether to use DC power flow assumptions (default: false)
  • Sg: Optional pre-computed generator complex power injections (default: nothing)
  • return_derivative: Boolean indicating whether to return derivative of Sbus with respect to Vm (default: false)

Returns

  • If return_derivative=false: Vector of complex bus power injections (Sbus)
  • If return_derivative=true: Sparse matrix of partial derivatives of power injections with respect to voltage magnitude (dSbus_dVm)

Description

This function computes the vector of complex bus power injections (Sbus) for power flow analysis. It accounts for ZIP load models, generator injections, and PV array contributions.

When return_derivative=true, it returns the partial derivatives of the power injections with respect to voltage magnitude, which is useful for power flow Jacobian calculations.

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.SdType
Sd

A mutable structure to store ZIP load model components.

Fields

  • z: Complex vector representing constant impedance component of load
  • i: Complex vector representing constant current component of load
  • p: Complex vector representing constant power component of load

This structure is used to store the components of the ZIP load model for efficient power flow calculations.

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.makeSdzipMethod
makeSdzip(baseMVA, bus, pw_1, pw_2, pw_3)

Create a ZIP load model structure from bus data and specified ZIP percentages.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix with columns representing bus parameters
  • pw_1: Vector of constant power percentages for active power
  • pw_2: Vector of constant current percentages for active power
  • pw_3: Vector of constant impedance percentages for active power

Returns

  • sd: An Sd structure containing the ZIP load model components

Description

This function creates a ZIP (constant impedance, constant current, constant power) load model for power flow calculations. It converts the load data from the bus matrix to per-unit values based on the system MVA base and the specified percentages for each component.

The function assumes that the same percentage distribution applies to both active and reactive power, so it uses the same percentages (pw1, pw2, pw_3) for both P and Q components.

Notes

  • All power values are converted to per-unit on system MVA base
  • PD and QD columns in bus represent the total active and reactive power demand
  • pw1, pw2, pw_3 represent the percentages of constant power, constant current, and constant impedance components
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.makeSdzipMethod
makeSdzip(baseMVA, bus)

Create a ZIP load model structure from bus data with default constant power model.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix with columns representing bus parameters

Returns

  • sd: An Sd structure containing the ZIP load model components

Description

This is a simplified version of the makeSdzip function that assumes a constant power model (100% constant power, 0% constant current, 0% constant impedance).

Notes

  • All power values are converted to per-unit on system MVA base
  • PD and QD columns in bus represent the total active and reactive power demand
  • By default, all load is modeled as constant power (P-Q) load
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.makeYbusMethod
makeYbus(baseMVA, bus, branch)

Build the bus admittance matrix and branch admittance matrices.

Arguments

  • baseMVA: Base MVA for the system
  • bus: Bus data matrix with columns representing bus parameters
  • branch: Branch data matrix with columns representing branch parameters

Returns

  • Ybus: Bus admittance matrix
  • Yf: Branch admittance matrix for "from" end of branches
  • Yt: Branch admittance matrix for "to" end of branches

Description

This function builds the bus admittance matrix (Ybus) and branch admittance matrices (Yf and Yt) for a given power system network. The admittance matrices are essential components for power flow and other power system analyses.

The function:

  1. Computes branch series admittances and line charging susceptances
  2. Handles tap ratios and phase shifters
  3. Incorporates bus shunt admittances
  4. Builds connection matrices between branches and buses
  5. Constructs the complete bus admittance matrix

Notes

  • All admittance values are in per-unit on system MVA base
  • Requires buses to be numbered consecutively (internal ordering)
  • Branch status values determine which branches are in service
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.merge_resultsMethod
merge_results(results)

Merge power flow calculation results from multiple isolated islands.

Arguments

  • results: An array of JPC objects containing power flow results for different islands

Returns

  • merged_result: A single JPC object containing the combined results
  • area: The number of islands that were merged

Description

This function combines power flow results from multiple isolated islands into a single comprehensive result. It merges all data matrices (buses, branches, generators, etc.) from the individual island results and sorts them by their ID numbers.

The function:

  1. Creates a new JPC object to hold the merged results
  2. Combines basic result fields like success status and iteration counts
  3. Merges all data matrices from the input results
  4. Sorts the merged matrices by their first column (typically ID numbers)

Notes

  • Assumes all input results use the same base MVA
  • Success is determined by the logical AND of all individual results' success flags
  • Iteration count is the maximum of all individual results' iteration counts
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.dcpfsolnMethod
dcpfsoln(baseMVA::Float64, bus0::Matrix{Float64}, gen0::Matrix{Float64}, 
         branch0::Matrix{Float64}, load0::Matrix{Float64}, Ybus, Yf, Yt, V, ref, p)

Update power system state variables after a DC power flow solution.

Arguments

  • baseMVA::Float64: Base MVA value for the system
  • bus0::Matrix{Float64}: Initial bus data matrix
  • gen0::Matrix{Float64}: Initial generator data matrix
  • branch0::Matrix{Float64}: Initial branch data matrix
  • load0::Matrix{Float64}: Load data matrix
  • Ybus: Bus admittance matrix
  • Yf: From-bus branch admittance matrix
  • Yt: To-bus branch admittance matrix
  • V: Complex bus voltage vector solution
  • ref: Reference (slack) bus indices
  • p: P bus indices

Returns

  • bus: Updated bus data matrix
  • gen: Updated generator data matrix
  • branch: Updated branch data matrix with power flows

Description

This function updates the power system state variables after a DC power flow solution has been obtained. It performs the following operations:

  1. Updates bus voltage magnitudes
  2. Updates generator reactive power (Qg) for generators at PV and slack buses
    • Distributes reactive power proportionally among multiple generators at the same bus
    • Respects generator reactive power limits
  3. Updates active power (Pg) for generators at slack buses
  4. Calculates branch power flows
  5. Expands the branch matrix if needed to store power flow results

The function handles special cases like multiple generators at the same bus and generators with identical reactive power limits.

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.process_resultMethod

Process power flow calculation results and generate a report. This function merges results, extracts execution time, and creates a MATPOWER format report.

Parameters:

  • results: Array containing calculation results and timing information
  • isolated: Information about isolated parts of the network
  • file_path: Path where the report will be saved
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.analyze_voltage_resultsMethod
analyze_voltage_results(results::NamedTuple, case::JuliaPowerCase, reference_file::String;
                       tolerance_mag::Float64=1e-4, tolerance_ang::Float64=1e-3,
                       output_dir::String="./results")

Analyze voltage differences between power flow calculation results and reference file, generate comparison reports and charts. Supports both original format and AC/DC mixed format. Parameters:

  • results: NamedTuple containing results in JPC format (typically the return value of power flow calculation)
  • case: Original JuliaPowerCase object, used to get node names and ID mappings
  • reference_file: Path to Excel file containing reference voltage values
  • tolerance_mag: Tolerance for voltage magnitude comparison (default: 1e-4)
  • tolerance_ang: Tolerance for voltage angle comparison (default: 1e-3)
  • output_dir: Output directory (default: "./results")

Returns:

  • DataFrame or NamedTuple containing comparison results
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.compare_voltage_resultsMethod
compare_voltage_results(results::NamedTuple, case::JuliaPowerCase, reference_file::String; 
                       tolerance_mag::Float64=1e-4, tolerance_ang::Float64=1e-3)

Compare power flow calculation results in JPC format with reference voltage values, using JuliaPowerCase for node mapping. Supports both original format and new format with mixed AC/DC data. Parameters:

  • results: NamedTuple containing results in JPC format (typically the return value of power flow calculation)
  • case: Original JuliaPowerCase object, used to get node names and ID mappings
  • reference_file: Path to Excel file containing reference voltage values
  • tolerance_mag: Tolerance for voltage magnitude comparison (default: 1e-4)
  • tolerance_ang: Tolerance for voltage angle comparison (default: 1e-3)

Returns:

  • NamedTuple containing comparison results, including ac and dc DataFrames
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.get_bus_voltage_resultsMethod
get_bus_voltage_results(results::NamedTuple, case::JuliaPowerCase)

Extract bus voltage information from power flow calculation results in JPC format, and map to node names in JuliaPowerCase. Parameters:

  • results: NamedTuple containing results in JPC format (typically the return value of power flow calculation)
  • case: Original JuliaPowerCase object, used to get node names and ID mappings

Returns:

  • DataFrame containing bus voltage results
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.get_bus_voltage_results_acdcMethod
get_bus_voltage_results_acdc(results::NamedTuple, case::JuliaPowerCase)

Extract both AC and DC bus voltage information from power flow calculation results in JPC format, and map to node names in JuliaPowerCase. Parameters:

  • results: NamedTuple containing results in JPC format (typically the return value of power flow calculation)
  • case: Original JuliaPowerCase object, used to get node names and ID mappings

Returns:

  • NamedTuple containing AC and DC bus voltage results as two DataFrames: ac and dc
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.plot_voltage_comparisonFunction
plot_voltage_comparison(comparison_results, output_file::String="voltage_comparison.png";
                       show_plot::Bool=true)

Plot voltage magnitude and angle comparison curves between calculated and reference values. Supports both original format and AC/DC mixed format. Parameters:

  • comparison_results: Can be a DataFrame or a NamedTuple containing ac and dc DataFrames
  • outputfile: Path to save the chart file (default: "voltagecomparison.png")
  • show_plot: Whether to display the chart (default: true)

Returns:

  • Generated chart object or NamedTuple containing chart objects
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.plot_voltage_errorsFunction
plot_voltage_errors(comparison_results, output_file::String="voltage_errors.png";
                   show_plot::Bool=true)

Plot voltage magnitude and angle error curves. Supports both original format and AC/DC mixed format. Parameters:

  • comparison_results: Can be a DataFrame or a NamedTuple containing ac and dc DataFrames
  • outputfile: Path to save the chart file (default: "voltageerrors.png")
  • show_plot: Whether to display the chart (default: true)

Returns:

  • Generated chart object or NamedTuple containing chart objects
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.calculate_droop_voltageFunction
calculate_droop_voltage(P_dc, k_p, U_dc_ref=1.0, U_dc_min=0.95, U_dc_max=1.05)

Calculate DC voltage with droop control using the equation: Udc = Udcref - kp * P_dc Limits the output voltage to be within specified minimum and maximum values.

Parameters:

  • P_dc: DC power
  • k_p: Droop coefficient
  • Udcref: Reference DC voltage (default: 1.0 p.u.)
  • Udcmin: Minimum allowed DC voltage (default: 0.95 p.u.)
  • Udcmax: Maximum allowed DC voltage (default: 1.05 p.u.)

Returns:

  • Limited DC voltage value
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.runhpfMethod
runhpf(jpc, opt)

Run hybrid power flow calculation for integrated AC/DC systems. Iteratively solves AC and DC power flow while updating converter power exchanges. Supports different converter control modes.

Parameters:

  • jpc: JPC object containing both AC and DC system data
  • opt: Options for power flow calculation

Returns:

  • Updated JPC object with power flow results
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_ac_load!Method
update_ac_load!(result_jpc, jpc1, ac_bus_id, P_ac)

Helper function to update AC side load with power from converter. Creates a new load if none exists at the specified bus.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • acbusid: ID of the AC bus to update
  • P_ac: AC power to add to the load
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_dc_load!Method
update_dc_load!(result_jpc, jpc2, dc_bus_id, P_dc)

Helper function to update DC side load with power from converter. Creates a new load if none exists at the specified bus.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc2: JPC object for DC system
  • dcbusid: ID of the DC bus to update
  • P_dc: DC power to add to the load
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_mode_1_converters!Method
update_mode_1_converters!(result_jpc, jpc1, jpc2, current_power_values)

Update converters with mode constant δs, Us (CONV_MODE==1). These converters have fixed AC voltage angle and magnitude, and the power is calculated from AC side.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • jpc2: JPC object for DC system
  • currentpowervalues: Dictionary to store current power values for convergence check
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_mode_3_converters!Method
update_mode_3_converters!(result_jpc, jpc1, jpc2, current_power_values)

Update converters with mode constant Ps, Us (CONV_MODE==3). These converters have fixed active power and AC voltage magnitude.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • jpc2: JPC object for DC system
  • currentpowervalues: Dictionary to store current power values for convergence check
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_mode_4_converters!Method
update_mode_4_converters!(result_jpc, jpc1, jpc2, current_power_values)

Update converters with mode constant Udc, Qs (CONV_MODE==4). These converters have fixed DC voltage and reactive power.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • jpc2: JPC object for DC system
  • currentpowervalues: Dictionary to store current power values for convergence check
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_mode_5_converters!Method
update_mode_5_converters!(result_jpc, jpc1, jpc2, current_power_values)

Update converters with mode constant Udc, Us (CONV_MODE==5). These converters have fixed DC voltage and AC voltage magnitude.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • jpc2: JPC object for DC system
  • currentpowervalues: Dictionary to store current power values for convergence check
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_mode_6_converters!Method
update_mode_6_converters!(result_jpc, jpc1, jpc2, current_power_values)

Update converters with mode Droop Udc, Constant Qs (CONV_MODE==6). These converters use DC voltage droop control and maintain constant reactive power.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • jpc2: JPC object for DC system
  • currentpowervalues: Dictionary to store current power values for convergence check
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.update_mode_7_converters!Method
update_mode_7_converters!(result_jpc, jpc1, jpc2, current_power_values)

Update converters with mode Droop Udc, Constant Us (CONV_MODE==7). These converters use DC voltage droop control and maintain constant AC voltage magnitude.

Parameters:

  • result_jpc: Main JPC object containing all system data
  • jpc1: JPC object for AC system
  • jpc2: JPC object for DC system
  • currentpowervalues: Dictionary to store current power values for convergence check
source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.runupfMethod
runupf(case, jpc_3ph, gs_eg, bs_eg, opt)

This function is used to run a local unbalanced power flow analysis on unsymmetrical load nodes

#Step1: find the unbalanced nodes in the system #Step2: find the interface branches of the unbalanced nodes and balanced nodes

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.total_loadMethod
total_load(bus, load)

Calculate the total fixed and dispatchable load at each bus in the system, considering ZIP load model.

Arguments

  • bus: Bus data matrix containing bus information
  • load: Load data matrix containing load model percentages

Returns

  • Pd: Vector of real power demand at each bus
  • Qd: Vector of reactive power demand at each bus (if want_Q=1)

This function computes the total load at each bus using the ZIP load model, which represents loads as a combination of constant impedance (Z), constant current (I), and constant power (P) components. The percentages for each component are specified in the load matrix.

source
TimeSeriesPowerFlow.TimeDomainPowerFlow.PowerFlow.total_loadMethod
total_load(bus)

Calculate the total fixed and dispatchable load at each bus in the system using default ZIP parameters.

Arguments

  • bus: Bus data matrix containing bus information

Returns

  • Pd: Vector of real power demand at each bus
  • Qd: Vector of reactive power demand at each bus (if want_Q=1)

This is an overloaded version of total_load that uses default ZIP model parameters. It computes the total load at each bus using the standard ZIP load model with default percentages for constant impedance (Z), constant current (I), and constant power (P) components.

source