[SciPy-user] fsolve with sparse matrices

Jan Wicijowski janislaw@o2...
Fri Apr 17 10:29:29 CDT 2009


Hi all!

I would like to ask you, if anyone was ever confronted with solving
nonlinear system with scipy.optimize.fsolve, with huge no. of equations,
say 10000.

The usual approach fails, because the size of jacobian matrix is
proportional to the square of equations number. The paging kills my OS.

In my problem, which is solving a nonlinear electrical circuit, the matrix
is mostly zeros, which has immediately led me to trying sparse matrices.

The first obstacle was numpy.atleast_1d contained in
scipy.optimize.minpack.check_func - instead of preserving sparse matrix as
is, it has a suprising behaviour of boxing the matrix in a list. This may
be a bug, but I may post it elsewhere.

Injecting custom function instead of scipy.optimize.minpack.check_func
didn't work as well with fsolve. This wasn't surprising, as I guessed,
that FORTRAN hybrj won't be able to deal with interfacing with scipy
matrices.

So, am I left with rewriting the original FORTRAN hybrj source to python,
or is there somebody, who dealt with such problem?

Regards,
Jan Wicijowski


More information about the SciPy-user mailing list