Source linked

Rumoca Pipes Modelica Models Into JAX, Julia, and CasADi Without Rewrites

A Rust-native compiler turns Modelica into a universal algebraic frontend, enabling differentiable simulation, optimization, and real-time control from a single model source.

rumocamodelicarustjaxjuliawasm

Rumoca compiles Modelica straight into the algebraic representations that JAX, CasADi, and Julia expect, without a human in the loop rewriting the model. Engineers no longer have to choose between the rich ecosystem of Modelica and the differentiable programming tools they actually want to use.

From Modelica to Multiple Backends Without Sacrifice

Modelica has been the gold standard for cyber-physical modeling, but its toolchains never targeted the numerically differentiated worlds of CasADi, JAX, or Julia. Every integration meant either losing structural information at the boundary or rewriting the entire model. Rumoca sidesteps that by enforcing explicit phase boundaries from parsing through Differential-Algebraic Equation (DAE) construction and template-driven code generation. The compiler is written in Rust, which buys us memory safety and speed, but the real win is that it outputs code the target backends can ingest natively.

The paper reports quantitative coverage of the Modelica Standard Library across all pipeline phases, meaning Rumoca isn't a toy. It handles real models without silently dropping constraints. The compiler's design makes it a universal algebraic frontend: one Modelica source file can spawn a JAX gradient tape, a CasADi optimization, and a Julia simulation from the same DAE intermediate representation.

Real-Time Control and Browser-Based Deployment

Rumoca ships with its own Rust-native simulation backend that supports real-time, software-in-the-loop execution. The quadrotor case study demonstrates exactly this: a Modelica model running in a real-time loop, driving hardware without a separate code generator. That alone would be noteworthy, but the team also packaged the entire compiler as a VS Code extension and a WebAssembly build that runs in the browser. Zero-install playgrounds become possible, and you can generate self-contained HTML simulators from Modelica sources.

This changes how models get shared. Instead of shipping a bloated simulation environment, you send a single HTML file that includes both the model and the compiled runtime. For verification, education, and rapid prototyping, that's a drastic reduction in friction.

Benchmarks and What Comes Next

Rumoca's performance is benchmarked against an open-source Modelica reference at both compile time and simulation time. The paper includes those numbers, but the more important metric is that the compiler doesn't degrade simulation fidelity when targeting foreign backends. The quadrotor case study shows that control logic written in Modelica can be deployed on JAX for gradient-based optimization and then on CasADi for nonlinear MPC, all from the same source.

The concrete next step is obvious: Modelica can now serve as the source language for differentiable simulation and scientific machine learning workflows that previously required hand-translation. Rumoca makes that translation automatic, correct, and performant.


Source: Rumoca: Modelica as a Universal Algebraic Frontend via a Rust-Native Compiler
Domain: arxiv.org

Read original source ->

External source stays available while the OJO article and comment thread stay local.

Comments load interactively on the live page.