VeraGridEngine.Templates.Rms packageο
Submodulesο
VeraGridEngine.Templates.Rms.basic_devices moduleο
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_converter_bus_block(vfactory: VarFactory, name: str = 'gfl_converter_bus') RmsModelTemplate[source]ο
Define the internal converter AC bus from its dq voltage in the PLL frame.
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_converter_line_rms_block(vfactory: VarFactory, name: str = 'gfl_converter_line') RmsModelTemplate[source]ο
Line between converter internal AC bus (from) and grid bus (to).
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_converter_rms(vfactory: VarFactory, name: str = 'current_ctrl_iq') RmsModelTemplate[source]ο
Current control iq
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_converter_rms_electrical(vfactory: VarFactory, name: str = 'gfl_converter_rms_electrical') RmsModelTemplate[source]ο
GFL converter using a separate RMS line for the electrical connection.
The line is oriented from converter internal AC bus (c) to grid bus (g).
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_current_limiter_block(vfactory: VarFactory, name: str = 'electrical') RmsModelTemplate[source]ο
Gfl electrical equations block
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_electrical_block(vfactory: VarFactory, name: str = 'gfl_electrical_eqs') RmsModelTemplate[source]ο
Gfl electrical equations block
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_line_current_measurement_block(vfactory: VarFactory, name: str = 'gfl_line_current_measurement') RmsModelTemplate[source]ο
Derive dq current feedback from the grid-side line power.
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_losses_block(vfactory: VarFactory, name: str = 'gfl_losses') RmsModelTemplate[source]ο
Gfl losses block
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_losses_from_line_block(vfactory: VarFactory, name: str = 'gfl_losses_line') RmsModelTemplate[source]ο
Losses/output block using line Pt/Qt directly.
- VeraGridEngine.Templates.Rms.basic_devices.get_gfl_voltage_control_electrical_block(vfactory: VarFactory, name: str = 'gfl_voltage_control_electrical') RmsModelTemplate[source]ο
Electrical voltage-control constraints separated from the line model.
- VeraGridEngine.Templates.Rms.basic_devices.get_pi_current_controller(vfactory: VarFactory, name: str = 'current_ctrl_iq') RmsModelTemplate[source]ο
Current control iq
- VeraGridEngine.Templates.Rms.basic_devices.get_pi_power_controller(vfactory: VarFactory, name: str = 'power_ctrl') RmsModelTemplate[source]ο
Current control iq
- VeraGridEngine.Templates.Rms.basic_devices.get_pi_power_controller_from_line(vfactory: VarFactory, name: str = 'power_ctrl_line') RmsModelTemplate[source]ο
Power controller using converter power directly from line Pt/Qt.
- VeraGridEngine.Templates.Rms.basic_devices.get_pll_transform_rms(vfactory: VarFactory, name: str = 'Pll_transform_rms') RmsModelTemplate[source]ο
Pll
VeraGridEngine.Templates.Rms.bus_complex_rms_template moduleο
- class VeraGridEngine.Templates.Rms.bus_complex_rms_template.BusComplexRmsTemplate(vf: VarFactory, is_dc: bool = False, name: str = 'rms_bus_complex_template')[source]ο
Bases:
RmsModelTemplateComplex phasor-based RMS template for buses using a single complex voltage variable.
This template represents bus voltage as a single complex variable V = Vr + j*Vi instead of separate real and imaginary components. The complex representation enables truly multilinear current equations in the network.
For compilation purposes, the complex variable is split into real and imaginary parts, but symbolically it remains a single complex entity.
- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- I_complexο
- Iiο
- Irο
- Pο
- Qο
- V_complexο
- Viο
- Vrο
- tpe: DeviceTypeο
- VeraGridEngine.Templates.Rms.bus_complex_rms_template.complex_to_polar(V: complex) Tuple[float, float][source]ο
Convert complex phasor to polar coordinates (magnitude, angle).
- Parameters:
V β Complex voltage in p.u.
- Returns:
Tuple of (Vm, Va) where Va is in radians
- VeraGridEngine.Templates.Rms.bus_complex_rms_template.complex_to_real_imag(V: complex) Tuple[float, float][source]ο
Convert complex phasor to real and imaginary components.
- Parameters:
V β Complex voltage V = Vr + j*Vi
- Returns:
Tuple of (Vr, Vi)
- VeraGridEngine.Templates.Rms.bus_complex_rms_template.get_bus_complex_rms_algebraic_vars(bus_rms_model: Block) Tuple[Var, Var][source]ο
Get the algebraic variables (Vr, Vi) from the complex bus model.
- Parameters:
bus_rms_model β The block containing the bus model
- Returns:
Tuple of (Vr, Vi) RMS variables
- VeraGridEngine.Templates.Rms.bus_complex_rms_template.get_bus_complex_voltage(bus_rms_model: Block) Var[source]ο
Get the complex voltage variable from the bus model.
- Parameters:
bus_rms_model β The block containing the bus model
- Returns:
Complex voltage variable
- VeraGridEngine.Templates.Rms.bus_complex_rms_template.initialize_bus_complex_rms(bus: Bus, vf: VarFactory)[source]ο
Initialize the complex phasor-based RMS model for a bus.
- Parameters:
bus β Bus device
vf β VarFactory for creating variables
- Returns:
None
VeraGridEngine.Templates.Rms.bus_phasor_rms_template moduleο
- class VeraGridEngine.Templates.Rms.bus_phasor_rms_template.BusPhasorRmsTemplate(vf: VarFactory, is_dc: bool = False, name: str = 'rms_bus_phasor_template')[source]ο
Bases:
RmsModelTemplatePhasor-based RMS template for buses using real and imaginary voltage components.
This template represents bus voltage as V = Vr + j*Vi instead of polar coordinates (Vm, Va). This representation makes line equations linear in the voltage variables.
- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- Viο
- Vrο
- tpe: DeviceTypeο
- VeraGridEngine.Templates.Rms.bus_phasor_rms_template.check_empty_bus(bus_rms_model: Block)[source]ο
Check if the bus model has no algebraic variables.
- VeraGridEngine.Templates.Rms.bus_phasor_rms_template.get_bus_phasor_rms_algebraic_vars(bus_rms_model: Block) Tuple[Var, Var][source]ο
Get the algebraic variables (Vr, Vi) from the phasor bus model.
- Parameters:
bus_rms_model β The block containing the bus model
- Returns:
Tuple of (Vr, Vi) RMS variables
- VeraGridEngine.Templates.Rms.bus_phasor_rms_template.initialize_bus_phasor_rms(bus: Bus, vf: VarFactory)[source]ο
Initialize the phasor-based RMS model for a bus.
- Parameters:
bus β Bus device
vf β VarFactory for creating variables
- Returns:
None
- VeraGridEngine.Templates.Rms.bus_phasor_rms_template.phasor_to_polar(Vr: float, Vi: float) Tuple[float, float][source]ο
Convert phasor (real, imaginary) to polar coordinates (magnitude, angle).
- Parameters:
Vr β Real part of voltage in p.u.
Vi β Imaginary part of voltage in p.u.
- Returns:
Tuple of (Vm, Va)
VeraGridEngine.Templates.Rms.dc_voltage_source moduleο
- VeraGridEngine.Templates.Rms.dc_voltage_source.DCCurrentSource(vfactory: VarFactory, Vdc: Var, name: str = 'DC current source RMS template') RmsModelTemplate[source]ο
Builds an RMS model template for a DC current source with capacitive filtering.
Models a DC current source (e.g., fuel cell, grid-connected inverter) connected through a DC-link capacitor and series resistance. The model captures the DC-side dynamics and power injection into the AC grid.
The circuit consists of: - DC voltage source (Vpv) with internal resistance (Rpv) - DC-link capacitor (C) for energy storage and ripple filtering - DC current (Idc) and power (Pdc) output to the converter
- The differential-algebraic equations governing the system:
Algebraic: Pdc = Idc * Vdc (power balance)
Algebraic: Vpv = Vpv0 (source voltage)
Differential: C*dVdc/dt + Idc = (Vpv - Vdc)/Rpv (capacitor dynamics)
- Parameters:
vfactory β Factory that owns the symbolic variables in the model.
Vdc β DC-link voltage state variable in per unit.
name β Name assigned to the generated RMS model template.
- Returns:
Configured DC current-source RMS model template.
- VeraGridEngine.Templates.Rms.dc_voltage_source.DCPVSourceAveraged(vfactory: VarFactory, Vdc: Var, name: str = 'Averaged PV DC source RMS template') RmsModelTemplate[source]ο
Averaged PV source with MPPT-like voltage reference and DC-link capacitor.
Model structure: - Irradiance/temperature dependent available PV current (Ipv_av) - MPPT voltage reference set to estimated Vmp - Averaged boost relation to inject DC current into the link - DC-link capacitor dynamics: Cdc * dVdc/dt + Idc - Idc_src = 0
- Parameters:
vfactory β Factory that owns the symbolic variables in the model.
Vdc β DC-link voltage state variable in per unit.
name β Name assigned to the generated RMS model template.
- Returns:
Configured averaged photovoltaic DC-source RMS model template.
- VeraGridEngine.Templates.Rms.dc_voltage_source.DCPowerLimitedSource(vfactory: VarFactory, Vdc: Var, name: str = 'DC power-limited source RMS template') RmsModelTemplate[source]ο
RMS DC source driven by a power reference with saturation.
This model injects a commanded DC power into the DC-link while limiting the requested power with hard saturation:
P_cmd = hard_sat(Pdc_ref0, -Pmax, Pmax) Idc_src = P_cmd / (Vdc + eps_v)
DC-link dynamics are then:
C * dVdc/dt + Idc - Idc_src = 0
where Pdc = Idc * Vdc is the converter-side DC power variable.
- Parameters:
vfactory β Factory that owns the symbolic variables in the model.
Vdc β DC-link voltage state variable in per unit.
name β Name assigned to the generated RMS model template.
- Returns:
Configured power-limited DC-source RMS model template.
- VeraGridEngine.Templates.Rms.dc_voltage_source.DCSimpleSourceAveraged(vfactory: VarFactory, Vdc: Var, name: str = 'Simple averaged DC source RMS template') RmsModelTemplate[source]ο
Simplified averaged DC source with a DC-link capacitor.
Model structure: - A controlled or fixed DC current source injects current into the DC link. - The converter extracts active power from the DC link. - A parallel DC resistance models losses/damping. - The DC-link capacitor defines the Vdc dynamic state.
The core equation is:
Cdc * dVdc/dt = Idc_src - Idc_conv - Vdc / Rdc
with:
Pdc = Vdc * Idc_conv
Sign convention: - Idc_src > 0 injects current into the DC link. - Idc_conv > 0 means the converter extracts power from the DC link. - Pdc > 0 means active power is delivered from DC side to AC side.
- Parameters:
vfactory β Factory that owns the symbolic variables in the model.
Vdc β DC-link voltage state variable in per unit.
name β Name assigned to the generated RMS model template.
- Returns:
Configured simplified averaged DC-source RMS model template.
- VeraGridEngine.Templates.Rms.dc_voltage_source.DCVoltageSource(vfactory: VarFactory, Vdc: Var, name: str = 'DC voltage source RMS template') RmsModelTemplate[source]ο
Builds an RMS model template for a DC voltage source with capacitive filtering.
Models a DC voltage source (e.g., photovoltaic array, battery) connected through a DC-link capacitor and series resistance. The model captures the DC-side dynamics and power injection into the AC grid.
The circuit consists of: - DC voltage source (Vpv) with internal resistance (Rpv) - DC-link capacitor (C) for energy storage and ripple filtering - DC current (Idc) and power (Pdc) output to the converter
- The differential-algebraic equations governing the system:
Algebraic: Pdc = Idc * Vdc (power balance)
Algebraic: Vpv = Vpv0 (source voltage)
Differential: C*dVdc/dt + Idc = (Vpv - Vdc)/Rpv (capacitor dynamics)
- Parameters:
vfactory β Factory that owns the symbolic variables in the model.
Vdc β DC-link voltage state variable in per unit.
name β Name assigned to the generated RMS model template.
- Returns:
Configured DC voltage-source RMS model template.
VeraGridEngine.Templates.Rms.empty_rms_template moduleο
- VeraGridEngine.Templates.Rms.empty_rms_template.get_empty_rms_template(vf: VarFactory, name: str = 'empty_template') RmsModelTemplate[source]ο
RMS empty template. Used to empty the block :param vf: grid.var_factory :param name: string to identify the model :return: rmsModelTemplate
VeraGridEngine.Templates.Rms.esd1_rms_template moduleο
- VeraGridEngine.Templates.Rms.esd1_rms_template.get_esd1_rms_template(vfactory: VarFactory, name: str = 'ESD1 RMS template') RmsModelTemplate[source]ο
ESD1-inspired RMS battery energy storage model.
The model provides: - P/Q setpoint channels (pref0, pext0, qref0) - SoC-dependent active-power availability (charge/discharge windows) - Current-command limiting with P/Q priority - First-order output current dynamics - SoC dynamic state with charge/discharge efficiencies
Sign convention used here: - P > 0: battery discharging (injecting power into AC grid) - P < 0: battery charging (absorbing power from AC grid)
VeraGridEngine.Templates.Rms.esdc2a_exciter_rms_template moduleο
Standard IEEE ESDC2A direct-current excitation-system RMS model.
- class VeraGridEngine.Templates.Rms.esdc2a_exciter_rms_template.Esdc2aRmsParameters(values: tuple[float, ...])[source]ο
Bases:
objectNumerical parameters for one ESDC2A excitation system.
- e1ο
- e2ο
- kaο
- keο
- kfο
- se1ο
- se2ο
- taο
- tbο
- tcο
- teο
- tf1ο
- trο
- vrmaxο
- vrminο
- VeraGridEngine.Templates.Rms.esdc2a_exciter_rms_template.configure_esdc2a_block(block: Block, parameters: Esdc2aRmsParameters, vfactory: VarFactory) None[source]ο
Configure one ESDC2A block.
- Parameters:
block β ESDC2A symbolic block.
parameters β Numerical record.
vfactory β Shared variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.esdc2a_exciter_rms_template.get_esdc2a_exciter_rms_template(vfactory: VarFactory, name: str = 'ESDC2A exciter RMS template') RmsModelTemplate[source]ο
Build the standard five-state ESDC2A realization.
- Parameters:
vfactory β Shared symbolic variable factory.
name β Template name.
- Returns:
ESDC2A exciter template.
VeraGridEngine.Templates.Rms.gencls_rms_template moduleο
Standard two-state classical synchronous-generator RMS model.
- class VeraGridEngine.Templates.Rms.gencls_rms_template.GenclsMechanicalInput(*values)[source]ο
Bases:
EnumMechanical-input structures supported by GENCLS.
- CONSTANT = 1ο
- TGOV1 = 2ο
- class VeraGridEngine.Templates.Rms.gencls_rms_template.GenclsRmsParameters(fn: float, d: float, m: float, ra: float, xd1: float)[source]ο
Bases:
objectNumerical parameters for one classical synchronous machine.
- d: floatο
- fn: floatο
- m: floatο
- ra: floatο
- xd1: floatο
- VeraGridEngine.Templates.Rms.gencls_rms_template.configure_gencls_block(block: Block, parameters: GenclsRmsParameters, vfactory: VarFactory) None[source]ο
Apply one GENCLS parameter record to a machine block.
- Parameters:
block β GENCLS machine block.
parameters β Numerical parameter record.
vfactory β Shared variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.gencls_rms_template.configure_gencls_tgov1_block(template: RmsModelTemplate, machine_parameters: GenclsRmsParameters, governor_parameters: Tgov1RmsParameters | None, vfactory: VarFactory) None[source]ο
Configure one complete GENCLS assembly.
- Parameters:
template β GENCLS composite template.
machine_parameters β Machine parameters.
governor_parameters β Optional TGOV1 parameters.
vfactory β Shared variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.gencls_rms_template.get_complete_gencls_rms_template(vfactory: VarFactory, mechanical_input: GenclsMechanicalInput = GenclsMechanicalInput.CONSTANT, name: str = 'Complete GENCLS RMS template') RmsModelTemplate[source]ο
Build GENCLS with either constant torque or a TGOV1 controller.
- Parameters:
vfactory β Shared symbolic variable factory.
mechanical_input β Mechanical-input structure.
name β Composite template name.
- Returns:
Connected GENCLS generator template.
- VeraGridEngine.Templates.Rms.gencls_rms_template.get_gencls_rms_template(vfactory: VarFactory, mechanical_input: GenclsMechanicalInput = GenclsMechanicalInput.CONSTANT, name: str = 'GENCLS RMS template') RmsModelTemplate[source]ο
Build the standard two-state classical-generator realization.
- Parameters:
vfactory β Shared symbolic variable factory.
mechanical_input β Constant-torque or TGOV1-driven structure.
name β Template name.
- Returns:
GENCLS RMS template.
VeraGridEngine.Templates.Rms.generation_tensygrid_ml moduleο
- VeraGridEngine.Templates.Rms.generation_tensygrid_ml.ExciterBuild(vfactory: VarFactory, name: str = 'Exciter RMS template', hard_sat_type: str = 'ml') RmsModelTemplate[source]ο
Build the generator excitation-system control model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
hard_sat_type β Saturation-block implementation used by the exciter.
- Returns:
Configured exciter RMS model template.
- VeraGridEngine.Templates.Rms.generation_tensygrid_ml.GenqecBuild(vfactory: VarFactory, name: str = 'GENQEC RMS template', hard_sat_type: str = 'ml') RmsModelTemplate[source]ο
Build the GENQEC synchronous-generator RMS model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
hard_sat_type β Saturation-block implementation used by the model.
- Returns:
Configured GENQEC RMS model template.
- VeraGridEngine.Templates.Rms.generation_tensygrid_ml.GovernorBuild(vfactory: VarFactory, name: str = 'Governor RMS template', hard_sat_type: str = 'ml') RmsModelTemplate[source]ο
Build the turbine-governor control model used by the generator.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
hard_sat_type β Saturation-block implementation used by the governor.
- Returns:
Configured turbine-governor RMS model template.
- VeraGridEngine.Templates.Rms.generation_tensygrid_ml.OELBuild(vfactory: VarFactory, name: str = 'OEL RMS template') RmsModelTemplate[source]ο
Build the generator over-excitation limiter control model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured over-excitation limiter RMS model template.
- VeraGridEngine.Templates.Rms.generation_tensygrid_ml.StabilizerBuild(vfactory: VarFactory, name: str = 'Stabilizer RMS template', hard_sat_type: str = 'ml') RmsModelTemplate[source]ο
Build the power-system stabilizer control model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
hard_sat_type β Saturation-block implementation used by the stabilizer.
- Returns:
Configured power-system stabilizer RMS model template.
- VeraGridEngine.Templates.Rms.generation_tensygrid_ml.get_complete_generator_template(vfactory: VarFactory, name: str = 'complete generator rms template', implicit: bool = False, hard_sat_type: str = 'ml') RmsModelTemplate[source]ο
- Returns:
VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template moduleο
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template.OELBuild(vfactory: VarFactory, name: str = 'OEL') RmsModelTemplate[source]ο
- Parameters:
name
- Returns:
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template.get_complete_generator_template_rms(vfactory: VarFactory, name='complete_generator_rms_template') RmsModelTemplate[source]ο
- Returns:
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template.get_exciter_rms(vfactory: VarFactory, name: str = 'exciter') RmsModelTemplate[source]ο
- Parameters:
vfactory
name
- Returns:
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template.get_genqec_rms(vfactory: VarFactory, name: str = 'Genqec_rms_template') RmsModelTemplate[source]ο
generator with quadratic saturation
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template.get_governor_rms(vfactory: VarFactory, name: str = 'Governor') RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template.get_stabilizer_rms(vfactory: VarFactory, name: str = 'stabilizer') RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references moduleο
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references.OELBuild(vfactory: VarFactory, name: str = 'OEL') RmsModelTemplate[source]ο
- Parameters:
name
- Returns:
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references.get_complete_generator_template_rms(vfactory: VarFactory, name='complete generator rms template') RmsModelTemplate[source]ο
- Returns:
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references.get_exciter_rms(vfactory: VarFactory, name: str = 'exciter') RmsModelTemplate[source]ο
- Parameters:
vfactory
name
- Returns:
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references.get_genqec_rms(vfactory: VarFactory, name: str = 'Genqec rms template') RmsModelTemplate[source]ο
generator with quadratic saturation
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references.get_governor_rms(vfactory: VarFactory, name: str = 'Governor') RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_references.get_stabilizer_rms(vfactory: VarFactory, name: str = 'stabilizer') RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2 moduleο
Alternative complete generator RMS template with explicit controller states.
This module keeps the generator model from the original template and only rebuilds the controller sections with explicit state equations so the small-signal DAE formulation exposes the controller modes as finite eigenvalues.
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2.OELBuild(vfactory: VarFactory, name: str = 'OEL') tuple[Block, Var][source]ο
Return the original OEL builder.
The complete generator template in this module does not currently wire the OEL into the composed model. The original implementation is therefore reused verbatim to avoid changing unrelated behavior.
- Parameters:
vfactory β Shared symbolic variable factory.
name β Model name.
- Returns:
OEL block and its output variable.
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2.get_complete_generator_template_rms(vfactory: VarFactory, name: str = 'complete_generator_rms_template') RmsModelTemplate[source]ο
Build the complete generator using the explicit-state controller variants.
- Parameters:
vfactory β Shared symbolic variable factory.
name β Model name.
- Returns:
Complete generator RMS template.
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2.get_exciter_rms(vfactory: VarFactory, name: str = 'exciter') RmsModelTemplate[source]ο
Build the exciter with explicit dynamic states.
The AVR, rate feedback, and exciter field stages are rewritten as explicit states. This preserves the original algebraic nonlinearities while making the controller dynamics visible to the small-signal state matrix.
- Parameters:
vfactory β Shared symbolic variable factory.
name β Model name.
- Returns:
Exciter RMS template.
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2.get_genqec_rms(vfactory: VarFactory, name: str = 'Genqec_rms_template') RmsModelTemplate[source]ο
generator with quadratic saturation :return: RmsModelTemplate
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2.get_governor_rms(vfactory: VarFactory, name: str = 'Governor') RmsModelTemplate[source]ο
Build the governor with explicit dynamic states.
The original template relied on helper transfer-function blocks whose internal dynamics were stored as derivative variables attached to algebraic variables. The small-signal assembler only guarantees finite modes for explicit
state_vars. This version therefore rewrites every dynamic governor stage as an explicit first-order state.- Parameters:
vfactory β Shared symbolic variable factory.
name β Model name.
- Returns:
Governor RMS template.
- VeraGridEngine.Templates.Rms.genqec_exc_gov_sat_template_v2.get_stabilizer_rms(vfactory: VarFactory, name: str = 'stabilizer') RmsModelTemplate[source]ο
Build the PSS with explicit dynamic states.
The stabilizer chain is rewritten in state-space form so the transducer, washout, second-order notch, and two lead-lag stages are all explicit states visible to the small-signal formulation.
- Parameters:
vfactory β Shared symbolic variable factory.
name β Model name.
- Returns:
Stabilizer RMS template.
VeraGridEngine.Templates.Rms.genqec_phasor_rms_template moduleο
Generator template (genqec) for phasor-based RMS simulation.
This template accepts Vr, Vi (phasor voltage components) as inputs instead of Vm, Va (polar coordinates). This allows direct connection to phasor bus models without coordinate conversion.
- VeraGridEngine.Templates.Rms.genqec_phasor_rms_template.get_complete_generator_template_phasor(vfactory: VarFactory, name='complete generator phasor rms template', hard_sat_type: str = 'ml') RmsModelTemplate[source]ο
Complete generator template with governor, exciter, and stabilizer for phasor-based RMS simulation.
This is the phasor version that accepts Vr, Vi (phasor voltage components) as inputs instead of Vm, Va. The governor, exciter, and stabilizer models are internally connected to the generator. The exciterβs Vm input is computed internally as Vm = sqrt(Vr^2 + Vi^2).
Uses models from generation_tensygrid_ml.py (GenqecBuild, GovernorBuild, StabilizerBuild, ExciterBuild).
- Args:
vfactory: VarFactory instance for creating variables name: Name of the template
- Returns:
RmsModelTemplate: Complete generator model template for phasor simulation
- VeraGridEngine.Templates.Rms.genqec_phasor_rms_template.get_genqec_phasor(vfactory: VarFactory, name: str = 'GENQEC phasor RMS template') RmsModelTemplate[source]ο
Generator with quadratic saturation for phasor-based RMS simulation.
This version accepts Vr, Vi (phasor voltage components) as inputs instead of Vm, Va. The dq-frame voltages are computed directly from Vr, Vi using Park transformation: - Vd = Vr * sin(delta) - Vi * cos(delta) - Vq = Vr * cos(delta) + Vi * sin(delta)
- Args:
vfactory: VarFactory instance for creating variables name: Name suffix for the template
- Returns:
RmsModelTemplate: Generator model template for phasor simulation
VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template moduleο
Standard GENROU generator, TGOV1-family governor and exciter RMS models.
This module follows the complete-generator composition pattern already used by
VeraGrid: the synchronous machine, governor and selected exciter are independent
child blocks connected through a shared VarFactory. Every physical
dynamic variable is an explicit state_var so RMS small-signal analysis sees
the complete standard-model realization.
The available blocks are GENROU, TGOV1, TGOV1N, EXST1 and the zero-TA structural variant of ESST3A. Numerical case inventories remain outside this reusable model module.
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.Esst3aRmsParameters(tr: float, vimax: float, vimin: float, km: float, tc: float, tb: float, ka: float, ta: float, vrmax: float, vrmin: float, kg: float, kp: float, ki: float, vbmax: float, kc: float, xl: float, vgmax: float, thetap: float, tm: float, vmmax: float, vmmin: float)[source]ο
Bases:
objectNumerical parameters for one ESST3A excitation system.
- ka: floatο
- kc: floatο
- kg: floatο
- ki: floatο
- km: floatο
- kp: floatο
- ta: floatο
- tb: floatο
- tc: floatο
- thetap: floatο
- tm: floatο
- tr: floatο
- vbmax: floatο
- vgmax: floatο
- vimax: floatο
- vimin: floatο
- vmmax: floatο
- vmmin: floatο
- vrmax: floatο
- vrmin: floatο
- xl: floatο
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.Exst1RmsParameters(tr: float, vimax: float, vimin: float, tc: float, tb: float, ka: float, ta: float, vrmax: float, vrmin: float, kc: float, kf: float, tf: float)[source]ο
Bases:
objectNumerical parameters for one EXST1 excitation system.
- ka: floatο
- kc: floatο
- kf: floatο
- ta: floatο
- tb: floatο
- tc: floatο
- tf: floatο
- tr: floatο
- vimax: floatο
- vimin: floatο
- vrmax: floatο
- vrmin: floatο
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.GenrouExciterType(*values)[source]ο
Bases:
EnumExcitation-system structures supported by complete GENROU models.
- ESST3A = 2ο
- EXST1 = 1ο
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.GenrouRmsParameters(fn: float, d: float, m: float, ra: float, xl: float, xd1: float, s10: float, s12: float, xd: float, xq: float, xd2: float, xq1: float, xq2: float, td10: float, td20: float, tq10: float, tq20: float)[source]ο
Bases:
objectNumerical parameters for one GENROU synchronous machine.
- d: floatο
- fn: floatο
- m: floatο
- ra: floatο
- s10: floatο
- s12: floatο
- td10: floatο
- td20: floatο
- tq10: floatο
- tq20: floatο
- xd: floatο
- xd1: floatο
- xd2: floatο
- xl: floatο
- xq: floatο
- xq1: floatο
- xq2: floatο
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.GenrouSaturationMode(*values)[source]ο
Bases:
EnumStructural magnetic-saturation realizations supported by GENROU.
- DISABLED = 2ο
- QUADRATIC = 1ο
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.Tgov1ModelType(*values)[source]ο
Bases:
EnumPower-reference placements in the standard TGOV1 model family.
- TGOV1 = 1ο
- TGOV1N = 2ο
- class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.Tgov1RmsParameters(wref0: float, r: float, vmax: float, vmin: float, t1: float, t2: float, t3: float, dt: float)[source]ο
Bases:
objectNumerical parameters for one TGOV1 turbine governor.
- dt: floatο
- r: floatο
- t1: floatο
- t2: floatο
- t3: floatο
- vmax: floatο
- vmin: floatο
- wref0: floatο
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.configure_esst3a_block(block: Block, parameters: Esst3aRmsParameters, vfactory: VarFactory) None[source]ο
Configure one ESST3A block from named model parameters.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.configure_exst1_block(block: Block, parameters: Exst1RmsParameters, vfactory: VarFactory) None[source]ο
Configure one EXST1 block from named model parameters.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.configure_genrou_block(block: Block, parameters: GenrouRmsParameters, vfactory: VarFactory) None[source]ο
Configure one GENROU block from named model parameters.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.configure_tgov1_block(block: Block, parameters: Tgov1RmsParameters, vfactory: VarFactory) None[source]ο
Configure one TGOV1 block from named model parameters.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.get_complete_genrou_rms_template(vfactory: VarFactory, exciter_type: GenrouExciterType = GenrouExciterType.EXST1, saturation_mode: GenrouSaturationMode = GenrouSaturationMode.QUADRATIC, name: str = 'Complete GENROU RMS template') RmsModelTemplate[source]ο
Build one complete GENROU generator using VeraGrid block composition.
The wrapper contains GENROU, TGOV1 and one selected excitation system. All internal ports are connected before the child blocks are attached.
- Parameters:
vfactory β Shared symbolic variable factory.
exciter_type β Standard excitation-system model to compose.
saturation_mode β GENROU magnetic-saturation realization.
name β Wrapper name.
- Returns:
Complete generator RMS template.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.get_esst3a_rms_template(vfactory: VarFactory, name: str = 'ESST3A RMS template') RmsModelTemplate[source]ο
Build the standard zero-TA ESST3A structural realization.
With
TA=0,LAW1_yis algebraic and is not retained as a differential state. The retained states areLG_y,LL_xandLAW2_y.- Parameters:
vfactory β Shared symbolic variable factory.
name β Template name.
- Returns:
RMS template containing one ESST3A block.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.get_exst1_rms_template(vfactory: VarFactory, name: str = 'EXST1 RMS template') RmsModelTemplate[source]ο
Build EXST1 with explicit dynamic states and initialized
vref0.- Parameters:
vfactory β Shared symbolic variable factory.
name β Template name.
- Returns:
RMS template containing one EXST1 block.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.get_genrou_rms_template(vfactory: VarFactory, name: str = 'GENROU RMS template', saturation_mode: GenrouSaturationMode = GenrouSaturationMode.QUADRATIC) RmsModelTemplate[source]ο
Build a standard six-state GENROU synchronous-machine model.
- Parameters:
vfactory β Shared symbolic variable factory.
name β Template name.
saturation_mode β Magnetic-saturation structural realization.
- Returns:
RMS template containing one GENROU block.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.get_tgov1_rms_template(vfactory: VarFactory, name: str = 'TGOV1 RMS template', model_type: Tgov1ModelType = Tgov1ModelType.TGOV1) RmsModelTemplate[source]ο
Build a standard two-state TGOV1-family governor realization.
TGOV1applies the droop gain after summing speed, reference and auxiliary inputs.TGOV1Napplies droop only to speed and sums power references afterwards, as required by the IEEE39 reference data. The valve lag uses directional anti-windup atVMINandVMAXso an outward derivative freezes the state while an inward derivative releases it.The second input is the machine electrical torque and is used only to initialize the frozen
pref0/mechanical-power reference.- Parameters:
vfactory β Shared symbolic variable factory.
name β Template name.
model_type β Standard TGOV1-family equation selection.
- Returns:
RMS template containing one TGOV1-family block.
- VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.set_rms_model_parameter(block: Block, parameter_name: str, value: float, vfactory: VarFactory) None[source]ο
Set exactly one named static or event parameter.
The function fails if the parameter is absent or duplicated so an explicit model configuration can never leave a default active silently.
- Parameters:
block β Block whose parameter will be changed.
parameter_name β Exact symbolic parameter name.
value β New numerical value.
vfactory β Shared symbolic variable factory.
- Returns:
None.
- Raises:
ValueError β If exactly one parameter is not found.
VeraGridEngine.Templates.Rms.genrow1_rms_template moduleο
- VeraGridEngine.Templates.Rms.genrow1_rms_template.get_genrow1_rms_template(var_factory: VarFactory, name='Genrow rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Genrow :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.genrow2_rms_template moduleο
- VeraGridEngine.Templates.Rms.genrow2_rms_template.get_genrow2_rms_template(var_factory: VarFactory, name='Genrow rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Genrow :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.genrow3_rms_template moduleο
- VeraGridEngine.Templates.Rms.genrow3_rms_template.get_genrow3_rms_template(var_factory: VarFactory, name='Genrow rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Genrow :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.genrow4_rms_template moduleο
- VeraGridEngine.Templates.Rms.genrow4_rms_template.get_genrow4_rms_template(var_factory: VarFactory, name='Genrow rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Genrow :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.genrow_rms_template moduleο
- VeraGridEngine.Templates.Rms.genrow_rms_template.get_genrow_rms_template(vfactory: VarFactory, name='Genrow rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Genrow :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.hvdc_rms_template moduleο
- class VeraGridEngine.Templates.Rms.hvdc_rms_template.HvdcRmsTemplate(nc: NumericalCircuit, hvdc: HvdcLine, hvdc_idx: int, vf: VarFactory, name: str = 'hvdc_rms_template')[source]ο
Bases:
RmsModelTemplateRMS Template for HVDC Line with fixed power setpoint control.
- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- tpe: DeviceTypeο
- VeraGridEngine.Templates.Rms.hvdc_rms_template.initialize_hvdc_rms(hvdc: HvdcLine, hvdc_idx: int, vf: VarFactory, nc: NumericalCircuit)[source]ο
Initialize the RMS model for an HVDC Line
- Parameters:
hvdc β HVDC Line device
hvdc_idx β Index of the HVDC in nc.hvdc_data
vf β VarFactory
nc β NumericalCircuit with compiled data
VeraGridEngine.Templates.Rms.hvdc_vsc_gfl_rms_template moduleο
Standalone grid-following VSC models for RMS HVDC studies.
- class VeraGridEngine.Templates.Rms.hvdc_vsc_gfl_rms_template.HvdcVscGflRmsTemplate(vf: VarFactory)[source]ο
Bases:
TemplateDefinitionEditable template definition for the standalone HVDC GFL VSC model.
- eval() RmsModelTemplate[source]ο
Build the HVDC VSC using the current editor property values.
- Returns:
Configured standalone HVDC GFL VSC RMS template.
- VeraGridEngine.Templates.Rms.hvdc_vsc_gfl_rms_template.build_hvdc_vsc_gfl_rms(vfactory: VarFactory, name: str = 'HVDC GFL VSC', control1: ConverterControlType = Vm_dc, control2: ConverterControlType = Q_ac, cdc: float = 0.4) RmsModelTemplate[source]ο
Build a complete controlled VSC with an RMS DC-link capacitor.
The model belongs directly to a
VSCdevice. Its AC terminal usesVm/Vaand its DC terminal usesVdc. A physical coupling transformer must use the ordinary transformer RMS template rather than hosting converter controls.- Parameters:
vfactory β Variable factory used to construct the symbolic model.
name β Catalog and block display name.
control1 β Active-axis control mode (
Vm_dc,Pdc, orPac).control2 β Reactive-axis control mode (
QacorVm_ac).cdc β DC-link capacitance in p.u.
- Returns:
Complete reusable RMS VSC template.
- VeraGridEngine.Templates.Rms.hvdc_vsc_gfl_rms_template.get_hvdc_pdc_q_vsc_rms(vfactory: VarFactory, name: str = 'HVDC GFL VSC - Pdc/Q') RmsModelTemplate[source]ο
Build the DC-power/reactive-power controlling HVDC terminal.
- VeraGridEngine.Templates.Rms.hvdc_vsc_gfl_rms_template.get_hvdc_vdc_q_vsc_rms(vfactory: VarFactory, name: str = 'HVDC GFL VSC - Vdc/Q') RmsModelTemplate[source]ο
Build the DC-voltage/reactive-power controlling HVDC terminal.
VeraGridEngine.Templates.Rms.ieeeg1_governor_rms_template moduleο
Standard IEEE Type-1 steam-turbine governor RMS model.
- class VeraGridEngine.Templates.Rms.ieeeg1_governor_rms_template.Ieeeg1RmsParameters(values: tuple[float, ...])[source]ο
Bases:
objectNumerical parameters and structural time constants for IEEEG1.
- kο
- k1ο
- k2ο
- k3ο
- k4ο
- k5ο
- k6ο
- k7ο
- k8ο
- pmaxο
- pminο
- t1ο
- t2ο
- t3ο
- t4ο
- t5ο
- t6ο
- t7ο
- ucο
- uoο
- VeraGridEngine.Templates.Rms.ieeeg1_governor_rms_template.configure_ieeeg1_block(block: Block, parameters: Ieeeg1RmsParameters, vfactory: VarFactory) None[source]ο
Configure one IEEEG1 block.
- Parameters:
block β IEEEG1 symbolic block.
parameters β Numerical record.
vfactory β Shared variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.ieeeg1_governor_rms_template.get_ieeeg1_governor_rms_template(vfactory: VarFactory, include_t7_state: bool, name: str = 'IEEEG1 governor RMS template') RmsModelTemplate[source]ο
Build an IEEEG1 block in the normal interior-limiter regime.
WECC records use zero
T5andT6and therefore retain only the lead-lag, valve, first-process and optional fourth-process states.- Parameters:
vfactory β Shared symbolic variable factory.
include_t7_state β Retain the fourth-process lag when
T7is nonzero.name β Block name.
- Returns:
IEEEG1 governor template.
VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template moduleο
Standard IEEEX1 excitation-system and IEEEST stabilizer RMS templates.
IEEEX1 and IEEEST are normally used as blocks of one synchronous-generator assembly. This module exposes each block independently and also provides a composite GENROUβTGOV1NβIEEEX1βIEEEST model. The IEEEST realization is the zeroed input-filter structural variant used by the IEEE39 reference data: F1, F2 and LL1 are exact algebraic pass-through blocks, while LL2 and the washout remain differential states.
- class VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.IeeestInputMode(*values)[source]ο
Bases:
EnumInput signals supported by the standard IEEEST template.
- ACCELERATING_POWER = 4ο
- BUS_FREQUENCY = 2ο
- BUS_VOLTAGE = 5ο
- ELECTRICAL_POWER = 3ο
- ROTOR_SPEED = 1ο
- class VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.IeeestRmsParameters(t3: float, t4: float, t5: float, t6: float, ks: float, lsmax: float, lsmin: float, vcu: float, vcl: float, machine_to_system_power_scale: float)[source]ο
Bases:
objectNumerical parameters for the reduced zero-input-filter IEEEST variant.
- ks: floatο
- lsmax: floatο
- lsmin: floatο
- machine_to_system_power_scale: floatο
- t3: floatο
- t4: floatο
- t5: floatο
- t6: floatο
- vcl: floatο
- vcu: floatο
- class VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.Ieeex1RmsParameters(ta: float, te: float, tf1: float, kf1: float, ka: float, ke: float, vrmax: float, vrmin: float, e1: float, se1: float, e2: float, se2: float)[source]ο
Bases:
objectNumerical parameters for one zero-TR, zero-TB/TC IEEEX1 exciter.
- e1: floatο
- e2: floatο
- ka: floatο
- ke: floatο
- kf1: floatο
- se1: floatο
- se2: floatο
- ta: floatο
- te: floatο
- tf1: floatο
- vrmax: floatο
- vrmin: floatο
- VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.configure_ieeest_block(block: Block, parameters: IeeestRmsParameters, vfactory: VarFactory) None[source]ο
Apply numerical IEEEST parameters to an existing block.
- Parameters:
block β IEEEST model block.
parameters β Numerical IEEEST parameters.
vfactory β Shared symbolic variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.configure_ieeex1_block(block: Block, parameters: Ieeex1RmsParameters, vfactory: VarFactory) None[source]ο
Apply numerical IEEEX1 parameters to an existing block.
- Parameters:
block β IEEEX1 model block.
parameters β Numerical IEEEX1 parameters.
vfactory β Shared symbolic variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.get_complete_genrou_ieeex1_ieeest_rms_template(vfactory: VarFactory, input_mode: IeeestInputMode = IeeestInputMode.ELECTRICAL_POWER, saturation_mode: GenrouSaturationMode = GenrouSaturationMode.QUADRATIC, name: str = 'GENROU IEEEX1 IEEEST TGOV1N RMS template') RmsModelTemplate[source]ο
Build one GENROUβTGOV1NβIEEEX1βIEEEST assembly.
- Parameters:
vfactory β Shared symbolic variable factory.
input_mode β IEEEST input-signal selection.
saturation_mode β GENROU magnetic-saturation realization.
name β Composite-template name.
- Returns:
Connected generator RMS template.
- VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.get_ieeest_rms_template(vfactory: VarFactory, input_mode: IeeestInputMode = IeeestInputMode.ELECTRICAL_POWER, name: str = 'IEEEST RMS template') RmsModelTemplate[source]ο
Build the reduced zero-input-filter IEEEST structural variant.
- Parameters:
vfactory β Shared symbolic variable factory.
input_mode β Standard stabilizer input signal.
name β Template name.
- Returns:
RMS template containing one IEEEST block.
- VeraGridEngine.Templates.Rms.ieeex1_ieeest_rms_template.get_ieeex1_rms_template(vfactory: VarFactory, name: str = 'IEEEX1 RMS template') RmsModelTemplate[source]ο
Build the zero-TR, zero-TB/TC IEEEX1 structural variant.
The voltage-sensing lag and lead-lag blocks are exact algebraic pass-throughs.
vp,LA_yandW_xremain differential states.- Parameters:
vfactory β Shared symbolic variable factory.
name β Template name.
- Returns:
RMS template containing one IEEEX1 block.
VeraGridEngine.Templates.Rms.line_complex_rms_template moduleο
- VeraGridEngine.Templates.Rms.line_complex_rms_template.calculate_complex_power(Vr: Var, Vi: Var, Ir: Var, Ii: Var) tuple[source]ο
Calculate complex power from voltage and current.
S = V * conj(I) = (Vr + j*Vi)*(Ir - j*Ii) P = Vr*Ir + Vi*Ii Q = Vi*Ir - Vr*Ii
- Parameters:
Vr β Voltage real part
Vi β Voltage imaginary part
Ir β Current real part
Ii β Current imaginary part
- Returns:
Tuple of (P, Q)
- VeraGridEngine.Templates.Rms.line_complex_rms_template.get_line_complex_current_equations(Vrf: Var, Vif: Var, Vrt: Var, Vit: Var, g: Var, b: Var, bsh: Var) tuple[source]ο
Calculate complex current using MULTILINEAR equations.
This is the core innovation: current is linear in voltage!
- Parameters:
Vrf β From bus voltage real part
Vif β From bus voltage imaginary part
Vrt β To bus voltage real part
Vit β To bus voltage imaginary part
g β Line conductance
b β Line susceptance
bsh β Shunt susceptance
- Returns:
Tuple of (Ir_f, Ii_f, Ir_t, Ii_t) current components
- VeraGridEngine.Templates.Rms.line_complex_rms_template.get_line_complex_rms_template(vfactory: VarFactory, name='Line_complex_rms_template') RmsModelTemplate[source]ο
Get the complex phasor-based RMS template model of the Line with TRULY MULTILINEAR equations.
This template uses complex phasor representation where: - V = Vr + j*Vi is the complex voltage - I = Y * (Vf - Vt) is the complex current (LINEAR in V!) - Y = g + j*b is the complex admittance
The key innovation is that current equations are LINEAR in voltage variables: I = (g + j*b) * ((Vrf + j*Vif) - (Vrt + j*Vit))
When expanded: Ir = g*(Vrf - Vrt) - b*(Vif - Vit) [Linear!] Ii = g*(Vif - Vit) + b*(Vrf - Vrt) [Linear!]
This is truly multilinear because there are no products of voltage variables, unlike power equations S = V * conj(I) which are bilinear.
The current balance at each node: Ξ£I = 0 is linear in all voltage variables.
- Parameters:
vfactory β Variable factory for creating variables
name β Name of the template
- Returns:
RmsModelTemplate with complex multilinear line equations
VeraGridEngine.Templates.Rms.line_phasor_rms_template moduleο
- VeraGridEngine.Templates.Rms.line_phasor_rms_template.get_line_phasor_rms_template(vfactory: VarFactory, name='Line_phasor_rms_template') RmsModelTemplate[source]ο
Get the phasor-based RMS template model of the Line using current balance.
This template uses phasor representation (Vr, Vi) for voltages and outputs currents directly for current balance equations: - Current: I = Y * (Vf - Vt) + Ysh * V
Where V = Vr + j*Vi and Y = g + j*b
- Parameters:
vfactory β Variable factory for creating variables
name β Name of the template
- Returns:
RmsModelTemplate with phasor-based line current equations
VeraGridEngine.Templates.Rms.line_rms_ml_template moduleο
- VeraGridEngine.Templates.Rms.line_rms_ml_template.get_line_rms_ml_template(vfactory: VarFactory, name='Line_rms_template') RmsModelTemplate[source]ο
Get the RMS template model of the Line :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.line_rms_template moduleο
- VeraGridEngine.Templates.Rms.line_rms_template.get_dc_line_rms_template(vfactory: VarFactory, name: str = 'DC_Line_rms_template', use_dynamic_inductance: bool = True) RmsModelTemplate[source]ο
Build the RMS series R-L model of a DC line.
The retained status input opens the driving voltage while preserving the fixed DAE dimensions and the physical current decay.
- Parameters:
vfactory β Symbolic variable factory shared by the circuit.
name β Human-readable RMS template name.
use_dynamic_inductance β Use a model-owned series inductance event parameter and represent current as a differential state. When
False, retain the exact purely resistive algebraic branch law.
- Returns:
DC-line RMS template for the requested branch topology.
- VeraGridEngine.Templates.Rms.line_rms_template.get_ideal_ac_connector_rms_template(vfactory: VarFactory, name: str = 'DGS ideal AC connector RMS shell', enforce_voltage_constraint: bool = True) RmsModelTemplate[source]ο
Build an exact fixed-size RMS model for an ideal AC connector.
A zero-impedance AC line is a topological contraction in PowerFactory. Its RMS counterpart must therefore conserve terminal powers and impose equal voltage phasors while closed. Reusing this moduleβs regular line wrapper preserves the symbolic port and UID topology expected by the circuit-wide DAE assembler.
- Parameters:
vfactory β Variable factory shared by the owning circuit.
name β Human-readable model name used by diagnostics and the GUI.
enforce_voltage_constraint β Include this connector in the active topology forest. A redundant chord retains zero transfer power.
- Returns:
Exact ideal-connector RMS template with regular line ports.
- VeraGridEngine.Templates.Rms.line_rms_template.get_line_rms_template(vfactory: VarFactory, name='Line_rms_template') RmsModelTemplate[source]ο
Get the RMS template model of the Line :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.load1_rms_template moduleο
- VeraGridEngine.Templates.Rms.load1_rms_template.get_load1_rms_template(var_factory: VarFactory, name='Load rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Load :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.load2_rms_template moduleο
- VeraGridEngine.Templates.Rms.load2_rms_template.get_load2_rms_template(var_factory: VarFactory, name='Load rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Load :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.load_dynamic_tap_template moduleο
- VeraGridEngine.Templates.Rms.load_dynamic_tap_template.DynamicTapLoadBuild(vfactory: VarFactory, name: str = '', Pl0=1.0, Ql0=0.1) RmsModelTemplate[source]ο
Builds an RMS model template for a dynamic tap-changing load with PI voltage control.
This load model represents a load equipped with an on-load tap changer (OLTC) or similar voltage regulation device. A PI controller adjusts the effective voltage ratio (m) to maintain the load voltage within desired bounds.
The model includes: - State equation for tap position/ratio (m) controlled by PI regulator - Algebraic equations for active and reactive power with exponential voltage dependency - Power equations: P = P0*(V/m)^alpha_p, Q = Q0*(V/m)^alpha_q
- The PI controller adjusts m based on voltage deviation from reference:
dm/dt = -Kd*m + Ki*(V/m - 1 + Kd/Ki*V0)
- Args:
vfactory: VarFactory instance for creating variables name (str): Name of the load model Pl0 (float): Initial active power at nominal voltage (pu) Ql0 (float): Initial reactive power at nominal voltage (pu)
- Returns:
RmsModelTemplate: Configured RMS model template for dynamic tap load simulation
- class VeraGridEngine.Templates.Rms.load_dynamic_tap_template.DynamicTapLoadRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.load_exponential_template moduleο
- VeraGridEngine.Templates.Rms.load_exponential_template.ExponentialLoadBuild(vfactory: VarFactory, name: str = 'Exponential load RMS template', Pl0: float = 1.0, Ql0: float = 0.1) RmsModelTemplate[source]ο
Builds an RMS model template for an exponential load.
Exponential load model represents load power consumption as an exponential function of voltage magnitude. The power varies with voltage raised to an exponent.
- The power equations are:
P = P0 * (V/V0)^a Q = Q0 * (V/V0)^b
- Where:
a is the active power voltage exponent (default 5.0 for constant impedance-like behavior)
b is the reactive power voltage exponent (default 5.0 for constant impedance-like behavior)
This model is useful for representing loads where power consumption is highly sensitive to voltage changes, such as heating loads or certain electronic devices.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
Pl0 β Initial active power at nominal voltage in per unit.
Ql0 β Initial reactive power at nominal voltage in per unit.
- Returns:
Configured exponential-load RMS model template.
- class VeraGridEngine.Templates.Rms.load_exponential_template.ExponentialLoadRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.load_frequency_dependent moduleο
- VeraGridEngine.Templates.Rms.load_frequency_dependent.FrequencyLoadBuild(vfactory: VarFactory, name: str = 'Frequency-dependent load RMS template', Pl0: float = 1.0, Ql0: float = 0.1) RmsModelTemplate[source]ο
Build a voltage- and frequency-dependent RMS load model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
Pl0 β Initial active power at nominal voltage in per unit.
Ql0 β Initial reactive power at nominal voltage in per unit.
- Returns:
Configured frequency-dependent load RMS model template.
- class VeraGridEngine.Templates.Rms.load_frequency_dependent.FrequencyLoadRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.load_motor_template moduleο
- VeraGridEngine.Templates.Rms.load_motor_template.MotorLoadBuild(vfactory: VarFactory, name: str = 'Motor load RMS template') RmsModelTemplate[source]ο
Build a detailed induction-motor RMS load model.
The model represents transient and subtransient electrical dynamics, rotor-speed mechanics, and dq-frame current, voltage, and power equations.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured induction-motor load RMS model template.
VeraGridEngine.Templates.Rms.load_phasor_current_rms_template moduleο
- VeraGridEngine.Templates.Rms.load_phasor_current_rms_template.get_load_phasor_current_rms_template(vfactory: VarFactory, name: str = 'Load phasor current RMS template') RmsModelTemplate[source]ο
Get the RMS template model of the load in current-balance phasor coordinates.
This model behaves as a constant-power load (not a current source): - P = Pl0 - Q = Ql0 - I = conj(S / V), with S = P + jQ and V = Vr + jVi
Sign convention follows the rest of the RMS templates: load consumption is represented with negative injections (Pl0 < 0, Ql0 < 0).
- Parameters:
vfactory β Variable factory for creating variables
name β Name of the template
- Returns:
RmsModelTemplate with voltage-dependent load current model
VeraGridEngine.Templates.Rms.load_phasor_rms_template moduleο
- VeraGridEngine.Templates.Rms.load_phasor_rms_template.get_load_phasor_rms_template(vfactory: VarFactory, name='Load phasor rms template') RmsModelTemplate[source]ο
Get the RMS template model of the Load using phasor coordinates (Vr, Vi) :return: RmsModelTemplate
VeraGridEngine.Templates.Rms.load_rms_template moduleο
- class VeraGridEngine.Templates.Rms.load_rms_template.LoadRmsTemplate(vf: VarFactory)[source]ο
Bases:
TemplateDefinitionDefinition of the editable RMS constant-power load.
- eval() RmsModelTemplate[source]ο
Build the RMS load with optional user-provided initial powers.
- Returns:
Constructed RMS load template.
- VeraGridEngine.Templates.Rms.load_rms_template.get_load_rms_template(vfactory: VarFactory, name: str = 'Load rms template', pl0_init: float | None = None, ql0_init: float | None = None) RmsModelTemplate[source]ο
Build the RMS constant-power load model.
Pl0andQl0remain runtime event parameters. When an optional value is unset, the associated Load device supplies its P/Q value throughapi_obj_mappingand the stored expression isConst(None). A numeric General option omits that mapping and becomes the authoritative baseline while preserving event support.- Parameters:
vfactory β Variable factory used by the symbolic model.
name β Model name.
pl0_init β Optional active-power override in p.u.
ql0_init β Optional reactive-power override in p.u.
- Returns:
RMS load template.
- VeraGridEngine.Templates.Rms.load_rms_template.get_voltage_dependent_power_rms_template(vfactory: VarFactory, voltage_model: VoltageDependentPowerModel, name: str = 'Voltage-dependent power RMS template') RmsModelTemplate[source]ο
Build a static injection initialized from its load-flow power.
Retaining
P0,Q0andV0reproduces either a voltage-aligned constant-current source, where terminal power scales withVm/V0, or a constant shunt admittance, where it scales with(Vm/V0)^2. The model therefore remains completely determined by the exported DGS operating point and does not require PowerFactory at run time.- Parameters:
vfactory β Variable factory owned by the imported circuit.
voltage_model β Physical voltage dependency to reproduce.
name β Human-readable model name shown in the dynamic editor.
- Returns:
RMS template implementing the selected initialized power law.
VeraGridEngine.Templates.Rms.load_zip_template moduleο
- VeraGridEngine.Templates.Rms.load_zip_template.ZIPLoadBuild(vfactory: VarFactory, name: str = 'ZIP model', Pl0=1.0, Ql0=0.1) RmsModelTemplate[source]ο
Builds an RMS model template for a ZIP load.
ZIP load model represents load power consumption as a combination of constant impedance (Z), constant current (I), and constant power (P) components. The active and reactive power are calculated as quadratic functions of voltage magnitude.
- The power equations are:
P = P0 * (a1*(V/V0)^2 + a2*(V/V0) + a3) Q = Q0 * (a4*(V/V0)^2 + a5*(V/V0) + a6)
Where coefficients must sum to 1.0 for both active (a1+a2+a3) and reactive (a4+a5+a6) power.
- Args:
vfactory: VarFactory instance for creating variables name (str): Name of the load model Pl0 (float): Initial active power at nominal voltage (pu) Ql0 (float): Initial reactive power at nominal voltage (pu)
- Returns:
RmsModelTemplate: Configured RMS model template for ZIP load simulation
- Raises:
ValueError: If ZIP coefficients do not sum to 1.0 within tolerance
- class VeraGridEngine.Templates.Rms.load_zip_template.ZipLoadRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.pv_load_template moduleο
- VeraGridEngine.Templates.Rms.pv_load_template.PVLoadBuild(vfactory: VarFactory, name: str = 'PV load RMS template', Pg0_val: float | None = None, Vg0_val: float = 1.0) RmsModelTemplate[source]ο
Builds an RMS model template for a PV load with reactive power limits.
The PV load model represents a load/generator with constant active power (P) and reactive power limited between Qmin and Qmax. When reactive power is within limits, the voltage is held at the reference value V0. When reactive power hits a limit, the voltage is allowed to vary.
- Equations:
P = Pg0 (constant active power) Qh = Qg Qg = Qmax_G if Qh >= Qmax_G Vh = Vg0 if Qmax_G < Qh < Qmin_G Qg = Qmin_G if Qh <= Qmin_G
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
Pg0_val β Optional initial active power in per unit; otherwise use the solved power-flow value.
Vg0_val β Initial voltage reference in per unit.
- Returns:
Configured PV-load RMS model template.
- class VeraGridEngine.Templates.Rms.pv_load_template.PvLoadRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
VeraGridEngine.Templates.Rms.pvd1_rms_template moduleο
- VeraGridEngine.Templates.Rms.pvd1_rms_template.get_pvd1_complete_rms_template(vfactory: VarFactory, name: str = 'PVD1 complete RMS template') RmsModelTemplate[source]ο
More complete WECC/ANDES-like PVD1 RMS model.
Compared to
get_pvd1_rms_template, this variant adds:frequency deadband and post-deadband active-power support (fdbd, ddn),
explicit pref/pext internal summation channels,
optional active-power limiting switch (plim),
recovery multipliers with separate frequency/voltage enable flags.
Notes:
fnis a static parameter mapped to the grid nominal frequency.f_hzis the local frequency measured by the PLL.True latching tripping behavior (frflag/vrflag in the original ANDES formulation) is approximated by continuous enable factors; it does not implement memory latching.
- VeraGridEngine.Templates.Rms.pvd1_rms_template.get_pvd1_dc_link_bess_rms_template(vfactory: VarFactory, name: str = 'PVD1 DC-link BESS RMS template') RmsModelTemplate[source]ο
PVD1 AC current-command framework adapted to a BESS with DC-link equivalent capacitance.
Main adaptations from the PV DC-link template: - Remove PV/MPPT channels and replace them with bidirectional battery DC power control. - Keep AC-side current control, P/Q limiting, and V/f tripping structure. - Represent stored energy on DC side through equivalent capacitance
Cdc_eqandVdcdynamics.Sign convention: -
P > 0: discharging to AC grid. -P < 0: charging from AC grid. -Pbat > 0: battery injects power into the DC link. -Pbat < 0: battery absorbs power from the DC link.
- VeraGridEngine.Templates.Rms.pvd1_rms_template.get_pvd1_dc_link_mppt_rms_template(vfactory: VarFactory, name: str = 'PVD1 DC-link MPPT RMS template') RmsModelTemplate[source]ο
PVD1 extension with explicit PV-side and DC-link dynamics.
Main additions over
get_pvd1_dc_mppt_rms_template: - PV-side voltage targetVmp(G,T)and currentImp(G,T)channels - Boost duty-cycle loop to trackVpv -> Vmp- Explicit DC-link dynamic stateVdcwith power balance
- VeraGridEngine.Templates.Rms.pvd1_rms_template.get_pvd1_dc_mppt_rms_template(vfactory: VarFactory, name: str = 'PVD1 DC-MPPT RMS template') RmsModelTemplate[source]ο
PVD1 extension with DC-side power availability and MPPT lag.
Added DC-side channels: - Pavail = Prated * (G / Gref) * (1 + kT * (Tcell - Tref)), limited to [0, Prated] - MPPT first-order tracking: dPmppt/dt = (Pavail - Pmppt) / Tmppt - Active-power command is limited by dynamic MPPT ceiling instead of a fixed pmx
This model keeps the same AC current-command framework as PVD1 while making irradiance and cell temperature directly affect active-power availability.
- VeraGridEngine.Templates.Rms.pvd1_rms_template.get_pvd1_rms_template(vfactory: VarFactory, name: str = 'PVD1 RMS template') RmsModelTemplate[source]ο
WECC/ANDES PVD1-inspired RMS PV model.
This implementation focuses on the core current-command behavior needed for RMS studies in VeraGrid: - P/Q references to current commands - Q(V) droop outside [v0, v1] - active/reactive current hard limits with P/Q priority - simplified V/f tripping multipliers - first-order lag on output currents (tip, tiq)
VeraGridEngine.Templates.Rms.pvd1_rms_template_procedural moduleο
- VeraGridEngine.Templates.Rms.pvd1_rms_template_procedural.get_pvd1_complete_rms_template(vfactory: VarFactory, name: str = 'PVD1 complete RMS template') RmsModelTemplate[source]ο
More complete WECC/ANDES-like PVD1 RMS model.
Compared to
get_pvd1_rms_template, this variant adds:frequency deadband and post-deadband active-power support (fdbd, ddn),
explicit pref/pext internal summation channels,
optional active-power limiting switch (plim),
recovery multipliers with separate frequency/voltage enable flags.
Notes:
fnis a static parameter mapped to the grid nominal frequency.f_hzis the local frequency measured by the PLL.True latching tripping behavior (frflag/vrflag in the original ANDES formulation) is approximated by continuous enable factors; it does not implement memory latching.
- VeraGridEngine.Templates.Rms.pvd1_rms_template_procedural.get_pvd1_dc_link_bess_rms_template(vfactory: VarFactory, name: str = 'PVD1 DC-link BESS RMS template') RmsModelTemplate[source]ο
PVD1 AC current-command framework adapted to a BESS with DC-link equivalent capacitance.
Main adaptations from the PV DC-link template: - Remove PV/MPPT channels and replace them with bidirectional battery DC power control. - Keep AC-side current control, P/Q limiting, and V/f tripping structure. - Represent stored energy on DC side through equivalent capacitance
Cdc_eqandVdcdynamics.Sign convention: -
P > 0: discharging to AC grid. -P < 0: charging from AC grid. -Pbat > 0: battery injects power into the DC link. -Pbat < 0: battery absorbs power from the DC link.
- VeraGridEngine.Templates.Rms.pvd1_rms_template_procedural.get_pvd1_dc_link_mppt_rms_template(vfactory: VarFactory, name: str = 'PVD1 DC-link MPPT RMS template') RmsModelTemplate[source]ο
PVD1 extension with explicit PV-side and DC-link dynamics.
Main additions over
get_pvd1_dc_mppt_rms_template: - PV-side voltage targetVmp(G,T)and currentImp(G,T)channels - Boost duty-cycle loop to trackVpv -> Vmp- Explicit DC-link dynamic stateVdcwith power balance
- VeraGridEngine.Templates.Rms.pvd1_rms_template_procedural.get_pvd1_dc_mppt_rms_template(vfactory: VarFactory, name: str = 'PVD1 DC-MPPT RMS template') RmsModelTemplate[source]ο
PVD1 extension with DC-side power availability and MPPT lag.
Added DC-side channels: - Pavail = Prated * (G / Gref) * (1 + kT * (Tcell - Tref)), limited to [0, Prated] - MPPT first-order tracking: dPmppt/dt = (Pavail - Pmppt) / Tmppt - Active-power command is limited by dynamic MPPT ceiling instead of a fixed pmx
This model keeps the same AC current-command framework as PVD1 while making irradiance and cell temperature directly affect active-power availability.
- VeraGridEngine.Templates.Rms.pvd1_rms_template_procedural.get_pvd1_rms_template(vfactory: VarFactory, name: str = 'PVD1 RMS template') RmsModelTemplate[source]ο
WECC/ANDES PVD1-inspired RMS PV model.
This implementation focuses on the core current-command behavior needed for RMS studies in VeraGrid: - P/Q references to current commands - Q(V) droop outside [v0, v1] - active/reactive current hard limits with P/Q priority - simplified V/f tripping multipliers - first-order lag on output currents (tip, tiq)
VeraGridEngine.Templates.Rms.shunt_template moduleο
- VeraGridEngine.Templates.Rms.shunt_template.ShuntLoadBuild(vfactory: VarFactory, name: str = 'Shunt RMS template') RmsModelTemplate[source]ο
Build the polar-voltage constant-admittance shunt model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured polar shunt RMS model template.
- VeraGridEngine.Templates.Rms.shunt_template.ShuntPhasorBuild(vfactory: VarFactory, name: str = 'Shunt phasor RMS template') RmsModelTemplate[source]ο
Build the rectangular-phasor constant-admittance shunt model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured phasor-current shunt RMS model template.
- class VeraGridEngine.Templates.Rms.shunt_template.ShuntTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.shunt_template.get_shunt_template(vfactory: VarFactory, name: str = 'Shunt phasor RMS template', phasor: bool = True) RmsModelTemplate[source]ο
Select and build the requested shunt formulation.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
phasor β Select the rectangular-phasor model when
Trueor the polar-voltage model whenFalse.
- Returns:
Configured shunt RMS model template.
VeraGridEngine.Templates.Rms.st2cut_stabilizer_rms_template moduleο
Standard ST2CUT dual-input power-system stabilizer RMS model.
- class VeraGridEngine.Templates.Rms.st2cut_stabilizer_rms_template.St2cutInputMode(*values)[source]ο
Bases:
EnumWECC ST2CUT input modes supported by this standard realization.
- ELECTRICAL_POWER = 3ο
- ROTOR_SPEED = 1ο
- class VeraGridEngine.Templates.Rms.st2cut_stabilizer_rms_template.St2cutRmsParameters(mode: St2cutInputMode, values: tuple[float, ...], power_scale: float)[source]ο
Bases:
objectNumerical parameters for one ST2CUT stabilizer.
- k1ο
- lsmaxο
- lsminο
- mode: St2cutInputModeο
- power_scale: floatο
- t1ο
- t10ο
- t3ο
- t4ο
- t5ο
- t6ο
- t7ο
- t8ο
- t9ο
- VeraGridEngine.Templates.Rms.st2cut_stabilizer_rms_template.configure_st2cut_block(block: Block, parameters: St2cutRmsParameters, vfactory: VarFactory) None[source]ο
Configure one ST2CUT block.
- Parameters:
block β ST2CUT symbolic block.
parameters β Numerical record.
vfactory β Shared variable factory.
- Returns:
None.
- VeraGridEngine.Templates.Rms.st2cut_stabilizer_rms_template.get_st2cut_stabilizer_rms_template(vfactory: VarFactory, input_mode: St2cutInputMode, include_input_lag: bool, include_second_lead_lag: bool, include_third_lead_lag: bool, name: str = 'ST2CUT stabilizer RMS template') RmsModelTemplate[source]ο
Build the WECC structural variants of ST2CUT.
- Parameters:
vfactory β Shared symbolic variable factory.
input_mode β Rotor-speed or electrical-power input.
include_input_lag β Retain
L1_ywhenT1is nonzero.include_second_lead_lag β Retain
LL2_xwhenT8is nonzero.include_third_lead_lag β Retain
LL3_xwhenT10is nonzero.name β Template name.
- Returns:
ST2CUT stabilizer template.
VeraGridEngine.Templates.Rms.transformer_rms_template moduleο
- class VeraGridEngine.Templates.Rms.transformer_rms_template.IdealTrafoRmsTemplate(vf: VarFactory, name: str = 'rms_ideal_trafo_template')[source]ο
Bases:
RmsModelTemplateRepresent an ideal two-winding transformer without a fake impedance.
- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- tpe: DeviceTypeο
- class VeraGridEngine.Templates.Rms.transformer_rms_template.TrafoPhasorRmsTemplate(vf: VarFactory, name: str = 'rms_trafo_phasor_template')[source]ο
Bases:
RmsModelTemplate- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- class VeraGridEngine.Templates.Rms.transformer_rms_template.TrafoRmsTemplate(vf: VarFactory, name: str = 'rms_trafo_template')[source]ο
Bases:
RmsModelTemplate- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- tpe: DeviceTypeο
- VeraGridEngine.Templates.Rms.transformer_rms_template.get_ideal_transformer2w_rms(vf: VarFactory, name: str = 'rms_ideal_trafo_template') RmsModelTemplate[source]ο
Build the exact zero-series-impedance transformer RMS template.
- Parameters:
vf β Variable factory shared by the owning circuit.
name β Human-readable template name.
- Returns:
Ideal-transformer RMS template.
- VeraGridEngine.Templates.Rms.transformer_rms_template.get_transformer2w_rms(vf: VarFactory, use_phasor_template: bool = False)[source]ο
- VeraGridEngine.Templates.Rms.transformer_rms_template.initialize_trafo_rms(trafo: Transformer2W, vf: VarFactory)[source]ο
- Parameters:
trafo
vf
- Returns:
- VeraGridEngine.Templates.Rms.transformer_rms_template.parse_windings_connection(conn: WindingsConnection) tuple[WindingType, WindingType][source]ο
Parse a WindingsConnection enum into (conn_f, conn_t) WindingType values.
WindingsConnection values are two-character strings: - G: GroundedStar - S: NeutralStar (ungrounded star) - D: Delta
Examples: - GG -> (GroundedStar, GroundedStar) - GD -> (GroundedStar, Delta) - DD -> (Delta, Delta)
VeraGridEngine.Templates.Rms.transformer_rms_template_legacy moduleο
- class VeraGridEngine.Templates.Rms.transformer_rms_template_legacy.TrafoPhasorRmsTemplate(trafo: Transformer2W, vf: VarFactory, name: str = 'rms_trafo_phasor_template')[source]ο
Bases:
RmsModelTemplate- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- class VeraGridEngine.Templates.Rms.transformer_rms_template_legacy.TrafoRmsTemplate(trafo: Transformer2W, vf: VarFactory, Sbase: float = 100, name: str = 'rms_bus_template')[source]ο
Bases:
RmsModelTemplate- CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'selected_to_merge', 'diff_changes', 'device_idtag', 'tpe', 'device_name', 'block')ο
- CLASS_PROPERTIES_WITH_PROFILE = {}ο
- CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:device, prop:block)ο
- CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'block': prop:block, 'code': prop:code, 'comment': prop:comment, 'device': prop:device, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'tpe': prop:tpe}ο
- tpe: DeviceTypeο
- VeraGridEngine.Templates.Rms.transformer_rms_template_legacy.initialize_trafo_rms(trafo: Transformer2W, vf: VarFactory, Sbase: float = 100, use_phasor_template: bool = False)[source]ο
- Parameters:
trafo
vf
Sbase
- Returns:
- VeraGridEngine.Templates.Rms.transformer_rms_template_legacy.parse_windings_connection(conn: WindingsConnection) tuple[WindingType, WindingType][source]ο
Parse a WindingsConnection enum into (conn_f, conn_t) WindingType values.
WindingsConnection values are two-character strings: - G: GroundedStar - S: NeutralStar (ungrounded star) - D: Delta
Examples: - GG -> (GroundedStar, GroundedStar) - GD -> (GroundedStar, Delta) - DD -> (Delta, Delta)
VeraGridEngine.Templates.Rms.voltage_source_template moduleο
- VeraGridEngine.Templates.Rms.voltage_source_template.VoltageSourceBuild(vfactory: VarFactory, name: str = 'Voltage source RMS template') RmsModelTemplate[source]ο
Build an RMS voltage-source template with P/Q capability limits.
Control logic:
Q within limits: enforce
Vm = Vg0.Q at a limit: enforce
Q = clamp(Q, Qmin_G, Qmax_G).P within limits: enforce
Va = Ag0.P at a limit: enforce
P = clamp(P, Pmin_G, Pmax_G).
- Parameters:
vfactory β Shared symbolic variable factory.
name β User-facing model name.
- Returns:
Voltage-source RMS model with an editor-visible equation block.
- VeraGridEngine.Templates.Rms.voltage_source_template.build_thevenin_voltage_source(vfactory: VarFactory, resistance_pu: float, reactance_pu: float, name: str = '') RmsModelTemplate[source]ο
Build an RMS external-network source behind its DGS impedance.
PowerFactory
ElmXnetobjects are ideal internal voltage sources behind the positive-sequence impedance derived fromsnssandrntxn. The terminal voltage therefore changes when the connected system exchanges power, even though the sourceβs internal voltage remains constant. This template retains that physical distinction and works with both the polar P/Q DAE and the rectangular-current phasor formulation.- Parameters:
vfactory β Symbolic variable factory shared by the circuit.
resistance_pu β Positive-sequence source resistance on system base.
reactance_pu β Positive-sequence source reactance on system base.
name β Optional human-readable template name.
- Returns:
External-network RMS template with a finite Thevenin impedance.
VeraGridEngine.Templates.Rms.vsc_ac2ac moduleο
- VeraGridEngine.Templates.Rms.vsc_ac2ac.VscAc2acModel(vfactory: VarFactory, name: str = 'VscAc2acModel') RmsModelTemplate[source]ο
VSC AC-to-DC Converter Model based on equations (18.9), (18.10), and (18.11)
- Parameters:
vfactory β Variable factory for creating symbolic variables
name β Name of the model
- Returns:
RmsModelTemplate containing the VSC AC2AC model
VeraGridEngine.Templates.Rms.vsc_gfl moduleο
- VeraGridEngine.Templates.Rms.vsc_gfl.TrafoGflBuild(vfactory: VarFactory, name: str = 'Grid-following transformer RMS template', control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac) RmsModelTemplate[source]ο
Transformer-coupled GFL model where AC-from side is internal converter bus and AC-to side is grid bus.
- class VeraGridEngine.Templates.Rms.vsc_gfl.TrafoGflRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl.VscGflBuild(vfactory: VarFactory, name: str = 'Grid-following VSC RMS template', control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac) RmsModelTemplate[source]ο
VSC GFL (Grid Following) model with from side the DC bus and to side the AC bus
- Args:
name: Model name control1: First control mode (Pac, Pdc, or Vm_dc) control2: Second control mode (Qac or Vm_ac)
- Supported control combinations:
Pac + Qac: Active and reactive power control
Pac + Vm_ac: Active power and AC voltage control
Pdc + Qac: DC power and reactive power control
Pdc + Vm_ac: DC power and AC voltage control
Vm_dc + Qac: DC voltage and reactive power control
Vm_dc + Vm_ac: DC voltage and AC voltage control
- class VeraGridEngine.Templates.Rms.vsc_gfl.VscGflRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl.build_gfl_converter_model(vfactory: VarFactory, inputs: List, control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac, multilinear: bool = False)[source]ο
Build power control loop model for Grid Following Converter. Supports multiple control modes via ConverterControlType.
- Args:
inputs: [Vm, Va, Vdc] - AC voltage mag/angle, DC voltage control1: First control mode (typically active power or DC voltage related) control2: Second control mode (typically reactive power or AC voltage related) multilinear: Use multilinearization for Park transforms
- Returns:
gfl_block: The complete converter block i_d, i_q: Current references P, Q: Active and reactive power measurements
- VeraGridEngine.Templates.Rms.vsc_gfl.get_pll_transform_rms(vfactory: VarFactory, name: str = 'Pll_transform_rms') RmsModelTemplate[source]ο
Pll
- VeraGridEngine.Templates.Rms.vsc_gfl.inverse_park_transform_block(vfactory: VarFactory, v_dq: list[Var], theta: Var, aux_vars=None, multilinear: bool = False, name: str = '')[source]ο
Create a symbolic inverse Park transform (dq β abc) block for voltages.
v_dq = [v_d_c, v_q_c] theta : grid angle (from PLL) multilinear : if True, use u_cos/u_sin auxiliary variables (for multilinearization)
- VeraGridEngine.Templates.Rms.vsc_gfl.park_transform_block(vfactory: VarFactory, v_abc: list[Var], theta: Var, multilinear: bool = False, aux_vars=None, name: str = '')[source]ο
Create a symbolic Park transform (abc β dq) block for voltages and currents.
i_abc = [i_a, i_b, i_c] v_abc = [v_a, v_b, v_c] theta : grid angle (from PLL)
- VeraGridEngine.Templates.Rms.vsc_gfl.pll_transform(vfactory: VarFactory, v_abc, multilinear: bool = False, name: str = '')[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl.pll_transform_rms(vfactory: VarFactory, Vm, Va, name: str = '')[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl.trafo_gfl_converter_model(vfactory: VarFactory, inputs, control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac)[source]ο
GFL converter model for transformer-coupled setup.
- Inputs order:
[Vm_f, Va_f, Vm_t, Va_t, Vdc, Pt_vsc, Qt_vsc]
from side (f): AC internal converter bus
to side (t): AC grid bus
VeraGridEngine.Templates.Rms.vsc_gfl_dclinked moduleο
- VeraGridEngine.Templates.Rms.vsc_gfl_dclinked.build_trafo_vsc(vf: VarFactory, trafo: Transformer2W, name: str = '')[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl_dclinked.build_vsc_rms(vfactory: VarFactory, name: str = 'vsc_rms_template')[source]ο
Build power control loop model for Grid Following Converter. Supports multiple control modes via ConverterControlType. from bus is DC to bus is AC
- VeraGridEngine.Templates.Rms.vsc_gfl_dclinked.build_vsc_transformer_control(vf: VarFactory, Vm: Var, vdc: Var, name: str = '')[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl_dclinked.parse_windings_connection(conn: WindingsConnection) tuple[WindingType, WindingType][source]ο
Parse a WindingsConnection enum into (conn_f, conn_t) WindingType values.
WindingsConnection values are two-character strings: - G: GroundedStar - S: NeutralStar (ungrounded star) - D: Delta
Examples: - GG -> (GroundedStar, GroundedStar) - GD -> (GroundedStar, Delta) - DD -> (Delta, Delta)
VeraGridEngine.Templates.Rms.vsc_gfl_new moduleο
- VeraGridEngine.Templates.Rms.vsc_gfl_new.TrafoGflBuild(vfactory: VarFactory, name: str = '', control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac) RmsModelTemplate[source]ο
Transformer-coupled GFL model where AC-from side is internal converter bus and AC-to side is grid bus.
- class VeraGridEngine.Templates.Rms.vsc_gfl_new.TrafoGflRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl_new.VscGflBuild(vfactory: VarFactory, name: str = '', control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac) RmsModelTemplate[source]ο
VSC GFL (Grid Following) model with from side the DC bus and to side the AC bus
- Args:
name: Model name control1: First control mode (Pac, Pdc, or Vm_dc) control2: Second control mode (Qac or Vm_ac)
- Supported control combinations:
Pac + Qac: Active and reactive power control
Pac + Vm_ac: Active power and AC voltage control
Pdc + Qac: DC power and reactive power control
Pdc + Vm_ac: DC power and AC voltage control
Vm_dc + Qac: DC voltage and reactive power control
Vm_dc + Vm_ac: DC voltage and AC voltage control
- class VeraGridEngine.Templates.Rms.vsc_gfl_new.VscGflRmsTemplate(vf)[source]ο
Bases:
TemplateDefinition- eval() RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl_new.build_gfl_converter_model(vfactory: VarFactory, inputs, control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac, multilinear: bool = False)[source]ο
Build power control loop model for Grid Following Converter. Supports multiple control modes via ConverterControlType.
- Args:
inputs: [Vm, Va, Vdc] - AC voltage mag/angle, DC voltage control1: First control mode (typically active power or DC voltage related) control2: Second control mode (typically reactive power or AC voltage related) multilinear: Use multilinearization for Park transforms
- Returns:
gfl_block: The complete converter block i_d, i_q: Current references P, Q: Active and reactive power measurements
- VeraGridEngine.Templates.Rms.vsc_gfl_new.get_pll_transform_rms(vfactory: VarFactory, name: str = 'Pll_transform_rms') RmsModelTemplate[source]ο
Pll
- VeraGridEngine.Templates.Rms.vsc_gfl_new.inverse_park_transform_block(vfactory: VarFactory, v_dq: list[Var], theta: Var, aux_vars=None, multilinear: bool = False, name: str = '')[source]ο
Create a symbolic inverse Park transform (dq β abc) block for voltages.
v_dq = [v_d_c, v_q_c] theta : grid angle (from PLL) multilinear : if True, use u_cos/u_sin auxiliary variables (for multilinearization)
- VeraGridEngine.Templates.Rms.vsc_gfl_new.park_transform_block(vfactory: VarFactory, v_abc: list[Var], theta: Var, multilinear: bool = False, aux_vars=None, name: str = '')[source]ο
Create a symbolic Park transform (abc β dq) block for voltages and currents.
i_abc = [i_a, i_b, i_c] v_abc = [v_a, v_b, v_c] theta : grid angle (from PLL)
- VeraGridEngine.Templates.Rms.vsc_gfl_new.pll_transform(vfactory: VarFactory, v_abc, multilinear: bool = False, name: str = '')[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl_new.pll_transform_rms(vfactory: VarFactory, Vm, Va, name: str = '')[source]ο
- VeraGridEngine.Templates.Rms.vsc_gfl_new.trafo_gfl_converter_model(vfactory: VarFactory, inputs, control1: ConverterControlType = P_ac, control2: ConverterControlType = Q_ac)[source]ο
GFL converter model for transformer-coupled setup.
- Inputs order:
[Vm_f, Va_f, Vm_t, Va_t, Vdc, Pt_vsc, Qt_vsc]
from side (f): AC internal converter bus
to side (t): AC grid bus
VeraGridEngine.Templates.Rms.vsc_gfm moduleο
- VeraGridEngine.Templates.Rms.vsc_gfm.VscGfmBuild(vfactory: VarFactory, name: str = 'Grid-forming VSC RMS template') RmsModelTemplate[source]ο
VSC GFM (Grid Forming) model template builder.
- VeraGridEngine.Templates.Rms.vsc_gfm.VscGfmLossBuild(vfactory: VarFactory, name: str = 'Grid-forming VSC loss RMS template', current_power_inputs: List[Var] | None = None, reconstruct_filter_voltage: bool = False) RmsModelTemplate[source]ο
VSC GFM model builder for explicit AC filter-network validations.
This maps the VSC active powers through the converter loss equation, exposes controlled/filter/grid AC node voltages separately, and does not expose a DC-side reactive power mapping.
- VeraGridEngine.Templates.Rms.vsc_gfm.build_gfm_converter_model(vfactory: VarFactory, inputs: List[Var], multilinear: bool = False, voltage_inputs: List[Var] | None = None, power_inputs: List[Var] | None = None, current_power_inputs: List[Var] | None = None, reconstruct_filter_voltage: bool = False)[source]ο
Build Grid Forming Converter model (Droop + voltage + current control) based on the provided conceptual equations.
VeraGridEngine.Templates.Rms.vsc_template moduleο
- VeraGridEngine.Templates.Rms.vsc_template.PVCellBuild(vfactory: VarFactory, name: str = 'PV cell RMS template') RmsModelTemplate[source]ο
Build the algebraic photovoltaic-cell DC source model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured photovoltaic-cell RMS model template.
- VeraGridEngine.Templates.Rms.vsc_template.PVControlBuild(vfactory: VarFactory, name: str = 'PV control RMS template') RmsModelTemplate[source]ο
Build a photovoltaic DC-voltage PI control model.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured photovoltaic control RMS model template.
- VeraGridEngine.Templates.Rms.vsc_template.PVControlBuild2(vfactory: VarFactory, name: str = '') RmsModelTemplate[source]ο
- VeraGridEngine.Templates.Rms.vsc_template.VSCShuntBuild(vfactory: VarFactory, name: str = 'VSC shunt RMS template') RmsModelTemplate[source]ο
Build a shunt VSC with a DC-side source and an AC-side terminal.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured shunt VSC RMS model template.
- VeraGridEngine.Templates.Rms.vsc_template.VSCShuntBuild2(vfactory: VarFactory, name: str = 'VSC shunt RMS template 2') RmsModelTemplate[source]ο
Build the alternate shunt VSC power-balance formulation.
- Parameters:
vfactory β Factory that owns the modelβs symbolic variables.
name β Name assigned to the generated RMS model template.
- Returns:
Configured alternate shunt VSC RMS model template.
- VeraGridEngine.Templates.Rms.vsc_template.VscControlledPV(vfactory: VarFactory, name='VscControlledPV') RmsModelTemplate[source]ο