Sparse support in IDA

4 posts / 0 new
Last post
w1th0utnam3
Offline
Joined: 2017-02-16
Sparse support in IDA

I want to solve a decently sized DAE system (up to 1e4 equations) with IDA which is too slow (and of course memory consuming) using dense linear algebra operations on the Jacobian. Therefore I either need to use the direct sparse solver module or the iterative methods of SUNDIALS. I successfully used the former with KINSOL in a C++ project with 1e5 (and more) equations but I have to rely on Python for my current project and the direct solvers are currently not usable in Assimulo (as far as I know?). Unfortunenately I can't get the GMRES solver to work either, probably because of the lack of preconditioning which is currently also not available for IDA.

At the moment I'm using IDA because of a singular mass matrix. However the system can be approximated using a modified non-singular mass matrix and therefore my next step will be trying to solve the modified system with CVODE. Do you have any other ideas regarding solving ODE/DAE systems with sparse Jacobian matrices in Python?

fredrik
Online
Joined: 2011-08-26
I haven't tried this myself,

I haven't tried this myself, but I think it should be relatively straightforward to install SuperLU and link it with Assimulo yourself and use it with SUNDIALS. If that sounds too difficult, there are plans to distribute JModelica.org (and PyFMI/Assimulo) with SuperLU (direct sparse solver) included in the not-too-distant future (I would guess some time during the fall), if waiting is an option.

w1th0utnam3
Offline
Joined: 2017-02-16
-

Thanks for the reply.

As I didn't want to spend too much time on setting up a build environment for Assimulo (on Windows) I quickly wrote some basic CVODE/IDA bindings using ctypes to check out the performance of SuperLU_MT.

Nevertheless it is great to hear that this functionality will be part of Assimulo in the future. Additionally I would appreciate it if more (preferably all) options from the original SUNDIALS library were made available for IDA and CVODE in Assimulo (e.g. the other iterative solvers and sparse support in general for IDA).

Overall I think Assimulo is a great library to quickly try out different solver configurations for a problem. I would gladly help implementing these missing features; maybe even add support for ARKode if this is not in conflict with project plans? Unfortunately I don’t have any free time at all to spend on contributing to the project for the next 1-2 months. But I’ll check again after this period.

BTW: I can’t use the Anaconda Assimulo packages from conda-forge (https://anaconda.org/conda-forge/assimulo) for Windows 64-bit, Python 3.6 at the moment. An exception occurs that a solver (I think RADAU) could not be found even though I don’t use the solver. If I remember correctly the same exception occurred when trying to use the package for Python 3.5. I have to use a package from another repository (https://anaconda.org/chria/assimulo/files) for Python 3.5 to get it to work. Is this a known bug or should I report this separately on the conda-forge github repository?

 

w1th0utnam3
Offline
Joined: 2017-02-16
Assimulo, Python 3.6 Windows 64-bit error

This is the error I mentioned earlier:

    import assimulo.solvers
  File "X:\Miniconda3\lib\site-packages\assimulo\solvers\__init__.py", line 23, in <module>
    from .radau5 import Radau5ODE, Radau5DAE, _Radau5ODE, _Radau5DAE
  File "X:\Miniconda3\lib\site-packages\assimulo\solvers\radau5.py", line 29, in <module>
    from assimulo.lib import radau5
ImportError: cannot import name 'radau5'

Login or register to post comments