ozone2_ode


ozone2_ode, a MATLAB code which defines a stiff system of four ordinary differential equations (ODE) that simulate the daily variation in atmospheric ozone concentration. This version of the ozone ODE includes a nitrogen oxide source term.

The problem studies the variation of the atmospheric concentrations of the molecules O, NO, NO2 and O3 (ozone). A single vector y stored the concentrations as

        y(1) = O
        y(2) = NO
        y(3) = NO2
        y(4) = O3
      

% sigma = NO2 source term

The concentrations change with time, according to the following system of ODEs:

        dy1dt = + k1 * y3 - k2 * y1;
        dy2dt = + k1 * y3           - k3 * y2 * y4 + sigma2;
        dy3dt = - k1 * y3           + k3 * y2 * y4;
        dy4dt =           + k2 * y1 - k3 * y2 * y4;
      
where sigma2 is a constant NO2 source term, k1, k2 and k3 are chemical reaction coefficients, with k1 a time dependent function, while k2 and k3 are constant.

The ozone concentration is essentially constant at nighttime, but increases rapidly at dawn. The variation in the range of parameters, variable values, and variable derivatives makes this a stiff system. MATLAB provides specialized stiff solvers like ode15s() and ode23s() to handle such problems. However, using ode23s(), it was nonetheless necessary to relax the error tolerances in order for MATLAB to be able to return an approximate solution over the time interval of interest.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

References:

  1. Willem Hundsdorfer, Jan Verwer,
    Numerical solution of time dependent advection-diffusion-reaction equations,
    Springer, 2003,
    ISBN13: 978-3-662-09017-6.

Source Code:

Tests:

Plots:

-
Last revised on 26 January 2021.