State of JPattern implementation for ode15S solver

Dear Octave Developers and Users,

Could someone share what is the status of JPattern implementation in GNU Octave. I referred to the old post dated in 2016 ( say JPattern option is not supported. My code that calls ode15s with JPattern option was written in MATLAB and when I ran my code using octave 5.2 (installed with flatpak), the code taking very longtime to complete the job as such JPattern is not implemented.

I appreciate your inputs. Thanks in advance.


@Chem please stay in this topic with your question. Opening it many more times just annoys other list readers and me.

What code do you try to run? Please post it here. You can study the solver by typing

edit ode15s


In Octave 5.x and 6.x the implementation of sparse jacobians is very limited : the jacobian is treated as sparse but
the amount of memory allocated is sufficient to accomodate a full jacobian of the same size.
As a result the sparse jacobian is taken advantage in terms of speed (a bit) but not much in terms of memory footprint.

In Octave 7.x the implementation of the sparse jacobian is a bit better as a sparse matrix is created from the
beginning and memory is allocated only as needed. Yet the matrix is assembled from scratch at each time step
which is time consuming.

The 7.1 release is at least six months away (very optimistically) so this behaviour may still be improved before the release,
including possibly implementation of JPattern, but definitely there will be no improvement in time for the 6.1 release as new changes
have been pushed in the 7.0 branch until now.

As for speed differences with Matlab, it’s most likely not all dependent on the JPattern option, but rather mostly on the
Matlab Just in Time (JIT) compiler which significantly speeds up the evaluation of the code used to compute the jacobian and residual
at each iteration. That feature is missing in Octave and I don’t know of any plans to finish the current very limited implementation.

Hope this helps,

@siko1056 Noted. Thanks. Sorry for the inconvenience caused. I will keep in mind your advise.

@cdf Greatly appreciate your time for providing the details on status of the Jacobian implementation. Very helpful to understand the current capabilities of the solver and possible directions to think in improving it.