Math & Numbers
用分离变量法求解 dy/dx = g(x)·h(y):分离变量、两侧逐项积分得 H(y) = G(x) + C,能反解时给出显式解 y = f(x)。支持单项 h(y)(y、y^n、e^(ky)、ky+m)以及可用部分分式分解的二次多项式(如逻辑斯蒂方程的 y(1−y));给定初始条件 y(x₀)=y₀ 时算出常数 C,并检测平衡解。示例:dy/dx = 2x·y → y = e^(x²+C)。
用三种语言从你的代码中调用此工具。
curl -X POST 'http://127.0.0.1:3003/zh/api/tools/first-order-ode-solver' \
-H 'Content-Type: application/json' \
-d '{"gx":"2x","hy":"y","x0":0,"y0":1}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST http://127.0.0.1:3003/zh/api/tools/first-order-ode-solver| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| gx | text | 是 | x-dependent factor of dy/dx = g(x)·h(y). Terms: constants, x^n, (kx+m)^n, e^(kx), sin(kx+m), cos(kx+m), ln(kx+m), sqrt(kx+m). |
| hy | text | 是 | y-dependent factor. Single terms (y, y^n, (ky+m)^n, e^(ky)) or a degree ≤ 2 polynomial with real roots, or c/D(y). |
| x0 | number | 否 | Only used together with y₀ to pin down the constant C. |
| y0 | number | 否 | Initial value. Leave empty for the general solution; provide with x₀ for the particular solution. |
文本结果
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-first-order-ode-solver": {
"name": "first-order-ode-solver",
"description": "用分离变量法求解 dy/dx = g(x)·h(y):分离变量、两侧逐项积分得 H(y) = G(x) + C,能反解时给出显式解 y = f(x)。支持单项 h(y)(y、y^n、e^(ky)、ky+m)以及可用部分分式分解的二次多项式(如逻辑斯蒂方程的 y(1−y));给定初始条件 y(x₀)=y₀ 时算出常数 C,并检测平衡解。示例:dy/dx = 2x·y → y = e^(x²+C)。",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=first-order-ode-solver",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "first-order-ode-solver",
"arguments": {
"gx": "2x",
"hy": "y",
"x0": 0,
"y0": 1
}
}
}有问题或反馈?请联系 [email protected]