Internal

PowerSimulationsDynamics.BranchWrapperType

Wraps DynamicBranch devices from PowerSystems to handle changes in controls and connection status, and allocate the required indexes of the state space.

PowerSimulationsDynamics.DynamicWrapperType

Wraps DynamicInjection devices from PowerSystems to handle changes in controls and connection status, and allocate the required indexes of the state space.

PowerSimulationsDynamics.generator_inner_varsType

Generator Inner Vars:

  • τe_var :: Electric torque
  • τm_var :: Mechanical torque
  • Vf_var :: Field voltage
  • V_pss_var :: Additional PSS voltage
  • VR_gen_var :: Real part of the terminal voltage
  • VI_gen_var :: Imaginary part of the terminal voltage
  • ψd_var :: Stator Flux (if defined) in the d-axis
  • ψq_var :: Stator Flux (if defined) in the q-axis
PowerSimulationsDynamics.inverter_inner_varsType

Inverter Inner Vars:

  • md_var :: Modulation signal on the d-component
  • mq_var :: Modulation signal on the q-component
  • Vdc_var :: DC voltage supplied by the DC source
  • Vr_filter_var :: Voltage seen in the capacitor of the filter in the R-component
  • Vi_filter_var :: Voltage seen in the capacitor of the filter in the I-component
  • θ_freq_estimator_var :: Angle estimated by the frequency estimator.
  • ω_freq_estimator_var :: Frequency estimated by the frequency estimator.
  • V_oc_var :: Control voltage reference in the d-axis supplied from the outer loop control to the inner loop (for Voltage Mode Control)
  • Id_oc_var :: Control current reference in the d-axis supplied from the outer loop control to the inner loop (for Current Mode Control)
  • Iq_oc_var :: Control current reference in the q-axis supplied from the outer loop control to the inner loop (for Current Mode Control)
  • Id_ic_var :: Control current reference in the d-axis supplied from the inner loop control to the converter (for Generic Models)
  • Iq_ic_var :: Control current reference in the q-axis supplied from the inner loop control to the converter (for Generic Models)
  • Ir_cnv_var :: Control current reference in the R-axis supplied from the converter to the filter (for Generic Models)
  • Ii_cnv_var :: Control current reference in the I-axis supplied from the converter to the filter (for Generic Models)
  • ω_oc_var :: Control frequency supplied from the outer loop control the inner loop
  • θ_oc_var :: Variation of the angle (PLL or VSM) of the inverter
  • Vr_inv_var :: Real terminal voltage on the inverter
  • Vi_inv_var :: Imaginary terminal voltage on the inverter
  • Vr_cnv_var :: Voltage supplied from the converter in the R-component
  • Vi_cnv_var :: Voltage supplied from the converter in the I-component
  • P_ES_var :: Power supplied from the Energy Source side
PowerSimulationsDynamics._field_currentMethod

Function to obtain the field current time series of a Dynamic Generator. It is dispatched via the machine type. By default, machine does not have support for field current

PowerSimulationsDynamics._field_voltageMethod

Function to obtain the field voltage time series of a Dynamic Generator with avrs that have the field voltage as a state. By default it is assumed that the models have that state.

PowerSimulationsDynamics._frequencyMethod

Function to obtain the frequency time series of a droop grid forming inverter out of the DAE Solution. It is dispatched via the OuterControl type.

PowerSimulationsDynamics._frequencyMethod

Function to obtain the frequency time series of a VOC grid forming inverter out of the DAE Solution. It is dispatched via the OuterControl type.

PowerSimulationsDynamics._frequencyMethod

Function to obtain the frequency time series of a virtual inertia grid forming inverter out of the DAE Solution. It is dispatched via the OuterControl type.

PowerSimulationsDynamics._frequencyMethod

Function to obtain the frequency time series of a grid-following inverter with KauraPLL out of the DAE Solution. It is dispatched via the OuterControl and FrequencyEstimator type.

PowerSimulationsDynamics._frequencyMethod

Function to obtain the frequency time series of a grid-following inverter with ReducedOrderPLL out of the DAE Solution. It is dispatched via the OuterControl and FrequencyEstimator type.

PowerSimulationsDynamics._machine_currentMethod

Function to obtain the output current time series of a SimpleMarconato or SimpleAndersonFouad model out of the DAE Solution. It is dispatched via the machine type.

PowerSimulationsDynamics.compute_field_currentMethod

Function to obtain the field current time series of a Dynamic Generator model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific current.

PowerSimulationsDynamics.compute_field_currentMethod

Function to obtain the field current time series of a Dynamic Inverter model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It must return nothing since field current does not exists in inverters.

PowerSimulationsDynamics.compute_field_voltageMethod

Function to obtain the field voltage time series of a Dynamic Generator model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific voltage.

