Xcos tests: recompilation at every call and context use
[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 assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/DDaskr_Platform_test.zcos"));
11 // Redefining messagebox() to avoid popup
12 prot = funcprot();
13 funcprot(0);
14 function messagebox(msg, msg_title)
15  disp(msg);
16 endfunction
17 funcprot(prot);
18 Info = scicos_simulate(scs_m, list());
19 --------------------------------------------\
20  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
21
22  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
23  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
24  
25 !Modelica blocks are reduced to a block with:             !
26 !                                                         !
27 !Number of differential states: 4                         !
28 !                                                         !
29 !Number of algebraic states: 0                            !
30 !                                                         !
31 !Number of discrete time states  : 2                      !
32 !                                                         !
33 !Number of zero-crossing surfaces: 1                      !
34 !                                                         !
35 !Number of modes  : 0                                     !
36 !                                                         !
37 !Number of inputs : 0                                     !
38 !                                                         !
39 !Number of outputs: 1                                     !
40 !                                                         !
41 !Input/output dependency:[T]                              !
42 !                                                         !
43 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
44 !                                                         !
45 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
46 !                                                         !
47 !                                                         !
48 !                                                         !
49 !Generated files path: TMPDIR/         !
50 !                                                         !
51 !                                                         !
52    Generate a loader file
53    Generate a Makefile
54    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
55    ilib_gen_Make: Copy DDaskr_Platform_test_im.c to TMPDIR
56    ilib_gen_Make: configure : Generate Makefile.
57    ilib_gen_Make: Modification of the Makefile in TMPDIR.
58    Running the Makefile
59    Generate a cleaner file
60 Shared archive loaded.
61 Link done.
62 for i=1:3  // 'max step size' = 10^-i, precision
63     // Start by updating the clock block period (sampling)
64     Context.per = 5*10^-i;
65     // Modify solver + run DDaskr + save results
66     scs_m.props.tol(6) = 101;     // Solver
67     scicos_simulate(scs_m, Info, Context); // DDaskr
68     ddaskrval = res.values;       // Results
69     time = res.time;              // Time
70     // Modify solver + run IDA + save results
71     scs_m.props.tol(6) = 100;     // Solver
72     scicos_simulate(scs_m, Info, Context); // IDA
73     idaval = res.values;          // Results
74     // Compare results
75     compa = abs(ddaskrval-idaval);
76     // Extract mean, standard deviation, maximum
77     mea = mean(compa);
78     [maxi, indexMaxi] = max(compa);
79     stdeviation = st_deviation(compa);
80     // Verifying closeness of the results
81     assert_checktrue(maxi <= 5*10^-(i+3));
82     assert_checktrue(mea <= 5*10^-(i+3));
83     assert_checktrue(stdeviation <= 5*10^-(i+3));
84 end
85 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
86
87 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
88
89 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
90
91 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
92
93 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
94
95 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
96