LeafPhotosynthesis.jl

LEAF PHYSIOLOGY / WORKED EXAMPLES

Start with a leaf.
See how it responds.

Small Julia examples, real model output. Change one input, inspect the response, then combine the components.

Loading model output…

Plots show saved Julia results. Switching precision selects a separate Julia run; the browser does not simulate physiology. Hover for values or use the series controls and data tables below each plot.

01 / THE FIRST CALL

Evaluate one leaf

Prescribe light, internal CO₂, and leaf temperature. photosynthesize returns carbon uptake and its component rates. Positive net assimilation means CO₂ uptake; negative values mean release.

julia --project=. examples/one_leaf.jl
Read the complete example

Configuration stays in read_parameters.jl; physical component assembly is visible in bonan_leaf.jl. The main script calls the biophysics.

02 / BONAN 11.1

Change one forcing at a time

These three curves use Bonan's C3 parameterization. In each panel, only the horizontal-axis variable changes. The Rubisco- and electron-limited curves have respiration subtracted, so they can be compared with net assimilation.

julia --project=. examples/bonan_11_1.jl
Read the complete response-curve example

The CO₂ axis is internal CO₂ mole fraction, not ambient CO₂. It represents the biochemical site here, with no mesophyll diffusion solve. Numerical curves pass an independent high-precision equation check; comparison with executed upstream MATLAB output remains pending. Scope and provenance →

03 / CONNECT THE COMPONENTS

Solve a leaf at equilibrium

Now prescribe ambient CO₂ and solve assimilation, diffusion, and Ball–Berry stomata together. CO₂ at the leaf surface, intercellular space, and biochemical site can differ. Temperature and humidity remain prescribed.

julia --project=. examples/core_exchange.jl
Read the complete equilibrium example

The derivatives describe the response to stomatal opening at fixed temperature. This is an illustrative component example, not a reproduction of Bonan 12.1. Equations and assumptions →

04 / LET STOMATA TAKE THEIR TIME

Turn the light on, then off

The prognostic model moves toward the current stomatal target. Its opening and closing time constants are separate parameters. Dashed lines show the fully coupled equilibrium for the same forcing, not the instantaneous target used in each prognostic step.

julia --project=. examples/stomatal_response.jl
Read the complete time-integration example

Temperature, surface humidity, and transport conductances stay fixed. The example uses an explicit Euler step; it does not provide a general-purpose integrator. Net O₂ release and net CO₂ uptake overlap for this example's core stoichiometry and respiratory quotient of one. This equality is not a universal physiological constraint. Oxygen budget and model limits →

05 / SUPPLY AND USE

Electron flow survives carbon cancellation

At the photorespiratory compensation point Γ*, carboxylation balances photorespiratory CO₂ release. Both processes still turn over, so realized linear electron flow remains positive even though pre-respiration carbon uptake is zero. Net uptake additionally subtracts respiration.

julia --project=. examples/biochemical_turnover.jl
Read the complete turnover example

Light and temperature are fixed; CO₂ is prescribed at the biochemical site. The example uses signed C3 assimilation and computes turnover with oxygen exchange disabled. Alternative electron sinks, cyclic flow and fluorescence yield are not inferred. Equations and limits →

PSII excitation and fluorescence

Compare two replaceable quenching components using the same C3 model and the same absorbed photons. Rates and the low-light electron yield are explicitly compatible in this new exercise; the earlier Bonan exercises retain their original values.

julia --project=. examples/fluorescence.jl
Read the complete fluorescence example

Temperature and biochemical-site CO₂ are prescribed. The empirical KN fit has PAM/PSI-contamination limitations; its PSII-only interpretation is an explicit approximation. There is no NPQ memory, PSI source or leaf optical escape here. Yield probabilities close an excitation budget, not a complete leaf energy budget. Equations, parameter conventions and limits →

06 / AN EXPLICIT OXYGEN RESPONSE

Let the compensation point respond to O₂