PowerSimulationsDynamics.compute_field_voltageMethod

Function to obtain the field current time series of a Dynamic Inverter model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It must return nothing since field voltage does not exists in inverters.

PowerSimulationsDynamics.compute_mechanical_torqueMethod

Function to obtain the mechanical torque time series of a Dynamic Generator model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific torque.

PowerSimulationsDynamics.compute_mechanical_torqueMethod

Function to obtain the mechanical torque time series of a Dynamic Inverter model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It must return nothing since mechanical torque is not used in inverters.

PowerSimulationsDynamics.compute_output_currentMethod

Function to obtain the output current time series of a AggregateDistributedGenerationA (DERA) model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage.

PowerSimulationsDynamics.compute_output_currentMethod

Function to obtain the output current time series of a PeriodicVariableSource model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific current. computeoutputcurrent(::SimulationResults, ::PeriodicVariableSource, ::Vector{Float64}, ::Vector{Float64}, ::Nothing)

PowerSimulationsDynamics.compute_output_currentMethod

Function to obtain the output current time series of a 3th Order Induction Machine model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage.

PowerSimulationsDynamics.compute_output_currentMethod

Function to obtain the output current time series of a 5th Order Induction Machine model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage.

PowerSimulationsDynamics.compute_output_currentMethod

Function to obtain the output current time series of a Dynamic Generator model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific current.

PowerSimulationsDynamics.compute_output_currentMethod

Function to obtain the output current time series of a Dynamic Inverter model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific current.

PowerSimulationsDynamics.compute_pss_outputMethod

Function to obtain the pss output time series of a Dynamic Generator model out of the DAE Solution. It receives the simulation inputs, the dynamic device and bus voltage. It is dispatched for device type to compute the specific output.

PowerSimulationsDynamics.configure_loggingMethod
configure_logging(;
    console_level = Logging.Error,
    file_level = Logging.Info,
    filename = "power-simulations.log",
)

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 messages
  • file_level = Logging.Info: level for file messages
  • filename::String = power-simulations.log: log file

Example

logger = configure_logging(console_level = Logging.Info)
@info "log message"
close(logger)
PowerSimulationsDynamics.device!Method

Model of 12-state Active Constant Power Load in Julia. Based on the paper Malicious Control of an Active Load in an Islanded Mixed-Source Microgrid by C. Roberts, U. Markovic, D. Arnold and D. Callaway.

PowerSimulationsDynamics.device!Method

Model of 3-state (SimplifiedSingleCageInductionMachine) induction motor in Julia. Based on the 3rd order model derived in Prabha Kundur's Book and the equations in "Analysis of Electric Machinery and Drive Systems" by Paul Krause, Oleg Wasynczuk and Scott Sudhoff.

PowerSimulationsDynamics.device!Method

Model of 5-state (SingleCageInductionMachine) induction motor in Julia. Refer to "Analysis of Electric Machinery and Drive Systems" by Paul Krause, Oleg Wasynczuk and Scott Sudhoff for the equations

PowerSimulationsDynamics.mdl_zip_load!Method

Model for ZIP Load model given by:

Pzip = Ppower + Pcurrent * (V / V0) + Pimpedance * (V / V0)^2 Qzip = Qpower + Qcurrent * (V / V0) + Qimpedance * (V / V0)^2

with V = sqrt(Vr^2 + Vi^2) and V0 the voltage magnitude from the power flow solution

The current taken for the load is computed as: Izip = (Pzip + j Qzip)^* / (Vr + j Vi)^* Izip = (Pzip - j Qzip) / (Vr - j Vi)

For constant impedance it is obtained: Izre = (1 / V0)^2 * (Vr * Pimpedance + Vi * Qimpedance) Izim = (1 / V0)^2 * (Vi * Pimpedance - Vr * Qimpedance)

For constant current it is obtained: Iire = (1 / V0) * ( (Vr * Pcurrent + Vi * Qcurrent) / V ) Iiim = (1 / V0) * ( (Vi * Pcurrent - Vr * Qcurrent) / V )

For constant power it is obtained: Ipre = (Vr * Ppower + Vi * Qpower) / V^2 Ipim = (Vi * Ppower - Vr * Qpower) / V^2

Model for Exponential Load model given by:

Pexp = P0 * (V / V0)^α Qexp = Q0 * (V / V0)^β

The current taken for the load is computed as: Iexp = (Pexp + j Qexp)^* / (Vr + j Vi)^* Iexp = (Pexp - j Qexp) / (Vr - j Vi)

It results: Irexp = Vr * P0 * (V^(α - 2) / V0^α) + Vi * Q0 * (V^(β - 2)/ V0^β) Iiim = Vi * P0 * (V^(α - 2) / V0^α) - Vr * Q0 * (V^(β - 2)/ V0^β)