Xcos tests: recompilation at every call and context use
[scilab.git] / scilab / modules / scicos / tests / unit_tests / DDaskrK_Bouncing.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_Bouncing_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_Bouncing_test_im.mo
21
22  Flat Modelica : TMPDIR/DDaskr_Bouncing_test_imf.mo
23  Simulation C code :TMPDIR/DDaskr_Bouncing_test_im.c
24  
25 !Modelica blocks are reduced to a block with:             !
26 !                                                         !
27 !Number of differential states: 2                         !
28 !                                                         !
29 !Number of algebraic states: 0                            !
30 !                                                         !
31 !Number of discrete time states  : 0                      !
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_Bouncing_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 // Modify solver + run DDaskr + save results
63 scs_m.props.tol(6) = 102;       // Solver
64 scicos_simulate(scs_m, Info);   // DDaskr
65 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
66
67 ddaskrval = res.values;         // Results
68 time = res.time;                // Time
69 // Modify solver + run IDA + save results
70 scs_m.props.tol(6) = 100;      // Solver
71 scicos_simulate(scs_m, Info);  // IDA
72 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
73
74 idaval = res.values;           // Results
75 // Compare results
76 compa = abs(ddaskrval-idaval);
77 // Extract mean, standard deviation, maximum
78 mea = mean(compa);
79 [maxi, indexMaxi] = max(compa);
80 stdeviation = st_deviation(compa);
81 // Verifying closeness of the results
82 assert_checktrue(maxi <= 5*10^-(5));
83 assert_checktrue(mea <= 5*10^-(5));
84 assert_checktrue(stdeviation <= 5*10^-(5));