M-RICh v0.5 MATLAB Rate Integrator for Chemical equations

Similar documents
The Chemical Kinetics Time Step a detailed lecture. Andrew Conley ACOM Division

0. Introduction 0.1 Concept The air / environment (geosphere): Is it a reactor? It s a matter of reactions and transports and mixing!

Ordinary differential equations - Initial value problems

Supplement of SOA formation from the photooxidation of α-pinene: systematic exploration of the simulation of chamber data

Modeling & Simulation 2018 Lecture 12. Simulations

A SPARC Success Story: The Role of Halogen Chemistry in Polar Stratospheric Ozone Depletion

CHM 5423 Atmospheric Chemistry Notes on kinetics (Chapter 4)

Linear Multistep Methods I: Adams and BDF Methods

2 Reaction kinetics in gases

Chapter 14 Chemical Kinetics

On Stationary state, also called steady state. Lifetimes and spatial scales of variability

Chapter 14 Chemical Kinetics

Introduction to Chemical Kinetics AOSC 433/633 & CHEM 433/633 Ross Salawitch

Introduction to Chemical Kinetics AOSC 433/633 & CHEM 433 Ross Salawitch

Analysis Methods in Atmospheric and Oceanic Science

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

CHAPTER 1. MEASURES OF ATMOSPHERIC COMPOSITION

Scientific Computing: An Introductory Survey

AP Chemistry - Notes - Chapter 12 - Kinetics Page 1 of 7 Chapter 12 outline : Chemical kinetics

Advanced Physical Chemistry CHAPTER 18 ELEMENTARY CHEMICAL KINETICS

CHEM Chemical Kinetics. Reaction Mechanisms

Tananyag fejlesztés idegen nyelven

X i t react. ~min i max i. R ij smallest. X j. Physical processes by characteristic timescale. largest. t diff ~ L2 D. t sound. ~ L a. t flow.

CHAPTER 10 CHEMICAL KINETICS

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Review of Fitting Kinetic Data

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Francis X. Giraldo,

Chapter 13 Lecture Lecture Presentation. Chapter 13. Chemical Kinetics. Sherril Soman Grand Valley State University Pearson Education, Inc.

1. Introduction to Chemical Kinetics

How fast reactants turn into products. Usually measured in Molarity per second units. Kinetics

Chapter 12. Chemical Kinetics

Finite Difference Solution of the Heat Equation

Examples of fast and slow reactions

Outline. Chemical lifetime. Photochemistry. Ozone chemistry Chapman model Catalytic cycles Ozone hole. Institute of Applied Physics University of Bern

2. Sketch a plot of R vs. z. Comment on the shape. Explain physically why R(z) has a maximum in the atmospheric column.

T(K) k(cm 3 /molecule s) 7.37 x x x x x 10-12

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

Appendix C: Recapitulation of Numerical schemes

Chemical Kinetics. Chapter 13. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chemical Kinetics I: The Dry Lab. Up until this point in our study of physical chemistry we have been interested in

1.2 Derivation. d p f = d p f(x(p)) = x fd p x (= f x x p ). (1) Second, g x x p + g p = 0. d p f = f x g 1. The expression f x gx

PHYSICS OF THE SPACE ENVIRONMENT

CHEM Chemical Kinetics. & Transition State Theory

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take

Chapter 12. Chemical Kinetics

ELEMENTARY CHEMICAL KINETICS

Name AP CHEM / / Chapter 12 Outline Chemical Kinetics

Brown et al, Chemistry, 2nd ed (AUS), Ch. 12:

Preliminary report: Analyses of tcfp s potential impact on atmospheric ozone

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

Elementary Reactions

CFC: chlorofluorocarbons

Fourth Order RK-Method

Quantitative Understanding in Biology Module IV: ODEs Lecture I: Introduction to ODEs

Appendix B: Aqueous chemistry and gas-phase halogen chemistry

Chapter 14 Chemical Kinetics

