← Projects · Research

Safe operating envelopes straight from data

Give it logged measurements of a system you have no model of, and it returns the region where the system can be kept safe forever, together with the commands that keep it there. No model, no grid, and a guarantee that is a proof, not a probability. From 1,000 measurements of a three-room cooling system it certifies 98 % of the safe temperature range in under a second; a grid-based method needs 200,000 to certify 74 %.

Safety · Data-driven · Invariant sets · Monotone systems · Python · MATLAB

Code on GitHub →Stack: Python · NumPy · MATLAB / Octave · pytest · GitHub Actions

1,000 → 98 %measurements in, share of the safe temperature range certified (three rooms, one cooling input)
200× less datathan a grid abstraction of the same system, which certifies 74 % from 200,000
< 1 sper envelope in every example, up to ten dimensions and 500,000 pairs of measurements
0violations in closed loop, under random worst-case disturbances

What it does

Before a controller goes near a real machine, someone has to answer: from which states can we always keep it within its limits, and with which commands? That region is the system’s safe operating envelope (a controlled invariant set). Computing it normally needs an accurate model, and identifying one is often the most expensive part of a project. Methods that skip the model often give only probabilistic guarantees, or struggle beyond a few states.

This work computes the envelope directly from logged data, with a hard guarantee:

  1. Logged dataMeasured transitions (state, command → next state), from normal operation or a simulator. Plus simple prior knowledge: how the variables push on each other, or bounds on how fast the dynamics can change.
  2. Order structureMany systems are monotone: more of one variable never means less of another. Systems that are not get lifted into a monotone system twice the size that tracks a lower and an upper bound.
  3. Envelope searchFind the measurements (or pairs of them) whose box of states provably maps back inside itself, and combine them. Only comparisons and small LPs: no gridding of the state space.
  4. Safety controllerFor every state in the envelope, the commands that keep it there. Use it as a safety filter around any controller, learned or hand-tuned.

The envelope is described by a short list of corner points, so checking whether a state is safe, or which commands are allowed, is a few comparisons: cheap enough for an embedded controller.

Demos

Three rooms, one cooling input. Each room exchanges heat with the hot outside and with its neighbours; one shared cooling unit can be throttled between 0 and 1; unknown heat gains of up to 0.15 °C per step act on every room. The goal: no room above 26 °C, ever. The method gets 1,000 logged transitions and nothing else besides the size of the heat gains and the fact that cooling never warms a room. It returns 13 corner temperatures, each with the least cooling that keeps everything below it, and certifies 98 % of the safe temperature range in under a second. The grid-based abstraction of my toolbox ddma, on the same system, needs 200,000 transitions and certifies 74 %. In closed loop, with a controller that would rather not cool at all and the envelope overriding it only when needed, no room ever went above 26 °C.

Certified safe temperatures of rooms 1 and 2 with room 3 at 24 °C: the envelope from 1,000 transitions (red) and the grid abstraction from 200,000 (dashed)

Nonlinear systems without any order structure. The second method needs no monotonicity, only bounds on the derivatives. On a two-species competition model with harvesting inputs and disturbances, 400 measurements certify 84 % of the operating range in a few hundredths of a second (hero image, left); a controller that harvests as much as it can, filtered by the envelope, never leaves it. On a ring of ten coupled nonlinear units, 1,000 measurements give certified boxes for the whole network in about 0.2 s (right).

A coupled thermal plant, with a neural safety certificate (from the CDC paper). Two zones are linked by a heat-recovery unit that pulls heat from one zone when the other demands it, so the plant is not monotone. The controller works on a lifted monotone system, and an interface with a proven tracking bound passes its commands to the real plant despite unmeasured disturbances. A small neural network that is monotone by construction is trained as the safety certificate and then verified exactly over the continuous state space by checking only box corners. The certified region covers 95 % of the comfort band left after the tracking margin.

Certified safe set of the two-zone thermal plant (blue), inside the comfort band; closed-loop trajectories from the corners stay inside (figure from the CDC paper)

