AxPDE_verify_solution
Verify manufactured PDE solutions symbolically by checking that every equation residual is zero and all boundary conditions hold, failing closed when any check cannot be completed.
Instructions
Verify a manufactured solution symbolically (deterministic, no LLM). Checks that the residual L[u] - f is identically zero for each equation and that every boundary condition is satisfied. This is the hard-to-cheat verification step of the Method of Manufactured Solutions: it fails closed, so anything it cannot check is reported as not passing rather than silently accepted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | No | Domain spec, e.g. {"type": "interval", "x_min": 0, "x_max": 1} or {"type": "rectangle", "x_min": 0, "x_max": 1, "y_min": 0, "y_max": 1}. Required for periodic and axis-aligned Neumann BCs — without it those cannot be verified and will not pass. | |
| unknowns | No | Unknown field names, e.g. ["u"] or ["u", "v", "p"]. Defaults to ["u"]. | |
| equations | Yes | PDE operator(s): [{"name": "pde", "operator_code": "def pde_operator(fields, vars_dict): ..."}]. operator_code defines exactly one function returning a single SymPy expression L[fields], using the L[u] = f convention. Only `sp` (SymPy) is available; no imports, no numpy. For systems give one entry per equation, e.g. "x_momentum", "y_momentum", "continuity". | |
| variables | Yes | Coordinate names, e.g. ["x", "t"] or ["x", "y", "t"]. Supported: x, y, t, r, theta, phi. | |
| source_exprs | Yes | Source term per equation name as SymPy-parseable strings, e.g. {"pde": "(-1 + pi**2)*exp(-t)*sin(pi*x)"}. Keys must match the equation names. Typically these come from derive_source. | |
| solution_exprs | Yes | Manufactured solution per field as SymPy-parseable strings, e.g. {"u": "sin(pi*x)*exp(-t)"}. Keys must match the field names the operator code reads from `fields`. | |
| boundary_conditions | No | Boundary conditions, each {"label", "type", "subs", "value"}. Types: "dirichlet", "neumann", "periodic", "robin". Axis-aligned uses subs={"x": 0}; polygon edges use subs={"edge": [[0,0],[1,0]]}. Neumann values are with respect to the OUTWARD normal. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| passed | Yes | True only if every equation residual is zero AND every boundary condition is satisfied. | |
| message | No | ||
| bcs_satisfied | No | ||
| bc_diagnostics | No | Per-item check results keyed by equation name or BC label. Each value has "passed" and "residual"; a nonzero residual string is the actionable detail. | |
| pde_residual_zero | No | ||
| equation_diagnostics | No | Per-item check results keyed by equation name or BC label. Each value has "passed" and "residual"; a nonzero residual string is the actionable detail. |