andes.system.System#

class andes.system.System(case: str | None = None, name: str | None = None, config: Dict | None = None, config_path: str | None = None, default_config: bool | None = False, options: Dict | None = None, no_undill: bool | None = False, autogen_stale: bool | None = True, **kwargs)[source]#

System contains models and routines for modeling and simulation.

System contains a several special OrderedDict member attributes for housekeeping. These attributes include models, groups, routines and calls for loaded models, groups, analysis routines, and generated numerical function calls, respectively.

Parameters:
no_undillbool, optional, default=False

True to disable the call to System.undill() at the end of object creation. False by default.

autogen_stalebool, optional, default=True

True to automatically generate code for stale models.

Notes

System stores model and routine instances as attributes. Model and routine attribute names are the same as their class names. For example, Bus is stored at system.Bus, the power flow calculation routine is at system.PFlow, and the numerical DAE instance is at system.dae. See attributes for the list of attributes.

Attributes:
daeandes.variables.dae.DAE

Numerical DAE storage

filesandes.variables.fileman.FileMan

File path storage

configandes.core.Config

System config storage

modelsOrderedDict

model name and instance pairs

groupsOrderedDict

group name and instance pairs

routinesOrderedDict

routine name and instance pairs

__init__(case: str | None = None, name: str | None = None, config: Dict | None = None, config_path: str | None = None, default_config: bool | None = False, options: Dict | None = None, no_undill: bool | None = False, autogen_stale: bool | None = True, **kwargs)[source]#

Methods

add(model[, param_dict])

Add a device instance for an existing model.

as_dict([vin, skip_empty])

Return system data as a dict where the keys are model names and values are dicts.

calc_pu_coeff()

Perform per unit value conversion.

call_models(method, models, *args, **kwargs)

Call methods on the given models.

collect_config()

Collect config data from models.

collect_ref()

Collect indices into BackRef for all models.

connectivity([info])

Perform connectivity check for system.

e_clear(models)

Clear equation arrays in DAE and model variables.

f_update(models)

Call the differential equation update method for models in sequence.

fg_to_dae()

Collect equation values into the DAE arrays.

find_devices()

Add dependent devices for all model based on DeviceFinder.

find_models(flag[, skip_zero])

Find models with at least one of the flags as True.

from_ipysheet(model, sheet[, vin])

Set an ipysheet object back to model.

g_islands()

Reset algebraic mismatches for islanded buses.

g_update(models)

Call the algebraic equation update method for models in sequence.

get_z(models)

Get all discrete status flags in a numpy array.

import_groups()

Import all groups classes defined in models/group.py.

import_models()

Import and instantiate models as System member attributes.

import_routines()

Import routines as defined in routines/__init__.py.

init(models, routine)

Initialize the variables for each of the specified models.

j_islands()

Set gy diagonals to eps for a and v variables of islanded buses.

j_update(models[, info])

Call the Jacobian update method for models in sequence.

l_update_eq(models[, init, niter])

Update equation-dependent limiter discrete components by calling l_check_eq of models.

l_update_var(models[, niter, err])

Update variable-based limiter discrete states by calling l_update_var of models.

link_ext_param([model])

Retrieve values for ExtParam for the given models.

precompile([models, nomp, ncpu])

Trigger precompilation for the given models.

prepare([quick, incremental, models, nomp, ncpu])

Generate numerical functions from symbolically defined models.

reload(case, **kwargs)

Reload a new case in the same System object.

remove_pycapsule()

Remove PyCapsule objects in solvers.

reset([force])

Reset to the state after reading data and setup (before power flow).

s_update_post(models)

Update variable services by calling s_update_post of models.

s_update_var(models)

Update variable services by calling s_update_var of models.

save_config([file_path, overwrite])

Save all system, model, and routine configurations to an rc-formatted file.

set_address(models)

Set addresses for differential and algebraic variables.

set_config([config])

Set configuration for the System object.

set_dae_names(models)

Set variable names for differential and algebraic variables, right-hand side of external equations, and discrete flags.

set_output_subidx(models)

Process andes.models.misc.Output data and store the sub-indices into dae.xy.

set_var_arrays(models[, inplace, alloc])

Set arrays (v and e) for internal variables to access dae arrays in place.

setup()

Set up system for studies.

store_adder_setter(models)

Store non-inplace adders and setters for variables and equations.

store_existing()

Store existing models in System.existing.

store_no_check_init(models)

Store differential variables with check_init == False.

store_sparse_pattern(models)

Collect and store the sparsity pattern of Jacobian matrices.

store_switch_times(models[, eps])

Store event switching time in a sorted Numpy array in System.switch_times and an OrderedDict System.switch_dict.

summary()

Print out system summary.

supported_models([export])

Return the support group names and model names in a table.

switch_action(models)

Invoke the actions associated with switch times.

to_ipysheet(model[, vin])

Return an ipysheet object for editing in Jupyter Notebook.

undill([autogen_stale])

Reload generated function functions, from either the $HOME/.andes/pycode folder.

vars_to_dae(model)

Copy variables values from models to System.dae.

vars_to_models()

Copy variable values from System.dae to models.