-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_01.py
138 lines (91 loc) · 2.96 KB
/
test_01.py
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import os
import json
from focont import foc, system
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
def test_01_01():
filepath = TEST_DIR + "/aircraft_model.json"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_02():
filepath = TEST_DIR + "/aircraft_model.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_03():
filepath = TEST_DIR + "/unstable_aircraft_model.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_04():
filepath = TEST_DIR + "/unstable_dt_aircraft_model.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_05():
filepath = TEST_DIR + "/test_model_01.json"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_05_01():
filepath = TEST_DIR + "/test_model_01.json"
with open(filepath, "r") as fh:
input_data = json.load(fh)
pdata = system.load(input_data)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_06():
filepath = TEST_DIR + "/test_model_01_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
def test_01_06_01():
filepath = TEST_DIR + "/test_model_01_01_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_07():
filepath = TEST_DIR + "/test_model_02_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_08():
filepath = TEST_DIR + "/test_model_03_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_08():
filepath = TEST_DIR + "/test_model_04_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_09():
filepath = TEST_DIR + "/test_model_05_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_10():
filepath = TEST_DIR + "/test_model_06_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
def test_01_11():
filepath = TEST_DIR + "/test_model_07_for_FO.mat"
pdata = system.load(filepath)
foc.solve(pdata)
foc.print_results(pdata)
assert foc.h2_improvement(pdata) < 1.0
if __name__ == "__main__":
test_01_01()