Archimedes Rocket Logo

Archimedes is an open-source Python framework designed for deployment of control systems to hardware. To make this possible, it provides a comprehensive toolkit for modeling, simulation, optimization, and C code generation. Archimedes builds on the powerful symbolic computation capabilities of CasADi with an interface designed to be familiar to NumPy users.

⭐ Introduction

Introduction to the Archimedes project

Introducing Archimedes
πŸ“š Quickstart

Learn how to use Archimedes

Quickstart
πŸ“ Blog

Announcements, deep dives, and case studies

Archimedes Blog

Quick ExampleΒΆ

See the Quickstart for recommended installation; the easiest version is:

pip install archimedes

Archimedes combines design features from SciPy, JAX, and PyTorch to make it possible to write regular NumPy functions that can be automatically differentiated and translated to C code for embedded applications:

import numpy as np
import archimedes as arc

def f(x):
    return np.sin(x**2)

# Use automatic differentiation to compute df/dx
df = arc.grad(f)
np.allclose(df(1.0), 2.0 * np.cos(1.0))  # True

# Automatically generate C code
template_args = (0.0,)  # Data type for C function
arc.codegen(df, "grad_f.c", template_args, return_names=("z",))

Key features:

  • NumPy-compatible array API with automatic dispatch

  • Efficient execution of computational graphs in compiled C++

  • Automatic differentiation with forward- and reverse-mode sparse autodiff

  • Interface to β€œplugin” solvers for ODE/DAEs, root-finding, and nonlinear programming

  • Automated C code generation for embedded applications

  • JAX-style function transformations

  • PyTorch-style hierarchical data structures for parameters and dynamics modeling

DocumentationΒΆ

Applications

Indices and TablesΒΆ