Skip to content

mathml

Helper functions for evaluation of mathml expressions.

In this namespace all the possible names occuring in formula strings have to be defined.

In build in python are *, /, +, - and, or, not

product

product(*args)

Product calculation.

sqr

sqr(x)

Square calculation.

root

root(a, b)

Root calculation.

xor

xor(*args)

XOR calculation.

piecewise

piecewise(*args)

Piecewise calculation.

evaluableMathML

evaluableMathML(astnode, variables=None)

Create evaluable python formula string from ASTNode.

evaluateMathML

evaluateMathML(astnode, variables=None)

Evaluate MathML string with given set of variable and parameter values.

:param astnode: astnode of MathML string :param variables: dictionary of var : value :return: value of evaluated MathML