ATM 507 Lecture 5. Text reading Chapter 4 Problem Set #2 due Sept. 20 Today s topics Photochemistry and Photostationary State Relation

KINETICS STUDY GUIDE- Written INTRODUCTION

Module 6 : Reaction Kinetics and Dynamics Lecture 28 : Elementary Reactions and Reaction Mechanisms

Factors Affecting Reaction Rate

Factors That Affect Rates. Factors That Affect Rates. Factors That Affect Rates. Factors That Affect Rates

MTH 452/552 Homework 3

CHEM/ENVS 380 S14, Midterm Exam ANSWERS 1 Apr 2014

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

ENVIRONMENTAL STRUCTURE AND FUNCTION: EARTH SYSTEM - Chemistry Of The Atmosphere - I.L. Karol and A.A. Kiselev

Reaction Rate. Rate = Conc. of A at t 2 -Conc. of A at t 1. t 2 -t 1. Rate = Δ[A] Δt

Lecture V: The game-engine loop & Time Integration

CONTENTS 1 MEASURES OF ATMOSPHERIC COMPOSITION

Chemical Kinetics. Rate = [B] t. Rate = [A] t. Chapter 12. Reaction Rates 01. Reaction Rates 02. Reaction Rates 03

Applied Math for Engineers

Chapter 14: Chemical Kinetics II. Chem 102 Dr. Eloranta

Chemical Kinetics. What quantities do we study regarding chemical reactions? 15 Chemical Kinetics

Review for Exam 2 Ben Wang and Mark Styczynski

CHEMICAL KINETICS. LECTURE Introduction

, but bursts into flames in pure oxygen.

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations

Meridional Transport in the Stratosphere of Jupiter

CHM 5423 Atmospheric Chemistry Notes on reactions of organics in the troposphere (Chapter 5)

Chapter 12. Chemical Kinetics

Theoretical Models for Chemical Kinetics

MOX EXPONENTIAL INTEGRATORS FOR MULTIPLE TIME SCALE PROBLEMS OF ENVIRONMENTAL FLUID DYNAMICS. Innsbruck Workshop October

14.4 Reaction Mechanism

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

Numerical solution of ODEs

Ordinary Differential Equations

Ch 13 Chemical Kinetics. Modified by Dr. Cheng-Yu Lai

Numerical Methods for the Solution of Differential Equations

Chemical Kinetics. Topic 7

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

Elevated atmospheric escape of atomic hydrogen from Mars induced by high-altitude water

Chapter: Chemical Kinetics

11/9/2012 CHEMICAL REACTIONS. 1. Will the reaction occur? 2. How far will the reaction proceed? 3. How fast will the reaction occur?

Kinetics - Chapter 14. reactions are reactions that will happen - but we can t tell how fast. - the steps by which a reaction takes place.

2. Outline of the MRI-EPS

Basic Aspects of Discretization

Chapter 14 Chemical Kinetics

Chemical Reaction Engineering Prof. Jayant Modak Department of Chemical Engineering Indian Institute of Science, Bangalore

Rate of a chemical reaction = Change in concentration Change in time

Transcription:

M-RICh v0.5 MATLAB Rate Integrator for Chemical equations Abstract: Accurately simulating the chemical conditions within a reactor tests both the stability and accuracy of a numerical scheme. M-RICh is a MATLAB-based implementation of an array of implicit and explicit finite-differencing techniques with the specific aim of simulating arbitrary chemical systems relevant to atmospheric chemistry in a user-friendly fashion. We cover the aims and development of M-RICh before testing the program with a small number of known-outcome problems, demonstrating the stability and accuracy features of the implemented solvers while demonstrating the inherent stiffness limit on chemical systems. Author: Sebastian D. Eastham MIT Department of Aeronautics and Astronautics Dates: Project start: 2014-04-01 Project report: 2014-05-11 Project presentation: 2014-05-13

