andes.core.var.BaseVar#

class andes.core.var.BaseVar(name: str | None = None, tex_name: 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, discrete: Discrete | None = None, v_setter: bool | None = False, e_setter: bool | None = False, v_str_add: bool | None = False, addressable: bool | None = True, export: bool | None = True, diag_eps: float | None = 0.0, deps: List | None = None, is_output: bool | None = False)[source]#

Base variable class.

Derived classes State and Algeb should be used to build model variables.

Parameters:
infostr, optional

Descriptive information

unitstr, optional

Unit

tex_namestr

LaTeX-formatted variable symbol. If is None, the value of name will be used.

discreteDiscrete

Discrete component on which this variable depends. ANDES will call check_var() of the discrete component before initializing this variable.

namestr, optional

Variable name. One should typically assigning the name directly because it will be automatically assigned by the model. The value of name will be the symbol name to be used in expressions.

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: str | None = None, tex_name: 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, discrete: Discrete | None = None, v_setter: bool | None = False, e_setter: bool | None = False, v_str_add: bool | None = False, addressable: bool | None = True, export: bool | None = True, diag_eps: float | None = 0.0, deps: List | None = None, is_output: bool | None = False)[source]#

Methods

get_names()

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