Algorithms and performance

  • Envelope as a skyline. For monotone systems, each measurement whose worst-case successor did not increase in some coordinate is a candidate wall of the envelope. The search picks one wall per coordinate, coordinate by coordinate, and drops every partial choice that another one dominates; a sort-filter skyline query keeps the maximal corners. It returns exactly what exhaustive enumeration returns (checked by brute force), but in under a second instead of enumerating millions of combinations.
  • Pairwise embedding in closed form. Two measurements span a box of states and of commands. Bounds on the derivatives turn each measurement into a growth cone, and the cones bound where the whole box can go. The bound is an LP; I solve it exactly in closed form (one sort per pair, checked against an LP solver), so all 500,000 pairs of 1,000 measurements take a fraction of a second.
  • Lifting with a proven tracking bound. For linear plants, the lifted monotone system and the real one are linked by a simulation function built from one discrete Lyapunov equation. It gives closed-form margins on the state and on the command, so the guarantee on the lifted system carries over to the real plant under any bounded disturbance.
  • Neural certificates that can be verified exactly. A network with non-negative weights and non-decreasing activations is monotone, so on a box its worst value sits at a corner. Training uses labelled samples; verification checks the corners of a finite cover and certifies the whole continuous region. No sampling-based “probably safe”.

Engineering

  • Tests that check the guarantee itself. Random monotone and nonlinear systems; every certified box or corner is pushed through the true dynamics with random inputs and worst-case disturbances; closed-loop runs from thousands of certified states. Exactness of the search (against brute force) and of the closed-form LP (against HiGHS).
  • Python and MATLAB. The same functions in both languages, with the MATLAB results checked against Python in CI (under Octave), like the rest of ddma.
  • Released in ddma v0.9 (ddma.invariance; MATLAB ddma.monotone_envelope, ddma.embedding_envelope). The hierarchical method of the CDC paper will get its own repository.

Next

  • Use the envelope as the safe set of ddma’s reinforcement-learning safety filter, so an agent can be shielded from a few hundred measurements instead of a full grid.
  • Use it inside my safe learning-based MPC in place of the gridded abstraction.
  • The hierarchical method with the neural certificate as its own package.

For researchers

Three results, one idea: exploit order to get deterministic data-driven invariance without a model and without gridding.

  • Monotone systems (IFAC WC 2026, with M. Zamani). For an unknown monotone x⁺ = f(x, u) + w with w ∈ [W_l, W_u] and a lower-closed safety specification, an intersection vector T formed from data points whose shifted successors satisfy the validity condition yields a robustly invariant lower set ↓T; the union over all valid T is lower-closed and invariant, and is represented by its maximal elements. For controlled systems, the componentwise minimum of the inputs of the defining points is a safe input for all of ↓T, which gives a maximal safe-input map C(x) by monotonicity.
  • Monotone embeddings for general nonlinear systems (IFAC WC 2026, with M. Zamani and S. Jafarpour). With interval bounds on the Jacobian, an embedding G_f on X × X built from intersections of growth cones of pairs of data points satisfies an inclusion property, hence alternatingly simulates the original system; controlled invariant sets of the embedding project to controlled invariant sets of the original. A sign-dependent change of coordinates makes the embedding monotone on each orthant, so invariant boxes are found by checking z′ ⪯ z on the transformed pair data.
  • Hierarchical control through a monotone embedding (IEEE CDC 2026, accepted, with M. Zamani and S. Jafarpour). For a linear plant with bounded disturbances, the 2n-dimensional embedding with blocks A⁺, A⁻ is monotone; with P = ½[I −I] and the interface u = R û + K(x − P x̂), V = √(eᵀMe) is a simulation function with contraction rate α = λ_min(Q)/(2λ_max(M)) and robust tracking radius γ̄ = γ(Δω)/α. Safe-set synthesis then becomes a search for a monotone barrier on the lifted space, learned as a monotone neural network and verified by upper-corner checks on a box cover. On the two-zone example, α ≈ 0.332, γ̄ ≈ 0.662, and the certified set has area 2.560 of 2.692 for the tightened box.

Unlike PAC or scenario-based data-driven abstractions, all guarantees are deterministic; unlike most direct data-driven invariance methods, linear dynamics are not required (first two results).

Methods: A. Makdesi, M. Zamani, S. Jafarpour. Implementation: Anas Makdesi.

Related papers

  1. IEEE CDC

    Monotone Embedding for Hierarchical Control of Linear Systems with Disturbances

    Anas Makdesi, Majid Zamani, Saber Jafarpour · IEEE Conference on Decision and Control, 2026 (accepted) · Journal extension in preparation

  2. IFAC WC

    Data-Driven Controlled Invariance via Monotone Embeddings

    Anas Makdesi, Majid Zamani, Saber Jafarpour · IFAC World Congress, 2026

  3. IFAC WC

    Data-Driven Synthesis of Controlled Invariant Sets for Monotone Systems

    Anas Makdesi, Majid Zamani · IFAC World Congress, 2026