weldx.MathematicalExpression#

class weldx.MathematicalExpression(expression, parameters=None)#

Mathematical expression using sympy syntax.

Construct a MathematicalExpression.

Parameters:
  • expression (Expr | str) – A sympy expression or a string that can be evaluated as one.

  • parameters (Union[Quantity, str, tuple[Quantity, str], DataArray, None]) – A dictionary containing constant values for variables of the expression.

Methods

equals

Compare the instance with another object for equality and return the result.

evaluate

Evaluate the expression for specific variable values.

get_variable_names

Get a list of all expression variables.

set_parameter

Define an expression parameter as constant value.

set_parameters

Set the expressions parameters.

Attributes

expression

Return the internal sympy expression.

num_parameters

Get the expressions number of parameters.

num_variables

Get the expressions number of free variables.

parameters

Return the internal parameters dictionary.