HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Earth Data with Python: Trends, Anomalies and Models
  1. 1Time series, trends and the seasonal cycle
  2. 2Anomalies, baselines and uncertainty
  3. 3Simple models of Earth data
  1. Earth and Environmental Science
  2. /Earth Data with Python: Trends, Anomalies and Models
  3. /Simple models of Earth data

Course 12.3·Lesson 3 of 3

Simple models of Earth data

A simple model puts a rule for change into a few lines of code. Growth by a fixed fraction doubles in ln⁡2/ln⁡(1+r)\ln 2/\ln(1 + r)ln2/ln(1+r), and a logarithm turns exponential records and rating curves into straight lines. A one-box energy balance, C dT/dt=F−λTC\,dT/dt = F - \lambda TCdT/dt=F−λT

Lesson 3 of 3Show all lessonsHide
Earth Data with Python: Trends, Anomalies and Models
  1. 1Time series, trends and the seasonal cycle
  2. 2Anomalies, baselines and uncertainty
  3. 3Simple models of Earth data

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 NNN grows by the fraction rrr each year, then N(t)=N0(1+r)tN(t) = N_0(1 + r)^tN(t)=N0​(1+r)t. This is an exponential. It doubles in the same time wherever you start:

t2=ln⁡2ln⁡(1+r)\displaystyle t_2 = \dfrac{\ln 2}{\ln(1 + r)}t2​=ln(1+r)ln2​

For small rrr this is about 0.693/r0.693/r0.693/r, or 70/(100r)70/(100r)70/(100r) with rrr in percent: the rule of 70. A growth of 3 %3\ \%3 % a year gives t2=23.45t_2 = 23.45t2​=23.45 years, and the rule of 70 gives 23.3323.3323.33.

Take logarithms and the curve becomes a line, ln⁡N=ln⁡N0+kt\ln N = \ln N_0 + ktlnN=lnN0​+kt. So we can fit an exponential with the least-squares line of ln⁡N\ln NlnN against ttt. The slope is the rate kkk per unit of time, and N0=eaN_0 = e^{a}N0​=ea. The same trick works for a power law, Q=a(h−h0)bQ = a(h - h_0)^bQ=a(h−h0​)b: plot ln⁡Q\ln QlnQ against ln⁡(h−h0)\ln(h - h_0)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−ktQ = Q_0 e^{-kt}Q=Q0​e−kt, with the half-life ln⁡2/k\ln 2/kln2/k.

An exponential is a model, not a law. The carbon dioxide above its pre-industrial level has grown by about 2 %2\ \%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 CCC per square metre. A forcing FFF adds energy. The warmer layer loses energy to space at the rate λ ΔT\lambda\,\Delta TλΔT, where λ\lambdaλ is the feedback parameter. Then

C d ΔTdt=F−λ ΔT\displaystyle C\,\dfrac{d\,\Delta T}{dt} = F - \lambda\,\Delta TCdtdΔT​=F−λΔT

The temperature rises until the loss equals the push, at ΔTeq=F/λ\Delta T_{eq} = F/\lambdaΔTeq​=F/λ. The solution is

ΔT(t)=Fλ(1−e−t/τ)\displaystyle \Delta T(t) = \dfrac{F}{\lambda}\left(1 - e^{-t/\tau}\right)ΔT(t)=λF​(1−e−t/τ)
τ=Cλ\displaystyle \tau = \dfrac{C}{\lambda}τ=λC​

The time constant τ\tauτ is the time to reach 63 %63\ \%63 % of the final warming. A layer of water 70 m70\ \text{m}70 m deep has C=ρcwh=1025×3990×70=2.86×108 J m−2 K−1C = \rho c_w h = 1025 \times 3990 \times 70 = 2.86 \times 10^{8}\ \text{J m}^{-2}\ \text{K}^{-1}C=ρcw​h=1025×3990×70=2.86×108 J m−2 K−1. With λ=1.2 W m−2 K−1\lambda = 1.2\ \text{W m}^{-2}\ \text{K}^{-1}λ=1.2 W m−2 K−1 we get τ=7.56\tau = 7.56τ=7.56 years. For a doubling of carbon dioxide, F=3.71 W/m2F = 3.71\ \text{W/m}^2F=3.71 W/m2 and ΔTeq=3.09 K\Delta T_{eq} = 3.09\ \text{K}ΔTeq​=3.09 K, close to the best estimate of 3 K3\ \text{K}3 K 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 ttt to t+Δtt + \Delta tt+Δt by using the rate at ttt:

