sbmlsim.combine.mathml
¶
Helper functions for evaluation of MathML expressions. Using sympy to evalutate the expressions.
Module Contents¶
Functions¶
|
Parses astnode from formula |
|
|
|
|
|
An AST node in libSBML is a recursive tree structure; each node has a type, |
|
Parses sympy expression from given formula string. |
|
Evaluate the astnode with values |
|
Adds variable names to the variables. |
|
Replaces libsbml piecewise with sympy piecewise. |
Attributes¶
- sbmlsim.combine.mathml.formula_to_astnode(formula)[source]¶
Parses astnode from formula
- Parameters
formula (str) –
- Return type
libsbml.ASTNode
- sbmlsim.combine.mathml.parse_astnode(astnode)[source]¶
An AST node in libSBML is a recursive tree structure; each node has a type, a pointer to a value, and a list of children nodes. Each ASTNode node may have none, one, two, or more children depending on its type. There are node types to represent numbers (with subtypes to distinguish integer, real, and rational numbers), names (e.g., constants or variables), simple mathematical operators, logical or relational operators and functions.
see also: http://sbml.org/Software/libSBML/docs/python-api/libsbml-math.html
- Parameters
mathml –
astnode (libsbml.ASTNode) –
- Returns
- sbmlsim.combine.mathml.expr_from_formula(formula)[source]¶
Parses sympy expression from given formula string.
- Parameters
formula (str) –
- sbmlsim.combine.mathml.evaluate(astnode, variables)[source]¶
Evaluate the astnode with values
- Parameters
astnode (libsbml.ASTNode) –
variables (Dict) –
- sbmlsim.combine.mathml._get_variables(astnode, variables=None)[source]¶
Adds variable names to the variables.
- Parameters
astnode (libsbml.ASTNode) –
- Return type
Set[str]