Jupyter notebook 2016-11-15-200330/lab1.ipynb
Earth's Atmospheric Composition: Computer Laboratory #1
Paul Palmer, University of Edinburgh ([email protected])
Contents:
The learning objectives of this lab are:
Understand what is an e-folding lifetime.
Understand what determines the lifetime of a gas that is subject to different loss processes.
Understand the relevance of an e-folding lifetime is to atmospheric composition.
This is a Jupyter notebook, which allows you to use the power of Python without much knowledge of the language.
To run the code below:
Click on the cell to select it.
Press SHIFT+ENTER on your keyboard or press the play button () in the toolbar above.
Exercise #1: Box model describing time-dependent mass of gas X

The following equation is a simple mass balance model that describes the change in mass of gas as a function of time : where mass is determined by a source (mass/time) and a loss that is described by an e-folding lifetime (time).
Rearranging and integrating this equation: where is the carbon mass at time .
The following piece of code describes this equation. In this example, we have ignored (=0), used seconds and X=10 units. Below we explore the role of in the model.
We can explore a few key concepts with this simple model: 1) e-folding lifetime and 2) mass balance.
From the figure above we can see that in the absence of a source the carbon mass progressively gets smaller, which is determined by . Every time increases by a factor of the carbon mass is reduced by a factor of , which has a value of approximately 2.72. At =, and when , . For the example above (using units) , , ...
Below is an interactive version of the static figure above. The vertical and horizontal lines are giving you the corresponding values for and for = and .
Activities
Use the slider to explore how the lifetime affects
Make sure you understand why in this model reduces in a way that can be described by multiples of .
What is the value of ? Double check by adjusting the code.
Exercise #2: Mass balance box model of gas X
Let's return to the original mass balance equation as defined above: where all variables are defined as above.
Activities
In this activity we retain the source term .
Fix = 300 units and = 120 units. Adjust the source term from the minimum value of 1 to the maximum value of 5. What do you find?
Return all the sliders back to their middle position. This time adjust the slider from the smallest to the largest value. What do you find?
Now freely adjust the and sliders. What do you find?
For some pairs of model parameters (e.g., and ) you should have found a situation when remains fixed in time for the entire period. What does mean? Given the value for and can you predict the fixed value?
For other model parameter values you will have found that reached a steady value later in the run. What does that mean? Given the value for and can you predict the final steady value?
Do long-lived or short-lived gases respond quicker to changes in sources?
How do you think an atmospheric gas would respond to a rapidly varying source and a source that has a slower mode of varibility?