get_input(x0,
ssys,
abstraction,
start,
end,
R=None,
r=None,
Q=None,
ord=1,
mid_weight=0.0)
|
|
Compute continuous control input for discrete transition.
Computes a continuous control input sequence which takes the
plant:
-
from state
start
-
to state
end
These are states of the partition abstraction . The
computed control input is such that:
f(x, u) = |Rx|_{ord} + |Qu|_{ord} + r'x +
mid_weight * |xc - x(N)|_{ord}
be minimal.
xc is the chebyshev center of the final cell. If no cost
parameters are given, then the defaults are:
Notes
-
The same horizon length as in reachability analysis should be used
in order to guarantee feasibility.
-
If the closed loop algorithm has been used to compute reachability
the input needs to be recalculated for each time step (with
decreasing horizon length).
In this case only u(0) should be used as a control signal and
u(1) ... u(N-1) discarded.
-
The "conservative" calculation makes sure that the plant
remains inside the convex hull of the starting region during
execution, i.e.:
x(1), x(2) ... x(N-1) are
\in conv_hull(starting region).
If the original proposition preserving partition is not convex,
then safety cannot be guaranteed.
- Parameters:
x0 (numpy 1darray) - initial continuous state
ssys (LtiSysDyn) - system dynamics
abstraction (AbstractPwa) - abstract system dynamics
start (int >= 0) - index of the initial state in abstraction.ts
end (int >= 0) - index of the end state in abstraction.ts
R (size (N*xdim x N*xdim)) - state cost matrix for:
x = [x(1)' x(2)' .. x(N)']'
If empty, zero matrix is used.
r (size (N*xdim x 1)) - cost vector for state trajectory: x = [x(1)' x(2)' .. x(N)']'
Q (size (N*udim x N*udim)) - input cost matrix for control input:
u = [u(0)' u(1)' .. u(N-1)']'
If empty, identity matrix is used.
mid_weight - cost weight for |x(N)-xc|_{ord}
ord (ord \in {1, 2, np.inf}) - norm used for cost function:
f(x, u) = |Rx|_{ord} + |Qu|_{ord} + r'x +
mid_weight *|xc - x(N)|_{ord}
- Returns: (N x m) numpy 2darray
- array A where row k contains the control input: u(k) for k = 0, 1
... N-1
|