Light and Temperature
For a general introduction to the physical environment, see The Environment.
Why Light and Temperature Set the Pace of Everything
Light is the only energy input. Every molecule of oxygen in the water and every calorie of food in the food web traces back to a photon striking an algal cell. When the light switches off at night, oxygen production stops — but every organism keeps breathing. This asymmetry between intermittent production and constant consumption creates the diurnal oscillation that is the fundamental rhythm of the ecosystem, and the single biggest threat to its survival.
Temperature controls how fast everything happens. Warmer water speeds up photosynthesis, respiration, decomposition, and bacterial growth — but not equally. Respiration accelerates faster than photosynthesis with rising temperature, which means a system that is in oxygen balance at 20°C can tip into deficit at 28°C without any other change. Temperature also determines how much gas the water can hold: warmer water dissolves less oxygen, so the ecosystem has a smaller safety margin precisely when metabolic demand is highest.
Together, light and temperature define the metabolic envelope of the ecosystem — how much energy enters, how fast it is consumed, and whether the daily budget balances.
Light Schedule
The basic on/off cycle and PAR units are introduced in The Environment. Two settings control it: the photoperiod (hours of light per day) and the brightness during those hours, measured in µmol photons/m²/s (PAR).
Custom light schedules are also supported, including natural daylight curves or siesta schedules (lights on, off midday, then on again).
Self-Shading
As algae grow denser in the water, they start blocking light from each other. The model accounts for this using the Beer-Lambert law, which describes how light fades as it passes through a medium that absorbs it.
The idea is straightforward: imagine shining a flashlight through a jar of clear water versus a jar of thick green algae soup. In the algae soup, most of the light gets absorbed near the top, and very little reaches the bottom. In clear water, light reaches all the way through.
The model computes the average amount of light available throughout the entire water column by calculating how much light penetrates to each depth and averaging it all together. When there is very little algae, the average light is nearly as bright as the surface light. As algae density increases, the average light drops because deeper water gets dimmer.
This creates an important self-regulating feedback: as algae grow and multiply, they shade themselves, which slows down their own growth. This self-shading is one of the mechanisms that helps prevent algae from growing without limit.
Two parameters control self-shading:
- Light attenuation coefficient: How strongly algae absorb light, per unit of algal carbon concentration per meter of water depth. The default value is 300, based on published measurements of phytoplankton light absorption.
- Jar depth: The depth of the water column in centimeters. Deeper jars mean light has to travel further and gets absorbed more. A typical 1-liter jar uses 15 cm.
The primary contributors to water-column shading are planktonic (free-floating) algae and submerged macrophyte stems. Surface-attached biofilm and periphyton do not float in the water column and so do not shade planktonic algae. Tall rooted macrophytes (e.g. Vallisneria) also attenuate light in the water column through their leaf tissue -- this is handled by a separate canopy model described below (see Rooted Macrophyte Canopy Shading).
How the Calculation Works
The model first computes an "optical depth" -- a single number that captures how opaque the water column is. This is the product of three things: the attenuation coefficient, the concentration of planktonic algal carbon in the water, and the physical depth of the jar.
When the optical depth is very small (nearly clear water), the average light is essentially the same as the surface light. When it is large (dense algae), the average light can be a small fraction of what hits the surface. The relationship is smooth and continuous -- there is no sharp threshold.
Surface Light Attenuation
Light reaching surfaces (gravel at the bottom, ceramic sticks, glass walls) is also attenuated by the water column above them. The model computes this using Beer-Lambert attenuation:
surface light = incident light × geometric light fraction × exp(-(phytoplankton attenuation × [planktonic C] + background attenuation) × depth)
The phytoplankton attenuation coefficient and planktonic algae carbon concentration together capture how much the algae in the water absorb light. Background water attenuation (default 0.05 per meter) accounts for absorption by the water itself and dissolved substances. Depth is the distance from the water surface to the surface in question.
This means surfaces at the bottom of a deep jar receive less light than surfaces near the top, and this effect strengthens as planktonic algae grow denser. Each surface can have its own depth; if not specified, the jar's overall depth is used as the default. The geometric light fraction represents orientation and obstruction factors rather than depth-based attenuation, which is calculated dynamically.
Floating Plant Canopy Shading
Floating macrophytes (Salvinia and relatives) add a second, higher-priority layer of light attenuation that sits above the planktonic Beer-Lambert calculation. Because the plants live at the air-water interface, they intercept light before it enters the water at all. The canopy effect works in two steps:
Step 1 — Per-species optical depth. Each floating species contributes an optical depth based on how much frond biomass it has per unit of water surface area, scaled by a species-specific opacity parameter. For Salvinia, full-coverage biomass (~33 mg N, 1.7 mg N/L in a 20 L tank) gives an optical depth of about 3, which translates to only 5% of incident light reaching the water below.
Step 2 — Whole-canopy transmittance. The optical depths of all floating species are summed and converted to a single transmittance fraction (the fraction of light that passes through the entire floating mat). Multiple floating species compound multiplicatively -- adding a second floating species makes the canopy darker than either species alone.
This transmittance is applied to the schedule light before any planktonic Beer-Lambert calculation, so all submerged organisms see the post-canopy light.
Floating plant self-shading. Floating plants compute their own light differently from submerged organisms. They use the raw, unattenuated schedule light and apply Beer-Lambert self-shading within their own mat: fronds near the top intercept the most light, while fronds deeper in the mat get progressively less. As the mat thickens, the average light per frond decreases toward zero, slowing growth.
A separate surface coverage limit provides a hard spatial cap. As the fractional surface coverage of all floating species approaches a species-specific maximum (95% for Salvinia, 90% for duckweed), new frond growth is linearly suppressed to zero. This prevents indefinite biomass accumulation that Beer-Lambert self-shading alone cannot stop -- at very high density, each frond still fixes a small amount of carbon and the mat would grow without bound in the absence of the spatial cap. All floating species share a single spatial budget (see producers.md).
Floating cover also suppresses evaporation. A dense floating mat reduces the effective water surface area available for evaporation. At full optical coverage, evaporation approaches zero. See Environment: Evaporation for details.
Reference: Beer, A. (1852). Bestimmung der Absorption des rothen Lichts in farbigen Flüssigkeiten. Ann. Phys. Chem., 162, 78-88. [Beer-Lambert law underlying all light attenuation calculations]
Rooted Macrophyte Canopy Shading
Tall rooted macrophytes like Vallisneria extend strap-shaped leaves from the substrate up through the water column, sometimes reaching the surface. A dense bed of these leaves forms a submerged canopy that intercepts light much the way a floating plant mat does -- but from within the water column rather than on top of it. Short rosette plants like Cryptocoryne, whose leaves stay near the substrate, do not form a canopy and have no shading effect on other organisms.
The model captures rooted macrophyte shading through two complementary mechanisms that operate at different scales:
1. Canopy transmittance (LAI-based, for planktonic organisms). This works identically to the floating plant canopy model. Each tall macrophyte species contributes an optical depth based on its shoot carbon biomass per unit of tank surface area, scaled by a species-specific canopy attenuation coefficient:
tau = k_canopy × shoot_C / tank_area
where k_canopy combines specific leaf area (m² of leaf per mol C of tissue) with a canopy extinction coefficient that accounts for leaf absorption and angle. For Vallisneria, k_canopy ≈ 0.45 m²/mol C, based on a specific leaf area of ~0.9 m²/mol C and a canopy extinction of ~0.5 per unit leaf area index (Titus & Adams 1979; Madsen et al. 2001; Sand-Jensen 1998 report values of 0.3–0.7 for submerged canopies). The transmittance through the rooted canopy is exp(-tau), and it multiplies into the light available to planktonic organisms alongside the floating plant transmittance.
Multiple canopy layers stack multiplicatively: a tank with both Salvinia floating on the surface and a dense Vallisneria bed below it will be substantially darker than either alone. This matches field observations where dense macrophyte beds suppress phytoplankton blooms through light competition (Scheffer et al. 1993; Van Donk & Van de Bund 2002).
2. Beer-Lambert depth attenuation (for benthic organisms). Shoot tissue also scatters and absorbs light at depth, shading organisms on surfaces below the canopy -- periphyton, benthic diatoms, and other surface-attached producers. This is handled by converting the shoot carbon into an equivalent planktonic algae concentration that produces the same light extinction per metre, then including it in the standard Beer-Lambert surface light calculation. This is the same approach used for submerged macrophyte stems (e.g. Hornwort).
The two mechanisms are deliberately kept separate to avoid double-counting. Canopy transmittance governs light for planktonic organisms (which experience the whole water column); Beer-Lambert depth attenuation governs light for organisms at specific depths. A rooted macrophyte does not shade itself through either mechanism -- it receives light at its own surface depth via the standard surface light calculation.
Ecological significance. In a Walstad-style planted tank, rooted macrophyte canopy shading is one of the primary mechanisms by which established plants suppress algal blooms. A healthy Vallisneria bed transmits progressively less light as it grows, squeezing the light budget for planktonic algae and reducing growth on shaded benthic surfaces. Combined with nutrient competition (roots scavenging pore-water nitrogen before it diffuses to the water column), this produces the "clear water, plant-dominated" stable state described by Scheffer et al. (1993) and observed in practice by Walstad (1999).
References:
- Madsen, J.D., Chambers, P.A., James, W.F., Koch, E.W. & Westlake, D.F. (2001). The interaction between water movement, sediment dynamics and submersed macrophytes. Hydrobiologia, 444, 71–84. [canopy extinction coefficients for submerged beds]
- Sand-Jensen, K. (1998). Influence of submerged macrophytes on sediment composition and near-bed flow in lowland streams. Freshw. Biol., 39, 663–679. [SLA and light attenuation by submerged leaf canopies]
- Scheffer, M., Hosper, S.H., Meijer, M.-L., Moss, B. & Jeppesen, E. (1993). Alternative equilibria in shallow lakes. Trends Ecol. Evol., 8, 275–279. [macrophyte-dominated clear-water stable state vs. algae-dominated turbid state]
- Titus, J.E. & Adams, M.S. (1979). Coexistence and the comparative light relations of the submersed macrophytes Myriophyllum spicatum L. and Vallisneria americana Michx. Oecologia, 40, 273–286. [canopy extinction k = 0.4–0.6 for Vallisneria beds]
- Van Donk, E. & Van de Bund, W.J. (2002). Impact of submerged macrophytes including charophytes on phyto- and zooplankton communities. Aquat. Bot., 72, 261–274. [macrophyte beds suppress phytoplankton through shading and allelopathy]
- Walstad, D.L. (1999). Ecology of the Planted Aquarium. Echinodorus Publishing. [practical observation of plant-dominated clear-water state in low-tech aquaria]
How Light Affects the Ecosystem
Light directly influences three things in the model:
1. Photosynthesis (growth). Algae need light to grow. The model uses a saturation curve (Michaelis-Menten kinetics): at very low light, growth is roughly proportional to brightness; at high light, growth levels off because the algae's photosynthetic machinery is working at full capacity. Each algae species has its own light half-saturation constant that defines how much light it needs -- species with lower values are better adapted to dim conditions. The model does not include photoinhibition (damage from excessive light).
2. DOM photodegradation. Dissolved organic matter (dead organic molecules floating in the water) can be broken down by light through a purely chemical process -- no bacteria needed. This releases nutrients (ammonium and CO2) back into the water. The rate of this process scales with light intensity using a saturation curve with a half-saturation of 150 umol/m2/s. The base maximum rate is about 3% of DOM per day at saturating light, but only about 40% of the degraded DOM is fully mineralized to CO2 and ammonium (the rest becomes smaller organic molecules that are not tracked separately). This photodegradation process has a weak temperature dependence (Q10 of 1.3).
3. Nitrate preference. Algae can absorb nitrogen in two forms: ammonium (NH4) and nitrate (NO3). They generally prefer ammonium because it is cheaper to use -- they can incorporate it directly. Using nitrate requires an extra chemical step (reduction by nitrate reductase) that depends on energy from light. So in bright conditions, algae are more willing to use nitrate; in the dark, they rely almost entirely on ammonium. Each producer species has separate nitrate preference settings for light and dark conditions. The actual preference at any moment is interpolated between these two values based on how much light is available.
Temperature
Temperature can be constant throughout the simulation or it can vary over the course of each day.
Constant temperature is the default. You set temperature_C in the scenario file and it stays there for the entire run.
Diurnal (daily) temperature variation uses a smooth wave pattern (a cosine curve) that rises and falls each day. You specify three things:
- The mean temperature -- the average temperature over the day
- The amplitude -- how far above and below the average the temperature swings (so the daily range is twice this value)
- The peak hour -- what hour of the day the peak temperature occurs (defaults to hour 15, i.e. 3 PM)
For example, a mean of 25 degrees with an amplitude of 3 degrees would give temperatures smoothly ranging from 22 to 28 degrees over each day, peaking at 3 PM and bottoming out at 3 AM.
The model updates the current temperature at every simulation timestep, so all temperature-dependent processes respond to changes continuously.
Q10 Temperature Scaling
Q10 scaling — described in The Environment — adjusts all biological rates for temperature relative to a 25°C reference. Different processes have different Q10 values, reflecting real biology:
- Photosynthesis: Uses a thermal optimum curve rather than simple Q10 (see photosynthesis.md). Below the optimum, Q10 of about 2.0 applies; above the optimum, rate declines linearly to zero at the lethal temperature.
- Respiration: Q10 of about 2.0 to 2.5 (somewhat more sensitive than photosynthesis)
- Grazing: Q10 of about 2.0 to 3.0 (grazers are quite temperature-sensitive)
- Microbial processes (decomposition, nitrification): Q10 of about 2.0 to 3.0
- Photodegradation of DOM: Q10 of 1.3 (barely affected by temperature, since it is a chemical rather than biological process)
Each species in the simulation carries its own Q10 value for its various metabolic rates. This means that warming does not affect all species equally -- a species with a high Q10 for respiration but a low Q10 for growth may actually fare worse at higher temperatures because its energy costs increase faster than its ability to grow.
What Temperature Affects
Temperature reaches into almost every corner of the model:
- Growth rates: Bacteria and other non-photosynthetic organisms grow faster in warmer water (up to their stress limits), scaled by each species' Q10 value. Algae photosynthesis peaks at a species-specific thermal optimum and declines above it.
- Respiration rates: All organisms burn through their energy reserves faster when warm.
- Decomposition: Dead organic matter breaks down faster in warm water.
- Gas solubility: Warmer water holds less dissolved oxygen and CO2. This is modeled through temperature-dependent Henry's law constants (using the van't Hoff equation). O2 and CO2 are both less soluble in warmer water. The practical effect is that a warm, sealed jar can become oxygen-limited more easily than a cool one, even with the same amount of photosynthesis.
- Chemical equilibria: The carbonate chemistry system (which determines pH) shifts with temperature -- the equilibrium constants K1, K2, and Kw all change. The ammonia/ammonium balance also shifts with temperature: warmer water pushes more ammonia into the toxic unionized form (NH3), which is dangerous for animals.
- Temperature stress and mortality: Each species has a comfortable temperature range. Outside that range, mortality increases. The model defines four thresholds per species:
- A low stress threshold and a high stress threshold -- the boundaries of the safe zone (no temperature mortality here)
- A low lethal threshold and a high lethal threshold -- the boundaries where mortality reaches its maximum rate
- Between the stress and lethal thresholds, mortality ramps up linearly. For example, if a species has a high stress threshold at 28°C and a high lethal threshold at 32°C, then at 30°C it experiences half the maximum mortality rate.
Further Reading
- Surfaces -- how surface depth and orientation affect the light reaching attached organisms
- Biofilm Nutrient Enrichment -- how the surface microenvironment differs from bulk water
- Photosynthesis -- how producers use light energy for carbon fixation
- Dissolved Gases and Gas Exchange -- how temperature affects gas solubility and Henry's law constants
- Stability and Failure -- how temperature and light extremes contribute to ecosystem collapse