Generate self-contained interactive science simulations as a single index.html from a SimSpec YAML or JSON. Use when the user asks for physics, chemistry, biology, STEM, science education, classroom demos, virtual labs, PhET-style activities, mechanics simulations, circuit simulations, parameter sliders, plots, inquiry worksheets, or offline canvas-based teaching tools.
Generate one self-contained index.html that runs offline, renders a STEM simulation on a 2D canvas, exposes model parameters as sliders, plots a time series, and includes an inquiry worksheet.
- If dt is missing, use default=0.01, min=0.001, max=0.05.
- If a parameter omits step, derive step=(max-min)/100 with sensible rounding.
- Normalize derivative aliases such as dx, dy, dvx, dvy, dq, dvc to canonical d<stateName> keys before generating JS.
- Default readouts to t plus every state variable in state order.
3. Choose the renderer:
- mechanics + state includes x and y -> trajectory2d
- mechanics + state includes x and v -> oscillator1d
- electromagnetism + state includes q or vc -> circuit_rc
- Otherwise stop and ask the user for a clearer SimSpec instead of guessing.