
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 and d^2G/dp^2, where p=[p1,p2] for
     G = int_t0^tB0 g(t,p,y) dt
     g(t,p,y) = y3


---------------------------------------------------------
Forward integration
---------------------------------------------------------

     G:      2.5042e+01
   dG/dp:   -1.3753e+02   4.1552e-04

---------------------------------------------------------
Backward integration 
---------------------------------------------------------

   dG/dp:   -1.3753e+02   4.1552e-04   (from backward pb. 1)
   dG/dp:   -1.3753e+02   4.1552e-04   (from backward pb. 2)

   H = d2G/dp2:
        (1)            (2)
    4.4243e+03   -2.7779e-03
   -2.7779e-03   -2.4173e-08

---------------------------------------------------------
Finite Differences ( dp1=1.0e-03 and dp2 = 2.5e+02 )
---------------------------------------------------------


   dG/dp:   -1.3534e+02    4.1250e-04   (fwd FD)
            -1.3977e+02    4.1855e-04   (bck FD)
            -1.3755e+02    4.1552e-04   (cntr FD)

  H(1,1):    4.4247e+03
  H(2,2):   -2.4174e-08
