Scicos tests: Sundials + minor corrections 41/12241/12
Paul BIGNIER [Wed, 7 Aug 2013 15:45:14 +0000 (17:45 +0200)]
Added some tests for Sundials and fixed other tests a bit.

Change-Id: I984f3623656305f2a2b212defad6080f2a5db908

64 files changed:
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Cont-Disc.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Cont-Disc.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Controller.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Controller.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Kalman.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Kalman.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Temperature_Controller.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Temperature_Controller.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Watertank.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Watertank.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/DAE_ODE.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/DAE_ODE.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Bouncing.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Bouncing.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Bouncing.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Hydraulics.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Hydraulics.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Hydraulics.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_ODE.dia.ref [deleted file]
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_ODE.tst [deleted file]
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Platform.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Platform.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_Platform.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_RLC.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_RLC.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_RLC.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Bouncing.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Bouncing.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Bouncing.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Hydraulics.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Hydraulics.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Hydraulics.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_ODE.dia.ref [deleted file]
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_ODE.tst [deleted file]
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Platform.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Platform.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_Platform.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_RLC.tst
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_RLC.unix.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_RLC.win.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DoPri.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/DoPri.tst
scilab/modules/scicos/tests/unit_tests/Solvers/ExpRK.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/ExpRK.tst
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.unix.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.win.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.unix.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.win.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.unix.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.win.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.tst [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.unix.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.win.dia.ref [new file with mode: 0644]
scilab/modules/scicos/tests/unit_tests/Solvers/ImpRK.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/ImpRK.tst
scilab/modules/scicos/tests/unit_tests/Solvers/LSodar.dia.ref
scilab/modules/scicos/tests/unit_tests/Solvers/LSodar.tst
scilab/modules/xcos/tests/unit_tests/Solvers/Cont-Disc.zcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/Solvers/Controller.zcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/Solvers/Temperature_Controller.zcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/Solvers/Watertank.zcos [new file with mode: 0644]

diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Cont-Disc.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Cont-Disc.dia.ref
new file mode 100644 (file)
index 0000000..d986961
--- /dev/null
@@ -0,0 +1,40 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Cont-Disc.zcos"));
+CVode_val_ref = [
+    0.0526307    0.0281557  -0.0448704
+    0.0532495    0.0310114  -0.0395186
+    0.0515776    0.0292653  -0.0411181
+    0.0541249    0.0359859  -0.0302313
+    0.0557393    0.0408484  -0.0222704
+    0.0553117    0.0416374  -0.0205659
+    0.0532631    0.0391278  -0.0237235
+    0.0527059    0.0395825  -0.0224774
+    0.0484859    0.0326594  -0.0322248
+    0.0478463    0.0328263  -0.0311995
+    0.0480311    0.0346173  -0.0277562
+    0.0482951    0.0365765  -0.0241936
+    0.0499827    0.0413830  -0.0164582
+    0.0482402    0.0393498  -0.0191464
+    0.0449862    0.0341952  -0.0262754
+    0.0456246    0.0367935  -0.0217585
+    0.0442013    0.0352645  -0.0235108
+    0.0418061    0.0317424  -0.0281739
+    0.0423243    0.0340336  -0.0241589
+    0.0416363    0.0338569  -0.0237435 ];
+CVode_time_ref = (17.2:.1:29.9)';
+for i=1:4
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, 1d-4);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Cont-Disc.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Cont-Disc.tst
new file mode 100644 (file)
index 0000000..cb26ce6
--- /dev/null
@@ -0,0 +1,46 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Cont-Disc.zcos"));
+
+CVode_val_ref = [
+    0.0526307    0.0281557  -0.0448704
+    0.0532495    0.0310114  -0.0395186
+    0.0515776    0.0292653  -0.0411181
+    0.0541249    0.0359859  -0.0302313
+    0.0557393    0.0408484  -0.0222704
+    0.0553117    0.0416374  -0.0205659
+    0.0532631    0.0391278  -0.0237235
+    0.0527059    0.0395825  -0.0224774
+    0.0484859    0.0326594  -0.0322248
+    0.0478463    0.0328263  -0.0311995
+    0.0480311    0.0346173  -0.0277562
+    0.0482951    0.0365765  -0.0241936
+    0.0499827    0.0413830  -0.0164582
+    0.0482402    0.0393498  -0.0191464
+    0.0449862    0.0341952  -0.0262754
+    0.0456246    0.0367935  -0.0217585
+    0.0442013    0.0352645  -0.0235108
+    0.0418061    0.0317424  -0.0281739
+    0.0423243    0.0340336  -0.0241589
+    0.0416363    0.0338569  -0.0237435 ];
+CVode_time_ref = (17.2:.1:29.9)';
+
+for i=1:4
+
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, 1d-4);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Controller.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Controller.dia.ref
new file mode 100644 (file)
index 0000000..3fe0be0
--- /dev/null
@@ -0,0 +1,40 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Controller.zcos"));
+CVode_val_ref = [
+  -0.3044468   -0.0529063   -0.1556339
+  -0.3152667   -0.0434950   -0.1412728
+  -0.3178104   -0.0331244   -0.1275205
+  -0.3071042   -0.0127201   -0.0885981
+  -0.3140531   -0.0293549   -0.1124763
+  -0.3227156   -0.0419506   -0.1226843
+  -0.3353218   -0.0411101   -0.1285499
+  -0.3202700   -0.0083677   -0.0802106
+  -0.2992298    0.0202297   -0.0450890
+  -0.2463811    0.0683297    0.0322714
+  -0.1970797    0.0886041    0.0663326
+  -0.1349323    0.1199161    0.1213726
+  -0.0965228    0.1049137    0.0971713
+  -0.0428198    0.1142629    0.1258705
+   0.0334498    0.1465127    0.1855820
+   0.0940592    0.1375793    0.1859050
+   0.1280733    0.1031344    0.1476760
+   0.1468555    0.0715547    0.1117624
+   0.1678585    0.0609110    0.1017769
+   0.1779129    0.0480921    0.0894899 ];
+CVode_time_ref = (0:.1:29.9)';
+for i=1:4
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, [], 1d-4);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Controller.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Controller.tst
new file mode 100644 (file)
index 0000000..50e731a
--- /dev/null
@@ -0,0 +1,46 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Controller.zcos"));
+
+CVode_val_ref = [
+  -0.3044468   -0.0529063   -0.1556339
+  -0.3152667   -0.0434950   -0.1412728
+  -0.3178104   -0.0331244   -0.1275205
+  -0.3071042   -0.0127201   -0.0885981
+  -0.3140531   -0.0293549   -0.1124763
+  -0.3227156   -0.0419506   -0.1226843
+  -0.3353218   -0.0411101   -0.1285499
+  -0.3202700   -0.0083677   -0.0802106
+  -0.2992298    0.0202297   -0.0450890
+  -0.2463811    0.0683297    0.0322714
+  -0.1970797    0.0886041    0.0663326
+  -0.1349323    0.1199161    0.1213726
+  -0.0965228    0.1049137    0.0971713
+  -0.0428198    0.1142629    0.1258705
+   0.0334498    0.1465127    0.1855820
+   0.0940592    0.1375793    0.1859050
+   0.1280733    0.1031344    0.1476760
+   0.1468555    0.0715547    0.1117624
+   0.1678585    0.0609110    0.1017769
+   0.1779129    0.0480921    0.0894899 ];
+CVode_time_ref = (0:.1:29.9)';
+
+for i=1:4
+
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, [], 1d-4);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Kalman.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Kalman.dia.ref
new file mode 100644 (file)
index 0000000..3b3f8b5
--- /dev/null
@@ -0,0 +1,39 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
+CVode_val_ref = [ -0.0124518   0.0057263   0.0202561
+                  -0.0056589   0.0003643   0.0040543
+                   0.0139675   0.0010424  -0.0068178
+                   0.0342362   0.0025550  -0.0150659
+                   0.0349585   0.0022871  -0.0139099
+                   0.0457677   0.0095449  -0.0057510
+                   0.0438374   0.0179447   0.0110369
+                   0.0399226   0.0159906   0.0084871
+                   0.0466923   0.0087662  -0.0088076
+                   0.0431542   0.0060647  -0.0101178
+                   0.0586618   0.0186971   0.0051877
+                   0.0629366   0.0288542   0.0211484
+                   0.0579398   0.0109636  -0.0105544
+                   0.0624743   0.0102438  -0.0139593
+                   0.0654326   0.0065228  -0.0207958
+                   0.0531896  -0.0026032  -0.0283963
+                   0.0353228  -0.0132950  -0.0343691
+                   0.0381893  -0.0053057  -0.0183788
+                   0.0563168   0.0083184  -0.0028685
+                   0.0363338   0.0053192   0.0038699 ];
+CVode_time_ref = (0:.03:14.97)';
+for i=1:4
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, [], 1d-7);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Kalman.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Kalman.tst
new file mode 100644 (file)
index 0000000..980551f
--- /dev/null
@@ -0,0 +1,45 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
+
+CVode_val_ref = [ -0.0124518   0.0057263   0.0202561
+                  -0.0056589   0.0003643   0.0040543
+                   0.0139675   0.0010424  -0.0068178
+                   0.0342362   0.0025550  -0.0150659
+                   0.0349585   0.0022871  -0.0139099
+                   0.0457677   0.0095449  -0.0057510
+                   0.0438374   0.0179447   0.0110369
+                   0.0399226   0.0159906   0.0084871
+                   0.0466923   0.0087662  -0.0088076
+                   0.0431542   0.0060647  -0.0101178
+                   0.0586618   0.0186971   0.0051877
+                   0.0629366   0.0288542   0.0211484
+                   0.0579398   0.0109636  -0.0105544
+                   0.0624743   0.0102438  -0.0139593
+                   0.0654326   0.0065228  -0.0207958
+                   0.0531896  -0.0026032  -0.0283963
+                   0.0353228  -0.0132950  -0.0343691
+                   0.0381893  -0.0053057  -0.0183788
+                   0.0563168   0.0083184  -0.0028685
+                   0.0363338   0.0053192   0.0038699 ];
+CVode_time_ref = (0:.03:14.97)';
+
+for i=1:4
+
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, [], 1d-7);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Temperature_Controller.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Temperature_Controller.dia.ref
new file mode 100644 (file)
index 0000000..17ec2aa
--- /dev/null
@@ -0,0 +1,40 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Temperature_Controller.zcos"));
+CVode_val_ref = [
+  -3.6548088    0.0000044    16.066667    19.721476
+  -3.6499578    0.0000040    16.066667    19.716625
+  -3.6451087    0.0000036    16.066667    19.711776
+  -3.6402617    0.0000033    16.066667    19.706929
+  -3.6354167    0.0000030    16.066667    19.702084
+  -3.6305738    0.0000027    16.066667    19.697241
+  -3.6257328    0.0000025    16.066667    19.6924
+  -3.6208938    0.0000023    16.066667    19.687561
+  -3.6160569    0.0000021    16.066667    19.682724
+  -3.611222     0.0000019    16.066667    19.677889
+  -3.6063891    0.0000017    16.066667    19.673056
+  -3.6015582    0.0000015    16.066667    19.668225
+  -3.5967293    0.0000014    16.066667    19.663396
+  -3.5919024    0.0000013    16.066667    19.658569
+  -3.5870775    0.0000012    16.066667    19.653745
+  -3.5822547    0.0000011    16.066667    19.648922
+  -3.5774338    0.0000010    16.066667    19.644101
+  -3.572615     0.0000009    16.066667    19.639282
+  -3.5677982    0.0000008    16.066667    19.634465
+  -3.5629834    0.0000007    16.066667    19.62965  ];
+CVode_time_ref = (28720.1:10:29990.1)';
+for i=1:4
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, [], 1d-4);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Temperature_Controller.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Temperature_Controller.tst
new file mode 100644 (file)
index 0000000..473c4f8
--- /dev/null
@@ -0,0 +1,46 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Temperature_Controller.zcos"));
+
+CVode_val_ref = [
+  -3.6548088    0.0000044    16.066667    19.721476
+  -3.6499578    0.0000040    16.066667    19.716625
+  -3.6451087    0.0000036    16.066667    19.711776
+  -3.6402617    0.0000033    16.066667    19.706929
+  -3.6354167    0.0000030    16.066667    19.702084
+  -3.6305738    0.0000027    16.066667    19.697241
+  -3.6257328    0.0000025    16.066667    19.6924
+  -3.6208938    0.0000023    16.066667    19.687561
+  -3.6160569    0.0000021    16.066667    19.682724
+  -3.611222     0.0000019    16.066667    19.677889
+  -3.6063891    0.0000017    16.066667    19.673056
+  -3.6015582    0.0000015    16.066667    19.668225
+  -3.5967293    0.0000014    16.066667    19.663396
+  -3.5919024    0.0000013    16.066667    19.658569
+  -3.5870775    0.0000012    16.066667    19.653745
+  -3.5822547    0.0000011    16.066667    19.648922
+  -3.5774338    0.0000010    16.066667    19.644101
+  -3.572615     0.0000009    16.066667    19.639282
+  -3.5677982    0.0000008    16.066667    19.634465
+  -3.5629834    0.0000007    16.066667    19.62965  ];
+CVode_time_ref = (28720.1:10:29990.1)';
+
+for i=1:4
+
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, [], 1d-4);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Watertank.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Watertank.dia.ref
new file mode 100644 (file)
index 0000000..00411fc
--- /dev/null
@@ -0,0 +1,40 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Watertank.zcos"));
+CVode_val_ref = [
+    7.8198758    9.6795397
+    7.8460626    9.6628927
+    7.8715566    9.6488678
+    7.8963773    9.6375731
+    7.9205414    9.6287258
+    7.9440674    9.6219139
+    7.9669711    9.6174424
+    7.9892697    9.6150375
+    8.0109781    9.6146991
+    8.0321113    9.6160474
+    8.052689     9.619105
+    8.0727243    9.6238066
+    8.0922301    9.6298068
+    8.1112209    9.6370943
+    8.1297115    9.6456041
+    8.1477135    9.6551443
+    8.1652409    9.6656234
+    8.1823051    9.6768902
+    8.198919     9.6888469
+    8.2150942    9.7013865 ];
+CVode_time_ref = (0.1:.1:10)';
+for i=1:4
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, 1d-3);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Watertank.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/CVode_Watertank.tst
new file mode 100644 (file)
index 0000000..e1a139c
--- /dev/null
@@ -0,0 +1,46 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Watertank.zcos"));
+
+CVode_val_ref = [
+    7.8198758    9.6795397
+    7.8460626    9.6628927
+    7.8715566    9.6488678
+    7.8963773    9.6375731
+    7.9205414    9.6287258
+    7.9440674    9.6219139
+    7.9669711    9.6174424
+    7.9892697    9.6150375
+    8.0109781    9.6146991
+    8.0321113    9.6160474
+    8.052689     9.619105
+    8.0727243    9.6238066
+    8.0922301    9.6298068
+    8.1112209    9.6370943
+    8.1297115    9.6456041
+    8.1477135    9.6551443
+    8.1652409    9.6656234
+    8.1823051    9.6768902
+    8.198919     9.6888469
+    8.2150942    9.7013865 ];
+CVode_time_ref = (0.1:.1:10)';
+
+for i=1:4
+
+    scs_m.props.tol(6) = i; // Solver
+    try scicos_simulate(scs_m); catch disp(lasterror()); end; // CVode
+
+    assert_checkalmostequal(res.values($-19:$, :), CVode_val_ref, 1d-3);
+    assert_checkalmostequal(res.time, CVode_time_ref);
+
+end
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/DAE_ODE.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/DAE_ODE.dia.ref
new file mode 100644 (file)
index 0000000..f8cb2b3
--- /dev/null
@@ -0,0 +1,37 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function message(msg)
+endfunction
+funcprot(prot);
+// Modify solver + run IDA
+scs_m.props.tol(6) = 100;       // Solver
+ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over)
+assert_checkequal(ier, 0);
+ier = execstr('scicos_simulate(scs_m);', 'errcatch');
+assert_checkequal(ier, 0);
+// Modify solver + run DDaskr Newton
+scs_m.props.tol(6) = 101;       // Solver
+ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over)
+assert_checkequal(ier, 0);
+ier = execstr('scicos_simulate(scs_m);', 'errcatch');
+assert_checkequal(ier, 0);
+// Modify solver + run DDaskr GMRes
+scs_m.props.tol(6) = 102;       // Solver
+ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over)
+assert_checkequal(ier, 0);
+ier = execstr('scicos_simulate(scs_m);', 'errcatch');
+assert_checkequal(ier, 0);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/DAE_ODE.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/DAE_ODE.tst
new file mode 100644 (file)
index 0000000..25f9c72
--- /dev/null
@@ -0,0 +1,42 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
+
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function message(msg)
+endfunction
+funcprot(prot);
+
+// Modify solver + run IDA
+scs_m.props.tol(6) = 100;       // Solver
+ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over)
+assert_checkequal(ier, 0);
+ier = execstr('scicos_simulate(scs_m);', 'errcatch');
+assert_checkequal(ier, 0);
+
+// Modify solver + run DDaskr Newton
+scs_m.props.tol(6) = 101;       // Solver
+ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over)
+assert_checkequal(ier, 0);
+ier = execstr('scicos_simulate(scs_m);', 'errcatch');
+assert_checkequal(ier, 0);
+
+// Modify solver + run DDaskr GMRes
+scs_m.props.tol(6) = 102;       // Solver
+ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over)
+assert_checkequal(ier, 0);
+ier = execstr('scicos_simulate(scs_m);', 'errcatch');
+assert_checkequal(ier, 0);
index 3fde5ac..9c24f79 100644 (file)
@@ -27,7 +27,6 @@ Info = scicos_simulate(scs_m, list());
 scs_m.props.tol(6) = 102;       // Solver
 scicos_simulate(scs_m, Info);   // DDaskr
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;      // Solver
index 84f1b9e..91d3891 100644 (file)
@@ -30,7 +30,6 @@ scicos_simulate(scs_m, Info);   // DDaskr
 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
 
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;      // Solver
 scicos_simulate(scs_m, Info);  // IDA
