-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c39339e
commit 9cda90d
Showing
25 changed files
with
518 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-49 KB
...mples/Submission/HSCC2020/ACC/Discrete Linear Plant/discrete_ACC_verification_results.mat
Binary file not shown.
7 changes: 0 additions & 7 deletions
7
...mples/Submission/HSCC2020/ACC/Discrete Linear Plant/discrete_ACC_verification_results.txt
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
.../nnv/examples/Submission/HSCC2020/ACC/Discrete Linear Plant/plot_discrete_ACC_reachSets.m
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
code/nnv/examples/Submission/HSCC2020/ACC/How to run ACC case study.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
NOTE***: To run ACC case study, we need to have CORA installed. | ||
|
||
1) Install NNV: | ||
|
||
a) git clone --recursive https://github.com/verivital/nnv.git | ||
|
||
b) go to ..code/nnv/ folder to run install.m | ||
|
||
2) Run ACC case study: | ||
|
||
a) Run ACC with discrete linear plant model: | ||
|
||
a1) using exact analysis: run verify_discrete_ACC_exact_star.m | ||
|
||
total runtime is about 5.5 hours | ||
|
||
a2) using approximate analysis: run verify_discrete_ACC_approx_star.m | ||
|
||
total runtime is about 4 minutes | ||
|
||
b) Run ACC with nonlinear plant model using approx-star method | ||
|
||
run verify_nonlinear_ACC.m | ||
|
||
total runtime is about 30 minutes | ||
|
||
NOTE***: | ||
|
||
We use 4 cores for computation. If your computer does not have >= 4 cores | ||
|
||
Set numCores (or n_cores) parameter (default = 4) in the script to a suitable number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function [dx]=car_dynamics(t,x,a_ego) | ||
|
||
mu=0.0001; % friction parameter | ||
|
||
% x1 = lead_car position | ||
% x2 = lead_car velocity | ||
% x3 = lead_car internal state | ||
|
||
% x4 = ego_car position | ||
% x5 = ego_car velocity | ||
% x6 = ego_car internal state | ||
|
||
% lead car dynamics | ||
a_lead = -5; | ||
dx(1,1)=x(2); | ||
dx(2,1) = x(3); | ||
dx(3,1) = -2 * x(3) + 2 * a_lead - mu*x(2)^2; | ||
% ego car dyanmics | ||
dx(4,1)= x(5); | ||
dx(5,1) = x(6); | ||
dx(6,1) = -2 * x(6) + 2 * a_ego - mu*x(5)^2; |
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.63 MB
code/nnv/examples/Submission/HSCC2020/ACC/discrete_ACC_approx_star.mat
Binary file not shown.
14 changes: 14 additions & 0 deletions
14
code/nnv/examples/Submission/HSCC2020/ACC/discrete_ACC_approx_star.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
====================================================== | ||
VERIFICATION RESULTS FOR ACC WITH DISCRETE PLANT MODEL | ||
====================================================== | ||
v_lead(0) approx-star | ||
safety | VT | ||
[29 30] SAFE | 15.764 | ||
[28 29] SAFE | 14.479 | ||
[27 28] SAFE | 17.387 | ||
[26 27] UNSAFE | 31.844 | ||
[25 26] UNSAFE | 41.238 | ||
[24 25] UNSAFE | 43.326 | ||
------------------------------------------------------- | ||
Total verification time: 164.038 |
Binary file added
BIN
+7.11 MB
code/nnv/examples/Submission/HSCC2020/ACC/discrete_ACC_verification_results.mat
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
code/nnv/examples/Submission/HSCC2020/ACC/discrete_ACC_verification_results.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
====================================================== | ||
VERIFICATION RESULTS FOR ACC WITH DISCRETE PLANT MODEL | ||
====================================================== | ||
x_lead(0) exact-star approx-star | ||
safety | VT safety | VT | ||
[29 30] | 0.000 | 0.000 | ||
[28 29] | 0.000 | 0.000 | ||
[27 28] | 0.000 | 0.000 | ||
[26 27] | 0.000 | 0.000 | ||
[25 26] | 0.000 | 0.000 | ||
[24 25] | 0.000 UNSAFE | 49.589 | ||
[23 24] | 0.000 | 0.000 | ||
[22 23] | 0.000 | 0.000 | ||
[21 22] | 0.000 | 0.000 | ||
[20 21] | 0.000 | 0.000 |
14 changes: 14 additions & 0 deletions
14
code/nnv/examples/Submission/HSCC2020/ACC/nonlinear_ACC.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
======================================================= | ||
VERIFICATION RESULTS FOR ACC WITH NONLINEAR PLANT MODEL | ||
======================================================= | ||
v_lead(0) approx-star | ||
safety | VT | ||
[29 30] UNSAFE | 265.006 | ||
[28 29] UNSAFE | 283.954 | ||
[27 28] UNSAFE | 292.673 | ||
[26 27] UNSAFE | 294.249 | ||
[25 26] UNSAFE | 300.120 | ||
[24 25] UNSAFE | 276.630 | ||
------------------------------------------------------- | ||
Total verification time: 1712.633 |
49 changes: 49 additions & 0 deletions
49
code/nnv/examples/Submission/HSCC2020/ACC/plot_discrete_ACC_reachSets.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
% Plot reachable sets for Discrete Linear ACC model | ||
% Dung Tran: 10/22/2019 | ||
|
||
|
||
|
||
%% Plot output reach sets: actual distance vs. safe distance | ||
|
||
% plot reachable set of the distance between two cars d = x1 - x4 vs. ego | ||
% car's velocity | ||
|
||
figure; | ||
h1 = subplot(2,1,1); | ||
load dis_ACC_ncs_1.mat; | ||
map_mat = [1 0 0 -1 0 0 0]; | ||
map_vec = []; | ||
ncs.plotOutputReachSets('blue', map_mat, map_vec); | ||
hold on; | ||
% plot safe distance between two cars: d_safe = D_default + t_gap * v_ego; | ||
% D_default = 10; t_gap = 1.4 | ||
% d_safe = 10 + 1.4 * x5; | ||
|
||
map_mat = [0 0 0 0 1.4 0 0]; | ||
map_vec = [10]; | ||
ncs.plotOutputReachSets('red', map_mat, map_vec); | ||
title(h1,'Actual Distance (blue) vs. Safe Distance (red)'); | ||
xlabel(h1, 'Control Time Steps'); | ||
ylabel(h1, 'Distance'); | ||
xticks(h1, [0:5:50]) | ||
|
||
h2 = subplot(2,1,2); | ||
load dis_ACC_ncs_6.mat; | ||
map_mat = [1 0 0 -1 0 0 0]; | ||
map_vec = []; | ||
ncs.plotOutputReachSets('blue', map_mat, map_vec); | ||
hold on; | ||
% plot safe distance between two cars: d_safe = D_default + t_gap * v_ego; | ||
% D_default = 10; t_gap = 1.4 | ||
% d_safe = 10 + 1.4 * x5; | ||
|
||
map_mat = [0 0 0 0 1.4 0 0]; | ||
map_vec = [10]; | ||
ncs.plotOutputReachSets('red', map_mat, map_vec); | ||
title(h2,'Actual Distance (blue) vs. Safe Distance (red)'); | ||
xlabel(h2, 'Control Time Steps'); | ||
ylabel(h2, 'Distance'); | ||
xticks(h2, [0:5:50]) | ||
|
||
|
||
%% END OF SCRIPT |
17 changes: 17 additions & 0 deletions
17
code/nnv/examples/Submission/HSCC2020/ACC/plot_nonlinear_ACC_counterExamples.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
cI = counterExamples{1}; | ||
cI = cell2mat(cI); | ||
d_rel = [1 0 0 -1 0 0]*cI; | ||
d_safe = [0 0 0 1.4 0 0]*cI + 10; | ||
|
||
figure; | ||
T = 0:1:50; | ||
plot(T, d_rel, 'blue'); | ||
hold on; | ||
plot(T, d_safe, 'red'); | ||
|
||
xlabel('Control Time Steps', 'FontSize', 13); | ||
ylabel('Distance', 'FontSize', 13); | ||
xticks([0:5:50]); | ||
a = get(gca,'XTickLabel'); | ||
set(gca,'XTickLabel',a,'FontName','Times','fontsize',13) | ||
title('Actual Distance (blue) vs. Safe Distance (red)'); |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.