pub struct Nonlinear<D, const N: usize> { /* private fields */ }Expand description
A Reach model of the nonlinear system x' = f(x, u) with N states.
The control of an edge is one input set U_k per time step of
NonlinearSettings::step; see the module docs. Each step linearizes or
polynomializes f around the current set (NonlinearSettings::method) and encloses
the abstraction error. A step polyzonotope-reach cannot prove (the set or the step is
too large for the abstraction, or the step for the Taylor bound) makes
Reach::propagate return None, so the edge is Indeterminate, never Safe.
Sets are stepped whole: NonlinearSettings::max_pieces, splitting,
merge_tolerance and adaptive do not apply, since a split set has no single end set
to hand to the next edge.
§Examples
use robust_planning::models::Nonlinear;
use nalgebra::{DMatrix, DVector};
use robust_planning::polyzonotope::{SparsePolyZonotope, Zonotope};
use robust_planning::polyzonotope_reach::{NonlinearSettings, Polynomial};
use robust_planning::Reach;
// `x' = u - x³` per axis, from the box `[-0.1, 0.1]²` under inputs `u ∈ [0.9, 1.1]²`.
let drag = Polynomial::new(2, 2)
.term(0, 1.0, &[0, 0, 1, 0])
.term(0, -1.0, &[3, 0, 0, 0])
.term(1, 1.0, &[0, 0, 0, 1])
.term(1, -1.0, &[0, 3, 0, 0]);
let model = Nonlinear::<_, 2>::new(drag, NonlinearSettings::new(0.1));
let start = SparsePolyZonotope::from_zonotope(&Zonotope::new(
DVector::zeros(2),
DMatrix::identity(2, 2) * 0.1,
));
let input = Zonotope::new(DVector::from_element(2, 1.0), DMatrix::identity(2, 2) * 0.1);
let mut cover = Vec::new();
let end = model.propagate(&start, &vec![input; 5], &mut cover).expect("short steps are proven");
assert_eq!(cover.len(), 5);
assert!(end.interval_hull().0[0].lo > 0.0);Implementations§
Source§impl<D: Dynamics, const N: usize> Nonlinear<D, N>
impl<D: Dynamics, const N: usize> Nonlinear<D, N>
Sourcepub fn new(dynamics: D, settings: NonlinearSettings) -> Self
pub fn new(dynamics: D, settings: NonlinearSettings) -> Self
The model of dynamics, stepped with settings.
§Panics
Panics if dynamics does not have N states, or if settings are out of range; see
NonlinearReach::new.
Trait Implementations§
Source§impl<D: Dynamics, const N: usize> Reach<N> for Nonlinear<D, N>
impl<D: Dynamics, const N: usize> Reach<N> for Nonlinear<D, N>
Source§type Control = Vec<Zonotope>
type Control = Vec<Zonotope>
One input set per time step, each with one dimension per input of the dynamics.
Source§fn propagate(
&self,
initial: &SparsePolyZonotope,
control: &Self::Control,
cover: &mut Vec<SparsePolyZonotope>,
) -> Option<SparsePolyZonotope>
fn propagate( &self, initial: &SparsePolyZonotope, control: &Self::Control, cover: &mut Vec<SparsePolyZonotope>, ) -> Option<SparsePolyZonotope>
§Panics
Panics if initial does not have N dimensions or an input set does not have one
per input of the dynamics.
Source§fn certify_collision(
&self,
initial: &SparsePolyZonotope,
control: &Self::Control,
set: &SparsePolyZonotope,
obstacle: &Polytope,
) -> Option<Vec<f64>>
fn certify_collision( &self, initial: &SparsePolyZonotope, control: &Self::Control, set: &SparsePolyZonotope, obstacle: &Polytope, ) -> Option<Vec<f64>>
Auto Trait Implementations§
impl<D, const N: usize> Forget for Nonlinear<D, N>
impl<D, const N: usize> Freeze for Nonlinear<D, N>where
NonlinearReach<D>: Freeze,
impl<D, const N: usize> Move for Nonlinear<D, N>
impl<D, const N: usize> RefUnwindSafe for Nonlinear<D, N>where
NonlinearReach<D>: RefUnwindSafe,
impl<D, const N: usize> Send for Nonlinear<D, N>where
NonlinearReach<D>: Send,
impl<D, const N: usize> Sync for Nonlinear<D, N>where
NonlinearReach<D>: Sync,
impl<D, const N: usize> Unpin for Nonlinear<D, N>where
NonlinearReach<D>: Unpin,
impl<D, const N: usize> UnsafeUnpin for Nonlinear<D, N>where
NonlinearReach<D>: UnsafeUnpin,
impl<D, const N: usize> UnwindSafe for Nonlinear<D, N>where
NonlinearReach<D>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.