18.086: M-RICh Sebastian D. Eastham Contents 1 Introduction 3 1.1 Background............................................ 3 1.2 Mathematical basis........................................ 3 2 Calculating k 3 2.1 First, second and third order reactions............................. 3 2.2 Termolecular reactions...................................... 4 2.3 Photolysis............................................. 4 2.4 Other chemistry......................................... 5 2.5 Consequences for numerical integration............................. 5 3 Running M-RICh 5 3.1 Demonstration of ability..................................... 5 3.2 Toy problem............................................ 5 3.3 Explicit methods......................................... 8 3.4 Implicit methods......................................... 8 3.5 Rosenbrock............................................ 8 3.6 Analysis.............................................. 8 4 Conclusions 10 4.1 Closing remarks.......................................... 10 References 11 2

Sebastian D. Eastham 18.086: M-RICh 1 Introduction 1.1 Background As the scientific debate regarding pollution and climate change has grown, the need to accurately model the atmosphere has increased at an exponential rate. A typical modern atmospheric model consists of a 3-D grid, on which chemistry and transport are solved independently by operator splitting. Each part of the model presents challenges both in terms of what is known about the underlying science and in terms of solving the specific numerical problem. For example, the tendency for much of the Earth s data to be defined in terms of latitude and longitude has resulted in a prevalence of models which grid by latitude and longitude. However, this results in cells with small CFL numbers as they approach the poles, with a polar singularity which necessitates the use of complex semi-lagrangian transport schemes. However, the focus of this project is the atmospheric chemistry specifically, what are the difficulties associated with modeling the chemical processes occurring in a typical atmospheric grid box? As a general note, this report will not address the computational specifics of implementation; interested readers are directed to inspect the code itself, which is included as an appendix and can be freely acquired by request to seastham@mit.edu 1.2 Mathematical basis Chemical reactions can be represented mathematically as follows. For an example reaction aa + bb xx + yy (1) we can see that the rate of loss of each of the reactants, A and B, wil be proportional to the rate of increase of the products X and Y. Representating the number density of A in molec cm 3 as [A], we find x d[x] = y d[y] = a d[a] dt dt dt Through standard chemical kinetic theory, we then find = b d[b] dt d[x] = 1 dt x k[a]a [B] b cm 3 molec 1 s 1 where k is a rate constant independent of chemical concentrations (see section 2). Assuming that a = b = 1 as is usually the case, the example given here is a second-order reaction and therefore not linear. For n reactions involving m species we can produces one non-linear ODE for each species of the form d[x 1 ] = f i (k, [X]) cm 3 molec 1 s 1 dt Integrating these equations is then the aim of any atmospheric chemistry module. 2 Calculating k The reaction rates k are determined by a number of parameterizations. The parameters for these equations such as A and B in equation 2 or σ in equation 3 can usually be found in either recent studies or in the JPL atmospheric chemistry data publications 1. 2.1 First, second and third order reactions The basic mechanism by which molecules interact require a discrete number of reacting molecules. For reaction i involving n reactants, we can expess the rate constant k i as follows ( ) Bi k i (T ) = A i exp (cm 3 molec -1 ) n s -1 (2) T which gives use the rate of change a product [P] with respect to reaction i involving n reactants [R] j as d[p] n dt = k i (T ) [R] j molec cm 3 s 1 i j=1 3

