forked from verivital/nnv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfpa_reach_mid.m
32 lines (26 loc) · 983 Bytes
/
fpa_reach_mid.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
function fpa_reach_mid()
%% Reachability analysis of the CTRNN Fixed Point Attractor (FPA)
reachstep = 0.01; % step size to compute reach sets
final_time = 2.5; % Time horizon
Initial_radius = 0.01; % Uncertainty in dynamics.
model = NonLinearODE(5,1,@CTRNN_FPA, reachstep, final_time,eye(5));
% Change default options
model.options.timeStep = 0.01;
model.options.taylorTerms = 4;
model.options.zonotopeOrder = 20;
model.options.alg = 'lin';
model.options.tensorOrder = 2;
% Initial states
x0 = [0.21535, -0.58587, 0.8, 0.52323, 0.5]';
lb = x0 - Initial_radius;
ub = x0 + Initial_radius;
init_set = Star(lb,ub);
input_set = Star(0,0); % No inputs, but need to define it
% Compute reachability analysis
t = tic;
R = model.stepReachStar(init_set,input_set);
time = toc(t);
Rall = model.intermediate_reachSet;
% Save results
save('fpa_reach_mid.mat','Rall','time')
end