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

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

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


Create and allocate IDAS memory for forward runs
Forward integration ...
--------------------------------------------------------
G:            4.0000e+10 
--------------------------------------------------------

Final Statistics:
Current time                 = 41445862940.10391
Steps                        = 774
Error test fails             = 8
NLS step fails               = 0
Initial step size            = 2.165063509460035e-11
Last step size               = 8711558430.605959
Current step size            = 8711558430.605959
Last method order            = 2
Current method order         = 2
Residual fn evals            = 1134
IC linesearch backtrack ops  = 0
NLS iters                    = 1134
NLS fails                    = 0
NLS iters per step           = 1.465116279069767
LS setups                    = 80
Jac fn evals                 = 80
LS residual 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.07054673721340388
Prec evals per NLS iter      = 0
Root fn evals                = 0
Quad fn evals                = 775
Quad error test fails        = 0

Create and allocate IDAS memory for backward run
Backward integration ...
--------------------------------------------------------
tB0:          4.0000e+10
dG/dp:        1.4878e+06  -5.9467e+00   9.9112e-04
lambda(t0):  -2.4998e+01   1.6442e-03   1.0000e+00
--------------------------------------------------------

Final Statistics:
Current time                 = 0
Steps                        = 1272
Error test fails             = 106
NLS step fails               = 0
Initial step size            = -6.123724356957945e-09
Last step size               = -5.635092667470378e-06
Current step size            = -1.127018533494076e-05
Last method order            = 5
Current method order         = 5
Residual fn evals            = 2033
IC linesearch backtrack ops  = 0
NLS iters                    = 2033
NLS fails                    = 2
NLS iters per step           = 1.598270440251572
LS setups                    = 197
Jac fn evals                 = 197
LS residual 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.09690113133300542
Prec evals per NLS iter      = 0
Root fn evals                = 0
Quad fn evals                = 1285
Quad error test fails        = 12

Re-initialize IDAS memory for backward run
--------------------------------------------------------
tB0:          5.0000e+01
dG/dp:        1.7341e+02  -5.0592e-04   8.4323e-08
lambda(t0):  -7.6780e+00  -1.2758e-04   1.0000e+00
--------------------------------------------------------

Final Statistics:
Current time                 = 0
Steps                        = 428
Error test fails             = 41
NLS step fails               = 0
Initial step size            = -6.123731096262232e-09
Last step size               = -1.584378912226939e-05
Current step size            = -1.584378912226939e-05
Last method order            = 3
Current method order         = 3
Residual fn evals            = 701
IC linesearch backtrack ops  = 0
NLS iters                    = 699
NLS fails                    = 0
NLS iters per step           = 1.63785046728972
LS setups                    = 68
Jac fn evals                 = 68
LS residual 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.09728183118741059
Prec evals per NLS iter      = 0
Root fn evals                = 0
Quad fn evals                = 429
Quad error test fails        = 0
