Internal
PowerSimulationsDynamics.BUILD_STATUS
— TypeDefines the status of the simulation object
PowerSimulationsDynamics.BranchWrapper
— TypeWraps DynamicBranch devices from PowerSystems to handle changes in controls and connection status, and allocate the required indexes of the state space.
PowerSimulationsDynamics.DynamicWrapper
— TypeWraps DynamicInjection devices from PowerSystems to handle changes in controls and connection status, and allocate the required indexes of the state space.
PowerSimulationsDynamics.SimulationInputs
— MethodSimulationInputs build function for MassMatrixModels
PowerSimulationsDynamics.SimulationInputs
— MethodSimulationInputs build function for ResidualModels
PowerSimulationsDynamics.generator_inner_vars
— TypeGenerator Inner Vars:
τe_var
:: Electric torqueτm_var
:: Mechanical torqueVf_var
:: Field voltageV_pss_var
:: Additional PSS voltageVR_gen_var
:: Real part of the terminal voltageVI_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_vars
— TypeInverter Inner Vars:
md_var
:: Modulation signal on the d-componentmq_var
:: Modulation signal on the q-componentVdc_var
:: DC voltage supplied by the DC sourceVr_filter_var
:: Voltage seen in the capacitor of the filter in the R-componentVi_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 inverterVr_inv_var
:: Real terminal voltage on the inverterVi_inv_var
:: Imaginary terminal voltage on the inverterVr_cnv_var
:: Voltage supplied from the converter in the R-componentVi_cnv_var
:: Voltage supplied from the converter in the I-componentP_ES_var
:: Power supplied from the Energy Source side
PowerSimulationsDynamics._field_current
— MethodFunction to obtain the field current time series of a Dynamic Generator with machine type GENSAE.
PowerSimulationsDynamics._field_current
— MethodFunction to obtain the field current time series of a Dynamic Generator with machine type GENSAL.
PowerSimulationsDynamics._field_current
— MethodFunction 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_current
— MethodFunction to obtain the field current time series of a Dynamic Generator with machine type GENROU/GENROE.
PowerSimulationsDynamics._field_voltage
— MethodFunction to obtain the field voltage time series of a Dynamic Generator with avr AVRFixed.
PowerSimulationsDynamics._field_voltage
— MethodFunction to obtain the field voltage time series of a Dynamic Generator with avr ESST1A.
PowerSimulationsDynamics._field_voltage
— MethodFunction to obtain the field voltage time series of a Dynamic Generator with avr SCRX.
PowerSimulationsDynamics._field_voltage
— MethodFunction to obtain the field voltage time series of a Dynamic Generator with avr ESAC1A and EXAC1.
PowerSimulationsDynamics._field_voltage
— MethodFunction 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._frequency
— MethodFunction 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._frequency
— MethodFunction 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._frequency
— MethodFunction 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._frequency
— MethodFunction 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._frequency
— MethodFunction 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_current
— MethodFunction to obtain the output current time series of a Classic Machine model out of the DAE Solution. It is dispatched via the machine type.
PowerSimulationsDynamics._machine_current
— MethodFunction to obtain the output current time series of a One-D-One-Q model out of the DAE Solution. It is dispatched via the machine type.
PowerSimulationsDynamics._machine_current
— MethodFunction to obtain the output current time series of a SauerPaiMachine model out of the DAE Solution. It is dispatched via the machine type.
PowerSimulationsDynamics._machine_current
— MethodFunction to obtain the output current time series of a Marconato or AndersonFouad model out of the DAE Solution. It is dispatched via the machine type.
PowerSimulationsDynamics._machine_current
— MethodFunction to obtain the output current time series of a GENROU/GENROE model out of the DAE Solution. It is dispatched via the machine type.
PowerSimulationsDynamics._machine_current
— MethodFunction to obtain the output current time series of a GENSAL/GENSAE model out of the DAE Solution. It is dispatched via the machine type.
PowerSimulationsDynamics._machine_current
— MethodFunction 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._make_reduced_jacobian_index
— MethodFinds the location of the differential states in the reduced Jacobian
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with DEGOV Turbine Governor.
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with GasTG (GAST) Turbine Governor.
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with HydroTurbineGov (HYGOV) Turbine Governor.
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with SteamTurbineGov1 (TGOV1) Turbine Governor.
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with TGFixed Turbine Governor.
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with TGTypeI Turbine Governor.
PowerSimulationsDynamics._mechanical_torque
— MethodFunction to obtain the mechanical torque time series of a Dynamic Generator with TGTypeII Turbine Governor.
PowerSimulationsDynamics._output_current
— MethodFunction to obtain the output current time series of a LCL Filter model out of the DAE Solution. It is dispatched via the Filter type.
PowerSimulationsDynamics._output_current
— MethodFunction to obtain the output current time series of a REGCA converter model out of the DAE Solution. It is dispatched via the Converter type.
PowerSimulationsDynamics._post_proc_state_series
— MethodInternal function to obtain as a Vector of Float64 of a specific state. It receives the solution and the global index for a state.
PowerSimulationsDynamics._pss_output
— MethodFunction to obtain the pss output time series of a Dynamic Generator with pss IEEEST.
PowerSimulationsDynamics._pss_output
— MethodFunction to obtain the pss output time series of a Dynamic Generator with pss PSSFixed.
PowerSimulationsDynamics.compute_field_current
— MethodFunction 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_current
— MethodFunction 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_voltage
— MethodFunction 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_voltage
— MethodFunction 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_frequency
— MethodFunction to obtain the output frequency time series of a DynamicGenerator
PowerSimulationsDynamics.compute_mechanical_torque
— MethodFunction 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_torque
— MethodFunction 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_current
— MethodFunction 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_current
— MethodFunction to obtain the output current time series of a ExponentialLoad model.
PowerSimulationsDynamics.compute_output_current
— MethodFunction 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_current
— MethodFunction to obtain the output current time series of a PowerLoad model.
PowerSimulationsDynamics.compute_output_current
— MethodFunction 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_current
— MethodFunction 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_current
— MethodFunction to obtain the output current time series of a PowerLoad model.
PowerSimulationsDynamics.compute_output_current
— MethodFunction 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_current
— MethodFunction 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_output_current
— MethodDefault function to compute output current. Returns an error
PowerSimulationsDynamics.compute_pss_output
— MethodFunction 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_logging
— Methodconfigure_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 messagesfile_level = Logging.Info
: level for file messagesfilename::String = power-simulations.log
: log file
Example
logger = configure_logging(console_level = Logging.Info)
+@info "log message"
+close(logger)
PowerSimulationsDynamics.device!
— MethodModel 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!
— MethodModel of Static Shunt Compensator: CSVGN1.
PowerSimulationsDynamics.device!
— MethodModel 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!
— MethodModel 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.initialize_mach_shaft!
— MethodInitialitation of model of 6-state (Anderson-Fouad) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.initialize_mach_shaft!
— MethodInitialitation of model of 0-state synchronous (classic model) machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.initialize_mach_shaft!
— MethodInitialitation of model of 6-state (Marconato) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.initialize_mach_shaft!
— MethodInitialitation of model of 2-state (One d- and One q-) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.initialize_mach_shaft!
— MethodInitialitation of model of 6-state (SauerPai) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.initialize_mach_shaft!
— MethodInitialitation of model of 4-state (Simple Anderson-Fouad) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.initialize_mach_shaft!
— MethodInitialitation of model of 4-state (Simple Marconato) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.low_pass_modified_mass_matrix
— MethodLow Pass Filter Modified ┌─────────────┐ │ K │ u -> │ ────────────│ -> y │ K_den + sT │ └─────────────┘
PowerSimulationsDynamics.mass_matrix_entries
— MethodDefault implementation of mass matrix entries. Keeps the default values in the identity matrix
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 6-state (AndersonFouadMachine) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 0-state synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 6-state (MarconatoMachine) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 2-state (One d- and One q-) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 6-state (SauerPaiMachine) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 4-state (SimpleAFMachine) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_machine_ode!
— MethodModel of 4-state (SimpleMarconatoMachine) synchronous machine in Julia. Refer to Power System Modelling and Scripting by F. Milano for the equations
PowerSimulationsDynamics.mdl_zip_load!
— MethodModel 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^β)
PowerSimulationsDynamics.post_proc_activepower_series
— MethodFunction to compute the active power output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_branch_series
— MethodFunction to compute the current flowing through an AC branch through their series element. The current is computed through the from
bus into the to
bus.
PowerSimulationsDynamics.post_proc_field_current_series
— MethodFunction to compute the field current output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_field_voltage_series
— MethodFunction to compute the field voltage output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_frequency_series
— MethodFunction to compute the frequency of a Dynamic Injection component.
PowerSimulationsDynamics.post_proc_imaginary_current_series
— MethodFunction to compute the imaginary current output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_mechanical_torque_series
— MethodFunction to compute the mechanical torque output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_pss_output_series
— MethodFunction to compute the pss output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_reactivepower_series
— MethodFunction to compute the active power output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_real_current_series
— MethodFunction to compute the real current output time series of a Dynamic Injection series out of the DAE Solution. It receives the solution and the string name of the Dynamic Injection device.
PowerSimulationsDynamics.post_proc_source_voltage_current_series
— FunctionFunction to obtain voltage and output currents for a source. It receives the simulation resutls and an optional argument of the time step of the results.
PowerSimulationsDynamics.post_proc_state_series
— MethodFunction to obtain the state time series of a specific state. It receives the simulation, and a tuple containing the name of the Dynamic Device and the symbol of the state.
PowerSimulationsDynamics.post_proc_voltage_current_series
— MethodFunction to obtain voltage and output currents for a dynamic device. It receives the simulation, and the name of the Dynamic Device.
PowerSimulationsDynamics.post_proc_voltage_series
— MethodFunction to obtain voltage using the bus index (and not the bus number). It receives the solution, the bus index and the total number of buses.
PowerSimulationsDynamics.saturation_function
— MethodSaturation function for exponential saturation models for machines
+ Se(x) = B * x^A
PowerSimulationsDynamics.saturation_function
— MethodSaturation function for quadratic saturation models for machines
+ Se(x) = B * (x - A)^2 / x