Skip to main content
Glama

solve_heat_1d_variable

Solve 1D heat diffusion with variable conductivity alpha(x) via an explicit conservative flux scheme and Dirichlet boundaries.

Instructions

Solve u_t = d/dx(alpha(x) * du/dx) with an explicit flux scheme.

``alpha_expr`` is an expression in x and must be strictly positive on the
spatial grid. Face conductivities ``alpha(x_{i+1/2})`` and
``alpha(x_{i-1/2})`` are evaluated on half nodes, giving the conservative
flux form

    u_i^{n+1} = u_i^n + dt/dx^2 * (
        alpha_{i+1/2} (u_{i+1}^n - u_i^n)
        - alpha_{i-1/2} (u_i^n - u_{i-1}^n))

The explicit scheme is rejected when ``dt * max(alpha) / dx^2 > 0.5``.
``nx`` is the number of intervals (nx+1 nodes), ``nt`` the number of time
steps. The ends use constant Dirichlet values. 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)
alpha_exprYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/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 well: it discloses the numerical scheme, the stability rejection condition (dt*max(alpha)/dx^2 > 0.5), Dirichlet end conditions, and the return behavior (full grid to .npz, arrays downsampled to 100x50). It omits permission/auth context, but that is minor for a local solver.

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?

The PDE and scheme are front-loaded, then constraints, then return behavior, with no filler. The math block is dense but each line earns its place; format is slightly heavy for an agent reader but not wasteful.

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?

No output schema and no annotations, so the description must stand alone. It covers the model, scheme, stability limit, boundary conditions, and output downsampling, which is enough to call the tool correctly, with only minor gaps in per-parameter documentation (length, t_end, initial).

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 coverage is 0% across 8 params, so the description must compensate. It meaningfully defines alpha_expr (expression in x, positive on grid), nx (intervals, nx+1 nodes), nt (time steps), and implies left/right via 'constant Dirichlet values', but leaves length, t_end, and initial (only inferable from its sin(pi*x) default) 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?

States a specific verb and resource: solving u_t = d/dx(alpha(x) du/dx) for variable-conductivity heat flow, and names the scheme (explicit flux form). The variable coefficient clearly distinguishes it from the constant-coefficient sibling solve_heat_1d without opening any schema.

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?

Usage is implied by the problem (spatially varying alpha) and the constraint that alpha must be strictly positive, but there is no explicit 'use this instead of solve_heat_1d / solve_pde_1d' routing or statement of prerequisites beyond positivity. The agent can infer the case but is not told it directly.

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