Install
Browser
Section titled “Browser”Nothing to install. Open the playground. It always runs the latest engine, and every live simulation in these docs is the playground embedded in the page.
Packages
Section titled “Packages”The engine is published on npm and PyPI as compiled packages. They are free to use, including commercially; see the licence that ships with each package. Versions 0.8.0 and earlier are under MIT OR Apache-2.0.
JavaScript
Section titled “JavaScript”npm install @soliton-physics/engineSee the JavaScript API.
Python
Section titled “Python”The package wraps the Rust engine with NumPy arrays in and out. It installs as soliton-physics and imports as
soliton:
pip install soliton-physicsfrom soliton import mechanics
scene = mechanics.scenario("atwood", m1=2, m2=3)print(scene.answers())run = scene.run(until=2.0)print(run.body("m2")["velocity"][-1])The wave solvers live beside it:
from soliton import Simulation, kdv_soliton
sim = Simulation("kdv", points=512, length=60.0, dt=1e-3)sim.state = kdv_soliton(sim.x, 0.0, speed=4.0, center=-10.0)sim.step(5000)print(sim.time, sim.invariants())The engine is tested against closed-form solutions on every change. See Validation for the current numbers.