parse_expression
Transform formulas into SymPy-computable expressions. Extracts symbols, equation status, and LaTeX for symbolic math workflows.
Instructions
Parse a mathematical expression into SymPy-computable form.
This tool converts human-readable formula notation into validated SymPy
expressions, extracting symbols and their relationships.
Args:
expression: Mathematical expression (e.g., "v' = M1*v*cos(θ)/(M1+M2)")
description: Optional description of what this formula represents
symbol_hints: Optional hints for symbol types (e.g., {"m": "positive_real"})
Returns:
Parsed expression with:
- sympy_expr: SymPy expression string
- symbols: List of extracted symbols with inferred types
- latex: LaTeX representation
- is_equation: Whether it's an equation (has '=')
Examples:
parse_expression("F = m*a")
→ {"sympy_expr": "Eq(F, m*a)", "symbols": ["F", "m", "a"], ...}
parse_expression("∫x²dx", description="Integral of x squared")
→ {"sympy_expr": "Integral(x**2, x)", ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | ||
| description | No | ||
| symbol_hints | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||