18.086: M-RICh Sebastian D. Eastham The Arrhenius parameter A and activation energy B are constants which can be taken from the literature. 2.2 Termolecular reactions Some reactions are pressure-dependent; this pressure dependency is represented by including an extra reactant, [M] which represents the number density of all molecules in the local environment, resulting in a termolecular reaction. The conventional approach above would be to use a third-order reaction involving [M] as a species; however, this does not adequately take into account the mechanisms by which termolecular reactions take place. Given the very low concentrations of atmospheric species relative to conventional lab conditions, simultaneous interaction of three molecules is exceedingly rare, such that the reaction X + Y + M Z + M would almost never happen. Instead, the reaction X + Y Z occurs, with Z corresponding to an unstable, high-energy form of Z. A series of collisions with M can then remove the excess energy from Z to yield Z. Representing these reactions requires special consideration, with low-pressure and high-pressure limits calculated as ( ) n T k 0 (T ) = k0 300 cm 6 molec 2 s 1 300 ( ) m T k (T ) = k 300 cm 3 molec 1 s 1 300 where the 300 K limiting rates k0 300 and k 300 are given parameters, as are n and m. For cases with pure low-pressure or high-pressure limits, these can be used in isolation; however, the general formula for the termolecular reaction rate constant k f is k f ([M], T ) = k 0 (T )[M] 1 + k 0(T )[M] k (T ) 0.6 [ ( k0 (T )[M] 1 + log 10 k (T ) )] 1 cm 6 molec 2 s 1 with a slightly adjusted version used for termolecular reactions involving bound intermediates. [M] is then removed as a reactant, and the rate of the reaction R 1 + R 2 + M P would be calculated as d[p] dt = k f,i ([M], T )[R] 1 [R] 2 molec cm 3 s 1 i Further details, such as reactions with only one limiting case, and explanations of the individual terms can be found in the JPL handbook 1. 2.3 Photolysis Another relevant set of reactions are photolytic decompositions. These reactions are crucial to almost every aspect of atmospheric chemistry, since photolytic decomposition of O 2 and O 3 is responsible for the presence of OH in the atmosphere, which in turn drives processes such as oxidation of CO to CO 2. An example decomposition such as R P 1 + P 2 can be represented in the usual format as d[p] 1 dt = j i (T, p)[r] molec cm 3 s 1 i Calculation of j involves is achieved as j i (T, p) = 0 σ(λ, T, p)dλ (3) where σ(λ, T ) is the species photolytic cross section as a function of wavelength λ, temperature T and pressure p. However, calculating this online requires estimation of UV penetration to each cell, which is beyond the scope of this project. Since temperature, pressure and actinic flux can all be approximated as a function of altitude and local time, we instead use literature values for noontime j-rates at a range of altitudes, multiplied by the cosine of the solar zenith angle as an analogy for the intensity of the local UV flux. 4

Sebastian D. Eastham 18.086: M-RICh 2.4 Other chemistry Although the bulk of atmospheric chemistry is captured by the above mechanisms included in M-RICh, some mechanisms such as heterogeneous chemistry on and within aerosols are not included. 2.5 Consequences for numerical integration Clearly, the above problems are non-linear. For even the basic equation NO + O 3 NO 2 + O 2, the representative ODE is non-linear, requiring the operation [NO][O 3 ]. This means that any implicit method will require not only calculation and inversion of a Jacobian matrix, but also repeated iteration using Newton s method or something similar, incurring huge computational cost. Explicit methods, however, are almost never practical in the solution of such problems due to the vast differences in timescales exhibited by atmospheric chemistry. Investigation of these problems is the basis of the rest of this report. 3 Running M-RICh 3.1 Demonstration of ability M-RICh is capable of accepting any chemical mechanism with an arbitrary number of species, either live or dead, and an arbitrary number of reactions of the form given in section 2. Specifically, all of the solvers are set up to require no recoding for new reaction mechanisms; Jacobian matrix generation code, for example, is determined at solver initialization based on the spcfile.dat and rxnfile.dat specification files. Figure 1 shows the results of M-RICh integrating the set of reactions shown in table 2. This particular reaction set is a partial implementation of the mechanism in Crutzen s seminal paper investigating the mechanisms underlying the ozone layer 2, but is shown here simply to demonstrate the broad capability of M-RICh. O 3 Reaction O 2 + O( 1 D) O 3 O 2 + O( 3 P) O 2 2 O( 3 P) N 2 O N 2 + O( 1 D) Type Photolysis Photolysis Photolysis Photolysis NO 2 NO + O( 3 P) Photolysis NO 3 NO 2 + O( 3 P) Photolysis NO 3 NO + O 2 Photolysis N 2 O 5 NO 2 + NO 3 Photolysis O 3 + O( 3 P) 2 O 2 Bimolecular O( 1 D) + O 2 O( 3 P) + O 2 Bimolecular O( 1 D) + N 2 O( 3 P) + N 2 Bimolecular O( 1 D) + N 2 O 2 NO Bimolecular O( 1 D) + N 2 O N 2 + O 2 Bimolecular NO + O 3 NO 2 + O 2 Bimolecular NO 2 + O 3 NO 3 + O 2 Bimolecular O( 3 P) + O 2 + M O 3 + M Termolecular NO 3 + NO 2 + M N 2 O 5 + M Termolecular N 2 O 5 + M NO 3 + NO 2 + M Termolecular Table 1: Reactions used for the demonstration integration in figure 1. 3.2 Toy problem However, for the purpose of this investigation, we will focus on a simpler problem: the Chapman mechanism 3. This mechanism was proposed in 1930 to explain the presence of the ozone layer in the lower stratosphere. For the purposes of this report, I will be borrowing heavily from the analysis given in 5

