A mechanism framework
you can read.

MBSD Core is a compact, MIT-licensed Python package: declare bodies, joints, drives, springs and forces, then solve kinematics or constrained dynamics with equations you can inspect and modify. Current release: v0.7.0.

FRAMEWORK

mbsd-core

The installable package. NumPy and SciPy only, tested on Python 3.10–3.13.

  • Planar rigid bodies, revolute and prismatic joints, drives and motors
  • Position, velocity and acceleration solves
  • Constrained dynamics with Lagrange multipliers, springs and damping
  • Residual checks, Jacobian rank and degree-of-freedom diagnostics
  • Versioned JSON and CSV exports for downstream tools and CAD
  • Four-bar synthesis helpers and an experimental spatial (3D) preview
mbsd-core on GitHub

EXAMPLES

mbsd-examples

Runnable, validation-heavy examples and a reproducible gallery, paired release-for-release with the core.

  • Slider-crank, four-bar, scotch yoke, pendulum, mass-spring
  • Energy conservation and finite-difference derivative checks
  • Precision-point synthesis and rocker function fitting
  • Export handoff and diagnostics-panel samples
  • Spatial vocabulary and kinematics previews
mbsd-examples on GitHub

Why another framework

Large engines such as Chrono, Exudyn and Simbody are the right choice for broad multiphysics, large contact stacks or production vehicle simulation. MBSD's niche is smaller: a mechanism-first API, readable Python source, direct NumPy/SciPy integration and examples that expose the math. Think of it as a “PySpice for mechanisms”, a compact declarative layer over a solver kernel that stays close enough to the equations to inspect and change.

Validation first

Every solve can be checked: constraint residuals across a trajectory, explicit assertions that fail loudly, Jacobian rank and rank-based degrees of freedom, and per-configuration classification as fully constrained, underconstrained, overconstrained or rank-deficient. Dynamics results record their integration method, tolerances and stabilisation settings, so a result file says how it was produced.

Scope, honestly

The stable solver API covers 2D planar mechanisms. The mbsd.spatial namespace provides an experimental 3D vocabulary with pose transforms, point velocities and joint residuals, but no general 3D solver yet. Forward dynamics currently require each body's reference point to coincide with its centre of mass, and models that need the missing terms raise a clear error rather than a wrong answer.

Install

git clone https://github.com/JAlcocerT/mbsd-core.git
cd mbsd-core
git checkout v0.7.0
uv sync --extra dev
uv run pytest -q

Then try a slider-crank or a four-bar. Each tool page shows the equivalent MBSD script.

BUILDING ON MBSD?

Custom joints, validation, workflows.

We help teams extend the framework, validate models against test data and turn one-off scripts into maintained tools.

Talk to us