index a1ba1f7..d9d9b01 100644 (file)
@@ -30,7 +30,6 @@ scicos_simulate(scs_m, Info);   // DDaskr
 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
 
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;      // Solver
 scicos_simulate(scs_m, Info);  // IDA
index c21660d..5f9c00a 100644 (file)
@@ -26,7 +26,6 @@ funcprot(prot);
 scs_m.props.tol(6) = 102;       // Solver
 scicos_simulate(scs_m);   // DDaskr
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;      // Solver
index 4896484..1c5e2ee 100644 (file)
@@ -27,7 +27,6 @@ scicos_simulate(scs_m);   // DDaskr
  Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
  Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;      // Solver
 scicos_simulate(scs_m);  // IDA
index 336020a..a5dd43c 100644 (file)
@@ -27,7 +27,6 @@ scicos_simulate(scs_m);   // DDaskr
  Flat Modelica : TMPDIR\DDaskr_Hydraulics_test_imf.mo
  Simulation C code :TMPDIR\DDaskr_Hydraulics_test_im.c
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;      // Solver
 scicos_simulate(scs_m);  // IDA
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_ODE.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_ODE.dia.ref
deleted file mode 100644 (file)
index 95067b3..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- ENGLISH IMPOSED -->
-//
-// <-- XCOS TEST -->
-//
-ilib_verbose(0); //to remove ilib_* traces
-// Import diagram
-assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
-prot = funcprot();
-funcprot(0);
-function message(msg)
-endfunction
-funcprot(prot);
-// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 102;       // Solver
-ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over DDaskr)
-assert_checkequal(ier, 0);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_ODE.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrK_ODE.tst
deleted file mode 100644 (file)
index d27d0ad..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- ENGLISH IMPOSED -->
-//
-// <-- XCOS TEST -->
-//
-
-ilib_verbose(0); //to remove ilib_* traces
-
-// Import diagram
-assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
-
-prot = funcprot();
-funcprot(0);
-function message(msg)
-endfunction
-funcprot(prot);
-
-// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 102;       // Solver
-ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over DDaskr)
-assert_checkequal(ier, 0);
index 9ce78c6..5a0afb3 100644 (file)
@@ -31,7 +31,6 @@ for i=1:2  // 'max step size' = 10^-i, precision
     scs_m.props.tol(6) = 102;     // Solver
     scicos_simulate(scs_m, Info, Context); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
 
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
index 71d4558..5e0ed99 100644 (file)
@@ -30,7 +30,6 @@ for i=1:2  // 'max step size' = 10^-i, precision
     scs_m.props.tol(6) = 102;     // Solver
     scicos_simulate(scs_m, Info, Context); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m, Info, Context); // IDA
