AxPDE_derive_source
Derive the source term f = L[u] by applying the PDE operator symbolically to a manufactured solution. Use this forward step of the Method of Manufactured Solutions to obtain an exact forcing term for verification.
Instructions
Derive the source term f = L[u] for a manufactured solution (deterministic, no LLM). Applies the PDE operator symbolically to the supplied solution, producing the forcing term that makes that solution exact. This is the forward step of the Method of Manufactured Solutions; pair it with verify_solution to confirm correctness.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| 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`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| success | Yes | ||
| source_exprs | No | Derived source term per equation name, e.g. {"pde": "(-1 + pi**2)*exp(-t)*sin(pi*x)"}. Pass this straight to verify_solution as source_exprs. |