Advanced maths

Finite horizon backward reachable polytope calculator with bounded controls

Compute states that can reach a target polytope in a finite number of discrete steps while respecting state and control inequalities.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Compute states that can reach a target polytope in a finite number of discrete steps while respecting state and control inequalities.

THE FORMULAPre(T) = {x in X : exists u in U, A x + B u + c in T}

A worked example

For xnext=x+u, ynext=y, controls −1≤u≤1 and target [−1,1]², the one-step predecessor is [−2,2]×[−1,1], with area eight.

Good to know

Rational discrete affine dynamics, state dimension1–2, one control, convex rational target/state/control polytopes and horizon1–8. Exact projected inequalities or vertex projection, redundancy LP and facet-growth cap. No disturbances, infinite-horizon viability claim or grid approximation presented as exact.

Backward sets answer a reachability question

A backward reachable set contains initial states from which at least one admissible control sequence reaches the target. The target is a set rather than one requested terminal point. The horizon fixes how many transitions are considered, and the state and control constraints determine which intermediate choices are allowed.

This is different from an unconstrained reachability Gramian or a minimum-energy calculation. Those constructions describe linear directions or an energy cost without enforcing the polyhedral restrictions used here. A state can be controllable in the usual rank sense while remaining outside a constrained predecessor because the allowed control magnitude or permitted state region prevents the necessary motion.

Finite horizon backward reachable polytope with bounded controlsTarget [−1,1]²Predecessor: [−2,2] × [−1,1]
Scroll across to see the full diagram.
For xnext=x+u, ynext=y, controls −1≤u≤1 and target [−1,1]², the one-step predecessor is [−2,2]×[−1,1], with area eight.

Compare this with the Finite horizon reachability Gramian and minimum energy control calculator. Compute the complete set of states that can be driven into a target under control/state inequalities, using quantified control elimination. A Gramian gives unconstrained energy from one state, not a constrained predecessor set.

One predecessor is an existential projection

Write the target as linear inequalities in the next state. Substitute A x plus B u plus the affine offset, and append the control bounds and current-state inequalities. The resulting polytope lives in a joint state-and-control space. Projecting away the control variable leaves precisely the states for which a feasible control exists.

That projection is existential: different initial states may use different controls. It is not the intersection of next-state sets obtained from a few sampled controls, nor does it require one control to work for every state. The distinction explains why exact inequality elimination or a certified polytope projection is needed instead of a convenient grid visualization.

Exact inequalities and redundancy removal

Rational coefficients permit exact arithmetic during elimination. Removing a variable can create many pairwise combinations of inequalities, and repeated steps can multiply the number of facets. Redundancy tests use linear programs to remove inequalities implied by the others without changing the represented set. Coordinate scaling can help keep the arithmetic manageable.

The implementation therefore has explicit limits on horizon and facet growth. Reaching a cap is not proof that the predecessor is empty. It means the exact representation became too expensive within the supported bounds. An empty-set claim requires a feasibility certificate, while a returned nonempty polytope should preserve its inequalities or vertices so the representation can be checked independently.

The translated interval example

The default dynamics can move the horizontal coordinate by a control in the interval from minus one to one. The vertical coordinate is unchanged. To finish horizontally inside [−1,1], an initial horizontal value can lie anywhere in [−2,2], because the control can move it inward by at most one unit.

The vertical coordinate must already lie in [−1,1], since no control acts on it. The broad state box [−5,5]² does not clip this predecessor. Its width is four and its height is two, giving area eight. For example, the state (2,0) reaches the target with control minus one, whereas (2.1,0) cannot do so in a single step.

Iterating a finite horizon

After computing one predecessor, repeat the operation using that set as the next target. Intersect with the permitted state region at each stage, according to the declared endpoint convention. The resulting family describes exactly-horizon reachability under those rules; a target-invariance assumption is needed before casually interpreting it as an at-most-horizon family.

A control witness for one state can be replayed through the stored predecessor sequence. At each step, choose an input satisfying the next-set inequalities and the control bounds. Verifying only the final point is insufficient when intermediate state constraints matter. A route that briefly leaves the allowed region and later returns is not admissible in this model.

How the polygons should be interpreted

The plot displays a low-dimensional representation of exact linear inequalities. It should not silently replace an unbounded polyhedron by a finite viewport box or present a disconnected-looking numerical artifact as a true hole. Initial supported problems use bounded polytopes, and any degeneracy to a segment, point or empty set should be reported explicitly.

Area is a convenient summary in two dimensions but does not describe every aspect of reachability. A thin predecessor can have small area while containing a particular state of interest. Inspect membership and steering witnesses for the actual initial condition rather than treating a larger area as an unconditional measure of better control performance.

What this finite model excludes

The construction assumes exact affine discrete dynamics and no disturbance term. Requiring a control that succeeds against every disturbance introduces a different quantifier and a robust predecessor operator. Likewise, iterating to a fixed point for an invariant or viability set goes beyond a capped finite-horizon calculation.

Use the returned sets to understand the declared finite task. They do not prove that the same control policy is safe indefinitely, that an uncertain physical system follows the model exactly, or that the control effort is minimal. Those claims require additional models and objectives. Keeping the quantifiers and horizon visible makes the output a reproducible reachability statement.

A few questions, answered

Is the same input used for all states?

No. The predecessor asks whether each state has at least one feasible control.

Does this include disturbances?

No. Robust reachability requires a different quantifier and is outside the initial model.

Does a cap imply an empty set?

No. A resource cap means the exact projection remained unresolved.

Is this an infinite-horizon safety result?

No. It is a finite-horizon predecessor calculation with explicit state and control constraints.

Find your calculator

Start typing to explore the library.