18.086: M-RICh Sebastian D. Eastham 10 4 10 6 Abundance (v/v) 10 8 10 10 10 12 O 3 O( 3 P) O( 1 D) NO NO 2 NO 3 N 2 O 5 10 14 10 16 0 10 20 30 40 50 60 Time (days) Figure 1: Integration of the system shown in table 2 over 60 days based on standard conditions at 25 km altitude (extended internation standard atmosphere). Solution found using backward Euler method with a 30 minute timestep as described in section??. Atmospheric Chemistry and Physics by Seinfeld and Pandis 4. Reaction numbering therefore follows their conventions. The relevant reactions are as follows. Using a fixed concentration of background oxygen, atomic oxygen is produced either at the ground state or in the excited form by photolysis of oxygen and ozone; it is assumed that excited atomic oxygen, O( 1 D), immediately returns to the ground state O( 3 P) for the purposes of this exercise. These photolytic decompositions proceed at the rate j O2 and j O3 respectively. O( 3 P) then reacts with oxygen through the termolecular reaction O( 3 P) + O 2 + M O 3 + M. This termolecular reaction rate constant we shall call k 2. Finally, O( 3 P) and O 3 can be returned to oxygen by the bimolecular reaction O( 3 P) + O 3 2 O 2, the rate constant for which we call k 4. From this point onwards I will refer to O( 3 P) as simply O, and will ignore O( 1 D), assuming that all ozone photolysis results in O( 3 P) either directly or almost immediately. This reaction set is shown in table??. Reaction Type Rate constant O 3 O 2 + O Photolysis j O3 O 2 2 O Photolysis j O2 O + O 2 + M O 3 + M Termolecular k 2 O 3 + O 2 O 2 Bimolecular k 4 Table 2: The Chapman mechanism We therefore have the following set of coupled ODEs: d[o] dt d[o 3 ] dt = k 2 [O][O 2 ][M] j O3 [O 3 ] k 4 [O 3 ][O] = 2j O2 [O 2 ] k 2 [O][O 2 ][M] + j O3 [O 3 ] k 4 [O 3 ][O] For a given temperature T in K and pressure p in Pa, the number density of the surrounding air can be estimated using the ideal gas law. Multiplying by Avogadro s number A and a factor of 10 6 yields [M] = pa 10 6 molec cm 3 RT where R 8.314 J K 1 mol 1 is the universal gas constant. We further define [O 2 ] = 0.21 [M] on the basis that oxygen consistently makes up approximately 21% of the atmosphere by volume throughout 6

