Skip to content

Auxeno/nimbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

84 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฉ๏ธ Nimbus

A massively parallelisable JAX flight simulation

Python JAX Ruff License Open In Colab



๐Ÿ“– Overview

Nimbus is a differentiable flight simulator written in JAX. It supports full 6DOF dynamics and vectorised execution on hardware accelerators for research and education in aerodynamics and control.

Nimbus demo clip 1 Nimbus demo clip 2 Nimbus demo clip 4

โœจ Features

  • โšก Massive Parallelisation: Simulate millions of aircraft simultaneously on consumer hardware
  • ๐ŸŽฎ 6DOF Flight Model: Full six degrees of freedom rigid body dynamics
  • ๐Ÿ”„ Quaternion Rotation Engine: Singularity-free 3D rotations
  • ๐ŸŽฏ RK4 Physics Integrator: Fourth-order Runge-Kutta for high numerical accuracy
  • ๐Ÿ”๏ธ Layered Simplex Noise Terrain: Procedurally generated terrain
  • ๐Ÿ’ฅ Supersonic Dynamics: Drag rise from shockwaves at transonic speeds
  • ๐ŸŒฌ๏ธ Atmospheric Modeling: Exponential atmosphere model with stochastic wind gusts
  • ๐Ÿ›ก๏ธ G-Limiter: PID G-force limiting
  • ๐Ÿป 3D Visualisation: Real-time rendering with Ursina engine

๐Ÿ“ฆ Installation

# Basic installation
pip install git+https://github.com/auxeno/nimbus

# With interactive demo support (includes Ursina and Pillow)
pip install "nimbus[viz] @ git+https://github.com/auxeno/nimbus"

For local development:

git clone https://github.com/auxeno/nimbus.git
cd nimbus
pip install -e .         # basic installation
pip install -e ".[viz]"  # with visualisation

For GPU acceleration (requires compatible OS and GPU):

pip install --upgrade "jax[cuda12]"

๐Ÿš€ Quick Start

Single Aircraft Simulation

import jax
from nimbus import quick_scenario, step, SimulationConfig

# Generate a complete scenario with terrain and waypoints
simulation, heightmap, waypoint_route = quick_scenario(seed=42)

# Configure and execute a single simulation step
key = jax.random.PRNGKey(0)
config = SimulationConfig()
step_fn = jax.jit(step, static_argnames=("config",))
next_sim, next_route = step_fn(key, simulation, heightmap, waypoint_route, config)

Massive Parallel Simulation

import jax
from nimbus import (
    InitialConditions, SimulationConfig, generate_simulation, quick_scenario, step
)

# Set up shared terrain and waypoint route
_, heightmap, waypoint_route = quick_scenario(seed=0)

# Generate 1 million unique aircraft simulation states
num_aircraft = 1_000_000
key = jax.random.PRNGKey(0)
keys = jax.random.split(key, num=num_aircraft)
simulation_states = jax.vmap(generate_simulation, in_axes=(0, None))(
    keys, 
    InitialConditions.default()
)

# Compile and vectorise the step function
config = SimulationConfig()
step_fn = jax.jit(step, static_argnames=("config",))
step_parallel = jax.vmap(step_fn, in_axes=(None, 0, None, None, None))

# Execute one simulation step for all aircraft
stepped_states = step_parallel(
    key, simulation_states, heightmap, waypoint_route, config
)

๐ŸŽฌ Demo

For a demonstration of Nimbus capabilities, check out the Nimbus demo notebook:

Open In Colab

The notebook demonstrates:

  • Simulating 1 million aircraft in parallel
  • Extended temporal simulations
  • Interactive 3D scenario visualisation with Plotly
  • Custom scenario generation
  • Terrain and aircraft configuration
  • Benchmarking

3D Visualisation

Run the Interactive Demo

requires local installation with the optional [viz] command..

from nimbus.visual import InteractiveDemo

demo = InteractiveDemo()
demo.run()
Key Action
W Pitch down (nose down)
S Pitch up (nose up)
A Yaw left
D Yaw right
Q Roll left
E Roll right
1-5 Set throttle position (0%, 25%, 50%, 75%, 100%)
P Pause/unpause simulation
Scroll Zoom camera in/out

๐Ÿ—๏ธ Project Structure

nimbus/
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ config.py       # simulation configuration dataclasses
โ”‚   โ”œโ”€โ”€ interface.py    # high-level physics interface
โ”‚   โ”œโ”€โ”€ logic.py        # control logic (PID controllers)
โ”‚   โ”œโ”€โ”€ physics.py      # aerodynamic forces and moments
โ”‚   โ”œโ”€โ”€ primitives.py   # type definitions
โ”‚   โ”œโ”€โ”€ quaternion.py   # 3D rotation operations
โ”‚   โ”œโ”€โ”€ scenario.py     # scenario management
โ”‚   โ”œโ”€โ”€ simulation.py   # numerical integration (RK4/Euler)
โ”‚   โ”œโ”€โ”€ spatial.py      # spatial operations and collision
โ”‚   โ”œโ”€โ”€ state.py        # aircraft and simulation state
โ”‚   โ”œโ”€โ”€ terrain.py      # procedural terrain generation
โ”‚   โ””โ”€โ”€ wind.py         # wind and turbulence modeling
โ””โ”€โ”€ visual/
    โ”œโ”€โ”€ config.py       # visualisation configuration
    โ”œโ”€โ”€ entities.py     # 3D entities (aircraft, terrain)
    โ”œโ”€โ”€ runtime.py      # Ursina runtime
    โ””โ”€โ”€ utils.py        # visualisation utilities

๐Ÿ“Š Benchmarks

Nimbus benchmark results

Benchmark Methodology

The code used for benchmarking can be found at the end of the demo notebook for easy results replication. Each data point is the average of 10 runs.

Hardware Configurations

Hardware Type Memory Max Throughput Sim Time Ratio
Apple M2 Air @ 3.5GHz CPU 16 GB 9.2M steps/second 1.8 days/second
i7 14770k @ 5.6GHz CPU 64 GB 10.0M steps/second 1.9 days/second
Google Colab T4 GPU 16 GB VRAM 112M steps/second 22 days/second
NVIDIA RTX 4090 GPU 24 GB VRAM 983M steps/second 190 days/second

Max Throughput: Peak aircraft-steps per second | Sim Time Ratio: Simulated seconds per wall-clock second

๐Ÿ“š Citation

If you use Nimbus in your research, please cite:

@software{nimbus2025,
  title = {Nimbus: A Massively Parallelisable JAX Flight Simulation},
  author = {Alex Goddard},
  year = {2025},
  url = {https://github.com/auxeno/nimbus}
}

๐Ÿ“œ License

Apache 2.0 - See licence for details.

๐ŸŒŸ Acknowledgments

Built with JAX โ€ข Visualised with Ursina

About

A massively parallelisable JAX flight simulator

Resources

License

Stars

Watchers

Forks

Packages

No packages published