Stanford AA228V I Validation of Safety Critical Systems I Reachability for Nonlinear Systems

Unknown AuthorAbout 7 min readApr 8, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Linear Reachability: Determining the set of states a linear system can reach from a given initial set.
  • Polytopes: Geometric objects with flat sides (faces) and straight edges.
  • Zonotopes: A special type of polytope where the number of generators grows linearly with depth, making them computationally efficient for reachability analysis.
  • Overapproximation: A set that is guaranteed to contain the true reachable set.
  • Avoid Set: A set of states that the system must not enter.
  • Support Vector: A function that takes a direction as input and returns the point in a set that maximizes the dot product with that direction.
  • Half-Space: A region of space defined by a plane, where all points on one side of the plane are included.
  • Linear Program (LP): An optimization problem where the objective function and constraints are linear.
  • Principal Component Analysis (PCA): A statistical method used to identify the primary directions of variance in a dataset.
  • Non-Linear Reachability: Determining the set of states a non-linear system can reach from a given initial set.
  • Interval Arithmetic: Performing arithmetic operations on intervals rather than single numbers.
  • Interval Box (Hyperrectangle): A multi-dimensional interval, formed by the Cartesian product of one-dimensional intervals.
  • Interval Counterpart: An extension of arithmetic operations to intervals.
  • Inclusion Function: An interval that is guaranteed to contain the interval counterpart.
  • Natural Inclusion Function: An inclusion function obtained by directly replacing each variable in a function with its interval counterpart.
  • Dependency Effect: An issue that arises when using natural inclusion functions, leading to overapproximation due to treating variables as independent when they are not.
  • Mean Value Theorem: A theorem from calculus that relates the slope of a secant line to the slope of a tangent line.
  • Mean Value Inclusion Function: An inclusion function based on the mean value theorem, providing a tighter approximation than the natural inclusion function.
  • Taylor Model: A representation of a set using a Taylor polynomial and an interval remainder, allowing for more accurate approximations than hyperrectangles.

Reachability Analysis for Linear Systems

The Challenge of Exponential Vertex Growth

  • In linear reachability, propagating polytopes through linear equations leads to an exponential increase in the number of vertices with each time step.
  • This exponential growth makes the computation quickly intractable.

Mitigation Strategies

  • Zonotopes: Representing sets as zonotopes can help, as the number of generators grows linearly with depth. However, not all polytopes can be represented as zonotopes.
  • Overapproximation: Overapproximating the reachable set with a simpler set (e.g., one with fewer vertices) can reduce computational cost.

Guarantees with Overapproximation

  • If the overapproximate reachable set does not intersect with the avoid set, then the true reachable set is guaranteed to be safe (i.e., it also does not intersect the avoid set).
  • If the overapproximate reachable set does intersect with the avoid set, no conclusion can be drawn about the safety of the true reachable set (inconclusive).

Practical Implementation with LazySets

  • The LazySets package provides functionality for automatic overapproximation.
  • The algorithm involves overapproximating the reachable set every few iterations (frequency is problem-dependent).
  • The overapproximate function in LazySets takes an error tolerance as input and returns an overapproximate set with fewer vertices.
  • The specific algorithm used by LazySets is detailed in the book.

Trade-off Between Computation and Accuracy

  • Overapproximation introduces error, leading to more conservative (larger) reachable sets.
  • There is a trade-off between the computational cost (number of vertices) and the accuracy (conservativeness) of the reachable sets.

Support Vectors: The Key to Overapproximation

  • A support vector is a function, σ(D), that takes a direction vector (D) as input and returns the point in a set that maximizes the dot product with that direction.
  • Visually, the support vector in a given direction is the point where a line perpendicular to that direction just touches the set.
  • The support vector defines a bounding half-space for the set.
  • By evaluating support vectors in multiple directions, a bounding polyhedron (overapproximation) can be constructed.
  • The choice of directions determines the shape of the bounding polytope.
  • LazySets uses a smart method for picking these directions to efficiently overapproximate the set.

Optimization Techniques for Reachability

  • Instead of propagating the set and then overapproximating, support vectors can be solved for directly using optimization.
  • The optimization problem seeks to maximize the dot product of a direction vector (d) with the states in the reachable set at time step d.
  • This optimization problem can be converted into a linear program (LP) by adding constraints:
    • The initial state must come from the initial state set.
    • The disturbance at each time step must come from the disturbance set.
    • The dynamics of the system (state transition function) must be satisfied.
  • Solving this LP provides bounds on the reachable set.

