Look into Sundials for time integration
https://computing.llnl.gov/projects/sundials