Skip to main content
Glama

solve_pde_1d

Solve 1D time-dependent PDEs of the form u_t = F(x, t, u, u_x, u_xx) using explicit Euler, centered differences, and Dirichlet boundaries.

Instructions

Solve u_t = F(x, t, u, u_x, u_xx) with an explicit Euler scheme.

``equation`` is a sympy expression for ``F`` in the symbols ``x``, ``t``,
``u``, ``u_x`` and ``u_xx``. Spatial derivatives are second-order centred
differences evaluated on the interior nodes at every step; the ends keep
the constant Dirichlet values ``left``/``right``.

This is only a *semi-general* solver: no stability condition can be
derived for arbitrary ``F``. The result therefore always contains a
``stability_note`` recommending smaller steps or a specialized solver.
If a step produces a non-finite value the solver stops and returns
``err(...)`` with the offending step number.

The full (t, x) grid is saved to .npz; returned arrays are downsampled to
at most 100 space and 50 time points.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ntNo
nxNo
leftNo
rightNo
t_endNo
lengthNo
initialNosin(pi*x)
equationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so richly: explicit Euler scheme, second-order centred interior differences, constant Dirichlet ends, guaranteed stability_note in the output, non-finite detection that halts and returns err(...) with the offending step number, full grid persisted to .npz, and downsampling to ≤100 space / ≤50 time points.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the equation and scheme, then behaviour, then return caveats. Every sentence does work, though the prose is a touch long for what is essentially a solver contract and could compress the derivative/BC paragraph.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description covers failure modes (err with step number), the stability_note, the .npz side effect, and the downsampled return shape. It stops short of describing the returned array fields, which is the main remaining gap for an agent consuming the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for 8 parameters, so the description must compensate. It clarifies equation (sympy expression in x, t, u, u_x, u_xx) and left/right (Dirichlet values) well, but nt, nx, t_end, length, and initial are only inferable from their names and defaults, leaving half the surface undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb ('Solve') and resource (u_t = F(x,t,u,u_x,u_xx)) and pins down the numerical scheme (explicit Euler with centred differences). An agent can immediately separate this general semi-linear solver from the specialized siblings solve_heat_1d, solve_wave_1d, and solve_burgers_1d.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage context by warning that no stability condition can be derived for arbitrary F and that the result recommends smaller steps or a specialized solver, which hints at when a sibling tool would be preferable. However, it never explicitly says 'use this instead of X when Y' or states prerequisites, so routing still requires inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.