Processing math: 100%

cvode_with_initial_sensitivity.py

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

This example shows how to use Assimulo and CVode for simulating sensitivities for initial conditions.

˙y1=(k01+k21+k31)y1+k12y2+k13y3+b1˙y2=k21y1(k02+k12)y2˙y3=k31y1k13y3

with the parameter dependent inital conditions y1(0)=0,y2(0)=0,y3(0)=0 . The initial values are taken as parameters p1,p2,p3 for the computation of the sensitivity matrix, see http://sundials.2283335.n4.nabble.com/Forward-sensitivities-for-initial-conditions-td3239724.html

on return:

  • exp_mod problem instance
  • exp_sim solver instance

Final Run Statistics: Example: Computing Sensitivities 

 Number of steps                                       : 139
 Number of function evaluations                        : 164
 Number of Jacobian evaluations                        : 3
 Number of function eval. due to Jacobian eval.        : 9
 Number of error test failures                         : 2
 Number of nonlinear iterations                        : 160
 Number of nonlinear convergence failures              : 0
 Number of sensitivity evaluations                     : 164
 Number of function eval. due to sensitivity eval.     : 984
 Number of sensitivity nonlinear iterations            : 0
 Number of sensitivity nonlinear convergence failures  : 0
 Number of sensitivity error test failures             : 0

Sensitivity options:

 Method                   : SIMULTANEOUS
 Difference quotient type : CENTERED
 Suppress Sens            : False

Solver options:

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

Simulation interval    : 0.0 - 400.0 seconds.
Elapsed simulation time: 0.0260779857635 seconds.
_images/cvode_with_initial_sensitivity.png

Note

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