ΔTnew=ΔT+Δt F−λ ΔTC\displaystyle \Delta T_{\text{new}} = \Delta T + \Delta t\,\dfrac{F - \lambda\,\Delta T}{C}Δ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\Delta tΔt. A step of one year, on a time constant of 7.67.67.6 years, is accurate to a few percent. A step of 0.10.10.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\sqrt{\text{mean of (model} - \text{data})^2}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 %3\ \%3 % a year after a dam is closed. How long until it has doubled?

  1. The factor. The area after ttt years is A0×1.03tA_0 \times 1.03^tA0​×1.03t.
  2. Set it to 2. 1.03t=21.03^t = 21.03t=2.
  3. Take logarithms. t=ln⁡2/ln⁡1.03=0.6931/0.02956=23.45t = \ln 2/\ln 1.03 = 0.6931/0.02956 = 23.45t=ln2/ln1.03=0.6931/0.02956=23.45 years.
  4. Check. The rule of 70 gives 70/3=23.3370/3 = 23.3370/3=23.33, close to it because 3 %3\ \%3 % is small.
  5. A warning. A growth of 3 %3\ \%3 % for 232323 years cannot go on for ever. The valley has a size.

Raise the feedback to 2.02.02.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.

Predict first. Is the Euler answer above or below the exact one? Then run it. Check with Show the answer.

1. Make the step half a year: set year / 2 in the step and run twice as many steps. Does the gap close?

2. Change depth to 150. Does the final warming change?

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=ln⁡2/ln⁡(1+r)t_2 = \ln 2/\ln(1 + r)t2​=ln2/ln(1+r), and a logarithm turns an exponential or a power law into a line.
  • C dΔT/dt=F−λΔTC\,d\Delta T/dt = F - \lambda\Delta TCdΔT/dt=F−λΔT; ΔTeq=F/λ\Delta T_{eq} = F/\lambdaΔTeq​=F/λ; τ=C/λ\tau = C/\lambdaτ=C/λ.
  • Euler: ΔTnew=ΔT+Δt (F−λΔT)/C\Delta T_{new} = \Delta T + \Delta t\,(F - \lambda\Delta T)/CΔ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.

  1. A river's flow falls by half every 121212 days after the rains. What is its recession constant kkk in e−kte^{-kt}e−kt?
  1. A one-box model has τ=8\tau = 8τ=8 years. How much of the final warming has happened after 888 years?
  1. A curve of high degree fits ten old values exactly, but misses the next three. What is this called?
  1. Why is a step of Δt=10\Delta t = 10Δt=10 years a poor choice for a layer with τ=7.6\tau = 7.6τ=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.
No payment. You can leave at any time.

Problems (4)

The annual mean carbon dioxide at Mauna Loa was 316.91 ppm in 1960 and 414.24 ppm in 2020…Hard · High School (11–12) · by StemPy Lab
A mixed layer of sea water is 100 m deep…Advanced · High School (11–12) · by StemPy Lab
After the monsoon ends, the discharge of a river, in m³/s, was measured every five days from day 0…Hard · High School (11–12) · by StemPy Lab
That was the last lessonBack to the course: take the test
← Earth Data with Python: Trends, Anomalies and Models
← Anomalies, baselines and uncertaintyNext →

Discussion (0)

Log in to join the discussion.

Loading…

, relaxes with the time constant
C/λC/\lambdaC/λ
, and Euler steps follow it. A model is judged on data that it has not seen.
about 30 min1 simulation2 practice questions1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Six yearly values of a quantity, for x = 0, 1, …, 5, are 2.1, 2.9, 3.4, 4.6, 4.9 and 6.0…Advanced · High School (11–12) · by StemPy Lab

Question Sets (1)

Records and Trends: Practice Questions10 questions · by StemPy Lab

Notes (1)

Earth Data with Python: Trends, Anomalies and Models: Quick RevisionNote · by StemPy Lab