andes.system.System#
- class andes.system.System(case: Optional[str] = None, name: Optional[str] = None, config: Optional[Dict] = None, config_path: Optional[str] = None, default_config: Optional[bool] = False, options: Optional[Dict] = None, no_undill: Optional[bool] = False, **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
True to disable the call to
System.undill()
at the end of object creation. False by default.
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 atsystem.PFlow
, and the numerical DAE instance is atsystem.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: Optional[str] = None, name: Optional[str] = None, config: Optional[Dict] = None, config_path: Optional[str] = None, default_config: Optional[bool] = False, options: Optional[Dict] = None, no_undill: Optional[bool] = False, **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.
Perform per unit value conversion.
call_models
(method, models, *args, **kwargs)Call methods on the given models.
Collect indices into BackRef for all models.
connectivity
([info])Perform connectivity check for system.
dill
()Serialize generated numerical functions in
System.calls
with packagedill
.e_clear
(models)Clear equation arrays in DAE and model variables.
f_update
(models)Call the differential equation update method for models in sequence.
Collect equation values into the DAE arrays.
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.
Fixes addressing issues after loading a snapshot.
from_ipysheet
(model, sheet[, vin])Set an ipysheet object back to model.
Reset algebraic mismatches for islanded buses.
g_update
(models)Call the algebraic equation update method for models in sequence.
Collect config data from models.
get_z
(models)Get all discrete status flags in a numpy array.
Import all groups classes defined in
devices/group.py
.Import and instantiate models as System member attributes.
Import routines as defined in
routines/__init__.py
.init
(models, routine)Initialize the variables for each of the specified models.
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])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.load_config
([conf_path])Load config from an rc-formatted file.
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 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_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 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 OrderedDictSystem.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
()Deserialize the function calls from
~/.andes/calls.pkl
withdill
.vars_to_dae
(model)Copy variables values from models to System.dae.
Copy variable values from System.dae to models.