Aerospace Blockset for Xcos  

Aerospace Blockset for Xcos Commit Details

Date:2014-09-16 13:42:45 (4 years 1 month ago)
Author:Paweł Zagórski
Branch:master
Commit:1a8534e703ddac6420ee490e6df417b1ff9b8af0
Parents: 4a96f68f910070d1f938bd0d7dd2f01e759b043f
Message:Fixed reference files for some unit tests

Changes:
Ctests/unit_tests/axa_to_quat.tst → tests/unit_tests/axa_to_quat.dia.ref
Ctests/unit_tests/car_to_ell.tst → tests/unit_tests/car_to_ell.dia.ref
Ctests/unit_tests/ell_to_car.tst → tests/unit_tests/ell_to_car.dia.ref
Ctests/unit_tests/quat_to_axa.tst → tests/unit_tests/quat_to_axa.dia.ref
Mtests/unit_tests/documentation_complete.dia.ref (1 diff)

File differences

tests/unit_tests/axa_to_quat.dia.ref
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
// This file is released under the 3-clause BSD license. See COPYING-BSD.
//=================================
// Test flags
//<-- XCOS TEST -->
//<-- NO CHECK ERROR OUTPUT -->
//Load xcos test diagram for quat_to_euler tests
[macros,path] = libraryinfo('xcos_aerolib');
result = importXcosDiagram(path + "../tests/unit_tests" +"/axa_to_quat.zcos");
assert_checktrue(result);
//This diagram uses 3 variables :
// axis_in : Euler axis (vector)
// angle_in : Euler angle
// quat_out :quaternion output (vector)
axis_in = [ 0.57735026918962573 0.37139067635410367;
0.57735026918962573 0.55708601453115558;
0.57735026918962573 0.74278135270820744];
angle_in = [ 1 2];
quat_exp = [ 0.87758256189037276 0.54030230586813977;
0.27679646376951794 0.3125144781801584;
0.27679646376951794 0.46877171727023764;
0.27679646376951794 0.6250289563603169];
// Define expected values
exp_time = [0; 1; 2];
scicos_simulate(scs_m);
//Validate results
assert_checkequal(exp_time, quat_out.time);
assert_checkalmostequal(quat_exp, quat_out.values(:,:,1), %eps);
assert_checkalmostequal(quat_exp, quat_out.values(:,:,2), %eps);
assert_checkalmostequal(quat_exp, quat_out.values(:,:,3), %eps);
tests/unit_tests/car_to_ell.dia.ref
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
// This file is released under the 3-clause BSD license. See COPYING-BSD.
//=================================
// Test flags
//<-- XCOS TEST -->
//<-- NO CHECK ERROR OUTPUT -->
//Load xcos test diagram for car_to_ell tests
[macros,path] = libraryinfo('xcos_aerolib');
result = importXcosDiagram(path + "../tests/unit_tests" +"/car_to_ell.zcos");
assert_checktrue(result);
//This diagram uses 3 variables :
// car_in : cartesian position
// ell_out : elliptical position output vectors (to_workspace)
// jacob_out : jacobian of the transformation (to_workspace)
car_in=[ 0.5;
1;
1.5];
scicos_simulate(scs_m);
// Define expected values
exp_time = [0.1; 1.1; 2.1];
exp_pos = [ 1.1071487
1.5707702
-6356750.1 ];
exp_jacob = [ -0.8 0.4 0
-0.0000104 -0.0000209 6.091D-10
0.0000117 0.0000233 1];
//Validate results
assert_checkequal(exp_time, pos_out.time);
assert_checkequal(exp_time, jacob_out.time);
assert_checkalmostequal(exp_pos', pos_out.values(1,:),1e-4);
assert_checkalmostequal(exp_pos', pos_out.values(2,:),1e-4);
assert_checkalmostequal(exp_pos', pos_out.values(3,:),1e-4);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,1),1e-2);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,2),1e-2);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,3),1e-2);
tests/unit_tests/documentation_complete.dia.ref
33
44
55
6
6
77
88
9
9
1010
1111
1212
1313
14
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
15111
16112
17
113
18114
19115
20116
21117
22
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
23335
24336
25337
// Test flags
//<-- XCOS TEST -->
//<-- NO CHECK ERROR OUTPUT -->
base_path = get_absolute_file_path('documentation_complete.tst');
[macros,base_path] = libraryinfo('xcos_aerolib');
s = filesep();
// Locate help files
help_files = findfiles(base_path + s + '..'+ s + '..' + s + 'help' + s + 'en_US' + s + 'blocks', '*.xml');
help_files = findfiles(base_path + '..' + s + 'help' + s + 'en_US' + s + 'blocks', '*.xml');
number_of_help = size(help_files);
help_files = strsubst(help_files,'.xml','')
help_files =
[]
!AXA_TO_QUAT !
! !
!TIMEZONE_CONVERSION !
! !
!VECTOR_ROTATE !
! !
!DOT_PRODUCT !
! !
!SOL_DRAG_MODEL !
! !
!KEP_TO_CAR !
! !
!FRAME_CONV_JACOBIAN !
! !
!PLOT_VISIBILITY !
! !
!FRAME_CONVERSION !
! !
!PLANET_MODEL !
! !
!VECTOR_NORMALIZATION !
! !
!QUAT_INVERT !
! !
!STATION_POINTING !
! !
!KEPLERIAN_INPUT !
! !
!CJD_NOW !
! !
!PLOT_POLAR !
! !
!CROSS_PRODUCT !
! !
!QUAT_PRODUCT !
! !
!VECTOR_NORM !
! !
!ROTATION_JACOBIAN !
! !
!GROUND_STATION !
! !
!VECTOR_ANGLE !
! !
!KEPLERIAN_PROPAGATOR !
! !
!ELL_TO_CAR !
! !
!DISTANCE_CONVERSION !
! !
!QUAT_INPUT !
! !
!QUAT_TO_DCM !
! !
!FRAME_CONV_DCM !
! !
!SUN_MODEL !
! !
!CJD_TIME !
! !
!SECULAR_J2 !
! !
!QUAT_QUOTIENT !
! !
!TIMEFRAME_CONVERSION !
! !
!QUAT_CONJUGATE !
! !
!PLOT_GROUNDTRACK !
! !
!ECLIPSE_MODEL !
! !
!GEOMAG_MODEL !
! !
!PLOT_INDICATORS !
! !
!VELOCITY_CONVERSION !
! !
!ATM_DRAG_MODEL !
! !
!STATION_VISIBILITY !
! !
!DCM_TO_QUAT !
! !
!QUAT_TO_AXA !
! !
!LYDDANE_PROPAGATOR !
! !
!MOON_MODEL !
! !
!US76_ATM_MODEL !
! !
!QUAT_NORM !
! !
!ANGLE_CONVERSION !
! !
!CAR_TO_ELL !
help_files = gsort(help_files);
// Locate macro files
macro_files = findfiles(base_path + s + '..'+ s + '..' + s + 'macros', '*.sci');
macro_files = findfiles(base_path + '..' + s + 'macros', '*.sci');
number_of_macro = size(macro_files);
macro_files = strsubst(macro_files,'.sci','')
macro_files =
[]
!ECLIPSE_MODEL !
! !
!VECTOR_NORM !
! !
!AB_plot_groundtrack !
! !
!AB_crossProduct !
! !
!FRAME_CONVERSION !
! !
!PLANET_MODEL !
! !
!SOL_DRAG_MODEL !
! !
!STATION_POINTING !
! !
!AB_mod_moonSun !
! !
!AB_quatConjugate !
! !
!AB__plot_pg_tick_steps !
! !
!AB_rot_quat2matrix !
! !
!AB_ground_station !
! !
!DISTANCE_CONVERSION !
! !
!AB_quatProduct !
! !
!STATION_VISIBILITY !
! !
!AB_gm_stationPointing !
! !
!ELL_TO_CAR !
! !
!AB_unit_conversion !
! !
!KEP_TO_CAR !
! !
!AB_rotationJacobian !
! !
!TIMEFRAME_CONVERSION !
! !
!ATM_DRAG_MODEL !
! !
!AXA_TO_QUAT !
! !
!AB_set_block_style !
! !
!AB_ex_lyddane !
! !
!AB_ex_kepler !
! !
!QUAT_NORM !
! !
!AB_rot_matrix2quat !
! !
!AB_check_cal_date !
! !
!AB__inputParam !
! !
!AB_fo_srpAcc !
! !
!DCM_TO_QUAT !
! !
!TIMEZONE_CONVERSION !
! !
!AB__atmUS76 !
! !
!PLOT_VISIBILITY !
! !
!AB_mod_atmUS76 !
! !
!AB_plot_polar !
! !
!AB_plot_visibility !
! !
!AB_fr_convertMat !
! !
!AB_rot_quat2axAng !
! !
!AB_ex_secularJ2 !
! !
!US76_ATM_MODEL !
! !
!AB_vectAngle !
! !
!AB_timeframe_conversion !
! !
!AB_keplerian_input !
! !
!AB_cjd_now !
! !
!GROUND_STATION !
! !
!PLOT_INDICATORS !
! !
!AB_quat_input !
! !
!AB_quatInvert !
! !
!QUAT_TO_DCM !
! !
!PLOT_GROUNDTRACK !
! !
!SUN_MODEL !
! !
!SECULAR_J2 !
! !
!AB__get_pv_params !
! !
!FRAME_CONV_JACOBIAN !
! !
!AB_plot_indicators !
! !
!CROSS_PRODUCT !
! !
!VELOCITY_CONVERSION !
! !
!AB_fo_dragAcc !
! !
!QUAT_INPUT !
! !
!AB_cjd_time !
! !
!AB_dotProduct !
! !
!AB_gm_eclipseCheck !
! !
!VECTOR_ROTATE !
! !
!AB_co_car2ell !
! !
!QUAT_CONJUGATE !
! !
!QUAT_PRODUCT !
! !
!xcos_block_debug !
! !
!QUAT_TO_AXA !
! !
!xcos_block_perf !
! !
!VECTOR_ANGLE !
! !
!CJD_TIME !
! !
!GEOMAG_MODEL !
! !
!CAR_TO_ELL !
! !
!QUAT_INVERT !
! !
!AB_co_ell2car !
! !
!AB_oe_kep2car !
! !
!FRAME_CONV_DCM !
! !
!AB_check_kep !
! !
!AB_timezone_conversion !
! !
!QUAT_QUOTIENT !
! !
!CJD_NOW !
! !
!ROTATION_JACOBIAN !
! !
!AB_quatNorm !
! !
!VECTOR_NORMALIZATION !
! !
!KEPLERIAN_INPUT !
! !
!AB_unitVector !
! !
!LYDDANE_PROPAGATOR !
! !
!AB__get_pg_params !
! !
!AB_vectorNorm !
! !
!ANGLE_CONVERSION !
! !
!AB__plot_earthMap !
! !
!AB_check_param_number !
! !
!AB_quatQuotient !
! !
!KEPLERIAN_PROPAGATOR !
! !
!DOT_PRODUCT !
! !
!MOON_MODEL !
! !
!AB_mod_geomagField !
! !
!PLOT_POLAR !
! !
!AB_eph_planet !
! !
!AB_rot_axAng2quat !
! !
!AB__get_pv_time_label !
! !
!AB_fr_convert !
! !
!AB_check_kep_lyd !
! !
!AB__plot_ephem !
! !
!AB_station_visibility !
! !
!AB_rot_rotVect !
macro_files = gsort(macro_files);
// the block files and help files
block_files = [];
tests/unit_tests/ell_to_car.dia.ref
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
// This file is released under the 3-clause BSD license. See COPYING-BSD.
//=================================
// Test flags
//<-- XCOS TEST -->
//<-- NO CHECK ERROR OUTPUT -->
//Load xcos test diagram for car_to_ell tests
[macros,path] = libraryinfo('xcos_aerolib');
result = importXcosDiagram(path + "../tests/unit_tests" +"/ell_to_car.zcos");
assert_checktrue(result);
//This diagram uses 3 variables :
// ell_in : elliptical position
// car_out : cartesian position output vectors (to_workspace)
// jacob_out : jacobian of the transformation (to_workspace)
ell_in= [ 0.21162117180431245;
1.88844625065786453;
110. ];
scicos_simulate(scs_m);
// Define expected values
exp_time = [0.1; 1.1; 2.1];
exp_pos = [ -1953617.59591063065
-419711.009606912441
6036856.73927161563 ];
exp_jacob = [ 419711.009606912441, -5938057.71355757304, -0.30536725130628495;
-1953617.59591063065, -1275719.56931502442, -0.06560444460314516;
0., -1996881.10071963165, 0.94997205152465258 ];
//Validate results
assert_checkequal(exp_time, car_out.time);
assert_checkequal(exp_time, jacob_out.time);
assert_checkalmostequal(exp_pos', car_out.values(1,:),1e-6);
assert_checkalmostequal(exp_pos', car_out.values(2,:),1e-6);
assert_checkalmostequal(exp_pos', car_out.values(3,:),1e-6);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,1),1e-8);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,2),1e-8);
assert_checkalmostequal(exp_jacob, jacob_out.values(:,:,3),1e-8);
tests/unit_tests/quat_to_axa.dia.ref
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
// This file is released under the 3-clause BSD license. See COPYING-BSD.
//=================================
// Test flags
//<-- XCOS TEST -->
//<-- NO CHECK ERROR OUTPUT -->
//Load xcos test diagram for quat_to_euler tests
[macros,path] = libraryinfo('xcos_aerolib');
result = importXcosDiagram(path + "../tests/unit_tests" +"/quat_to_axa.zcos");
assert_checktrue(result);
//This diagram uses 3 variables :
// quat_in :quaternion input (vector)
// axis_out : Euler axis (to_workspace)
// angle_out : Euler angle (to_workspace)
q = CL_rot_axAng2quat([1;1;1],1);
quat_in = [ 0.87758256189037276 0.54030230586813977;
0.27679646376951794 0.3125144781801584;
0.27679646376951794 0.46877171727023764;
0.27679646376951794 0.6250289563603169];
axis_exp = [ 0.57735026918962573 0.37139067635410367;
0.57735026918962573 0.55708601453115558;
0.57735026918962573 0.74278135270820744];
angle_exp = [ 1 2];
// Define expected values
exp_time = [0; 1; 2];
scicos_simulate(scs_m);
//Validate results
assert_checkequal(exp_time, axis_out.time);
assert_checkequal(exp_time, angle_out.time);
assert_checkalmostequal(axis_exp, axis_out.values(:,:,1), %eps);
assert_checkalmostequal(axis_exp, axis_out.values(:,:,2), %eps);
assert_checkalmostequal(axis_exp, axis_out.values(:,:,3), %eps);
assert_checkalmostequal(angle_exp, angle_out.values(:,:,1), %eps);
assert_checkalmostequal(angle_exp, angle_out.values(:,:,2), %eps);
assert_checkalmostequal(angle_exp, angle_out.values(:,:,3), %eps);

Archive Download the corresponding diff file

Branches