Practical Considerations for Optimization

  • To obtain a bounding polytope, the optimization problem must be solved in multiple directions.
  • If the only goal is to check if the reachable set intersects with the avoid set, this can be solved exactly using an optimization problem (minimizing the distance between points in the two sets).

Code Implementation

  • The optimization problem can be implemented in Julia using packages like Convex.jl or JuMP.jl.

Choosing Directions for Support Vectors

  • Axis-aligned directions: Result in a bounding box, but can lead to significant overapproximation.
  • Random directions: Can improve the approximation, but the quality depends on the sampling.
  • Principal Component Analysis (PCA): Performing PCA on samples from rollouts can identify the primary directions of variance, leading to a tighter approximation with fewer support vectors.

Reachability Analysis for Non-Linear Systems

The Challenge of Non-Linear Operators

  • Applying non-linear operators to polytopes results in sets that are no longer polytopes, making set propagation more difficult.
  • Non-convex sets are generally more challenging to work with.

General Approach: Overapproximation with Polytopes

  • The main strategy is to overapproximate non-polytope sets with polytopes to enable further analysis.

Interval Arithmetic

  • Intervals: Represent a range of values between a lower and upper bound.
  • Interval Boxes (Hyperrectangles): Multi-dimensional intervals formed by the Cartesian product of one-dimensional intervals.
  • Interval Counterparts: Extensions of arithmetic operations to intervals (addition, subtraction, multiplication, division).
  • Interval counterparts can also be defined for elementary functions (e.g., sine, cosine, square root).

Interval Arithmetic for Reachability

  • Instead of propagating specific states, intervals representing ranges of possible states are propagated through the system.
  • For a non-linear system, the reach function is typically non-linear.
  • Inclusion Function: An interval that is guaranteed to contain the interval counterpart.
  • The reach function is broken down into a set of functions, each outputting a single state variable.
  • Inclusion functions are then used to approximate the range of each state variable, resulting in an approximate hyperrectangular reachable set.

Natural Inclusion Function

  • The natural inclusion function is obtained by directly replacing each variable in a function with its interval counterpart.
  • However, the natural inclusion function often leads to significant overapproximation due to the dependency effect.

Mean Value Inclusion Function

  • Based on the mean value theorem from calculus.
  • Provides a tighter approximation than the natural inclusion function.
  • Involves evaluating the function at the center of the interval and using the derivative (gradient) to bound the error.

Taylor Inclusion Functions

  • Generalization of the mean value inclusion function using n terms of the Taylor series.
  • A zero-order Taylor inclusion function is equivalent to the natural inclusion function.
  • A first-order Taylor inclusion function is equivalent to the mean value inclusion function.
  • Higher-order Taylor inclusion functions can provide even tighter approximations, but the computational cost increases.

Code Implementation in Julia

  • The IntervalArithmetic.jl package provides support for interval arithmetic and inclusion functions.
  • Julia's multiple dispatch allows for seamless integration of interval arithmetic with existing code, including automatic differentiation.

Limitations of Interval Arithmetic

  • Interval arithmetic always results in hyperrectangular reachable sets, which can lead to overapproximation if the true reachable set is not hyperrectangular.
  • The overapproximation tends to worsen as the number of time steps increases due to the compounding of nonlinearities.

Taylor Models (Preview)

  • Taylor models can represent more expressive sets than hyperrectangles, allowing for more accurate approximations.

Conclusion

The lecture covers techniques for reachability analysis, focusing on the challenges posed by linear and non-linear systems. For linear systems, the exponential growth of vertices in polytopes is addressed using zonotopes and overapproximation techniques, with LazySets providing practical tools for implementation. Support vectors are introduced as a key concept for overapproximation, and optimization techniques are presented as an alternative to set propagation. For non-linear systems, interval arithmetic and inclusion functions are explored, with the mean value and Taylor inclusion functions offering improved accuracy over the natural inclusion function. While interval arithmetic is limited to hyperrectangular sets, the lecture concludes with a preview of Taylor models, which promise more expressive set representations for non-linear systems.

AI summaries can miss context or contain errors. Check important details against the original video.

MAKE IT YOURS

Read. Remember. Reuse.

Free tools

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.