andes.core.var.Algeb#
- class andes.core.var.Algeb(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]#
Algebraic variable class, an alias of
andes.core.var.BaseVar
.Note that residual equations corresponding to algebraic variables are given in an implicit form.
Examples
When an algebraic variable
y
and the equationy = x + z
shall be defined, usee_str = 'x + z - y'
because it expresses the equation
x + z - y = 0
. It is a common mistake to usee_str = 'x + z'
, which will result in a singular Jacobian matrix becaused(x + z) / d(y)
is zero.- Attributes:
- e_codestr
Equation code string, equals string literal
g
- v_codestr
Variable code string, equals string literal
y
- __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)#
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