index fe0228d..c09ceeb 100644 (file)
@@ -30,7 +30,6 @@ for i=1:2  // 'max step size' = 10^-i, precision
     scs_m.props.tol(6) = 102;     // Solver
     scicos_simulate(scs_m, Info, Context); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m, Info, Context); // IDA
index 6a3924f..d8506ae 100644 (file)
@@ -30,7 +30,6 @@ for i=2:3
     scs_m.props.tol(6) = 102;     // Solver
     scicos_simulate(scs_m); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
 
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
index 2c90345..71ff5f5 100644 (file)
@@ -24,7 +24,6 @@ for i=2:3
     scs_m.props.tol(6) = 102;     // Solver
     scicos_simulate(scs_m); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m); // IDA
index 5d3eb51..1878b51 100644 (file)
@@ -24,7 +24,6 @@ for i=2:3
     scs_m.props.tol(6) = 102;     // Solver
     scicos_simulate(scs_m); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m); // IDA
index b660814..cd06dbd 100644 (file)
@@ -27,7 +27,6 @@ Info = scicos_simulate(scs_m, list());
 scs_m.props.tol(6) = 101;      // Solver
 scicos_simulate(scs_m, Info);  // DDaskr
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;     // Solver
index c02095f..b6c1f93 100644 (file)
@@ -30,7 +30,6 @@ scicos_simulate(scs_m, Info);  // DDaskr
 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
 
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;     // Solver
 scicos_simulate(scs_m, Info); // IDA
