Direct and Adjoint Sensitivity Analysis of Chemical Kinetic Systems With
Total Page:16
File Type:pdf, Size:1020Kb
ARTICLE IN PRESS Atmospheric Environment 37 (2003) 5083–5096 Direct and adjoint sensitivity analysis ofchemical kinetic systems with KPP: Part I—theory and software tools Adrian Sandua, Dacian N. Daescub, Gregory R. Carmichaelc,* a Department of Computer Science, Virginia Polytechnic Institute and State University, 660 McBryde Hall, Blacksburg, VA 24061, USA b Institute for Mathematics and its Applications, University of Minnesota, 400 Lind Hall, 207 Church Street S.E., Minneapolis, MN 55455, USA c Center for Global and Regional Environmental Research, University of Iowa, 204 IATL, Iowa City, IA 52242-1297, USA Received 26 January 2003; accepted 7 August 2003 Abstract The analysis ofcomprehensive chemical reactions mechanisms, parameter estimation techniques, and variational chemical data assimilation applications require the development of efficient sensitivity methods for chemical kinetics systems. The new release (KPP-1.2) of the kinetic preprocessor (KPP) contains software tools that facilitate direct and adjoint sensitivity analysis. The direct-decoupled method, built using BDF formulas, has been the method of choice for direct sensitivity studies. In this work, we extend the direct-decoupled approach to Rosenbrock stiff integration methods. The need for Jacobian derivatives prevented Rosenbrock methods to be used extensively in direct sensitivity calculations; however, the new automatic and symbolic differentiation technologies make the computation of these derivatives feasible. The direct-decoupled method is known to be efficient for computing the sensitivities of a large number ofoutput parameters with respect to a small number ofinput parameters. The adjoint modeling is presented as an efficient tool to evaluate the sensitivity of a scalar response function with respect to the initial conditions and model parameters. In addition, sensitivity with respect to time-dependent model parameters may be obtained through a single backward integration ofthe adjoint model. KPP softwaremay be used to completely generate the continuous and discrete adjoint models taking fulladvantage ofthe sparsity ofthe chemical mechanism. Flexible direct-decoupled and adjoint sensitivity code implementations are achieved with minimal user intervention. In a companion paper, we present an extensive set of numerical experiments that validate the KPP software tools for several direct/adjoint sensitivity applications, and demonstrate the efficiency of KPP-generated sensitivity code implementations. r 2003 Elsevier Ltd. All rights reserved. Keywords: Chemical kinetics; Sensitivity analysis; Direct-decoupled method; Adjoint model 1. Introduction nonlinear differential equations dy 0 0 0 F The mathematical formulation of chemical reaction ¼ f ðt; y; pÞ; yðt Þ¼y ; t ptpt : ð1Þ dt mechanisms is given by a coupled system ofstiff The solution yðtÞARn represents the time evolution of the concentrations ofthe species considered in the *Corresponding author. Tel.: +1-319-335-3333; fax: +1- chemical mechanism starting from the initial configura- 0 319-335-3337. tion y : Throughout this work vectors will be repre- T E-mail addresses: [email protected] (A. Sandu), daescu@ sented in column format and an upper script ðÁÞ will ima.umn.edu (D.N. Daescu), [email protected] denote the transposition operator. The rate ofchange in (G.R. Carmichael). the concentrations y is determined by the nonlinear 1352-2310/$ - see front matter r 2003 Elsevier Ltd. All rights reserved. doi:10.1016/j.atmosenv.2003.08.019 ARTICLE IN PRESS 5084 A. Sandu et al. / Atmospheric Environment 37 (2003) 5083–5096 T production/loss function f ¼ðf1; y; fnÞ ; which depends frequent modifications of the existing ones, there is a on a vector ofparameters pARm: In practice, the vector need for software tools that facilitate the sensitivity p may represent reaction rate coefficients, the initial state analysis ofgeneral chemical kinetic mechanisms. The ofthe model ðp ¼ y0Þ; additional source/sink terms (e.g. kinetic preprocessor (KPP) (Damian-Iordache et al., emission rates), etc. We assume that problem (1) has a 1995) has been successfully used in the forward unique solution y ¼ yðt; pÞ once the model parameters integration ofthe chemical kinetics systems ( Sandu are specified. Comprehensive atmospheric reaction et al., 1997a, b; Verwer et al., 1999). The new release mechanisms take into consideration as many as 100 (KPP-1.2) presented in this paper implements a com- chemical species involved in hundreds ofchemical prehensive set of software tools for direct and adjoint reactions (see e.g. Carter, 2000), such that to efficiently sensitivity analysis. Given a chemical mechanism de- integrate system (1) fast and reliable numerical methods scribed by a list ofchemical reactions, KPP generates a must be implemented (Byrne and Dean, 1993; Jacobson flexible code for the model, its forward integration and and Turco, 1994; Sandu et al., 1997a, b). In addition, the the direct-decoupled/adjoint sensitivity analysis. model parameters are often obtained from experimental The paper is organized as follows: a review of the data and their accuracy is hard to estimate. The direct-decoupled sensitivity analysis and extensions to development and validation ofchemical reactions Runge–Kutta and Rosenbrock stiff integration methods mechanisms require a systematic sensitivity analysis to are presented in Section 2. In Section 3, we review the evaluate the effects of parameter variations on the model continuous and discrete adjoint sensitivity methods and solution. discuss practical issues ofthe adjoint code implementa- n The sensitivities ScðtÞAR are defined as the deriva- tion for chemical kinetics systems. The KPP tools that tives ofthe solution with respect to the parameters facilitate the implementation of the sensitivity methods @yðtÞ are presented in Section 4. Tutorial examples for ScðtÞ¼ ; 1pcpm: ð2Þ building the direct-decoupled code and the adjoint code @pc with KPP are presented in Sections 5 and 6, respectively. A large sensitivity value ScðtÞ shows that the para- In Section 7, we outline the new numerical methods for meter pc plays an essential role in determining the model sensitivity calculations available in the KPP numerical forecast yðtÞ; therefore one problem of interest is to library. A summary ofthe results and concluding nÂm evaluate the sensitivities SðtÞAR for t0ptptF: Some remarks are presented in Section 8. practical applications (e.g. data assimilation) require the sensitivity ofa scalar response function Z tF 2. Direct sensitivity analysis g ¼ g#ðt; yðt; pÞÞ dt ð3Þ 0 t For the direct analysis we consider the parameters p to with respect to the model parameters be constant, i.e. they do not change in time. By Z F @g t @g# differentiating (1) with respect to the parameters one ¼ STðtÞ ðt; yðt; pÞÞ dt: ð4Þ obtains the sensitivity equations (variational equations) @p t0 @y dSc Depending on the problem at hand, an appropriate ¼ Jðt; y; pÞSc þ fpc ðt; y; pÞ; dt method for sensitivity evaluation must be selected. The 0 0 @y most popular and efficient techniques for sensitivity Scðt Þ¼ ; 1pcpm; ð5Þ pc studies are the direct-decoupled and the adjoint sensi- @ tivity methods. These approaches are complementary; where J is the Jacobian matrix ofthe derivative function for example, a single direct sensitivity calculation could and fpc are its partial derivatives with respect to the 0 0 F provide @½y1ðtÞ; y; ynðtÞ=@yjðt Þ for all t ptpt ; parameters while a single adjoint calculation provides @y ðtFÞ= j @½f1; y; fn 0 F @½y1ðtÞ; y; ynðtÞ for all t ptpt : The sensitivity infor- Jðt; y; pÞ¼ ; @½y1; y; yn mation provided by the direct method may be used to y @½f1; ; fn c asses how parametric uncertainties propagate in the fpc ðt; y; pÞ¼ ; 1p pm: ð6Þ @pc system; the adjoint method is more suitable for inverse modeling and may be used to identify the origin of Ifthe parameter pc represents the initial concentration c 0 0 uncertainty in a given model output. In this paper, ofthe th species, pc ¼ yc; then fpc ¼ 0 and Scðt Þ¼ special emphasis is given to the adjoint technique which ð0; y; 0; 1; 0; y; 0ÞT; the cth vector ofthe canonical n 0 has not been used as extensively as the direct method in basis in R ; otherwise, Scðt Þ¼0: the context ofchemical systems. The variational equations (5) are linear. The direct Given the multitude ofapplications, the continuous method solves simultaneously the model equation (1) development ofnew reaction mechanisms and the together with the variational equations (5) to obtain ARTICLE IN PRESS A. Sandu et al. / Atmospheric Environment 37 (2003) 5083–5096 5085 both concentrations and sensitivities. The combined nonlinear system ofequations which implicitly defines system (1)–(5) has the Jacobian yiþ1; and which must be solved by a Newton-type þ y iterative scheme. Typically, the solution yi 1 at @½f ; JS1 þ fp1 ; ; JSm þ fpm fqþ1g y iteration q þ 1 is computed as 0@½y; S1; ; Sm 1 J 0 ? 0 ½I À hbJðti; yi; pÞðyiþ1 À yiþ1Þ B C fqþ1g fqg B ðJS Þ þ J J ? 0 C XkÀ1 B 1 y p1 C ¼ B C; ð7Þ ¼ a yiÀj þ hbf ðtiþ1; yiþ1; pÞÀyiþ1; ð10Þ @ ^ & ^ A j fqg fqg j¼0 ðJS Þ þ J 0 ? J m y pm which requires one factorization of I À hbJ and one where the subscripts in the component sub-matrices backsubstitution per iteration. denote partial differentiation. The eigenvalues of the Discretization of the continuous sensitivity equation:In combined Jacobian (7) are the eigenvalues of J (the this approach (Dunker, 1984; Caracotsios and Stewart, Jacobian of the model equations), with different multi- 1985; Leis and Kramer, 1986) one discretizes the plicities; therefore, if model (1) is stiff the sensitivity continuous sensitivity equation (5) with the same BDF equations (5) are also stiff. To maintain stability, an method used for discretizing model (9) implicit time-stepping method is needed. Implicit meth- XkÀ1 ods solve linear systems with the ‘‘prediction’’ matrix iþ1 iÀj iþ1 iþ1 iþ1 Sc ¼ ajSc þ hbJðt ; y ; pÞSc ðI À hgJÞ; where h is the stepsize and g a parameter j¼0 determined by the method.