Sebastian D. Eastham 18.086: M-RICh the troposphere and stratosphere. If we assume that conversion between O 3 and O is rapid compared to production from photolysis of oxygen and loss by reaction 4, we can further simplify to find d[o 3 ] dt 2j O2 [O 2 ] 2k 4j O3 [O 3 ] 2 k 2 [O 2 ][M] This equation, of the form dy dt = β αy2, has an analytical solution if time variance in reaction rates and conditions is ignored specifically, if it is assumed that there is always sunlight present. Substituting for [O 2 ] as explained, and setting [O 3 ](t = 0) = 0, this yields [O 3 ](t) α = 2k 4j O3 [O 3 ] 2 0.21k 2 [M] 2 β = 2 0.21j O2 [M] ( ) 0.5 β 1 exp [ 2(ab) 0.5 t ] α 1 + exp [ 2(αβ) 0.5 t] This will be used as the reference solution. Using A variety of different integration methods have been coded into M-RICh, with a range of different accuracy and stability characteristics. For each of the coded solvers, I will perform the following analysis: Find the longest integer timestep (in seconds) which results in a stable and accurate solution to the simplified Chapman mechanism with the conditions below: Altitude: 40 km Pressure: 2.78 hpa Temperature: 251.1 K Latitude: 0 Longitude: 180 Storage timestep: 30 minutes End time: 3 days Accuracy is assessed by achieving within 10% of the reference solution at all times and 2% after 3 simulated days. The timestep length, average accuracy and runtime are summarized in table 3. The interface developed for this project is shown in figure 2. Figure 2: The M-RICh GUI Please note that I have assumed reader familiarity with all of the explored methods. Although some other methods were implemented, notably Adams-Bashforth and Adams-Moulton variable order methods along with adaptive-timestep RK4, I have not tested these methods due to simple lack of time. 7

18.086: M-RICh Sebastian D. Eastham 3.3 Explicit methods Forward Euler (FE): FE could not converge even for a timestep of 1 second. This is a result of the very low stability of the forward Euler method, which must contend with the extreme stiffness of the problem at hand. Runge-Kutta 4th-Order (RK4): An implementation of Runge-Kutta 4 was found to remain stable for the problem when a timestep of 2 seconds was chosen. This is, in some ways, highly desirable; the increased stability of RK4 relative to forward Euler allows it to successfully integrate the problem, while the explicit nature of RK4 is easy to implement and can respond rapidly to changes in rate (see discussion in Backward Euler regarding the damping problem). However, the extremely long solution time 206 seconds for a 3 day simulation compared to 0.348 for the same simulation with Backward Euler to a similar level of accuracy mean that RK4 is impractical. The general outcome from the attempt to implement explicit methods is that the problem is simply too stiff to be reasonably solved by a purely explicit approach. Although such methods have the advantage of high per-iteration computational efficiency, they are not practical for these purposes. 3.4 Implicit methods Backward Euler (BE): Backwards Euler converges easily, with a long timestep yielding good results. At a coarse testing resolution, a timestep of 2,600 seconds was found to be the marginal case, yielding an initial error around 10% which rapidly fell, converging to within 0.3% of the steady state solution. An interesting problem arises, however; implicit methods, when used with exponential problems, will inherently damp the solution. This is because they implicitly use the gradient at t + t for time t, which, in this case, is lower than the true gradient. Backward Difference variable-order (BDFn): For n = 1, backward difference schemes are identical to the backward Euler scheme. However, the order of the solver increases as more steps are included. M-RICh allows up to 5 steps to be taken to maximize accuracy, and the solution time does not appreciably increase as the accuracy is increased. Unfortunately, the increasing number of previous steps becomes a problem when dealing with initial conditions. For this project, a naive approach was taken, simply replicating the initial conditions for the phantom previous steps; however, this results in a significant damping of the solution and large maximum errors. As a result, BDF experiences larger and larger initial errors as the order increases. This resulted in a very small timestep 50 s needed to bring the peak error with 10%. Note the results mentioned previously; although RK4 produced the most accurate solution, it did so at massive computational expense. 3.5 Rosenbrock A future goal is to implement the Rosenbrock solver, a mixed implicit-explicit solver known to be effective for numerically stiff problems and used widely in the atmospheric chemistry modeling community. The Rosenbrock solver should be relatively simple to implement. 3.6 Analysis Figure 3 shows the error as a function of solution time for all of the successful solvers. This figure, along with table 3, can be used to highlight some important issues. Firstly, the problem of initial conditions is shown clearly for the BDF2 solver; the large initial error takes almost half a day to be reduced. Furthermore, the three different solvers converge on the same solution, suggesting that it may be the reference solution that is erroneous rather than the solvers themselves. A future investigation may wish to use, for example, the high-fidelity RK4 simulation rather than the approximated analytical solution as a reference. This conclusion is further reinforced by the lowest result on table 3, which shows that a small-timestep Backward Euler simulation still observes the same difference from the reference solution as the RK4 solution. The middle table, which shows the results of varying the order of the BDF solver while holding the timestep constant, is yet another reinforcement; increasing the order does not close the gap between the reference solution and the integrated solution. Rather, it simply increases the initial error, poisoning the solution for a greater period after initialization. 8

