Xcos tests: recompilation at every call and context use
[scilab.git] / scilab / modules / scicos / tests / unit_tests / DDaskrN_Hydraulics.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_Hydraulics_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 // Modify solver + run DDaskr + save results
19 scs_m.props.tol(6) = 101;       // Solver
20 scicos_simulate(scs_m);   // DDaskr
21 --------------------------------------------\
22  Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
23
24  Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
25  Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
26  
27 !Modelica blocks are reduced to a block with:             !
28 !                                                         !
29 !Number of differential states: 2                         !
30 !                                                         !
31 !Number of algebraic states: 5                            !
32 !                                                         !
33 !Number of discrete time states  : 0                      !
34 !                                                         !
35 !Number of zero-crossing surfaces: 19                     !
36 !                                                         !
37 !Number of modes  : 19                                    !
38 !                                                         !
39 !Number of inputs : 1                                     !
40 !                                                         !
41 !Number of outputs: 1                                     !
42 !                                                         !
43 !Input/output dependency:[F]                              !
44 !                                                         !
45 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
46 !                                                         !
47 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
48 !                                                         !
49 !                                                         !
50 !                                                         !
51 !Generated files path: TMPDIR/          !
52 !                                                         !
53 !                                                         !
54    Generate a loader file
55    Generate a Makefile
56    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
57    ilib_gen_Make: Copy DDaskr_Hydraulics_test_im.c to TMPDIR
58    ilib_gen_Make: configure : Generate Makefile.
59    ilib_gen_Make: Modification of the Makefile in TMPDIR.
60    Running the Makefile
61    Generate a cleaner file
62 Shared archive loaded.
63 Link done.
64 ddaskrval = res.values;         // Results
65 time = res.time;                // Time
66 // Modify solver + run IDA + save results
67 scs_m.props.tol(6) = 100;       // Solver
68 scicos_simulate(scs_m);   // IDA
69 --------------------------------------------\
70  Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
71
72  Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
73  Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
74  
75 !Modelica blocks are reduced to a block with:             !
76 !                                                         !
77 !Number of differential states: 2                         !
78 !                                                         !
79 !Number of algebraic states: 5                            !
80 !                                                         !
81 !Number of discrete time states  : 0                      !
82 !                                                         !
83 !Number of zero-crossing surfaces: 19                     !
84 !                                                         !
85 !Number of modes  : 19                                    !
86 !                                                         !
87 !Number of inputs : 1                                     !
88 !                                                         !
89 !Number of outputs: 1                                     !
90 !                                                         !
91 !Input/output dependency:[F]                              !
92 !                                                         !
93 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
94 !                                                         !
95 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
96 !                                                         !
97 !                                                         !
98 !                                                         !
99 !Generated files path: TMPDIR/          !
100 !                                                         !
101 !                                                         !
102    Generate a loader file
103    Generate a Makefile
104    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
105    ilib_gen_Make: Copy DDaskr_Hydraulics_test_im.c to TMPDIR
106    ilib_gen_Make: configure : Generate Makefile.
107    ilib_gen_Make: Modification of the Makefile in TMPDIR.
108    Running the Makefile
109    Generate a cleaner file
110 Shared archive loaded.
111 Link done.
112 idaval = res.values;            // Results
113 // Compare results
114 compa = abs(ddaskrval-idaval);
115 // Extract mean, standard deviation, maximum
116 mea = mean(compa);
117 [maxi, indexMaxi] = max(compa);
118 stdeviation = st_deviation(compa);
119 // Verifying closeness of the results
120 assert_checktrue(maxi <= 2*10^-(7));
121 assert_checktrue(mea <= 2*10^-(7));
122 assert_checktrue(stdeviation <= 2*10^-(7));