1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 // <-- ENGLISH IMPOSED -->
10 assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/DDaskr_Hydraulics_test.zcos"));
11 // Redefining messagebox() to avoid popup
14 function messagebox(msg, msg_title)
18 // Modify solver + run DDaskr + save results
19 scs_m.props.tol(6) = 102; // Solver
20 scicos_simulate(scs_m); // DDaskr
21 --------------------------------------------\
22 Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
24 Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
25 Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
27 !Modelica blocks are reduced to a block with: !
29 !Number of differential states: 2 !
31 !Number of algebraic states: 5 !
33 !Number of discrete time states : 0 !
35 !Number of zero-crossing surfaces: 19 !
37 !Number of modes : 19 !
39 !Number of inputs : 1 !
41 !Number of outputs: 1 !
43 !Input/output dependency:[F] !
45 !Analytical Jacobian: enabled (%Jacobian=%t) !
47 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t) !
51 !Generated files path: TMPDIR/ !
54 Generate a loader file
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.
61 Generate a cleaner file
62 Shared archive loaded.
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
72 Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
73 Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
75 !Modelica blocks are reduced to a block with: !
77 !Number of differential states: 2 !
79 !Number of algebraic states: 5 !
81 !Number of discrete time states : 0 !
83 !Number of zero-crossing surfaces: 19 !
85 !Number of modes : 19 !
87 !Number of inputs : 1 !
89 !Number of outputs: 1 !
91 !Input/output dependency:[F] !
93 !Analytical Jacobian: enabled (%Jacobian=%t) !
95 !Parameter embedding mode: enabled (%Modelica_ParEmb=%t) !
99 !Generated files path: TMPDIR/ !
102 Generate a loader file
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.
109 Generate a cleaner file
110 Shared archive loaded.
112 idaval = res.values; // Results
114 compa = abs(ddaskrval-idaval);
115 // Extract mean, standard deviation, maximum
117 [maxi, indexMaxi] = max(compa);
118 stdeviation = st_deviation(compa);
119 // Verifying closeness of the results
120 assert_checktrue(maxi <= 2*10^-(6));
121 assert_checktrue(mea <= 2*10^-(6));
122 assert_checktrue(stdeviation <= 2*10^-(6));