I am curently using R package nleqslv for solving a non-linear system of equations with 300 variables. I need to scale this to the system with ~50k variables and naturally this does not scale very well, since the jacobian then takes up to ~30G of RAM, and I do not have access to a machine with such amount of RAM. The jacobian is a sparse matrix, but nleqslv does not have the ability to exploit this feature.

What are available solvers (preferably open source) which can exploit sparsity of the jacobian and can work with large systems?

I've searched around and found lots of software for optimization problems, which does not exactly suit me, since I am reluctant to minimize the sum of squares of the system. I can always hack nleqslv code to use sparse matrices, but first I would like to now what are available ready-made solutions.

  • 1
    $\begingroup$ Minimizing the sum of squares of the residuals is generally a more robust strategy than trying to solve a system of nonlinear equations. When there's real data involved, it's quite common that there is no exact solution to the system of equations. $\endgroup$ – Brian Borchers May 22 '14 at 18:33
  • $\begingroup$ Well in my particular application, the solution exists and non-linear equation solver finds the solution, contrary to the optimization solver which minimizes the sum of squares. $\endgroup$ – mpiktas May 23 '14 at 6:26

PETSc is a solver package that has interfaces to a number of different methods for solving sparse linear systems, and many different nonlinear equation solvers (that make use of the linear solvers as subroutines). Although the framework is involved, the flexibility it gives you is worth it.

Taking advantage of sparsity and possibly parallelism (if you can decompose the vectors and matrices in your problem appropriately) should help mitigate the memory bottleneck you mentioned because a sparse representation should require less memory, and parallelism should enable you to use memory across multiple machines, with should increase the amount of memory you can use for your simulation runs.

  • $\begingroup$ Thanks, it seems like something I was looking for. Are there any alternatives, i.e. competing frameworks? $\endgroup$ – mpiktas May 22 '14 at 13:19
  • 2
    $\begingroup$ @mpiktas You should consider Trilinos and its NOX package. Trilinos is THE classical alternative to PETSc. Which one to choose depends on your needs and your taste! $\endgroup$ – Dr_Sam May 22 '14 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.