Package tulip :: Package abstract :: Module feasible
[frames] | no frames]

Module feasible

Check Linear Discrete-Time-Invariant System reachability between polytopes

Primary functions:

See Also

find_controller

Functions
 
is_feasible(from_region, to_region, sys, N, closed_loop=True, use_all_horizon=False, trans_set=None)
Return True if to_region is reachable from_region.
Polytope or Region
solve_feasible(P1, P2, ssys, N=1, closed_loop=True, use_all_horizon=False, trans_set=None, max_num_poly=5)
Compute S0 \subseteq P1 from which P2 is N-reachable.
 
solve_closed_loop(P1, P2, ssys, N, use_all_horizon=False, trans_set=None)
Compute S0 \subseteq P1 from which P2 is closed-loop N-reachable.
 
solve_open_loop(P1, P2, ssys, N, trans_set=None, max_num_poly=5)
 
poly_to_poly(p1, p2, ssys, N, trans_set=None)
Compute s0 for open-loop polytope to polytope N-reachability.
 
volumes_for_reachability(part, max_num_poly)
 
createLM(ssys, N, list_P, Pk=None, PN=None, disturbance_ind=None)
Compute the components of the polytope:
 
get_max_extreme(G, D, N)
Calculate the array d_hat such that:
Variables
  logger = logging.getLogger(__name__)
  __package__ = 'tulip.abstract'
Function Details

is_feasible(from_region, to_region, sys, N, closed_loop=True, use_all_horizon=False, trans_set=None)

 

Return True if to_region is reachable from_region.

For details see solve_feasible.

solve_feasible(P1, P2, ssys, N=1, closed_loop=True, use_all_horizon=False, trans_set=None, max_num_poly=5)

 

Compute S0 \subseteq P1 from which P2 is N-reachable.

N-reachable = reachable in horizon n. The system dynamics are ssys. The closed-loop algorithm solves for one step at a time, which keeps the dimension of the polytopes down.

Parameters:
  • N - The horizon length
  • closed_loop (bool) - If true, take 1 step at a time. This keeps down polytope dimension and handles disturbances better.
  • use_all_horizon (bool) - Used for closed loop algorithm. If true, then allow reachability also in less than N steps.
  • trans_set - If specified, then force transitions to be in this set. Otherwise, P1 is used.
  • P2 (Polytope or Region)
  • ssys (LtiSysDyn)
  • P1 (Polytope or Region)
Returns: Polytope or Region
the subset S0 of P1 from which P2 is reachable

solve_closed_loop(P1, P2, ssys, N, use_all_horizon=False, trans_set=None)

 

Compute S0 \subseteq P1 from which P2 is closed-loop N-reachable.

Parameters:
  • ssys - system dynamics
  • N (int > 0) - horizon length
  • use_all_horizon (bool) -
    • if True, then take union of S0 sets
    • Otherwise, chain S0 sets (funnel-like)
  • trans_set - If provided, then intermediate steps are allowed to be in trans_set.

    Otherwise, P1 is used.

  • P2 (Polytope or Region)
  • P1 (Polytope or Region)

createLM(ssys, N, list_P, Pk=None, PN=None, disturbance_ind=None)

 

Compute the components of the polytope:

   L [x(0)' u(0)' ... u(N-1)']' <= M

which stacks the following constraints:

  • x(t+1) = A x(t) + B u(t) + E d(t)
  • [u(k); x(k)] \in ssys.Uset for all k

If list_P is a Polytope:

  • x(0) \in list_P if list_P
  • x(k) \in Pk for k= 1,2, .. N-1
  • x(N) \in PN

If list_P is a list of polytopes:

  • x(k) \in list_P[k] for k= 0, 1 ... N

The returned polytope describes the intersection of the polytopes for all possible

Parameters:
  • ssys (LtiSysDyn) - system dynamics
  • N - horizon length
  • disturbance_ind - list indicating which k's that disturbance should be taken into account. Default is [1,2, ... N]
  • Pk (Polytope)
  • list_P (list of Polytopes or Polytope)
  • PN (Polytope)

get_max_extreme(G, D, N)

 

Calculate the array d_hat such that:

   d_hat = max(G*DN_extreme),

where DN_extreme are the vertices of the set D^N.

This is used to describe the polytope:

   L*x <= M - G*d_hat.

Calculating d_hat is equivalen to taking the intersection of the polytopes:

   L*x <= M - G*d_i

for every possible d_i in the set of extreme points to D^N.

Parameters:
  • G - The matrix to maximize with respect to
  • D - Polytope describing the disturbance set
  • N - Horizon length
Returns:
d_hat: Array describing the maximum possible effect from the disturbance