A domain-specific language for classical mechanics. Write physics in natural notation, simulate in real-time, export to C++, CUDA, Rust, and more.
Write physics equations and watch them come to life
Click any example to load it into the playground
Classic harmonic motion
BeginnerChaotic dynamics
IntermediateDamped harmonic motion
BeginnerKepler orbits
AdvancedQuaternion dynamics
AdvancedDam break simulation
AdvancedEverything you need for computational mechanics
Automatic Euler-Lagrange and Hamilton's equations from your Lagrangian or Hamiltonian.
Generate CUDA kernels for massive parallelism. 50x speedup on particle simulations.
Export to C++, Python, Rust, Julia, MATLAB, Fortran, JavaScript, CUDA, OpenMP, WASM, and Arduino.
SPH implementation with viscosity, pressure, surface tension, and boundary conditions.
Singularity-free rigid body dynamics for spacecraft, robotics, and games.
Phase portraits, Poincarรฉ sections, energy plots, and 3D animations.
Generate production-ready code for any platform
// Generated C++ code for simple pendulum
#include <cmath>
#include <vector>
const double g = 9.81;
const double l = 1.0;
void compute_derivatives(const double* y, double* dydt, double t) {
double theta = y[0];
double theta_dot = y[1];
dydt[0] = theta_dot;
dydt[1] = -g/l * sin(theta);
}
void rk4_step(double* y, double t, double dt) {
// ... RK4 integration
}
Install MechanicsDSL and start building simulations in minutes.
pip install mechanicsdsl-core