Scicos tests: relieving compilation
[scilab.git] / scilab / modules / scicos / tests / unit_tests / DDaskrK_RLC.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_RLC_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(), 'nw');
19  
20  CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp 
21       ected, getting 2 2 2 2                                            
22 --------------------------------------------\
23  Main Modelica : TMPDIR/DDaskr_RLC_test_im.mo
24
25  Flat Modelica : TMPDIR/DDaskr_RLC_test_imf.mo
26  Simulation C code :TMPDIR/DDaskr_RLC_test_im.c
27  
28 !Modelica blocks are reduced to a block with:             !
29 !                                                         !
30 !Number of differential states: 2                         !
31 !                                                         !
32 !Number of algebraic states: 1                            !
33 !                                                         !
34 !Number of discrete time states  : 0                      !
35 !                                                         !
36 !Number of zero-crossing surfaces: 0                      !
37 !                                                         !
38 !Number of modes  : 0                                     !
39 !                                                         !
40 !Number of inputs : 0                                     !
41 !                                                         !
42 !Number of outputs: 3                                     !
43 !                                                         !
44 !Input/output dependency:[T]                              !
45 !                                                         !
46 !Analytical Jacobian: enabled  (%Jacobian=%t)             !
47 !                                                         !
48 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t)  !
49 !                                                         !
50 !                                                         !
51 !                                                         !
52 !Generated files path: TMPDIR/         !
53 !                                                         !
54 !                                                         !
55    Generate a loader file
56    Generate a Makefile
57    ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
58    ilib_gen_Make: Copy DDaskr_RLC_test_im.c to TMPDIR
59    ilib_gen_Make: configure : Generate Makefile.
60    ilib_gen_Make: Modification of the Makefile in TMPDIR.
61    Running the Makefile
62    Generate a cleaner file
63 Shared archive loaded.
64 Link done.
65 // looking for the CLOCK_f/EVTDLY_f to update period
66 for path_1=1:length(scs_m.objs)
67     if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
68         CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
69         break;
70     end
71 end
72 for path_2=1:length(CLOCK_f_scs_m)
73     if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
74         EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
75         break;
76     end
77 end
78 for i=2:3
79     // Start by updating the clock block period (sampling)
80     scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
81     // Modify solver + run DDaskr + save results
82     scs_m.props.tol(6) = 102;     // Solver
83     scicos_simulate(scs_m, Info, 'nw'); // DDaskr
84     ddaskrval = res.values;        // Results
85     time = res.time;               // Time
86     // Modify solver + run IDA + save results
87     scs_m.props.tol(6) = 100;     // Solver
88     scicos_simulate(scs_m, Info, 'nw'); // IDA
89     idaval = res.values;          // Results
90     // Compare results
91     compa = abs(ddaskrval-idaval);
92     // Extract mean, standard deviation, maximum
93     mea = mean(compa);
94     [maxi, indexMaxi] = max(compa);
95     stdeviation = st_deviation(compa);
96     // Verifying closeness of the results
97     assert_checktrue(maxi <= 10^-(i+3));
98     assert_checktrue(mea <= 10^-(i+3));
99     assert_checktrue(stdeviation <= 10^-(i+3));
100 end
101  
102  CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp 
103       ected, getting 2 2 2 2                                            
104 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
105
106  
107  CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp 
108       ected, getting 2 2 2 2                                            
109 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
110
111  
112  CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp 
113       ected, getting 2 2 2 2                                            
114 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
115
116  
117  CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp 
118       ected, getting 2 2 2 2                                            
119 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
120