Scicos tests: relieving compilation
[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 Info = scicos_simulate(scs_m, list(), 'nw');
21 --------------------------------------------\
22  Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
23
24  Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
25  Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
26  
27 !Modelica blocks are reduced to a block with:             !
28 !                                                         !
29 !Number of differential states: 4                         !
30 !                                                         !
31 !Number of algebraic states: 0                            !
32 !                                                         !
33 !Number of discrete time states  : 2                      !
34 !                                                         !
35 !Number of zero-crossing surfaces: 1                      !
36 !                                                         !
37 !Number of modes  : 0                                     !
38 !                                                         !
39 !Number of inputs : 0                                     !
40 !                                                         !
41 !Number of outputs: 3                                     !
42 !                                                         !
43 !Input/output dependency:[T]                              !
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_Platform_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 // looking for the CLOCK_f/EVTDLY_f to update period
65 for path_1=1:length(scs_m.objs)
66     if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_c" then
67         CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
68         break;
69     end
70 end
71 for path_2=1:length(CLOCK_f_scs_m)
72     if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_c" then
73         EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
74         break;
75     end
76 end
77 for i=1:3  // 'max step size' = 10^-i, precision
78     // Start by updating the clock block period (sampling)
79     scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
80     // Modify solver + run DDaskr + save results
81     scs_m.props.tol(6) = 101;     // Solver
82     scicos_simulate(scs_m, Info, 'nw'); // DDaskr
83     ddaskrval = res.values;       // Results
84     time = res.time;              // Time
85     // Modify solver + run IDA + save results
86     scs_m.props.tol(6) = 100;     // Solver
87     scicos_simulate(scs_m, Info, 'nw'); // IDA
88     idaval = res.values;          // Results
89     // Compare results
90     compa = abs(ddaskrval-idaval);
91     // Extract mean, standard deviation, maximum
92     mea = mean(compa);
93     [maxi, indexMaxi] = max(compa);
94     stdeviation = st_deviation(compa);
95     // Verifying closeness of the results
96     assert_checktrue(maxi <= 10^-(i+3));
97     assert_checktrue(mea <= 10^-(i+3));
98     assert_checktrue(stdeviation <= 10^-(i+3));
99 end
100 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
101
102 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
103
104 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
105
106 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
107
108 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
109
110 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
111