
Adjoint Sensitivity Example for Chemical Kinetics
-------------------------------------------------

ODE: dy1/dt = -p1*y1 + p2*y2*y3
     dy2/dt =  p1*y1 - p2*y2*y3 - p3*(y2)^2
     dy3/dt =  p3*(y2)^2

Find dG/dp for
     G = int_t0^tB0 g(t,p,y) dt
     g(t,p,y) = y3


Create and allocate CVODES memory for forward runs
Forward integration ... done (ncheck = 5)
--------------------------------------------------------
G:            3.9983e+07 
--------------------------------------------------------

Final Statistics:
Current time                 = 40090396.38262068
Steps                        = 766
Error test fails             = 37
NLS step fails               = 0
Initial step size            = 4.712160915387242e-10
Last step size               = 2056516.139492778
Current step size            = 2056516.139492778
Last method order            = 5
Current method order         = 5
Stab. lim. order reductions  = 0
RHS fn evals                 = 1057
NLS iters                    = 1056
NLS fails                    = 0
NLS iters per step           = 1.378590078328982
LS setups                    = 125
Jac fn evals                 = 16
LS RHS fn evals              = 0
Prec setup evals             = 0
Prec solves                  = 0
LS iters                     = 0
LS fails                     = 0
Jac-times setups             = 0
Jac-times evals              = 0
LS iters per NLS iter        = 0
Jac evals per NLS iter       = 0.01515151515151515
Prec evals per NLS iter      = 0
Root fn evals                = 0
Quad fn evals                = 767
Quad error test fails        = 0

Create and allocate CVODES memory for backward run
Backward integration from tB0 =   4.0000e+07

--------------------------------------------------------
returned t:   4.0000e+01
tout:         4.0000e+01
lambda(t):    3.9967e+07   3.9967e+07   3.9967e+07
y(t):         7.1583e-01   9.1855e-06   2.8416e-01
--------------------------------------------------------
--------------------------------------------------------
returned t:   0.0000e+00
lambda(t0):   3.9967e+07   3.9967e+07   3.9967e+07
y(t0):        1.0000e+00   0.0000e+00   0.0000e+00
dG/dp:        7.6842e+05  -3.0691e+00   5.1144e-04
--------------------------------------------------------

Final Statistics:
Current time                 = 0
Steps                        = 212
Error test fails             = 1
NLS step fails               = 0
Initial step size            = -9.424321830774485e-08
Last step size               = -3.814693791377326
Current step size            = -3.814693791377326
Last method order            = 4
Current method order         = 4
Stab. lim. order reductions  = 0
RHS fn evals                 = 252
NLS iters                    = 251
NLS fails                    = 0
NLS iters per step           = 1.183962264150943
LS setups                    = 76
Jac fn evals                 = 4
LS RHS fn evals              = 0
Prec setup evals             = 0
Prec solves                  = 0
LS iters                     = 0
LS fails                     = 0
Jac-times setups             = 0
Jac-times evals              = 0
LS iters per NLS iter        = 0
Jac evals per NLS iter       = 0.01593625498007968
Prec evals per NLS iter      = 0
Root fn evals                = 0
Quad fn evals                = 245
Quad error test fails        = 32

Re-initialize CVODES memory for backward run
Backward integration from tB0 =   5.0000e+01

--------------------------------------------------------
returned t:   4.0000e+01
tout:         4.0000e+01
lambda(t):    2.8959e-01   1.7624e+00   9.3567e+00
y(t):         7.1583e-01   9.1855e-06   2.8416e-01
--------------------------------------------------------
--------------------------------------------------------
returned t:   0.0000e+00
lambda(t0):   8.4190e+00   1.6097e+01   1.6097e+01
y(t0):        1.0000e+00   0.0000e+00   0.0000e+00
dG/dp:        1.7341e+02  -5.0590e-04   8.4321e-08
--------------------------------------------------------

Final Statistics:
Current time                 = 0
Steps                        = 186
Error test fails             = 13
NLS step fails               = 0
Initial step size            = -5.132424409507535e-10
Last step size               = -0.0002691205025119647
Current step size            = -0.0002691205025119647
Last method order            = 4
Current method order         = 4
Stab. lim. order reductions  = 0
RHS fn evals                 = 261
NLS iters                    = 258
NLS fails                    = 4
NLS iters per step           = 1.387096774193548
LS setups                    = 44
Jac fn evals                 = 8
LS RHS fn evals              = 0
Prec setup evals             = 0
Prec solves                  = 0
LS iters                     = 0
LS fails                     = 0
Jac-times setups             = 0
Jac-times evals              = 0
LS iters per NLS iter        = 0
Jac evals per NLS iter       = 0.0310077519379845
Prec evals per NLS iter      = 0
Root fn evals                = 0
Quad fn evals                = 189
Quad error test fails        = 0
