cvode_with_jac_spgmr.py

assimulo.examples.cvode_with_jac_spgmr.run_example(with_plots=True)[source]

An example for CVode with scaled preconditioned GMRES method as a special linear solver. Note, how the operation Jacobian times vector is provided.

ODE:

\[\begin{split}\dot y_1 &= y_2 \\ \dot y_2 &= -9.82\end{split}\]

on return:

  • exp_mod problem instance
  • exp_sim solver instance

Final Run Statistics: Example using the Jacobian Vector product 

 Number of steps                                 : 18
 Number of function evaluations                  : 22
 Number of Jacobian*vector evaluations           : 14
 Number of function eval. due to Jacobian eval.  : 0
 Number of error test failures                   : 0
 Number of nonlinear iterations                  : 18
 Number of nonlinear convergence failures        : 0

Solver options:

 Solver                   : CVode
 Linear multistep method  : BDF
 Nonlinear solver         : Newton
 Linear solver type       : SPGMR
 Maximal order            : 5
 Tolerances (absolute)    : 1e-05
 Tolerances (relative)    : 1e-05

Simulation interval    : 0.0 - 5.0 seconds.
Elapsed simulation time: 0.00798606872559 seconds.
_images/cvode_with_jac_spgmr.png

Note

Press [source] (to the top right) to view the example.