Skip to main content

Method

Enum Method 

Source
#[non_exhaustive]
pub enum Method { Linearization, Polynomialization, }
Expand description

How NonlinearReach abstracts the dynamics in each step.

Non-exhaustive: more abstractions may be added.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Linearization

Conservative linearization (Althoff, Stursberg & Buss 2008): the whole abstraction error ½ Δzᵀ H(ξ) Δz over the time-interval set is one box, guessed and checked. Needs the Hessians only. The default, because every Dynamics supports it.

§

Polynomialization

Conservative polynomialization (Althoff 2013): the second- and third-order error at the start set stays a polynomial zonotope over the set’s factors and moves with the set; only what changes during the step and the Lagrange remainder around the third derivatives at z* go into the box. Needs Dynamics::third_derivatives. Tighter for large sets, since the box shrinks from O(w²) to O(w r + w² r) plus the spread of ∂³f times w³ for a set of width w; that spread comes from rounding only for fields of degree 3 or less.

§The error decomposition

Let f be three times continuously differentiable, z* = (x*, u*) the linearization point and [A B] the center of the enclosure of J(z*), with w ∈ f(z*) − A x* − B u* the model offset. For a trajectory with x(t_k) = x_k and any input signal u(t) ∈ U, write

  • Δz(t) = z(t) − z* with z(t) = (x(t), u(t)),
  • s = (x_k − x_m, 0), the start of the trajectory relative to the middle x_m of the start set’s hull, which is constant along the trajectory, and
  • δ(t) = Δz(t) − s = (x(t) − x_k − c, u(t) − u*), what changes, with c = x* − x_m the half step from x_m to the linearization point.

Any constant split of Δz would do; this one centers both parts. With s = (x_k − x*, 0) instead, s would be off-center by the half step and δ would range over the whole step’s drift [0, r] f, which made the sets of small starts larger than those of linearization in a trial on Van der Pol. Centered, δ spans about ±½ r f.

Taylor’s theorem with the Lagrange remainder gives, row by row and for some ξ(t) on the segment from z* to z(t),

f(z) = f(z*) + J(z*) Δz + ½ Δzᵀ H(z*) Δz + ⅙ Σ_{abc} ∂³f(ξ)_{abc} Δz_a Δz_b Δz_c.

With ½ H(z*) ∈ Q ± R_Q, J(z*) ∈ [A B] ± R_J and a point tensor P ≈ ⅙ ∂³f(z*) (the midpoints, divided by 6 and rounded), write T_c for an enclosure of 6 P and

⅙ T(ξ) Δz³ = P s³ + ⅙ T_c (Δz³ − s³) + ⅙ (T(ξ) − T_c) Δz³,

exact for the real 6 P ∈ T_c. The error of the linear model, e = f(z) − (A x + B u + w), then splits into

e = ψ_s(x_k) + ψ_d(t),
ψ_s(x_k) = sᵀ Q s + P s³                                   (static)
ψ_d(t)  ∈ sᵀ [±R_Q] s + sᵀ (½H) δ + δᵀ (½H) s + δᵀ (½H) δ  (dynamic)
          + ⅙ T_c (Δz³ − s³) + ⅙ (T(ξ) − T_c) Δz³ + [±R_J] |Δz|.

The change of the cubic term is bounded through the telescoping identity Δz_a Δz_b Δz_c − s_a s_b s_c = δ_a Δz_b Δz_c + s_a δ_b Δz_c + s_a s_b δ_c, so it is O(w² r) instead of the O(w³) of the whole cube over □Δz.

The inputs are never part of s: u(t) may jump anywhere in U during the step, so only the state at t_k is constant along a trajectory. Every term with u − u* is dynamic.

§Why the sets enclose every trajectory

The static part is a polynomial of x_k alone. The step computes Ψ_s = { sᵀ Q s + P s³ | x_k ∈ X } with the quadratic and the cubic map of the polynomial zonotope X − x_m, joined by exact_plus, which keeps the factors of X: the point of Ψ_s that belongs to x_k = X(α, β) uses the same α. Degrees above the cap are enclosed as independent generators, which only adds points.

The static error acts on the trajectory as a constant input v = ψ_s(x_k). The step therefore runs the linear reach on the augmented system x' = A x + v + B u + w + ψ_d, v' = 0, x₀' = 0, from { (x_k, ψ_s(x_k), x_k) | x_k ∈ X }, built by one linear map of X and SparsePolyZonotope::exact_plus, which keep the shared factors and pair the independent generators of both copies of x_k. The linear reach is sound for any input signal in its input set, so with ψ_d(t) ∈ Ψ̄ for all t of the step, the projection of its sets onto x holds the trajectory at t_{k+1} and during the step. The static error never needs a guess: it is exact up to the degree cap, and it moves with the set rather than being smeared over the whole step as a box.

The dynamic part needs boxes of s, δ and Δz. The step takes s from the interval hull of X − x_m, Δz from the hull of the time-interval set R(τ) and U, the input part of δ from U − u*, and the state part, minus c, from two enclosures of x(t) − x_k, intersected: the flow, x(t) − x_k = ∫_{t_k}^t f(z(σ)) dσ ∈ [0, r] · f(□R(τ) × □U) (enclosed in interval arithmetic), and the hull of x − x₀ over the augmented time-interval set, where the factors of x_k cancel. Both hold as long as the trajectory stays in R(τ) up to t with its error in Ψ̄. That is the same hypothesis the guess-and-check loop proves for every other term, so the usual argument closes: if the dynamic error computed over R(τ) lies in the guess Ψ̄, no trajectory can leave R(τ) during the step, because up to the first exit its error lies in Ψ̄ and the linear model with an input in Ψ̄ keeps it in R(τ). The remainder evaluates ∂³f over a box that holds every segment from z* into z* + □Δz, which holds every ξ(t).

The decomposition is exact algebra, every box encloses its quantity, and every product and sum of boxes is interval arithmetic, outward rounded with the sound feature. Removing any one term makes the claim false; the unit tests show that for each term that floating-point rounding does not dominate.

Trait Implementations§

Source§

impl Clone for Method

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Method

Source§

impl Debug for Method

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Method

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Method

Source§

impl PartialEq for Method

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Method

Auto Trait Implementations§

§

impl Forget for Method

§

impl Freeze for Method

§

impl Move for Method

§

impl RefUnwindSafe for Method

§

impl Send for Method

§

impl Sync for Method

§

impl Unpin for Method

§

impl UnsafeUnpin for Method

§

impl UnwindSafe for Method

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.