index bba92d4..59a2923 100644 (file)
@@ -30,7 +30,6 @@ scicos_simulate(scs_m, Info);  // DDaskr
 Warning : redefining function: dst                     . Use funcprot(0) to avoid this message
 
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;     // Solver
 scicos_simulate(scs_m, Info); // IDA
index 1704647..19e0be7 100644 (file)
@@ -26,7 +26,6 @@ funcprot(prot);
 scs_m.props.tol(6) = 101;       // Solver
 scicos_simulate(scs_m);   // DDaskr
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;       // Solver
index cf59af8..7fdaae9 100644 (file)
@@ -27,7 +27,6 @@ scicos_simulate(scs_m);   // DDaskr
  Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
  Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;       // Solver
 scicos_simulate(scs_m);   // IDA
index f6e25d9..14ec28f 100644 (file)
@@ -27,7 +27,6 @@ scicos_simulate(scs_m);   // DDaskr
  Flat Modelica : TMPDIR\DDaskr_Hydraulics_test_imf.mo
  Simulation C code :TMPDIR\DDaskr_Hydraulics_test_im.c
 ddaskrval = res.values;         // Results
-time = res.time;                // Time
 // Modify solver + run IDA + save results
 scs_m.props.tol(6) = 100;       // Solver
 scicos_simulate(scs_m);   // IDA
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_ODE.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_ODE.dia.ref
deleted file mode 100644 (file)
index 7c8b8ba..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- ENGLISH IMPOSED -->
-//
-// <-- XCOS TEST -->
-//
-ilib_verbose(0); //to remove ilib_* traces
-// Import diagram
-assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
-prot = funcprot();
-funcprot(0);
-function message(msg)
-endfunction
-funcprot(prot);
-// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 101;       // Solver
-ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over DDaskr)
-assert_checkequal(ier, 0);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_ODE.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/DDaskrN_ODE.tst
deleted file mode 100644 (file)
index e588bbf..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- ENGLISH IMPOSED -->
-//
-// <-- XCOS TEST -->
-//
-
-ilib_verbose(0); //to remove ilib_* traces
-
-// Import diagram
-assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
-
-prot = funcprot();
-funcprot(0);
-function message(msg)
-endfunction
-funcprot(prot);
-
-// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 101;       // Solver
-ier = execstr('xcos_simulate(scs_m, 4);', 'errcatch'); // Run simulation (LSodar will actually take over DDaskr)
-assert_checkequal(ier, 0);
index 63f40e2..0bee9d5 100644 (file)
@@ -32,7 +32,6 @@ for i=1:3  // 'max step size' = 10^-i, precision
     scs_m.props.tol(6) = 101;     // Solver
     scicos_simulate(scs_m, Info, Context); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
 
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
index 0df391a..87dd671 100644 (file)
@@ -31,7 +31,6 @@ for i=1:3  // 'max step size' = 10^-i, precision
     scs_m.props.tol(6) = 101;     // Solver
     scicos_simulate(scs_m, Info, Context); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m, Info, Context); // IDA
index 4eda407..f970819 100644 (file)
@@ -31,7 +31,6 @@ for i=1:3  // 'max step size' = 10^-i, precision
     scs_m.props.tol(6) = 101;     // Solver
     scicos_simulate(scs_m, Info, Context); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m, Info, Context); // IDA
index 8f274ba..ca96500 100644 (file)
@@ -30,7 +30,6 @@ for i=2:3
     scs_m.props.tol(6) = 101;     // Solver
     scicos_simulate(scs_m); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
 
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
index 201e8bf..d137a8b 100644 (file)
@@ -24,7 +24,6 @@ for i=2:3
     scs_m.props.tol(6) = 101;     // Solver
     scicos_simulate(scs_m); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m); // IDA
index c8aa06d..2550c89 100644 (file)
@@ -24,7 +24,6 @@ for i=2:3
     scs_m.props.tol(6) = 101;     // Solver
     scicos_simulate(scs_m); // DDaskr
     ddaskrval = res.values;       // Results
