ams.system.System#
- class ams.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, **kwargs)[source]#
A subclass of
andes.system.System
, this class encapsulates data, models, and routines for dispatch modeling and analysis in power systems. Some methods inherited from the parent class are intentionally disabled.- Parameters:
- casestr, optional
The path to the case file.
- namestr, optional
Name of the system instance.
- configdict, optional
Configuration options for the system. Overrides the default configuration if provided.
- config_pathstr, optional
The path to the configuration file.
- default_configbool, optional
If True, the default configuration file is loaded.
- optionsdict, optional
Additional configuration options for the system.
- **kwargs
Additional configuration options passed as keyword arguments.
- Attributes:
- namestr
Name of the system instance.
- optionsdict
A dictionary containing configuration options for the system.
- modelsOrderedDict
An ordered dictionary holding the model names and instances.
- model_aliasesOrderedDict
An ordered dictionary holding model aliases and their corresponding instances.
- groupsOrderedDict
An ordered dictionary holding group names and instances.
- routinesOrderedDict
An ordered dictionary holding routine names and instances.
- typesOrderedDict
An ordered dictionary holding type names and instances.
- matsMatrixProcessor, None
A matrix processor instance, initially set to None.
- matOrderedDict
An ordered dictionary holding common matrices.
- exit_codeint
Command-line exit code. 0 indicates normal execution, while other values indicate errors.
- recentRecentSolvedRoutines, None
An object storing recently solved routines, initially set to None.
- dynANDES System, None
linked dynamic system, initially set to None. It is an instance of the ANDES system, which will be automatically set when using
System.to_andes()
.- filesFileMan
File path manager instance.
- is_setupbool
Internal flag indicating if the system has been set up.
Methods
setup:
Set up the system.
to_andes:
Convert the system to an ANDES system.
- __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, **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_config
(**kwargs)Collect config data from models.
Collect indices into BackRef for all models.
connectivity
([info])Perform connectivity check for system.
e_clear
(**kwargs)Clear equation arrays in DAE and model variables.
f_update
(**kwargs)Call the differential equation update method for models in sequence.
fg_to_dae
(**kwargs)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.
from_ipysheet
(**kwargs)Set an ipysheet object back to model.
g_islands
(**kwargs)Reset algebraic mismatches for islanded buses.
g_update
(**kwargs)Call the algebraic equation update method for models in sequence.
get_z
(**kwargs)Get all discrete status flags in a numpy array.
Import all groups classes defined in
models/group.py
.Import and instantiate models as System member attributes.
Import routines as defined in
routines/__init__.py
.Import all types classes defined in
routines/type.py
.init
(**kwargs)Initialize the variables for each of the specified models.
j_islands
(**kwargs)Set gy diagonals to eps for a and v variables of islanded buses.
j_update
(**kwargs)Call the Jacobian update method for models in sequence.
l_update_eq
(**kwargs)Update equation-dependent limiter discrete components by calling
l_check_eq
of models.l_update_var
(**kwargs)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
(**kwargs)Trigger precompilation for the given models.
prepare
(**kwargs)Generate numerical functions from symbolically defined models.
reload
(**kwargs)Reload a new case in the same System object.
remove_pycapsule
(**kwargs)Remove PyCapsule objects in solvers.
report
()Write system routine reports to a plain-text file.
reset
([force])Reset to the state after reading data and setup.
s_update_post
(**kwargs)Update variable services by calling
s_update_post
of models.s_update_var
(**kwargs)Update variable services by calling
s_update_var
of models.save_config
(**kwargs)Save all system, model, and routine configurations to an rc-formatted file.
set_address
(models)Set addresses for differential and algebraic variables.
set_config
(**kwargs)Set configuration for the System object.
set_dae_names
(**kwargs)Set variable names for differential and algebraic variables, right-hand side of external equations, and discrete flags.
set_output_subidx
(**kwargs)Process
andes.models.misc.Output
data and store the sub-indices intodae.xy
.set_var_arrays
(**kwargs)Set arrays (v and e) for internal variables to access dae arrays in place.
setup
()Set up system for studies.
store_adder_setter
(**kwargs)Store non-inplace adders and setters for variables and equations.
Store existing models in System.existing.
store_no_check_init
(**kwargs)Store differential variables with
check_init == False
.store_sparse_pattern
(**kwargs)Collect and store the sparsity pattern of Jacobian matrices.
store_switch_times
(**kwargs)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.
supported_routines
([export])Return the support type names and routine names in a table.
switch_action
(**kwargs)Invoke the actions associated with switch times.
to_andes
([setup, addfile])Convert the AMS system to an ANDES system.
to_ipysheet
(**kwargs)Return an ipysheet object for editing in Jupyter Notebook.
undill
(**kwargs)Reload generated function functions, from either the
$HOME/.andes/pycode
folder.vars_to_dae
(model)Copy variables values from models to System.dae.
Copy variable values from System.dae to models.