SciML / ODE.jl

Assorted basic Ordinary Differential Equation solvers for scientific machine learning (SciML). Deprecated: Use DifferentialEquations.jl instead.
Other
105 stars 49 forks source link

WIP: Rosenbrock(-W) methods #72

Closed mauro3 closed 6 years ago

mauro3 commented 9 years ago

This is work in progress of me and @jedbrown to implement Rosenbrock(-W) methods. It uses a different interface to what ODE.jl has: implicit in-place functions. Works for ODE and DAEs. At the moment two methods are implemented: Rodas3 and RA34PW2.

This will take some time until it is ready to be considered for a merge. But it works now (see examples/ folder) and might be of use to someone. The simple benchmarks in the example folder suggests that these solvers can be faster and more memory efficient than DASSL and ode23s, e.g. van der Pol:

ode23s with jacobian:
elapsed time: 0.025410477 seconds (25_194_952 bytes allocated)
ode_rosw with jacobian:
elapsed time: 0.00535883 seconds  (2_462_312 bytes allocated)
ode_rosw with numeric jacobian:
elapsed time: 0.013636325 seconds (9_859_344 bytes allocated)
coveralls commented 9 years ago

Coverage Status

Coverage decreased (-9.1%) to 87.65% when pulling c48d9f7114f37af4568a2ef9601c978b7053e337 on mauro3:m3/rosw into 162c881430f51797fb91607770f55df554a4df5f on JuliaLang:master.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-6.0%) to 87.65% when pulling 8d8ad658a86c02bf6ca0c65d0abcdecdce79d477 on mauro3:m3/rosw into 4058120e7d553c85dfbfc9fce33c7a1adbecb2be on JuliaLang:master.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-5.85%) to 87.8% when pulling 3bf2ce0d5b62324ae769ecec218f8998a8c6d828 on mauro3:m3/rosw into 4058120e7d553c85dfbfc9fce33c7a1adbecb2be on JuliaLang:master.

mauro3 commented 9 years ago

Large sparse Jacobians can now be numerically approximated using coloring with https://github.com/mauro3/MatrixColorings.jl. The bruss1d.jl example shows it in action.

pwl commented 9 years ago

Wow, the performance boost is really impressive. What is the increase in performance for smaller systems? Do you think it could be used in DASSL?

mauro3 commented 9 years ago

Thanks :-)

The coloring only really helps for sparse Jacobians (try setting N=5000 in the bruss1d example and use the numeric Jacobian in DASSL). I suspect small sparse systems may still be slower. You should be able to pretty much just plug it into DASSL except that I used in-place functions, see: https://github.com/mauro3/ODE.jl/blob/m3/rosw/src/rosw.jl#L465