Sebastian D. Eastham 18.086: M-RICh Error (%) 0 1 2 3 4 5 6 7 8 9 RK4 ( t = 2 s) Backward Euler ( t = 2600 s) BDF2 ( t = 50 s) 10 0 0.5 1 1.5 2 2.5 3 Time (days) Figure 3: Error as a function of time using each solver Solver Order t (s) Max Error (%) Final Error (%) Runtime (s) Forward Euler 1 - - - - Runge-Kutta 4 th order 4 8.212 0.236 206 Backward Euler 1 2600 9.97 0.310 0.348 BDF2 2 50 9.48 0.236 12.8 Backward Differences 2 2600 39.9 0.271 1.95 Backward Differences 4 2600 56.7 0.273 2.09 Backward Euler 100 1 8.217 0.238 7.53 Table 3: Project results 9

18.086: M-RICh Sebastian D. Eastham 4 Conclusions A chemical solver capable of taking an arbitrary chemical mechanism was implemented in MATLAB. This solver, M-RICh v0.5, is verified using an analytical solution to the simplified Chapman mechanism from atmospheric chemistry. Implicit methods are found to be hugely preferable to the nearly-unusable explicit methods due to their ability to solve stiff problems, although the damping effect which would be neutralized by use of an explicit method is found to be a problem. Future work includes implementation of a more complex chemical mechanism along with some of the unfulfilled stretch goals such as implementation of simplified transport. Future analysis would include comparison against a more reliable reference solution and implementation of the Rosenbrock solution scheme. 4.1 Closing remarks Thank you for reading this report, and I hope you have found it interesting or at least enlightening. The Chapman mechanism described above was revolutionary but significantly overestimated the ozone number density; the NO x mechanism described above was one of the first steps towards understanding why this was the case. Figure 4 shows how the two mechanisms are represented by M-RICh. I look forward to further exploring these results as part of my research. 18 x 1011 16 14 [O3] (molec/cm 3 ) 12 10 8 6 4 2 Chapman NO x 0 0 0.5 1 1.5 2 2.5 3 Time (days) Figure 4: Ozone at 40 km under sunlit conditions under 2 different mechanisms one without NO x, and the other with 10

Sebastian D. Eastham 18.086: M-RICh References [1] S. P. Sander, R. R. Friedl, J. R. Barker, D. M. Golden, M. J. Kurylo, G. E. Sciences, P. H. Wine, J. P. D. Abbatt, J. B. Burkholder, C. E. Kolb, G. K. Moortgat, R. E. Huie, and V. L. Orkin, Chemical Kinetics and Photochemical Data for Use in Atmospheric Studies Evaluation Number 17 NASA Panel for Data Evaluation :, no. 17, 2011. [2] P. Crutzen, Ozone production rates in an oxygen hydrogen nitrogen oxide atmosphere, Journal of Geophysical Research, vol. 76, 1971. [3] S. Chapman, XXXV. On ozone and atomic oxygen in the upper atmosphere, The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, vol. 10, no. 26, 1930. [4] J. H. Seinfeld and S. N. Pandis, Atmospheric Chemistry and Physics. Wiley, 2 ed., 2006. 11