Sundials differential equations solvers features

Hello Scilab users,

We would like to have your impressions about forthcoming features. They are mainly about differential equations, differential-algebraic and non-linear systems of equations and their solvers as implemented by the recently awarded SUNDIALS solver suite. Preview builds of Scilab allowing to use all the solvers and their features are available at (look for “Sundials/Colpack preview builds”). The help pages (available online) and demos should give you a good idea of the user-friendly features that are available, which can be compared to the actual features of Scilab solvers such as ode() and dassl(). The underlying Sundials library also allows to consider large scale systems of stiff equations (typically coming from discretization of partial differential equations) by specifying sparse Jacobians or sparsity patterns allowing efficient estimation thereof.

This is the occasion of thinking about revamping the differential equations module, which could embrace theses new solvers and the actual ones, in a unified API, which could also propose new solvers. So let us start the discussion !


Hello Stephane, hello all,

I’m sharing feedback for discussion around these new powerful features (solvers) since I’ve been playing around the last releases, from previous discussion. In particular, it is about combined use of Scilab_6.1.2_Sundial::cvode() and atoms module fmincon with dependencies sci-ipopt and scicolpack. I installed manually from sources fmincon1.0.4 because of failures with recent 1.0.5 or former 1.0.3 compiled build from ATOMS with Scilab_6.1.2_Sundial build.

Start SciIPOpt 1.3.2: load gateways, help, demos.
Start SciColPack: load macros, dependencies, gateways, help, demos.
Start Fmincon 1.0.4: loading macros, help, demos.

“Windows 10 10.0”
“OpenJDK Runtime Environment (build 1.8.0_292-b10)”
“OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)”
“Oracle Corporation”

With experimental data from tests in outdoor environment (~10000 timesteps), I checked that simulation with cvode was about 2x faster than ode() and was happy with that. In addition I noticed a strong limitation in the simulation of my custom dynamic model, essentially about linear interpolation of time-varying input data for the model (I guess it is quite common situation for such application ) with interp1(t,myvectorinputdata,tt), “linear” or “nearest”). At those times, the long computation time prevented me to run constraint optimization for parameters fitting.
I just realized recently that I could replace time consuming


interpolation by:

  • “nearest” :
function r= funmyvectorinputdata(tt)
r= myvectorinputdata(max(find(tt>=t)

like a basic step function passed to objective function in cvode() call
~1000 times faster than interp1

  • “linear”
function r= funmyvectorinputdata(tt)
r= interpln([t;myvectorinputdata],tt)

native routine 100 times faster than interp1

It made parameters fitting with fmincon just feasible in my case !
I used fmincon module in comparison with leastsq on constraint optimization purposes. Not detailed comparison yet but already: interface fmincon module with structs for settings is leading to much cleaner and safer code is enough to switch for this feature from my perspective.

Thank you for the huge work around all these features, I hope it can enter soon in next Scilab release.


Thanks for your report.

Concerning the problem with fmincon 1.0.5 : it is caused by colpack being already a Scilab module in the custom “Sundials” build you are using. The fmincon 1.0.5 atoms module is packaged for being used in the latest official Scilab builds and has the atoms scicolpack as a dependency. But you were able to make all these (sundials, fmincon, colpack) work together, that’s great. In a near future Colpack and Sundials will be Scilab modules and the next version of fmincon won’t depend on atoms scicolpack.