andes.core.var.ExtVar#
- class andes.core.var.ExtVar(model: str, src: str, indexer: List | ndarray | BaseParam | BaseService | None = None, allow_none: bool | None = False, name: str | None = None, tex_name: str | None = None, ename: str | None = None, tex_ename: str | None = None, info: str | None = None, unit: str | None = None, v_str: str | float | None = None, v_iter: str | None = None, e_str: str | None = None, v_setter: bool | None = False, e_setter: bool | None = False, addressable: bool | None = True, export: bool | None = True, diag_eps: float | None = 0.0, is_input: bool | None = False)[source]#
Algebraic variable that links to an external model.
This class is used to retrieve the addresses of a variable defined in an external model. An equation can be defined for the
ExtVar
. The evaluated value for the equation will be stored in theExtVar.e
attribute and added to the equations corresponding to the external variables.- 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, optional, default=False
True to allow None in indexer
- e_strstring, optional, default=None
Equation string, the evaluated value of which will be added to the source residual equation
- 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: List | ndarray | BaseParam | BaseService | None = None, allow_none: bool | None = False, name: str | None = None, tex_name: str | None = None, ename: str | None = None, tex_ename: str | None = None, info: str | None = None, unit: str | None = None, v_str: str | float | None = None, v_iter: str | None = None, e_str: str | None = None, v_setter: bool | None = False, e_setter: bool | None = False, addressable: bool | None = True, export: bool | None = True, diag_eps: float | None = 0.0, is_input: bool | None = 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