-    time = res.time;              // Time
     // Modify solver + run IDA + save results
     scs_m.props.tol(6) = 100;     // Solver
     scicos_simulate(scs_m); // IDA
index fef90a5..cca4918 100644 (file)
@@ -17,10 +17,9 @@ for i=2:4  // 'max step size' = 5*10^-i, precision
  scs_m.objs(8).model.rpar(1) = 5*10^-i;
  scs_m.objs(9).model.rpar(1) = 5*10^-i;
  // Modify solver and 'max step size' + run DoPri + save results
- scs_m.props.tol(7) = 5*10^(-i); scs_m.props.tol(6) = 5;           // 'max step size' + solver
+ scs_m.props.tol(7) = 5*10^-i; scs_m.props.tol(6) = 5;           // 'max step size' + solver
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end;   // DoPri
  doprival = res.values;   // Results
- time = res.time;         // Time
  // Modify solver and 'max step size' + run CVode + save results
  scs_m.props.tol(7) = 0; scs_m.props.tol(6) = 1;
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end;
index 41adabd..552dfb7 100644 (file)
@@ -21,10 +21,9 @@ for i=2:4  // 'max step size' = 5*10^-i, precision
  scs_m.objs(9).model.rpar(1) = 5*10^-i;
 
  // Modify solver and 'max step size' + run DoPri + save results
- scs_m.props.tol(7) = 5*10^(-i); scs_m.props.tol(6) = 5;           // 'max step size' + solver
+ scs_m.props.tol(7) = 5*10^-i; scs_m.props.tol(6) = 5;           // 'max step size' + solver
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end;   // DoPri
  doprival = res.values;   // Results
- time = res.time;         // Time
 
  // Modify solver and 'max step size' + run CVode + save results
  scs_m.props.tol(7) = 0; scs_m.props.tol(6) = 1;
index 5b5886c..2d3315c 100644 (file)
@@ -17,10 +17,9 @@ for i=2:4  // 'max step size' = 5*10^-i, precision
  scs_m.objs(7).model.rpar(1) = 5*10^-i;
  scs_m.objs(8).model.rpar(1) = 5*10^-i;
  // Modify solver and 'max step size' + run ExpRK + save results
- scs_m.props.tol(7) = 5*10^(-i); scs_m.props.tol(6) = 6;     // 'max step size' + solver
+ scs_m.props.tol(7) = 5*10^-i; scs_m.props.tol(6) = 6;     // 'max step size' + solver
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end;   // ExpRK
  rkval = res.values;   // Results
- time = res.time;      // Time
  // Modify solver and 'max step size' + run CVode + save results
  scs_m.props.tol(7) = 0; scs_m.props.tol(6) = 1;
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end;
index 5126277..5577098 100644 (file)
@@ -21,10 +21,9 @@ for i=2:4  // 'max step size' = 5*10^-i, precision
  scs_m.objs(8).model.rpar(1) = 5*10^-i;
 
  // Modify solver and 'max step size' + run ExpRK + save results
- scs_m.props.tol(7) = 5*10^(-i); scs_m.props.tol(6) = 6;     // 'max step size' + solver
+ scs_m.props.tol(7) = 5*10^-i; scs_m.props.tol(6) = 6;     // 'max step size' + solver
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end;   // ExpRK
  rkval = res.values;   // Results
