Skip to content
Kitbay

simscape-diagnose-simulation-error

NOASSERTIONUpdated on Nov 19, 20261,366GitHub starsIncludes scripts

A MathWorks skill from the Simulink Agentic Toolkit for working out why a Simscape physical model fails during simulation. The agent sorts the error into one of three paths.

What the skill teaches

A MathWorks skill from the Simulink Agentic Toolkit for working out why a Simscape physical model fails during simulation. The agent sorts the error into one of three paths. Minimum step size failures at event times are treated as discontinuous inputs, checked through tolerances, zero crossings and input sample times, then smoothed where the physics allows. Other step size failures and stiffness warnings lead to testing parasitic parameters group by group and running stiffness and variable scaling analysis. Initialisation failures lead to comparing constraint counts with a different index reduction method. It uses MATLAB helper functions bundled in the skill through the MATLAB MCP Server and reruns the simulation to check each fix.

Capabilities

  • Classify a Simscape simulation error
  • Smooth discontinuous inputs that break the solver
  • Find stiff parameters and retune them
  • Fix transient initialisation failures