andes.core.var.BaseVar#
- class andes.core.var.BaseVar(name: Optional[str] = None, tex_name: 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, discrete: Optional[andes.core.discrete.Discrete] = None, v_setter: Optional[bool] = False, e_setter: Optional[bool] = False, v_str_add: Optional[bool] = False, addressable: Optional[bool] = True, export: Optional[bool] = True, diag_eps: Optional[float] = 0.0, deps: Optional[List] = None)[source]#
Base variable class.
Derived classes State and Algeb should be used to build model variables.
- Parameters
- namestr, optional
Variable name
- infostr, optional
Descriptive information
- unitstr, optional
Unit
- tex_namestr
LaTeX-formatted variable name. If is None, use name instead.
- discreteDiscrete
Discrete component on which thi variable depends on. ANDES will call check_var() of the discrete component before initializing this variable.
- Attributes
- aarray-like
variable address
- varray-like
local-storage of the variable value
- earray-like
local-storage of the corresponding equation value
- e_strstr
the string/symbolic representation of the equation
- v_strstr
explicit initialization equation
- v_str_addbool
True if the value of v_str will be added to the variable. Useful when other models access this variable and set part of the initial value
- v_iterstr
implicit iterative equation in the form of 0 = v_iter
- __init__(name: Optional[str] = None, tex_name: 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, discrete: Optional[andes.core.discrete.Discrete] = None, v_setter: Optional[bool] = False, e_setter: Optional[bool] = False, v_str_add: Optional[bool] = False, addressable: Optional[bool] = True, export: Optional[bool] = True, diag_eps: Optional[float] = 0.0, deps: Optional[List] = None)[source]#
Methods
reset
()Reset the internal numpy arrays and flags.
set_address
(addr[, contiguous])Set the address of internal variables.
set_arrays
(dae[, inplace, alloc])Set the equation and values arrays.
Attributes