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

Module discretization

Algorithms related to discretization of continuous dynamics.

See Also

find_controller

Classes
  AbstractSwitched
Abstraction of SwitchedSysDyn, with mode-specific and common info.
  AbstractPwa
Discrete abstraction of PWA dynamics, with attributes:
Functions
AbstractPwa
discretize(part, ssys, N=10, min_cell_volume=0.1, closed_loop=True, conservative=False, max_num_poly=5, use_all_horizon=False, trans_length=1, remove_trans=False, abs_tol=1e-07, plotit=False, save_img=False, cont_props=None, plot_every=1)
Refine the partition and establish transitions based on reachability analysis.
 
reachable_within(trans_length, adj_k, adj)
Find cells reachable within trans_length hops.
 
sym_adj_change(IJ, adj_k, transitions, i)
 
discretize_overlap(closed_loop=False, conservative=False)
default False.
 
multiproc_discretize(q, mode, ppp, cont_dyn, disc_params)
 
multiproc_get_transitions(q, absys, mode, ssys, params)
 
multiproc_discretize_switched(ppp, hybrid_sys, disc_params=None, plot=False, show_ts=False, only_adjacent=True)
Parallel implementation of discretize_switched.
AbstractSwitched
discretize_switched(ppp, hybrid_sys, disc_params=None, plot=False, show_ts=False, only_adjacent=True)
Abstract switched dynamics over given partition.
 
plot_mode_partitions(swab, show_ts, only_adjacent)
Save each mode's partition and final merged partition.
 
plot_annot(ax)
 
merge_abstractions(merged_abstr, trans, abstr, modes, mode_nums)
Construct merged transitions.
scipy.sparse.lil_matrix
get_transitions(abstract_sys, mode, ssys, N=10, closed_loop=True, trans_length=1)
Find which transitions are feasible in given mode.
 
multiproc_merge_partitions(abstractions)
LOGTIME in #processors parallel merging.
 
merge_partitions(abstractions)
Merge multiple abstractions.
 
merge_partition_pair(old_regions, ab2, cur_mode, prev_modes, old_parents, old_ap_labeling)
Merge an Abstraction with the current partition iterate.
Variables
  logger = logging.getLogger(__name__)
  debug = False
  __package__ = 'tulip.abstract'
Function Details

discretize(part, ssys, N=10, min_cell_volume=0.1, closed_loop=True, conservative=False, max_num_poly=5, use_all_horizon=False, trans_length=1, remove_trans=False, abs_tol=1e-07, plotit=False, save_img=False, cont_props=None, plot_every=1)

 

Refine the partition and establish transitions based on reachability analysis.

Reference

[NOTM12]

See Also

prop2partition.pwa_partition, prop2partition.part2convex

Parameters:
  • part - PropPreservingPartition object
  • ssys - LtiSysDyn or PwaSysDyn object
  • N - horizon length
  • min_cell_volume - the minimum volume of cells in the resulting partition.
  • closed_loop - boolean indicating whether the `closed loop` algorithm should be used. default True.
  • conservative - if true, force sequence in reachability analysis to stay inside starting cell. If false, safety is ensured by keeping the sequence inside a convexified version of the original proposition preserving cell.
  • max_num_poly - maximum number of polytopes in a region to use in reachability analysis.
  • use_all_horizon - in closed loop algorithm: if we should look for reachability also in less than N steps.
  • trans_length - the number of polytopes allowed to cross in a transition. a value of 1 checks transitions only between neighbors, a value of 2 checks neighbors of neighbors and so on.
  • remove_trans - if True, remove found transitions between non-neighbors.
  • abs_tol - maximum volume for an "empty" polytope
  • plotit (boolean, default = False) - plot partitioning as it evolves
  • save_img (boolean, default = False) - save snapshots of partitioning to PDF files, requires plotit=True
  • cont_props (list of Polytope) - continuous propositions to plot
Returns: AbstractPwa

discretize_overlap(closed_loop=False, conservative=False)

 

default False.

UNDER DEVELOPMENT; function signature may change without notice. Calling will result in NotImplementedError.

multiproc_discretize_switched(ppp, hybrid_sys, disc_params=None, plot=False, show_ts=False, only_adjacent=True)

 

Parallel implementation of discretize_switched.

Uses the multiprocessing package.

discretize_switched(ppp, hybrid_sys, disc_params=None, plot=False, show_ts=False, only_adjacent=True)

 

Abstract switched dynamics over given partition.

Parameters:
Returns: AbstractSwitched
abstracted dynamics, some attributes are dict keyed by mode

merge_abstractions(merged_abstr, trans, abstr, modes, mode_nums)

 

Construct merged transitions.

Parameters:

get_transitions(abstract_sys, mode, ssys, N=10, closed_loop=True, trans_length=1)

 

Find which transitions are feasible in given mode.

Used for the candidate transitions of the merged partition.

Returns: scipy.sparse.lil_matrix

multiproc_merge_partitions(abstractions)

 

LOGTIME in #processors parallel merging.

Assuming sufficient number of processors.

UNDER DEVELOPMENT; function signature may change without notice. Calling will result in NotImplementedError.

merge_partitions(abstractions)

 

Merge multiple abstractions.

Parameters:
Returns:
(merged_abstraction, ap_labeling) where:

merge_partition_pair(old_regions, ab2, cur_mode, prev_modes, old_parents, old_ap_labeling)

 

Merge an Abstraction with the current partition iterate.

Parameters:
  • old_regions (list of Region) - A list of Region that is from either:
    1. The ppp of the first (initial) AbstractPwa to be merged.
    2. A list of already-merged regions
  • ab2 (AbstractPwa) - Abstracted piecewise affine dynamics to be merged into the
  • cur_mode (tuple) - mode to be merged
  • prev_modes (list of tuple) - list of modes that have already been merged together
  • old_parents (dict of modes to list of region indices in list old_regions or dict of region indices to regions in original ppp for that mode) - dict of modes that have already been merged to dict of indices of new regions to indices of regions
  • old_ap_labeling (dict of tuples to sets) - dict of states of already-merged modes to sets of propositions for each state
Returns:
the following:
  • new_list, list of new regions
  • parents, same as input param old_parents, except that it includes the mode that was just merged and for list of regions in return value new_list
  • ap_labeling, same as input param old_ap_labeling, except that it includes the mode that was just merged.