Math & Numbers
Aproxima f′(x₀) com três diferenças finitas: progressiva (f(x₀+h)−f(x₀))/h, retroativa (f(x₀)−f(x₀−h))/h e central (f(x₀+h)−f(x₀−h))/(2h), além da segunda derivada central. A derivada exata, opcional, adiciona o erro absoluto de cada método e mostra o contraste O(h) vs. O(h²). Exemplo: f=x², x₀=1, h=0,1 → progressiva 2,1; retroativa 1,9; central exatamente 2,0.
Chame esta ferramenta a partir do seu código em três idiomas.
curl -X POST 'http://127.0.0.1:3003/pt/api/tools/numerical-differentiation' \
-H 'Content-Type: application/json' \
-d '{"fx":"x^2","x0":1,"h":0.1,"exactDy":"2x","decimalPlaces":6}'Envie uma requisição POST com suas entradas em JSON. Parâmetros do tipo arquivo exigem upload prévio.
POST http://127.0.0.1:3003/pt/api/tools/numerical-differentiation| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| fx | text | Sim | Function of x (functions: sin, cos, exp, ln, sqrt, …). |
| x0 | number | Sim | — |
| h | number | Sim | Difference step, 0 < h ≤ 1. Central differences: truncation O(h²); too small an h amplifies round-off. |
| exactDy | text | Não | Exact derivative in x; the tool reports the absolute error of each method. Leave empty to skip. |
| decimalPlaces | number | Não |
Adicione esta ferramenta ao seu servidor Model Context Protocol para que agentes de IA possam listá-la e chamá-la.
Adicione este bloco à configuração do seu cliente MCP:
{
"mcpServers": {
"elysiatools-numerical-differentiation": {
"name": "numerical-differentiation",
"description": "Aproxima f′(x₀) com três diferenças finitas: progressiva (f(x₀+h)−f(x₀))/h, retroativa (f(x₀)−f(x₀−h))/h e central (f(x₀+h)−f(x₀−h))/(2h), além da segunda derivada central. A derivada exata, opcional, adiciona o erro absoluto de cada método e mostra o contraste O(h) vs. O(h²). Exemplo: f=x², x₀=1, h=0,1 → progressiva 2,1; retroativa 1,9; central exatamente 2,0.",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=numerical-differentiation",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Após conectar ao endpoint SSE, liste as ferramentas expostas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoque a ferramenta pelo seu id; os argumentos são construídos a partir de seus parâmetros:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "numerical-differentiation",
"arguments": {
"fx": "x^2",
"x0": 1,
"h": 0.1,
"exactDy": "2x",
"decimalPlaces": 6
}
}
}| — |
Resultado de texto
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Dúvidas ou problemas? Contate [email protected]