When specified from a string, an alias uses the notation :=
Alias``es can be defined in terms of other ``Alias``es, so for example, if we had ComponentClass representing a Hodgkin-Huxley style gating channel, which has a ``Property, reversal_potential, and an input AnalogPort, membrane_voltage, then we could define an Alias:
``driving_force := reversal_potential - membrane_voltage``If the relevant StateVariables, m and h, for example were also defined, and a Parameter, g_bar, we could also define the current flowing through this channel as:
current := driving_force * g * m * m * m * hThis current could then be attached to an output AnalogPort for example.
It is important to ensure that Alias definitions are not circular, for example, it is not valid to define two alias in terms of each other:
a := b + 1 b := 2 * aDuring code generation, we typically call ComponentClass.backsub_all(). This method first expands each alias in terms of other aliases, such that each alias depends only on Parameters, StateVariables and incoming AnalogPort. Next, it expands any alias definitions within TimeDerivatives, StateAssignments, Conditions and output AnalogPorts.
Constructor for an Alias
| Parameters: |
|
|---|
Methods
| __init__([lhs, rhs]) | Constructor for an Alias |
| accept_visitor(visitor, **kwargs) | link to something about visitation. |
| lhs_name_transform_inplace(name_map) | |
| name_transform_inplace(name_map) | |
| rhs_as_python_func([namespace]) | Returns a python callable which evaluates the expression in |
| rhs_has_missing_functions() | returns True if at least 1 function on the RHS is not in the math |
| rhs_name_transform_inplace(name_map) | Replace atoms on the RHS with values in the name_map |
Attributes
| atoms | Returns a list of the atoms in the LHS and RHS of this expression |
| lhs | |
| lhs_atoms | |
| rhs | |
| rhs_atoms | Returns an iterator over all the variable names and mathematical |
| rhs_funcs | |
| rhs_missing_functions | yield names of functions in the RHS which are not in the math |
| rhs_names |
link to something about visitation.
Returns a python callable which evaluates the expression in namespace and returns the result
returns True if at least 1 function on the RHS is not in the math namespace
Replace atoms on the RHS with values in the name_map
Returns a list of the atoms in the LHS and RHS of this expression
Returns an iterator over all the variable names and mathematical functions on the RHS function. This does not include defined mathematical symbols such as pi and e, but does include functions such as sin and log
yield names of functions in the RHS which are not in the math namespace