andes.core.var.ExtVar#
- class andes.core.var.ExtVar(model: str, src: str, indexer: Optional[Union[List, numpy.ndarray, andes.core.param.BaseParam, andes.core.service.BaseService]] = None, allow_none: Optional[bool] = False, name: Optional[str] = None, tex_name: Optional[str] = None, ename: Optional[str] = None, tex_ename: Optional[str] = None, info: Optional[str] = None, unit: Optional[str] = None, v_str: Optional[Union[str, float]] = None, v_iter: Optional[str] = None, e_str: Optional[str] = None, v_setter: Optional[bool] = False, e_setter: Optional[bool] = False, addressable: Optional[bool] = True, export: Optional[bool] = True, diag_eps: Optional[float] = 0.0, is_input: Optional[bool] = False)[source]#
Externally defined algebraic variable
This class is used to retrieve the addresses of externally- defined variable. The e value of the ExtVar will be added to the corresponding address in the DAE equation.
- Parameters
- modelstr
Name of the source model
- srcstr
Source variable name
- indexerBaseParam, BaseService
A parameter of the hosting model, used as indices into the source model and variable. If is None, the source variable address will be fully copied.
- allow_nonebool
True to allow None in indexer
- Attributes
- parent_modelModel
The parent model providing the original parameter.
- uidarray-like
An array containing the absolute indices into the parent_instance values.
- e_codestr
Equation code string; copied from the parent instance.
- v_codestr
Variable code string; copied from the parent instance.
- __init__(model: str, src: str, indexer: Optional[Union[List, numpy.ndarray, andes.core.param.BaseParam, andes.core.service.BaseService]] = None, allow_none: Optional[bool] = False, name: Optional[str] = None, tex_name: Optional[str] = None, ename: Optional[str] = None, tex_ename: Optional[str] = None, info: Optional[str] = None, unit: Optional[str] = None, v_str: Optional[Union[str, float]] = None, v_iter: Optional[str] = None, e_str: Optional[str] = None, v_setter: Optional[bool] = False, e_setter: Optional[bool] = False, addressable: Optional[bool] = True, export: Optional[bool] = True, diag_eps: Optional[float] = 0.0, is_input: Optional[bool] = False)[source]#
Methods
link_external
(ext_model)Update variable addresses provided by external models
reset
()Reset the internal numpy arrays and flags.
set_address
(addr[, contiguous])Assigns address for equation RHS.
set_arrays
(dae[, inplace, alloc])Access
dae.h
ordae.i
for the RHS of external variables whene_str
exists..Attributes