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: RmsModelTemplate

Complex 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_complex_rms_template.polar_to_complex(Vm: float, Va: float) → complex[source]

Convert polar coordinates (magnitude, angle) to complex phasor.

Parameters:
  • Vm – Voltage magnitude in p.u.

  • Va – Voltage angle in radians

Returns:

Complex voltage V = Vm * exp(j*Va)

VeraGridEngine.Templates.Rms.bus_complex_rms_template.real_imag_to_complex(Vr: float, Vi: float) → complex[source]

Convert real and imaginary components to complex phasor.

Parameters:
  • Vr – Real part of voltage

  • Vi – Imaginary part of voltage

Returns:

Complex voltage V = Vr + j*Vi

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: RmsModelTemplate

Phasor-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.bus_phasor_rms_template.polar_to_phasor(Vm: float, Va: float) → Tuple[float, float][source]

Convert polar coordinates (magnitude, angle) to phasor (real, imaginary).

Parameters:
  • Vm – Voltage magnitude in p.u.

  • Va – Voltage angle in radians

Returns:

Tuple of (Vr, Vi)

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: object

Numerical 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: Enum

Mechanical-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: object

Numerical 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: object

Numerical 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: object

Numerical 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: Enum

Excitation-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: object

Numerical 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: Enum

Structural magnetic-saturation realizations supported by GENROU.

DISABLED = 2
QUADRATIC = 1
class VeraGridEngine.Templates.Rms.genrou_exc_gov_rms_template.Tgov1ModelType(*values)[source]

Bases: Enum

Power-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: object

Numerical 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_y is algebraic and is not retained as a differential state. The retained states are LG_y, LL_x and LAW2_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.

TGOV1 applies the droop gain after summing speed, reference and auxiliary inputs. TGOV1N applies droop only to speed and sums power references afterwards, as required by the IEEE39 reference data. The valve lag uses directional anti-windup at VMIN and VMAX so 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: RmsModelTemplate

RMS 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: TemplateDefinition

Editable 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 VSC device. Its AC terminal uses Vm/Va and its DC terminal uses Vdc. 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, or Pac).

  • control2 – Reactive-axis control mode (Qac or Vm_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: object

Numerical 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 T5 and T6 and 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 T7 is 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: Enum

Input 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: object

Numerical 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: object

Numerical 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_y and W_x remain 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: TemplateDefinition

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

Pl0 and Ql0 remain runtime event parameters. When an optional value is unset, the associated Load device supplies its P/Q value through api_obj_mapping and the stored expression is Const(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, Q0 and V0 reproduces either a voltage-aligned constant-current source, where terminal power scales with Vm/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:

  • fn is a static parameter mapped to the grid nominal frequency. f_hz is 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.

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_eq and Vdc dynamics.

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.

PVD1 extension with explicit PV-side and DC-link dynamics.

Main additions over get_pvd1_dc_mppt_rms_template: - PV-side voltage target Vmp(G,T) and current Imp(G,T) channels - Boost duty-cycle loop to track Vpv -> Vmp - Explicit DC-link dynamic state Vdc with 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:

  • fn is a static parameter mapped to the grid nominal frequency. f_hz is 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.

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_eq and Vdc dynamics.

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.

PVD1 extension with explicit PV-side and DC-link dynamics.

Main additions over get_pvd1_dc_mppt_rms_template: - PV-side voltage target Vmp(G,T) and current Imp(G,T) channels - Boost duty-cycle loop to track Vpv -> Vmp - Explicit DC-link dynamic state Vdc with 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 True or the polar-voltage model when False.

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: Enum

WECC 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: object

Numerical 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_y when T1 is nonzero.

  • include_second_lead_lag – Retain LL2_x when T8 is nonzero.

  • include_third_lead_lag – Retain LL3_x when T10 is 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: RmsModelTemplate

Represent 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 ElmXnet objects are ideal internal voltage sources behind the positive-sequence impedance derived from snss and rntxn. 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]

Module contents