Skip to content

Add Alpaqa solver support through CasADi #1084

Description

@mickaelbegon

Disclosure: This issue text and technical analysis were prepared by OpenAI Codex from the implementation and benchmark results on the linked branch, and reviewed by the branch author.

Motivation

Add Alpaqa as an optional nonlinear programming solver in Bioptim through CasADi’s nlpsol interface.

Alpaqa combines an augmented Lagrangian method with PANOC and L-BFGS directions. It may be useful for repeated optimal-control and NMPC solves, although its performance and robustness depend strongly on scaling, warm starts, and problem formulation.

Reference implementation

A working experimental implementation is available on this branch:

Proposed scope

  • Add Solver.ALPAQA().
  • Expose the nested ALM, PANOC, and L-BFGS option groups expected by CasADi.
  • Support primal warm starts and constraint-multiplier warm starts.
  • Normalize solver status, feasibility, and timing information in Solution.
  • Keep Alpaqa optional so Bioptim remains importable when the CasADi plugin is unavailable.
  • Add solver-option and integration tests.
  • Document installation, supported options, and current limitations.
  • Add representative OCP and cyclic NMPC benchmarks.

Current validation

The reference branch contains:

  • standard OCP benchmarks against IPOPT and FATROP;
  • a long holonomic-muscle stress case;
  • a cyclic NMPC benchmark with shifted primal and dual warm starts.

On the small cube benchmark, Alpaqa converges to an objective equivalent to IPOPT, with constraint violation below the requested tolerance. It is currently slower than IPOPT on this example.

In the cyclic NMPC benchmark, the common initial window is solved successfully, but the shifted windows do not yet meet the configured 0.5-second deadline. The current results therefore validate the integration and benchmark protocol but do not yet establish a performance advantage.

Installation considerations

The native Alpaqa Python package is not used directly. CasADi must be compiled with WITH_ALPAQA=ON and linked against a compatible Alpaqa C++ library.

The reference branch documents how to verify the plugin using:

import casadi as cas

print(cas.has_nlpsol("alpaqa"))
print(cas.nlpsol_options("alpaqa"))

Known limitations

  • Online optimization callbacks are not currently supported.
  • Bioptim’s c_compile path is disabled for Alpaqa.
  • Detailed ALM and PANOC iteration statistics are not exposed by the tested CasADi plugin.
  • Scaling and warm-start tuning still require further investigation.
  • Block-shooting and DSS formulations have not been tested.

Would the maintainers be interested in turning this experimental branch into a pull request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions