andes.system.facade.System#
- class andes.system.facade.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.
- 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
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.- __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_name[, 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.
b_update(models)Call the observable variable update method for models in sequence.
build_ybus()Build bus admittance matrix by aggregating contributions from all models with
flags.ybus == True.calc_pu_coeff()Perform per unit value conversion.
call_models(method, models, *args, **kwargs)Call methods on the given models.
check_group_common()Delegate to
andes.system.registry.RegistryLoader.collect_config()Delegate to
andes.system.config_runtime.SystemConfigRuntime.collect_ref()Collect indices into BackRef for all models.
connectivity([info])Delegate to
ConnMan.check_connectivity().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_connected(model_or_group, idx)Find all devices connected to a given device.
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_status(model_or_group, idx)Get the effective status of a device.
get_z(models)Get all discrete status flags in a numpy array.
import_groups()Delegate to
andes.system.registry.RegistryLoader.import_models()Delegate to
andes.system.registry.RegistryLoader.import_routines()Delegate to
andes.system.registry.RegistryLoader.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_eqof models.l_update_var(models[, niter, err])Update variable-based limiter discrete states by calling
l_update_varof models.link_ext_param([model])Retrieve values for
ExtParamfor the given models.precompile([models, nomp, ncpu])Delegate to
andes.system.codegen.CodegenManager.prepare([quick, incremental, models, nomp, ncpu])Delegate to
andes.system.codegen.CodegenManager.propagate_init_status()Propagate effective status from parent to child models at init time.
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_postof models.s_update_var(models)Update variable services by calling
s_update_varof models.save_config([file_path, overwrite])Delegate to
andes.system.config_runtime.SystemConfigRuntime.set_address(models)Set addresses for differential and algebraic variables.
set_config([config])Delegate to
andes.system.config_runtime.SystemConfigRuntime.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.Outputdata and store the sub-indices intodae.xy.set_status(model_or_group, idx, value)Set the online status of a device and propagate to dependents.
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_getters(models)Build
_gettersand_settersso thatvars_to_modelsandvars_to_daework during model initialization.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_timesand an OrderedDictSystem.switch_dict.summary()Delegate to
ConnMan.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])Delegate to
andes.system.codegen.CodegenManager.vars_to_dae(model)Copy variables values from models to System.dae.
vars_to_models()Copy variable values from System.dae to models.