LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.synthesis.terminal Namespace Reference

Classes

class  AxisBlock
 
class  FaceSet
 
class  Polygon
 
class  TerminalSet
 

Functions

tuple[np.ndarray, np.ndarray] _normalise (np.ndarray H, np.ndarray g)
 
Polygon|None polygon_from_halfspaces (np.ndarray H, np.ndarray g)
 
Polygon polygon_from_points (np.ndarray points)
 
Polygon|None intersect (Polygon p, Polygon q)
 
tuple[float, float] input_interval (np.ndarray A, np.ndarray B, np.ndarray x, Polygon P, float u_lo, float u_hi)
 
Polygon pre_set (np.ndarray A, np.ndarray B, Polygon P, float u_lo, float u_hi)
 
Polygon|None max_control_invariant (np.ndarray A, np.ndarray B, Polygon region, float u_lo, float u_hi, int max_iter=500)
 
None verify_invariant (np.ndarray A, np.ndarray B, Polygon P, float u_lo, float u_hi, float tol=1e-7)
 
dict[str, AxisBlock] axis_blocks (DiscreteLinearModel model, dict[str, tuple[tuple[int, int], int]] spec, float tol=1e-10)
 
TerminalSet patrol_terminal_set (DiscreteLinearModel model, dict[str, AxisBlock] blocks, tuple[str, str] plane, float c_out, np.ndarray x_lo, np.ndarray x_hi, np.ndarray u_lo, np.ndarray u_hi, dict[str, int] position_index)
 

Variables

int _TOL = 1e-9
 

Detailed Description

Verified terminal sets (persistently feasible sets) for the NAHS patrol formulas.

Construction (NAHS Prop. 6 with Prop. 8's "commit to one disjunct"): ``S^c`` is the union of
four half-planes (faces) ``px >= c``, ``px <= -c``, ``py >= c``, ``py <= -c``. For each face
``f`` a set ``Q_f`` is built that is **control invariant for the nominal dynamics** under
the tightened state/input constraints and lies inside the face. A plan whose last ``b``
nominal states lie in one ``Q_f`` can be extended forever by the terminal controller
without leaving ``Q_f``; for theta (``b = 1``) and phi (``b = hG + 1``) every later window
then contains the outside samples it needs (see ``rl_stl.stl.nahs.PatrolTask.terminal_block``).

Decomposition. All synthesis models used here are, at the linearisation point, a product of
decoupled 2-state axis blocks driven by one input each (double integrator ``(p, v)`` per
axis; the blimp's ``(v, p)`` lateral, vertical and yaw blocks, whose inputs also excite
roll/pitch states that feed back into nothing). With a box input set the product of
per-axis control invariant polygons is control invariant for the full model. Every block's
decoupling is checked numerically (:func:`axis_blocks`).

Per axis the maximal control invariant subset of a polygon is computed by the standard
iteration ``Omega <- Omega cap Pre(Omega)`` and **verified** afterwards: every vertex of the
result has an admissible input mapping it back into the set (sufficient for convex sets).

Function Documentation

◆ _normalise()

tuple[np.ndarray, np.ndarray] rl_stl.synthesis.terminal._normalise ( np.ndarray  H,
np.ndarray  g 
)
protected

◆ axis_blocks()

dict[str, AxisBlock] rl_stl.synthesis.terminal.axis_blocks ( DiscreteLinearModel  model,
dict[str, tuple[tuple[int, int], int]]  spec,
float   tol = 1e-10 
)
Extract and check decoupled blocks ``{name: ((i0, i1), input)}``.

◆ input_interval()

tuple[float, float] rl_stl.synthesis.terminal.input_interval ( np.ndarray  A,
np.ndarray  B,
np.ndarray  x,
Polygon  P,
float  u_lo,
float  u_hi 
)
``{u in [u_lo, u_hi] : A x + B u in P}`` as an interval (``lo > hi`` if empty).

◆ intersect()

Polygon | None rl_stl.synthesis.terminal.intersect ( Polygon  p,
Polygon  q 
)

◆ max_control_invariant()

Polygon | None rl_stl.synthesis.terminal.max_control_invariant ( np.ndarray  A,
np.ndarray  B,
Polygon  region,
float  u_lo,
float  u_hi,
int   max_iter = 500 
)
Maximal control invariant subset of ``region`` (``None`` if empty), verified.

◆ patrol_terminal_set()

TerminalSet rl_stl.synthesis.terminal.patrol_terminal_set ( DiscreteLinearModel  model,
dict[str, AxisBlock]  blocks,
tuple[str, str]  plane,
float  c_out,
np.ndarray  x_lo,
np.ndarray  x_hi,
np.ndarray  u_lo,
np.ndarray  u_hi,
dict[str, int]  position_index 
)
Four face sets for ``S^c = {|p_a| >= c_out for some planar axis a}``.

``x_lo/x_hi/u_lo/u_hi`` are the (tightened) constraint boxes; ``c_out`` already includes
the robustness margin and the output tube. For face ``(+, ax)`` the planar axis ``ax`` is
confined to ``p_ax in [c_out, x_hi]``; every other block keeps its full box.

◆ polygon_from_halfspaces()

Polygon | None rl_stl.synthesis.terminal.polygon_from_halfspaces ( np.ndarray  H,
np.ndarray  g 
)
Polygon of ``H x <= g`` (``None`` if empty or degenerate).

◆ polygon_from_points()

Polygon rl_stl.synthesis.terminal.polygon_from_points ( np.ndarray  points)

◆ pre_set()

Polygon rl_stl.synthesis.terminal.pre_set ( np.ndarray  A,
np.ndarray  B,
Polygon  P,
float  u_lo,
float  u_hi 
)
``{x : exists u in [u_lo, u_hi], A x + B u in P}`` for invertible ``A``.

◆ verify_invariant()

None rl_stl.synthesis.terminal.verify_invariant ( np.ndarray  A,
np.ndarray  B,
Polygon  P,
float  u_lo,
float  u_hi,
float   tol = 1e-7 
)
Raise unless every vertex of ``P`` can be mapped into ``P`` (convexity => whole set).

Variable Documentation

◆ _TOL

int rl_stl.synthesis.terminal._TOL = 1e-9
protected