51fded64c92814c09a1a9d9ec609b00a4e068746
[scilab.git] / scilab / modules / scicos / tests / unit_tests / DDaskrN_Platform.dia.ref
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 // <-- ENGLISH IMPOSED -->
8 // <-- XCOS TEST -->
9 // Import diagram
10 loadScicos();
11 loadXcosLibs();
12 assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/DDaskr_Platform_test.zcos"));
13 // Redefining messagebox() to avoid popup
14 prot = funcprot();
15 funcprot(0);
16 function messagebox(msg, msg_title)
17  disp(msg);
18 endfunction
19 funcprot(prot);
20 // looking for the CLOCK_f/EVTDLY_f to update period
21 for path_1=1:length(scs_m.objs)
22     if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_c" then
23         CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
24         break;
25     end
26 end
27 for path_2=1:length(CLOCK_f_scs_m)
28     if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_c" then
29         EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
30         break;
31     end
32 end
33 for i=1:3  // 'max step size' = 10^-i, precision
34     // Start by updating the clock block period (sampling)
35     scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
36     // Modify solver + run DDaskr + save results
37     scs_m.props.tol(6) = 101;     // Solver
38     scicos_simulate(scs_m, 'nw'); // DDaskr
39     ddaskrval = res.values;       // Results
40     time = res.time;              // Time
41     // Modify solver + run IDA + save results
42     scs_m.props.tol(6) = 100;     // Solver
43     scicos_simulate(scs_m, 'nw'); // IDA
44     idaval = res.values;          // Results
45     // Compare results
46     compa = abs(ddaskrval-idaval);
47     // Extract mean, standard deviation, maximum
48     mea = mean(compa);
49     [maxi, indexMaxi] = max(compa);
50     stdeviation = st_deviation(compa);
51     // Verifying closeness of the results
52     assert_checktrue(maxi <= 10^-(i+3));
53     assert_checktrue(mea <= 10^-(i+3));
54     assert_checktrue(stdeviation <= 10^-(i+3));
55 end
56 --------------------------------------------\
57  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
58
59  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
60  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
61  
62 !Modelica blocks are reduced to a block with:             !
63 !                                                         !
64 !Number of differential states: 4                         !
65 !                                                         !
66 !Number of algebraic states: 0                            !
67 !                                                         !
68 !Number of discrete time states  : 2                      !
69 !                                                         !
70 !Number of zero-crossing surfaces: 1                      !
71 !                                                         !
72 !Number of modes  : 0                                     !
73 !                                                         !
74 !Number of inputs : 0                                     !
75 !                                                         !
76 !Number of outputs: 3                                     !
77 !                                                         !
78 !Input/output dependency:[T]                              !
79 !                                                         !
80 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
81 !                                                         !
82 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
83 !                                                         !
84 !                                                         !
85 !                                                         !
86 !Generated files path: TMPDIR/          !
87 !                                                         !
88 !                                                         !
89    Generate a loader file
90    Generate a Makefile
91    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
92    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
93    ilib_gen_Make: configure : Generate Makefile.
94    ilib_gen_Make: Modification of the Makefile in TMPDIR.
95    Running the Makefile
96    Generate a cleaner file
97 Shared archive loaded.
98 Link done.
99 --------------------------------------------\
100  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
101
102  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
103  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
104  
105 !Modelica blocks are reduced to a block with:             !
106 !                                                         !
107 !Number of differential states: 4                         !
108 !                                                         !
109 !Number of algebraic states: 0                            !
110 !                                                         !
111 !Number of discrete time states  : 2                      !
112 !                                                         !
113 !Number of zero-crossing surfaces: 1                      !
114 !                                                         !
115 !Number of modes  : 0                                     !
116 !                                                         !
117 !Number of inputs : 0                                     !
118 !                                                         !
119 !Number of outputs: 3                                     !
120 !                                                         !
121 !Input/output dependency:[T]                              !
122 !                                                         !
123 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
124 !                                                         !
125 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
126 !                                                         !
127 !                                                         !
128 !                                                         !
129 !Generated files path: TMPDIR/          !
130 !                                                         !
131 !                                                         !
132    Generate a loader file
133    Generate a Makefile
134    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
135    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
136    ilib_gen_Make: configure : Generate Makefile.
137    ilib_gen_Make: Modification of the Makefile in TMPDIR.
138    Running the Makefile
139    Generate a cleaner file
140 Shared archive loaded.
141 Link done.
142 --------------------------------------------\
143  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
144
145  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
146  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
147  
148 !Modelica blocks are reduced to a block with:             !
149 !                                                         !
150 !Number of differential states: 4                         !
151 !                                                         !
152 !Number of algebraic states: 0                            !
153 !                                                         !
154 !Number of discrete time states  : 2                      !
155 !                                                         !
156 !Number of zero-crossing surfaces: 1                      !
157 !                                                         !
158 !Number of modes  : 0                                     !
159 !                                                         !
160 !Number of inputs : 0                                     !
161 !                                                         !
162 !Number of outputs: 3                                     !
163 !                                                         !
164 !Input/output dependency:[T]                              !
165 !                                                         !
166 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
167 !                                                         !
168 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
169 !                                                         !
170 !                                                         !
171 !                                                         !
172 !Generated files path: TMPDIR/          !
173 !                                                         !
174 !                                                         !
175    Generate a loader file
176    Generate a Makefile
177    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
178    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
179    ilib_gen_Make: configure : Generate Makefile.
180    ilib_gen_Make: Modification of the Makefile in TMPDIR.
181    Running the Makefile
182    Generate a cleaner file
183 Shared archive loaded.
184 Link done.
185 --------------------------------------------\
186  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
187
188  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
189  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
190  
191 !Modelica blocks are reduced to a block with:             !
192 !                                                         !
193 !Number of differential states: 4                         !
194 !                                                         !
195 !Number of algebraic states: 0                            !
196 !                                                         !
197 !Number of discrete time states  : 2                      !
198 !                                                         !
199 !Number of zero-crossing surfaces: 1                      !
200 !                                                         !
201 !Number of modes  : 0                                     !
202 !                                                         !
203 !Number of inputs : 0                                     !
204 !                                                         !
205 !Number of outputs: 3                                     !
206 !                                                         !
207 !Input/output dependency:[T]                              !
208 !                                                         !
209 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
210 !                                                         !
211 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
212 !                                                         !
213 !                                                         !
214 !                                                         !
215 !Generated files path: TMPDIR/          !
216 !                                                         !
217 !                                                         !
218    Generate a loader file
219    Generate a Makefile
220    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
221    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
222    ilib_gen_Make: configure : Generate Makefile.
223    ilib_gen_Make: Modification of the Makefile in TMPDIR.
224    Running the Makefile
225    Generate a cleaner file
226 Shared archive loaded.
227 Link done.
228 --------------------------------------------\
229  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
230
231  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
232  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
233  
234 !Modelica blocks are reduced to a block with:             !
235 !                                                         !
236 !Number of differential states: 4                         !
237 !                                                         !
238 !Number of algebraic states: 0                            !
239 !                                                         !
240 !Number of discrete time states  : 2                      !
241 !                                                         !
242 !Number of zero-crossing surfaces: 1                      !
243 !                                                         !
244 !Number of modes  : 0                                     !
245 !                                                         !
246 !Number of inputs : 0                                     !
247 !                                                         !
248 !Number of outputs: 3                                     !
249 !                                                         !
250 !Input/output dependency:[T]                              !
251 !                                                         !
252 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
253 !                                                         !
254 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
255 !                                                         !
256 !                                                         !
257 !                                                         !
258 !Generated files path: TMPDIR/          !
259 !                                                         !
260 !                                                         !
261    Generate a loader file
262    Generate a Makefile
263    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
264    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
265    ilib_gen_Make: configure : Generate Makefile.
266    ilib_gen_Make: Modification of the Makefile in TMPDIR.
267    Running the Makefile
268    Generate a cleaner file
269 Shared archive loaded.
270 Link done.
271 --------------------------------------------\
272  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
273
274  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
275  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
276  
277 !Modelica blocks are reduced to a block with:             !
278 !                                                         !
279 !Number of differential states: 4                         !
280 !                                                         !
281 !Number of algebraic states: 0                            !
282 !                                                         !
283 !Number of discrete time states  : 2                      !
284 !                                                         !
285 !Number of zero-crossing surfaces: 1                      !
286 !                                                         !
287 !Number of modes  : 0                                     !
288 !                                                         !
289 !Number of inputs : 0                                     !
290 !                                                         !
291 !Number of outputs: 3                                     !
292 !                                                         !
293 !Input/output dependency:[T]                              !
294 !                                                         !
295 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
296 !                                                         !
297 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
298 !                                                         !
299 !                                                         !
300 !                                                         !
301 !Generated files path: TMPDIR/          !
302 !                                                         !
303 !                                                         !
304    Generate a loader file
305    Generate a Makefile
306    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
307    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
308    ilib_gen_Make: configure : Generate Makefile.
309    ilib_gen_Make: Modification of the Makefile in TMPDIR.
310    Running the Makefile
311    Generate a cleaner file
312 Shared archive loaded.
313 Link done.