A simple model puts a rule for change into a few lines of code. Growth by a fixed fraction doubles in ln2/ln(1+r), and a logarithm turns exponential records and rating curves into straight lines. A one-box energy balance, CdT/dt=F−λT
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
From a record to a rule
A line through a record describes it. A model goes further: it gives a rule for why the numbers change, and the rule can be run forward. A good simple model has few numbers, each with a meaning, and it can be wrong in a way that you can measure. This lesson has three simple models.
Growth by a fixed fraction
If a quantity N grows by the fraction r each year, then N(t)=N0(1+r)t. This is an exponential. It doubles in the same time wherever you start:
t2=ln(1+r)ln2
For small r this is about 0.693/r, or 70/(100r) with r in percent: the rule of 70. A growth of 3% a year gives t2=23.45 years, and the rule of 70 gives 23.33.
Take logarithms and the curve becomes a line, lnN=lnN0+kt. So we can fit an exponential with the least-squares line of lnN against t. The slope is the rate k per unit of time, and N0=ea. The same trick works for a power law, Q=a(h−h0)b: plot lnQ against ln(h−h0). This is how a rating curve turns the height of a river, easy to measure, into its flow, hard to measure. The recession of a river after rain is an exponential fall, Q=Q0e−kt, with the half-life ln2/k.
An exponential is a model, not a law. The carbon dioxide above its pre-industrial level has grown by about 2% a year since 1960, but the cause is the emission of people, which changes. A curve that fits well for sixty years need not continue for thirty more.
A one-box energy balance
How fast does a layer of sea warm when the energy balance is pushed? Treat the surface layer as one well-mixed box of heat capacity C per square metre. A forcing F adds energy. The warmer layer loses energy to space at the rate λΔT, where λ is the feedback parameter. Then
CdtdΔT=F−λΔT
The temperature rises until the loss equals the push, at ΔTeq=F/λ. The solution is
ΔT(t)=λF(1−e−t/τ)
τ=λC
The time constantτ is the time to reach 63% of the final warming. A layer of water 70m deep has C=ρcwh=1025×3990×70=2.86×108J m−2K−1. With λ=1.2W m−2K−1 we get τ=7.56 years. For a doubling of carbon dioxide, F=3.71W/m2 and ΔTeq=3.09K, close to the best estimate of 3K in the report of the IPCC of 2021. The real ocean is deeper than this one box, so the real response is slower.
Solving it by steps
Most models cannot be solved with a formula, and a computer takes small steps. In the Euler method we move from time t to t+Δt by using the rate at t:
ΔTnew=ΔT+ΔtCF−λΔT
Each step uses the slope at the start, so the result lags the true curve when the slope is changing. The error falls in proportion to Δt. A step of one year, on a time constant of 7.6 years, is accurate to a few percent. A step of 0.1 year is ten times better.
Judging a model
A model is checked against data. Two simple numbers do this. The bias is the mean of (model − data). The root mean square error (RMSE) is mean of (model−data)2. A model that fits the years it was built on is not yet tested. A fair test keeps some years back, fits the model to the rest, and measures the error on the years that it did not see. A more flexible curve, such as a polynomial of high degree, fits the old years better and the new years worse. This is overfitting. It shows most outside the record, where two curves with the same fit inside can part widely.
Worked example: a doubling time
The area of a reservoir surface grows by 3% a year after a dam is closed. How long until it has doubled?
The factor. The area after t years is A0×1.03t.
Set it to 2.1.03t=2.
Take logarithms.t=ln2/ln1.03=0.6931/0.02956=23.45 years.
Check. The rule of 70 gives 70/3=23.33, close to it because 3% is small.
A warning. A growth of 3% for 23 years cannot go on for ever. The valley has a size.
Raise the feedback to 2.0. Does the final warming rise or fall? Does the layer reach it sooner or later?
Practise with new numbers
Try it in Python
The program solves the box model by steps of one year and prints the exact solution beside it.
Common mistakes
Extending a fitted exponential far into the future. A fit describes the past.
Measuring a model on the data that it was built on. Keep some data back.
Mixing the time unit of the rate and of the time. A rate per day needs days.
Thinking a deeper layer warms to a different temperature. It warms to the same temperature, more slowly.
Remember these
t2=ln2/ln(1+r), and a logarithm turns an exponential or a power law into a line.
CdΔT/dt=F−λΔT; ΔTeq=F/λ; τ=C/λ.
Euler: ΔTnew=ΔT+Δt(F−λΔT)/C.
Judge a model on data that it has not seen: bias and RMSE.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A river's flow falls by half every 12 days after the rains. What is its recession constant k in e−kt?
A one-box model has τ=8 years. How much of the final warming has happened after 8 years?
A curve of high degree fits ten old values exactly, but misses the next three. What is this called?
Why is a step of Δt=10 years a poor choice for a layer with τ=7.6 years?
References
D. S. Wilks, Statistical Methods in the Atmospheric Sciences (4th edition, Elsevier, 2019), the chapters on Forecast Verification and on Linear Regression.
IPCC, Climate Change 2021: The Physical Science Basis, Chapter 7, for the feedback parameter and the equilibrium climate sensitivity.
OpenStax, Calculus Volume 2, the section on Euler's method.
Enroll free in Earth Data with Python: Trends, Anomalies and Models
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.