pdsolve_pde
Solve partial differential equations (PDEs) using SymPy's pdsolve function on the Symbolic Algebra MCP Server. Input expression key and function name to obtain a LaTeX-formatted solution, handling complex PDEs efficiently.
Instructions
Solves a partial differential equation using SymPy's pdsolve function.
Args:
expr_key: The key of the expression (previously introduced) containing the PDE.
If the expression is not an equation (Eq), it will be interpreted as
PDE = 0.
func_name: The name of the function (previously introduced) to solve for.
This should be a function of multiple variables.
Example:
# First introduce variables and a function
intro("x", [Assumption.REAL], [])
intro("y", [Assumption.REAL], [])
introduce_function("f")
# Create a PDE: 1 + 2*(ux/u) + 3*(uy/u) = 0
expr_key = introduce_expression(
"Eq(1 + 2*Derivative(f(x, y), x)/f(x, y) + 3*Derivative(f(x, y), y)/f(x, y), 0)"
)
# Solve the PDE
result = pdsolve_pde(expr_key, "f")
# Returns solution with exponential terms and arbitrary function
Returns:
A LaTeX string representing the solution. Returns an error message string if issues occur.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
expr_key | Yes | ||
func_name | Yes | ||
hint | No |
Input Schema (JSON Schema)
{
"$defs": {
"PDEHint": {
"enum": [
"1st_linear_constant_coeff_homogeneous",
"1st_linear_constant_coeff",
"1st_linear_constant_coeff_Integral",
"1st_linear_variable_coeff"
],
"title": "PDEHint",
"type": "string"
}
},
"properties": {
"expr_key": {
"title": "Expr Key",
"type": "string"
},
"func_name": {
"title": "Func Name",
"type": "string"
},
"hint": {
"anyOf": [
{
"$ref": "#/$defs/PDEHint"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"expr_key",
"func_name"
],
"title": "pdsolve_pdeArguments",
"type": "object"
}