Nonlinear Modeling, Estimation and Predictive Control in Apmonitor
Total Page:16
File Type:pdf, Size:1020Kb
Brigham Young University BYU ScholarsArchive Faculty Publications 2014-11-05 Nonlinear Modeling, Estimation and Predictive Control in APMonitor John Hedengren Brigham Young University, [email protected] Reza Asgharzadeh Shishavan Brigham Young University Kody M. Powell University of Utah Thomas F. Edgar University of Texas at Austin Follow this and additional works at: https://scholarsarchive.byu.edu/facpub Part of the Chemical Engineering Commons BYU ScholarsArchive Citation Hedengren, John; Asgharzadeh Shishavan, Reza; Powell, Kody M.; and Edgar, Thomas F., "Nonlinear Modeling, Estimation and Predictive Control in APMonitor" (2014). Faculty Publications. 1667. https://scholarsarchive.byu.edu/facpub/1667 This Peer-Reviewed Article is brought to you for free and open access by BYU ScholarsArchive. It has been accepted for inclusion in Faculty Publications by an authorized administrator of BYU ScholarsArchive. For more information, please contact [email protected], [email protected]. Computers and Chemical Engineering 70 (2014) 133–148 Contents lists available at ScienceDirect Computers and Chemical Engineering j ournal homepage: www.elsevier.com/locate/compchemeng Nonlinear modeling, estimation and predictive control in APMonitor a,∗ a b b John D. Hedengren , Reza Asgharzadeh Shishavan , Kody M. Powell , Thomas F. Edgar a Department of Chemical Engineering, Brigham Young University, Provo, UT 84602, United States b The University of Texas at Austin, Austin, TX 78712, United States a r t i c l e i n f o a b s t r a c t Article history: This paper describes nonlinear methods in model building, dynamic data reconciliation, and dynamic Received 10 August 2013 optimization that are inspired by researchers and motivated by industrial applications. A new formulation Received in revised form 19 April 2014 of the 1-norm objective with a dead-band for estimation and control is presented. The dead-band in the Accepted 27 April 2014 objective is desirable for noise rejection, minimizing unnecessary parameter adjustments and movement Available online 9 May 2014 of manipulated variables. As a motivating example, a small and well-known nonlinear multivariable level control problem is detailed that has a number of common characteristics to larger controllers seen in Keywords: practice. The methods are also demonstrated on larger problems to reveal algorithmic scaling with sparse Advanced process control methods. The implementation details reveal capabilities of employing nonlinear methods in dynamic Differential algebraic equations applications with example code in both Matlab and Python programming languages. Model predictive control Dynamic parameter estimation © 2014 Elsevier Ltd. All rights reserved. Data reconciliation Dynamic optimization 1. Introduction are present. The art of using linear models to perform nonlin- ear control has been refined by a number of control experts to Applications of Model Predictive Control (MPC) are ubiquitous extend linear MPC to a wider range of applications. While this in a number of industries such as refining and petrochemicals approach is beneficial in deploying applications, maintenance costs (Darby and Nikolaou, 2012). Applications are also somewhat are increased and sustainability is decreased due to the complexity common in chemicals, food manufacture, mining, and other man- of the heuristic rules and configuration. ufacturing industries (Qin and Badgwell, 2003). Contributions by A purpose of this article is to give implementation details on Morari and others have extended the MPC applications to building using nonlinear models in the typical steps of dynamic optimiza- climate control (Gyalistras et al., 2011; Oldewurtel et al., 2010), tion including (1) model construction, (2) fitting parameters to data, stochastic systems (Nolde et al., 2008; Oldewurtel et al., 2008), (3) optimizing over a future predictive horizon, and (4) transfor- induction motors (Papafotiou et al., 2007), and other fast processes ming differential equations into sets of algebraic equations. Recent with explicit MPC (Bemporad et al., 2002; Hedengren and Edgar, advancements in numerical techniques have permitted the direct 2008; Johansen, 2004; Domahidi et al., 2011; Ferreau et al., 2008; application of nonlinear models in control applications (Findeisen Pannocchia et al., 2007). A majority of the applications employ et al., 2007), however, many nonlinear MPC applications require linear models that are constructed from empirical model identifi- advanced training to build and sustain an application. Perhaps cation, however, some of these processes have either semi-batch the one remaining obstacle to further utilization of nonlinear characteristics or nonlinear behavior. To ensure that the linear technology is the ease of deploying and sustaining applications models are applicable over a wider range of operating conditions by researchers and practitioners. Up to this point, there remain and disturbances, the linear models are retrofitted with elements relatively few actual industrial applications of control based on that approximate nonlinear control characteristics. Some of the nonlinear models. An objective of this paper is to reduce the barri- nonlinear process is captured by including gain scheduling, switch- ers to implementation of nonlinear advanced control applications. ing between multiple models depending on operating conditions, This is attempted by giving implementation details on the following and other logical programming when certain events or conditions topics: • ∗ nonlinear model development Corresponding author. Tel.: +1 801 477 7341. • parameter estimation from dynamic data E-mail address: [email protected] (J.D. Hedengren). http://dx.doi.org/10.1016/j.compchemeng.2014.04.013 0098-1354/© 2014 Elsevier Ltd. All rights reserved. 134 J.D. Hedengren et al. / Computers and Chemical Engineering 70 (2014) 133–148 • model predictive control with large-scale models or nonlinear, empirical or based on fundamental forms that results • direct transcription for solution of dynamic models from material and energy balances, reaction kinetic mechanisms, or other pre-defined model structure. The foundation of many of these correlations is on equations of motion, individual reaction In addition to the theoretical underpinnings of the techniques, expressions, or balance equations around a control volume such as a practical application with process data is used to demonstrate accumulation = inlet − outlet + generation − consumption. In the case model identification and control. The application used in this of a mole balance, for example, this includes molar flows, reactions, paper is a simple level control system that was selected to illus- d ni = − − trate the concepts without burdening the reader with model and an accumulation term (ni) (ni) (ni) . Model d t in out rxn complexity. In practice, much larger and more complex systems structure may also include constraints such as fixed gain ratios, can be solved using these techniques. An illustration of scale- constraints on compositions, or other bounds that reflect physical up to larger problems gives an indication of the size that can be realism. Detailing the full range of potential model structures is out- solved with current computational resources. The example prob- side the scope of this document. Eq. (1) is a statement of a general lems are demonstrated with the APMonitor Optimization Suite model form that may include differential, algebraic, continuous, (Hedengren, 2014, 2012), freely available software for solution of binary, and integer variables. linear programming (LP), quadratic programming (QP), nonlinear programming (NLP), and mixed-integer (MILP and MINLP) prob- lems. Several other software platforms can also solve dynamic d x optimization problems with a variety of modeling systems, solu- 0 = f , x, y, p, d, u (1a) d t tion strategies, and solvers (Cizniar et al., 2005; Houska et al., 2011; Piela et al., 1991; Tummescheit et al., 2010; Simon et al., 2009; Nagy et al., 2007). 0 = g(x, y, p, d, u) (1b) Of particular interest for this overview is the transformation of the differential and algebraic equation (DAE) systems into equiv- alent NLP or MINLP problems that can be solved by large-scale optimizers such as the active set solver APOPT (Hedengren et al., 0 ≤ h(x, y, p, d, u) (1c) 2012) and the interior point solver IPOPT (Wächter and Biegler, 2006). Specific examples are included in the appendices with commands to reproduce the examples in this paper. Some other The solution of Eq. (1) is determined by the initial state x0, a set of examples include applications of computational biology (Abbott parameters p, a trajectory of disturbance values d = (d0,d1,. .,dn−1), et al., 2012), unmanned aerial systems (Sun et al., 2014), chemi- and a sequence of control moves u = (u0,u1,. .,un−1). Likewise, the cal process control (Soderstrom et al., 2010), solid oxide fuel cells variables values may be determined from the equations such as (Jacobsen et al., 2013; Spivey et al., 2012), industrial process fouling differential x or algebraic equations y. The equations include dif- (Spivey et al., 2010), boiler load following (Jensen and Hedengren, ferential f, algebraic g, and inequality constraints h. The inequality 2012), energy storage (Powell et al., 2957; Powell and Edgar, 2011, constraints are included to model physical phenomena such as 2012), subsea monitoring systems (Hedengren and Brower, 2012; phase changes where complementarity conditions are required.