-
Notifications
You must be signed in to change notification settings - Fork 2
/
NStepCapturabilitySOSSystem.m
66 lines (52 loc) · 1.64 KB
/
NStepCapturabilitySOSSystem.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
classdef NStepCapturabilitySOSSystem
% An abstract class for dynamical systems to be used with
% nStepCapturabilitySOS.m and related methods
% Forces definition of the dynamics, any input guards, etc.
properties
num_states;
num_inputs;
num_reset_inputs;
end
methods
function obj = NStepCapturabilitySOSSystem(num_states, num_inputs, num_reset_inputs)
obj.num_states = num_states;
obj.num_inputs = num_inputs;
obj.num_reset_inputs = num_reset_inputs;
end
end
methods (Abstract)
xdot = dynamics(obj, t, x, u);
xp = reset(obj, t, xm, s);
%@return >= 0 for valid inputs
ret = inputLimits(obj, u, x);
%@return >= 0 for valid inputs
ret = resetInputLimits(obj, s);
% get umin, umax for a given state
[umin,umax,A] = simpleInputLimits(obj,x);
plotfun(obj, n, Vsol, Wsol, h_X, R_diag, t, x);
end
methods
%@return 0 for valid inputs
function ret = inputEqualityConstraints(obj, u, x)
ret = msspoly * zeros(0, 1);
end
function draw(obj,t,y)
% didn't make this abstract to avoid errors for old examples where it
% isn't implemented yet
error('Implement for subclasses')
end
function [smin,smax] = simpleResetInputLimits(obj,x)
smin = [];
smax = [];
end
function rp = stanceUpdate(obj,x,r,s)
rp = r;
end
% Transform u
% y = A*u + b s.t. limits on y are |y_i| <= 1
% u = C*y + d inverse transform
function [A,b,C,d] = unitBoxInputTransform(obj)
error('Implement for subclasses, throw an error if not applicable')
end
end
end