- time = res.time;      // Time
 
  // Modify solver and 'max step size' + run CVode + save results
  scs_m.props.tol(7) = 0; scs_m.props.tol(6) = 1;
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.tst
new file mode 100644 (file)
index 0000000..00203b2
--- /dev/null
@@ -0,0 +1,58 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+ilib_verbose(0); //to remove ilib_* traces
+
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Bouncing_test.zcos"));
+
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+
+IDA_val_ref = [ 10.
+                11.3875
+                12.55
+                13.4875
+                14.2
+                14.6875
+                14.95
+                14.9875
+                14.8
+                14.3875
+                13.75
+                12.8875
+                11.8
+                10.4875
+                8.95
+                7.1875
+                5.2
+                2.9875
+                0.55
+                1.5647919
+                3.3538291
+                4.9178663
+                6.2569034
+                7.3709406
+                8.2599778
+                8.924015 ];
+IDA_time_ref = (0:.5:49.5)';
+
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.5"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+
+assert_checkalmostequal(res.values(1:26), IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.unix.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.unix.dia.ref
new file mode 100644 (file)
index 0000000..7fb5efc
--- /dev/null
@@ -0,0 +1,57 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Bouncing_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [ 10.
+                11.3875
+                12.55
+                13.4875
+                14.2
+                14.6875
+                14.95
+                14.9875
+                14.8
+                14.3875
+                13.75
+                12.8875
+                11.8
+                10.4875
+                8.95
+                7.1875
+                5.2
+                2.9875
+                0.55
+                1.5647919
+                3.3538291
+                4.9178663
+                6.2569034
+                7.3709406
+                8.2599778
+                8.924015 ];
+IDA_time_ref = (0:.5:49.5)';
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.5"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_Bouncing_test_im.mo
+
+ Flat Modelica : TMPDIR/DDaskr_Bouncing_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Bouncing_test_im.c
+assert_checkalmostequal(res.values(1:26), IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.win.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Bouncing.win.dia.ref
new file mode 100644 (file)
index 0000000..8d275d0
--- /dev/null
@@ -0,0 +1,57 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Bouncing_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [ 10.
+                11.3875
+                12.55
+                13.4875
+                14.2
+                14.6875
+                14.95
+                14.9875
+                14.8
+                14.3875
+                13.75
+                12.8875
+                11.8
+                10.4875
+                8.95
+                7.1875
+                5.2
+                2.9875
+                0.55
+                1.5647919
+                3.3538291
+                4.9178663
+                6.2569034
+                7.3709406
+                8.2599778
+                8.924015 ];
+IDA_time_ref = (0:.5:49.5)';
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.5"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR\DDaskr_Bouncing_test_im.mo
+
+ Flat Modelica : TMPDIR\DDaskr_Bouncing_test_imf.mo
+ Simulation C code :TMPDIR\DDaskr_Bouncing_test_im.c
+assert_checkalmostequal(res.values(1:26), IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.tst
new file mode 100644 (file)
index 0000000..dea7daa
--- /dev/null
@@ -0,0 +1,100 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+ilib_verbose(0); //to remove ilib_* traces
+
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Hydraulics_test.zcos"));
+
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+
+IDA_val_ref = [ 0.2014730
+                0.2014678
+                0.2014630
+                0.2014586
+                0.2014545
+                0.2014507
+                0.2014472
+                0.2014440
+                0.201441
+                0.2014383
+                0.2014358
+                0.2014336
+                0.2014315
+                0.2014297
+                0.201428
+                0.2014265
+                0.2014252
+                0.2014240
+                0.2014229
+                0.2014220
+                0.2014211
+                0.2014204
+                0.2014198
+                0.2014192
+                0.2014188
+                0.2014184
+                0.2014181
+                0.2014178
+                0.2014176
+                0.2014174
+                0.2014173
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014173
+                0.2014174
+                0.2014174
+                0.2014175
+                0.2014176
+                0.2014178
+                0.2014179
+                0.201418
+                0.2014181
+                0.2014183
+                0.2014184
+                0.2014185
+                0.2014186
+                0.2014188
+                0.2014189
+                0.2014190
+                0.2014191
+                0.2014193
+                0.2014194
+                0.2014195
+                0.2014196
+                0.2014197
+                0.2014198
+                0.2014199
+                0.2014200
+                0.2014200
+                0.2014201
+                0.2014202
+                0.2014203
+                0.2014203
+                0.2014204
+                0.2014204 ];
+IDA_time_ref = (25.05:.05:50)';
+
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.05"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+
+assert_checkalmostequal(res.values($-67:$, :), IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.unix.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.unix.dia.ref
new file mode 100644 (file)
index 0000000..ccd02e8
--- /dev/null
@@ -0,0 +1,99 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Hydraulics_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [ 0.2014730
+                0.2014678
+                0.2014630
+                0.2014586
+                0.2014545
+                0.2014507
+                0.2014472
+                0.2014440
+                0.201441
+                0.2014383
+                0.2014358
+                0.2014336
+                0.2014315
+                0.2014297
+                0.201428
+                0.2014265
+                0.2014252
+                0.2014240
+                0.2014229
+                0.2014220
+                0.2014211
+                0.2014204
+                0.2014198
+                0.2014192
+                0.2014188
+                0.2014184
+                0.2014181
+                0.2014178
+                0.2014176
+                0.2014174
+                0.2014173
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014173
+                0.2014174
+                0.2014174
+                0.2014175
+                0.2014176
+                0.2014178
+                0.2014179
+                0.201418
+                0.2014181
+                0.2014183
+                0.2014184
+                0.2014185
+                0.2014186
+                0.2014188
+                0.2014189
+                0.2014190
+                0.2014191
+                0.2014193
+                0.2014194
+                0.2014195
+                0.2014196
+                0.2014197
+                0.2014198
+                0.2014199
+                0.2014200
+                0.2014200
+                0.2014201
+                0.2014202
+                0.2014203
+                0.2014203
+                0.2014204
+                0.2014204 ];
+IDA_time_ref = (25.05:.05:50)';
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.05"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
+
+ Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
+assert_checkalmostequal(res.values($-67:$, :), IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.win.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Hydraulics.win.dia.ref
new file mode 100644 (file)
index 0000000..e191fca
--- /dev/null
@@ -0,0 +1,99 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Hydraulics_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [ 0.2014730
+                0.2014678
+                0.2014630
+                0.2014586
+                0.2014545
+                0.2014507
+                0.2014472
+                0.2014440
+                0.201441
+                0.2014383
+                0.2014358
+                0.2014336
+                0.2014315
+                0.2014297
+                0.201428
+                0.2014265
+                0.2014252
+                0.2014240
+                0.2014229
+                0.2014220
+                0.2014211
+                0.2014204
+                0.2014198
+                0.2014192
+                0.2014188
+                0.2014184
+                0.2014181
+                0.2014178
+                0.2014176
+                0.2014174
+                0.2014173
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014172
+                0.2014173
+                0.2014174
+                0.2014174
+                0.2014175
+                0.2014176
+                0.2014178
+                0.2014179
+                0.201418
+                0.2014181
+                0.2014183
+                0.2014184
+                0.2014185
+                0.2014186
+                0.2014188
+                0.2014189
+                0.2014190
+                0.2014191
+                0.2014193
+                0.2014194
+                0.2014195
+                0.2014196
+                0.2014197
+                0.2014198
+                0.2014199
+                0.2014200
+                0.2014200
+                0.2014201
+                0.2014202
+                0.2014203
+                0.2014203
+                0.2014204
+                0.2014204 ];
+IDA_time_ref = (25.05:.05:50)';
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.05"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR\DDaskr_Hydraulics_test_im.mo
+
+ Flat Modelica : TMPDIR\DDaskr_Hydraulics_test_imf.mo
+ Simulation C code :TMPDIR\DDaskr_Hydraulics_test_im.c
+assert_checkalmostequal(res.values($-67:$, :), IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.tst
new file mode 100644 (file)
index 0000000..485319f
--- /dev/null
@@ -0,0 +1,72 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+ilib_verbose(0); //to remove ilib_* traces
+
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Platform_test.zcos"));
+
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+
+IDA_val_ref = [ 11.
+                11.
+                11.
+                7.1057377
+                4.2276434
+                3.7837192
+                2.9538128
+                5.8771057
+                6.3928885
+                7.7794415
+                8.7234525
+                8.1656745
+                5.4692996
+                4.119467
+                3.98566
+                4.5880334
+                6.2619705
+                7.460788
+                8.0411235
+                7.0316339
+                5.9103864
+                5.0870516
+                4.8350387
+                5.2736793
+                6.0991627
+                6.8411039
+                7.22751
+                6.791484
+                6.0262625
+                5.4580017
+                5.3754978
+                5.5876889
+                6.078075
+                6.5118764
+                6.6403792
+                6.4498018
+                6.0902532
+                5.7053277
+                5.6308887
+                5.8353956 ];
+IDA_time_ref = (0:.5:19.5)';
+
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.5"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+
+assert_checkalmostequal(res.values, IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.unix.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.unix.dia.ref
new file mode 100644 (file)
index 0000000..7f6b1b3
--- /dev/null
@@ -0,0 +1,71 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Platform_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [ 11.
+                11.
+                11.
+                7.1057377
+                4.2276434
+                3.7837192
+                2.9538128
+                5.8771057
+                6.3928885
+                7.7794415
+                8.7234525
+                8.1656745
+                5.4692996
+                4.119467
+                3.98566
+                4.5880334
+                6.2619705
+                7.460788
+                8.0411235
+                7.0316339
+                5.9103864
+                5.0870516
+                4.8350387
+                5.2736793
+                6.0991627
+                6.8411039
+                7.22751
+                6.791484
+                6.0262625
+                5.4580017
+                5.3754978
+                5.5876889
+                6.078075
+                6.5118764
+                6.6403792
+                6.4498018
+                6.0902532
+                5.7053277
+                5.6308887
+                5.8353956 ];
+IDA_time_ref = (0:.5:19.5)';
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.5"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
+
+ Flat Modelica : TMPDIR/DDaskr_Platform_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Platform_test_im.c
+assert_checkalmostequal(res.values, IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.win.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_Platform.win.dia.ref
new file mode 100644 (file)
index 0000000..bcf237a
--- /dev/null
@@ -0,0 +1,71 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_Platform_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [ 11.
+                11.
+                11.
+                7.1057377
+                4.2276434
+                3.7837192
+                2.9538128
+                5.8771057
+                6.3928885
+                7.7794415
+                8.7234525
+                8.1656745
+                5.4692996
+                4.119467
+                3.98566
+                4.5880334
+                6.2619705
+                7.460788
+                8.0411235
+                7.0316339
+                5.9103864
+                5.0870516
+                4.8350387
+                5.2736793
+                6.0991627
+                6.8411039
+                7.22751
+                6.791484
+                6.0262625
+                5.4580017
+                5.3754978
+                5.5876889
+                6.078075
+                6.5118764
+                6.6403792
+                6.4498018
+                6.0902532
+                5.7053277
+                5.6308887
+                5.8353956 ];
+IDA_time_ref = (0:.5:19.5)';
+scs_m.props.tol(6) = 100; // Solver
+scs_m.props.context = "per = 0.5"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR\DDaskr_Platform_test_im.mo
+
+ Flat Modelica : TMPDIR\DDaskr_Platform_test_imf.mo
+ Simulation C code :TMPDIR\DDaskr_Platform_test_im.c
+assert_checkalmostequal(res.values, IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.tst b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.tst
new file mode 100644 (file)
index 0000000..37b9c3a
--- /dev/null
@@ -0,0 +1,63 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+
+ilib_verbose(0); //to remove ilib_* traces
+
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_RLC_test.zcos"));
+
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+
+IDA_val_ref = [
+   0.0019611
+   0.0015823
+   0.0011972
+   0.0008074
+   0.0004144
+   0.0000198
+  -0.0003750
+  -0.0007682
+  -0.0011584
+  -0.0015440
+  -0.0019236
+  -0.0022955
+  -0.0026584
+  -0.0030108
+  -0.0033513
+  -0.0036786
+  -0.0039914
+  -0.0042884
+  -0.0045685
+  -0.0048305
+  -0.0050736
+  -0.0052965
+  -0.0054986
+  -0.0056790
+  -0.0058369
+  -0.0059719
+  -0.0060832
+  -0.0061706
+  -0.0062336
+  -0.0062720 ];
+IDA_time_ref = (1.7:.01:1.99)';
+
+scs_m.props.tol(6) = 101; // Solver
+scs_m.props.context = "L = .0001; per = 0.01;"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+
+assert_checkalmostequal(res.values, IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.unix.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.unix.dia.ref
new file mode 100644 (file)
index 0000000..ac2d21d
--- /dev/null
@@ -0,0 +1,62 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_RLC_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [
+   0.0019611
+   0.0015823
+   0.0011972
+   0.0008074
+   0.0004144
+   0.0000198
+  -0.0003750
+  -0.0007682
+  -0.0011584
+  -0.0015440
+  -0.0019236
+  -0.0022955
+  -0.0026584
+  -0.0030108
+  -0.0033513
+  -0.0036786
+  -0.0039914
+  -0.0042884
+  -0.0045685
+  -0.0048305
+  -0.0050736
+  -0.0052965
+  -0.0054986
+  -0.0056790
+  -0.0058369
+  -0.0059719
+  -0.0060832
+  -0.0061706
+  -0.0062336
+  -0.0062720 ];
+IDA_time_ref = (1.7:.01:1.99)';
+scs_m.props.tol(6) = 101; // Solver
+scs_m.props.context = "L = .0001; per = 0.01;"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_RLC_test_im.mo
+
+ Flat Modelica : TMPDIR/DDaskr_RLC_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_RLC_test_im.c
+assert_checkalmostequal(res.values, IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
diff --git a/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.win.dia.ref b/scilab/modules/scicos/tests/unit_tests/Solvers/IDA_RLC.win.dia.ref
new file mode 100644 (file)
index 0000000..9737f08
--- /dev/null
@@ -0,0 +1,62 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- ENGLISH IMPOSED -->
+//
+// <-- XCOS TEST -->
+//
+ilib_verbose(0); //to remove ilib_* traces
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/DDaskr_RLC_test.zcos"));
+// Redefining messagebox() to avoid popup
+prot = funcprot();
+funcprot(0);
+function messagebox(msg, msg_title)
+endfunction
+funcprot(prot);
+IDA_val_ref = [
+   0.0019611
+   0.0015823
+   0.0011972
+   0.0008074
+   0.0004144
+   0.0000198
+  -0.0003750
+  -0.0007682
+  -0.0011584
+  -0.0015440
+  -0.0019236
+  -0.0022955
+  -0.0026584
+  -0.0030108
+  -0.0033513
+  -0.0036786
+  -0.0039914
+  -0.0042884
+  -0.0045685
+  -0.0048305
+  -0.0050736
+  -0.0052965
+  -0.0054986
+  -0.0056790
+  -0.0058369
+  -0.0059719
+  -0.0060832
+  -0.0061706
+  -0.0062336
+  -0.0062720 ];
+IDA_time_ref = (1.7:.01:1.99)';
+scs_m.props.tol(6) = 101; // Solver
+scs_m.props.context = "L = .0001; per = 0.01;"; // Period, to get more varied results
+scicos_simulate(scs_m);   // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR\DDaskr_RLC_test_im.mo
+
+ Flat Modelica : TMPDIR\DDaskr_RLC_test_imf.mo
+ Simulation C code :TMPDIR\DDaskr_RLC_test_im.c
+assert_checkalmostequal(res.values, IDA_val_ref, [], 1d-7);
+assert_checkalmostequal(res.time, IDA_time_ref);
index fc0bd51..ee5af06 100644 (file)
@@ -14,16 +14,15 @@ assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Ka
 Info = scicos_simulate(scs_m, list());
 for i=2:4  // 'max step size' = 10^-i, precision
  // Start by updating the clock block period (sampling)
- scs_m.objs(7).model.rpar(1) = 5*(10^-i);
- scs_m.objs(8).model.rpar(1) = 5*(10^-i);
+ scs_m.objs(7).model.rpar(1) = 5*10^-i;
+ scs_m.objs(8).model.rpar(1) = 5*10^-i;
  // Modify solver and 'max step size' + run ImpRK + save results
- scs_m.props.tol(7) = 5*(10^-i); scs_m.props.tol(6) = 7;        // 'max step size' + solver
- scs_m.props.tol(2) = 1.0e-12;                                   // reltol
+ scs_m.props.tol(7) = 5*10^-i; scs_m.props.tol(6) = 7;        // 'max step size' + solver
+ scs_m.props.tol(2) = 1d-12;                                   // reltol
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end  // ImpRK
  rkval = res.values;   // Results
- time = res.time;      // Time
  // Modify solver and reltol + run CVode + save results
- scs_m.props.tol(6) = 4; scs_m.props.tol(2) = 1.0e-15;
+ scs_m.props.tol(6) = 4; scs_m.props.tol(2) = 1d-15;
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end
  cvval = res.values;
  // Compare results
index 12b6431..0b06b97 100644 (file)
@@ -17,18 +17,17 @@ Info = scicos_simulate(scs_m, list());
 for i=2:4  // 'max step size' = 10^-i, precision
 
  // Start by updating the clock block period (sampling)
- scs_m.objs(7).model.rpar(1) = 5*(10^-i);
- scs_m.objs(8).model.rpar(1) = 5*(10^-i);
+ scs_m.objs(7).model.rpar(1) = 5*10^-i;
+ scs_m.objs(8).model.rpar(1) = 5*10^-i;
 
  // Modify solver and 'max step size' + run ImpRK + save results
- scs_m.props.tol(7) = 5*(10^-i); scs_m.props.tol(6) = 7;        // 'max step size' + solver
- scs_m.props.tol(2) = 1.0e-12;                                   // reltol
+ scs_m.props.tol(7) = 5*10^-i; scs_m.props.tol(6) = 7;        // 'max step size' + solver
+ scs_m.props.tol(2) = 1d-12;                                   // reltol
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end  // ImpRK
  rkval = res.values;   // Results
- time = res.time;      // Time
 
  // Modify solver and reltol + run CVode + save results
- scs_m.props.tol(6) = 4; scs_m.props.tol(2) = 1.0e-15;
+ scs_m.props.tol(6) = 4; scs_m.props.tol(2) = 1d-15;
  try scicos_simulate(scs_m, Info); catch disp(lasterror()); end
  cvval = res.values;
 
index 45ffae4..1bf820d 100644 (file)
 // Import diagram
 assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
 // Set solver to LSodar + run LSodar + save results
-scs_m.props.tol(6) = 0;                                         // Set solver to LSodar
+scs_m.props.tol(6) = 0;                                    // Set solver to LSodar
 try scicos_simulate(scs_m); catch disp(lasterror()); end; // Run LSodar
 lsodarval = res.values;  // Results
-time = res.time;         // Time
 // Set solver to CVode BDF/Newton + run + save results
 scs_m.props.tol(6) = 1;
 try scicos_simulate(scs_m); catch disp(lasterror()); end;
@@ -30,3 +29,23 @@ stdeviation = st_deviation(compa);
 assert_checktrue(maxi <= 1d-8);
 assert_checktrue(mea <= 1d-8);
 assert_checktrue(stdeviation <= 1d-8);
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Controller.zcos"));
+// Set solver to LSodar + run LSodar + save results
+scs_m.props.tol(6) = 0;                                    // Set solver to LSodar
+try scicos_simulate(scs_m); catch disp(lasterror()); end; // Run LSodar
+lsodarval = res.values;  // Results
+// Set solver to CVode BDF/Newton + run + save results
+scs_m.props.tol(6) = 1;
+try scicos_simulate(scs_m); catch disp(lasterror()); end;
+cvval = res.values;
+// Compare results
+compa = abs(lsodarval-cvval);
+// Extract mean, standard deviation, maximum
+mea = mean(compa);
+[maxi, indexMaxi] = max(compa);
+stdeviation = st_deviation(compa);
+// Verifying closeness of the results
+assert_checktrue(maxi <= 10^-4);
+assert_checktrue(mea <= 10^-4);
+assert_checktrue(stdeviation <= 10^-4);
index 982b28a..044c075 100644 (file)
 assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Kalman.zcos"));
 
 // Set solver to LSodar + run LSodar + save results
-scs_m.props.tol(6) = 0;                                         // Set solver to LSodar
+scs_m.props.tol(6) = 0;                                    // Set solver to LSodar
 try scicos_simulate(scs_m); catch disp(lasterror()); end; // Run LSodar
 lsodarval = res.values;  // Results
-time = res.time;         // Time
 
 // Set solver to CVode BDF/Newton + run + save results
 scs_m.props.tol(6) = 1;
@@ -36,3 +35,30 @@ stdeviation = st_deviation(compa);
 assert_checktrue(maxi <= 1d-8);
 assert_checktrue(mea <= 1d-8);
 assert_checktrue(stdeviation <= 1d-8);
+
+
+// Import diagram
+assert_checktrue(importXcosDiagram("SCI/modules/xcos/tests/unit_tests/Solvers/Controller.zcos"));
+
+// Set solver to LSodar + run LSodar + save results
+scs_m.props.tol(6) = 0;                                    // Set solver to LSodar
+try scicos_simulate(scs_m); catch disp(lasterror()); end; // Run LSodar
+lsodarval = res.values;  // Results
+
+// Set solver to CVode BDF/Newton + run + save results
+scs_m.props.tol(6) = 1;
+try scicos_simulate(scs_m); catch disp(lasterror()); end;
+cvval = res.values;
+
+// Compare results
+compa = abs(lsodarval-cvval);
+
+// Extract mean, standard deviation, maximum
+mea = mean(compa);
+[maxi, indexMaxi] = max(compa);
+stdeviation = st_deviation(compa);
+
+// Verifying closeness of the results
+assert_checktrue(maxi <= 10^-4);
+assert_checktrue(mea <= 10^-4);
+assert_checktrue(stdeviation <= 10^-4);
diff --git a/scilab/modules/xcos/tests/unit_tests/Solvers/Cont-Disc.zcos b/scilab/modules/xcos/tests/unit_tests/Solvers/Cont-Disc.zcos
new file mode 100644 (file)
index 0000000..66dd6f8
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/Solvers/Cont-Disc.zcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/Solvers/Controller.zcos b/scilab/modules/xcos/tests/unit_tests/Solvers/Controller.zcos
new file mode 100644 (file)
index 0000000..93e2e3f
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/Solvers/Controller.zcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/Solvers/Temperature_Controller.zcos b/scilab/modules/xcos/tests/unit_tests/Solvers/Temperature_Controller.zcos
new file mode 100644 (file)
index 0000000..67ff29b
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/Solvers/Temperature_Controller.zcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/Solvers/Watertank.zcos b/scilab/modules/xcos/tests/unit_tests/Solvers/Watertank.zcos
new file mode 100644 (file)
index 0000000..567e37b
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/Solvers/Watertank.zcos differ