Rubisco competition and the photorespiratory compensation point must use the same oxygen level. Here Γ* scales with O₂ from a declared reference partial pressure. The prescribed-Γ* curve is a controlled comparison, incompatible with an oxygen sweep away from its calibration; it is not an alternative calibrated prediction.

julia --project=. examples/oxygen_response.jl
Read the complete oxygen-response example

Ambient CO₂, light, surface humidity and diffusion conductances are prescribed. The A–Ci solve adjusts biochemical-site CO₂ and equilibrium stomata at each oxygen level. O₂ transport and anaerobic respiration are not solved. Equations, reference calibration and limits →

07 / MECHANISTIC VS. EMPIRICAL STRESS FLUORESCENCE

How fluorescence responds when sinks or Cytochrome b₆f limit

Compare empirical PSII quenching fits (van der Tol et al. 2014 Cotton and Drought KN(x)) against the coupled Cytochrome b₆f + PSII/PSI mechanics of Johnson & Berry (2021), using shared Rubisco kinetics (Vcmax25 = 60) and aligned mid-PAR crossover capacities (FvCB Jmax25 = 100.2, θ = 0.90 vs. Cytochrome Vqmax25 = 195, SerialLimitation).

julia --project=. examples/cytochrome_stress.jl
Read the complete Cytochrome stress-comparison example

Under high-light stomatal closure, empirical Cotton KN(x) saturates early and predicts a slight fluorescence yield increase, requiring a separately fitted Drought parameter table. Johnson & Berry's single mechanistic parameter set predicts strong feedback quenching under Rubisco/stomatal sink stress, PSI cyclic-flow rebalancing at moderate light, and opposite fluorescence signs for Rubisco vs. Cytochrome b₆f downregulation. Yields remain internal leaf emission probabilities before optical escape. Biophysics, equations and stress regimes →

08 / JOHNSON & BERRY (2021) BENCHMARKS

Connectivity, state transitions, capacity inversion, and PAM leakage

Reproduce four signature mechanisms from Johnson & Berry (2021, Photosynthesis Research 148:101–136, Table 2 & Fig. 8): PSII exciton sharing (KU2, Case 9), closed-form pointwise LHCII state transitions (StateTransitionRule, Case 10), coordinated Cytochrome b₆f + Rubisco capacity scaling (Case 12), and apparent leaf-chamber PAM fluorometry under PSI detector leakage (PAMFluorescenceObserver, Eqs. 38–42).

julia --project=. examples/johnson_berry_2021.jl
Read the complete Johnson & Berry (2021) benchmark example

With static antennae (Case 9), exciton sharing (KU2 > 0) boosts PSII efficiency above PSI's capacity and forces low-light KN > 0, damping the huge puddle (KU2 = 0) fluorescence spike. Closed-form state transitions (Case 10) instead migrate 17–22% of PSII cross-section to PSI, keeping KN = 0 up to Rubisco saturation and restoring a moderate biphasic ΦF2 peak while boosting light-limited assimilation. Coordinated capacity scaling (Case 12) shifts that peak in PAR and flips the sign of ∂ΦF2/∂capacity between low and high light. In long-pass (>700 nm) PAM detectors (εF1/εF2 = 2), PSI contributes ~39% of dark Fo, depressing apparent 1 − Fs/Fm′ and lake 1 − qL while leaving puddle qP invariant when KX1 = KP1. Closed-form derivations and PAM equations →

KEEP EXPLORING

Change a parameter. Rebuild the figures.

Edit the named values in bonan_11_1.toml, core_exchange.toml, or the CO₂ sweep in turnover.toml, then regenerate all plotted data:

julia --project=. docs/build_examples.jl

Reopen this file in a browser. Chart.js and all model results are bundled locally, so the gallery works offline. No server or JavaScript package installation is needed to view it.

Try changing opening_timescale while keeping closing_timescale fixed. Which part of the response changes? Then change the Ball–Berry slope and compare the new equilibrium.