Skip to content

IMAGINARY/climate-crisis-box-models

Repository files navigation

Climate box model simulator

This pedagogical program shows three examples of the box model modeling technique applied to climate. This program is part of the 10 Minute Museum on the Climate Crisis by IMAGINARY.

Check out the online demo.

Background

A box model consists of:

  • A series of stocks or containers of the quantity we want to model (e.g. energy, but could be money, people, etc).

  • A series of flows or arrows that transfer the quantity in and out the stocks, according to some physical laws or given formulas.

  • Some variables or values that depend on other values according to certain formulas.

  • Some parameters or values that we are free to adjust.

    Each of the components is set to an initial value. To run the model, we need an engine or program that updates the values of stocks, flows, and variables for each time step. Mathematically, this is an integration algorithm.

Models in this program

The Earth Energy Balance

Energy enters the Earth by the Sun radiation, and it leaves the Earth by infrared radiation. We adjust the albedo parameter (how reflective is the Earth) to find the temperature at the equilibrium point.

The Ice-Albedo Feedback

We modify the previous model to introduce a relationship between the albedo and the temperature (since the albedo depends mostly on the ice and water vapour in the Earth surface, which depends on the temperature). We observe a hysteresis effect, that is, the system has some "memory" that makes the system evolve to one or another state depending on the previous history; and we also observe tipping points, that is, moments when the behavior changes abruptly and irreversibly due to the reinforced feedback effect. We adjust the Sun intensity to explore the effect.

The Greenhouse Effect

This model describes the effect of the atmosphere as an energy trap for the Earth. It is what makes life possible on the planet, but an increase of greenhouse gases (by human pollution) can cause the Earth to warm in excess.

Unlike the previous two theoretical examples, this third model is more realistic and has been tuned with real values. We can tune the amount of Greenhouse gases since 1850 and into the future according to some scenarios, and see the effect in the average temperature.

Please note that this is a pedagogical project. Our model for the greenhouse effect is an oversimplified toy model aimed to explain the basic ideas to the public, and its results are in no way accurate. It cannot be a substitute for any professional model made by climate scientists.

Usage

The repository contains the bundled app inside the dist folder. This folder needs to be served by a web server.

Having npx installed, you can serve the app via

npx reload --dir dist

Another possibility is to run

npm install
npm run server

Note, however, that this pulls in all development dependencies, which are of considerable size.

In both cases, check the CLI output for the URL of the server, that you have to open in a web browser.

Configuration

The app exposes a number of configuration options via the URL query string:

  • initialScenario (first | last | random | number, default: first): start with the given scenario/model.
  • osc (true | false, default: true): Toggle [on-screen controls](#On-screen controls).
  • pauseAfter (number | false, default: 60): Automatically pause the simulation after being idle for the given number of seconds.
  • resetAfter (number | false, default: 180): Automatically reset to the initial scenario after being idle for the given number of seconds.
  • autoPlay (true | false, default: true): Toggle auto-play.
  • scenarioCycleDirection (forward | backward, default: forward): Cycle direction for the cycle key.
  • prevScenarioKey (key name, default: ArrowLeft): Key to go to the previous scenario/model.
  • nextScenarioKey (key name, default: ArrowRight): Key to go to the next scenario/model.
  • cycleScenarioKey (key name, default: c): Key to cycle through the scenarios/model.
  • increaseParameterKey (key name, default: ArrowUp): Key to increase the parameter value.
  • decreaseParameterKey (key name, default: ArrowDown): Key to decrease the parameter value.
  • mathModeKey (key name, default: m): Key to toggle the math mode.
  • wheelDivisor(number, default: 1.0): Divisor controlling the speed with the mouse wheel/trackpad controls the parameter.
  • wheelInvert (true | false, default: false): Invert the direction of the mouse wheel/trackpad controls.
  • wheelAxis(x | y, default: y): Let this mouse wheel/trackpad axis control the parameter.

On-screen controls

When the osc URL parameter is set to true, certain on-screen elements become sensitive to mouse and touch input, which is more convenient for using the program in a workshop setting:

  • Clicking on a non-active scenario indicator switches to the corresponding scenario and resets math mode.
  • Clicking on the already active scenario indicator resets the scenario.
  • Two-finger dragging controls the value of the parameter in addition to controlling it with the mouse wheel. Setting the wheelInvert URL parameter switches the direction of increase and decrease. The wheelAxis URL parameter controls the axis that is used for the parameter control. The wheelDivisor URL parameter controls the speed of the parameter control.
  • Tapping/clicking once onto the UI toggles math mode.
  • Tapping/clicking twice onto the UI toggles fullscreen mode.

Building

Install the dependencies:

npm install

Run the development server:

npm run serve

Build the redistributable bundle into the dist folder:

npm run build

References

Contributors

  • Christian Stussak (Software development)
  • Daniel Ramos (Concept and theory)
  • Malte Hein (Graphic design)
  • Andreas Matt (Coordination)

License

Copyright 2022 IMAGINARY gGmbH

Licensed under the MIT license (see the LICENSE file).