introduce_expression
Parse and store symbolic expressions with SymPy, assigning them to temporary or user-defined variables. Supports equations and matrices while applying canonicalization rules by default.
Instructions
Parses a sympy expression string using available local variables and stores it. Assigns it to either a temporary name (expr_0, expr_1, etc.) or a user-specified global name.
Uses Sympy parse_expr to parse the expression string.
Applies default Sympy canonicalization rules unless canonicalize is False.
For equations (x^2 = 1) make the input string "Eq(x^2, 1") not "x^2 == 1"
Examples:
{expr_str: "Eq(x^2 + y^2, 1)"}
{expr_str: "Matrix(((25, 15, -5), (15, 18, 0), (-5, 0, 11)))"}
{expr_str: "pi+e", "expr_var_name": "z"}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| canonicalize | No | ||
| expr_str | Yes | ||
| expr_var_name | No |