ida_with_jac_spgmr.py

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

An example for IDA 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 &= 0\\ \dot y_2 -9.82 &= 0\end{split}\]

on return:

  • imp_mod problem instance
  • imp_sim solver instance

Final Run Statistics: Example using the Jacobian Vector product 

 Number of steps                                 : 24
 Number of function evaluations                  : 25
 Number of Jacobian*vector evaluations           : 20
 Number of function eval. due to Jacobian eval.  : 0
 Number of error test failures                   : 0
 Number of nonlinear iterations                  : 25
 Number of nonlinear convergence failures        : 0

Solver options:

 Solver                       : IDA (BDF)
 Maximal order                : 5
 Suppressed algebr. variables : False
 Tolerances (absolute)        : 1e-05
 Tolerances (relative)        : 1e-05

Simulation interval    : 0.0 - 5.0 seconds.
Elapsed simulation time: 0.0134358406067 seconds.
_images/ida_with_jac_spgmr.png

Note

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