Configuration#

Every run is controlled by a Config object. The everyday way to set its fields is through keyword arguments of hermess.simulate(), which accepts any field listed below:

dae = hermess.simulate("ieee39", ts=0.001, T_end=12.0, line_dyn=False)

For repeated runs, or to work with the shipped default scenario, build a configuration object explicitly and derive variants from it:

from hermess.config import config          # the shipped default scenario

new_config = config.updated(ts=0.001, T_end=12.0)

The fields, with their types and defaults:

class hermess.config.Config(**data)[source]

Holds all attributes controlling a simulation run.

Parameters:
  • data (Any)

  • testsystemfile (str)

  • system_root (Path | None)

  • omega_mode (Literal['coi', 'single', 'nom', 'dist'])

  • omega_single_idx (str | None)

  • fn (Literal[50, 60])

  • Sb (int)

  • ts (float)

  • T_start (float)

  • T_end (float)

  • int_scheme_sim (Literal['idas', 'collocation', 'cvodes', 'rk'])

  • int_scheme_sim_options (dict)

  • plot (bool)

  • plot_voltage (bool)

  • plot_diff (bool)

  • incl_lim (bool)

  • line_dyn (bool)

  • skip_disturance (bool)

  • debug_check_init (bool)

  • print_power_flow (bool)

  • small_signal_analysis (bool)

  • small_signal_figures (bool)

  • parametric (bool)

  • show_progress (bool)

  • log_level (Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])

hermess.config.Config.updated(self, **kwargs)

Return a copy of this config with the given fields overridden.

Parameters:
  • testsystemfile (str) – The path to the system test case.

  • fn (float) – System frequency (currently only tested for 50 Hz).

  • omega_mode (str) – Reference frequency mode used in the simulation. Must be ‘coi’, ‘single’, ‘nom’ or ‘dist’.

  • omega_single_idx (str or None) – Reference device identifier (e.g. “SG1”) used only if omega_mode=’single’ (None → slack bus).

  • Sb (float) – Base power of the grid in [MW]. Line parameters are assumed to be calculated using this base power.

  • ts (float) – Simulation time step.

  • T_start (float) – Simulation start time (must currently be 0).

  • T_end (float) – End time of the simulation.

  • plot (bool) – Enable or disable plotting.

  • plot_voltage (bool) – Whether to plot voltage data.

  • plot_diff (bool) – Whether to plot differential state data.

  • incl_lim (bool) – If state limiters should be included in the simulation. If False, the simulation will be much faster.

  • line_dyn (bool) – Simulate with line dynamic models (differential equations).

  • skip_disturance (bool) – Skip disturbance simulation.

  • debug_check_init (bool) – Enable debug check for initialization of DAE system.

  • print_power_flow (bool) – Print initial power flow to output.

  • system_root (Path or None) – Directory holding the system folders. None uses the systems shipped with the package (hermess/systems); point it at a directory of your own to run a system you wrote.

  • int_scheme_sim (str) – Integration scheme. 'idas' (default) and 'cvodes' are the SUNDIALS variable-step solvers and are the right choice for stiff models; 'collocation' and 'rk' are fixed-step schemes, faster on smooth problems but less robust.

  • int_scheme_sim_options (dict) – Extra options passed to the CasADi integrator, e.g. {'abstol': 1e-8, 'reltol': 1e-8}.

  • log_level (str) – Logging verbosity: 'DEBUG', 'INFO', 'WARNING', 'ERROR' or 'CRITICAL'.

  • small_signal_analysis (bool) – Run the small-signal eigenvalue/participation analysis at the operating point (before the simulation) and show the frequency-banded participation figures plus the modal report.

  • small_signal_figures (bool) – Show the small-signal figures when small_signal_analysis is set. False computes the data only (eigenvalues, modes, participation factors on the returned model), for headless or embedded use.

  • parametric (bool) – Build the equations with device parameters as CasADi symbols, so trajectories and functionals can be differentiated with respect to them. The parametric expressions are stashed as dae.parametric_model; the run itself uses the numeric model recovered by substitution and is unchanged up to floating point rounding. See hermess.parametric.

  • kwargs (Any)

Returns:

A new instance of the Config class configured with the provided parameters.

Return type:

Config