Three-dimensional plant architecture and sunlit–shaded patterns: a stochastic model of light dynamics in canopies

Abstract Background and Aims Diurnal changes in solar position and intensity combined with the structural complexity of plant architecture result in highly variable and dynamic light patterns within the plant canopy. This affects productivity through the complex ways that photosynthesis responds to changes in light intensity. Current methods to characterize light dynamics, such as ray-tracing, are able to produce data with excellent spatio-temporal resolution but are computationally intensive and the resulting data are complex and high-dimensional. This necessitates development of more economical models for summarizing the data and for simulating realistic light patterns over the course of a day. Methods High-resolution reconstructions of field-grown plants are assembled in various configurations to form canopies, and a forward ray-tracing algorithm is applied to the canopies to compute light dynamics at high (1 min) temporal resolution. From the ray-tracer output, the sunlit or shaded state for each patch on the plants is determined, and these data are used to develop a novel stochastic model for the sunlit–shaded patterns. The model is designed to be straightforward to fit to data using maximum likelihood estimation, and fast to simulate from. Key Results For a wide range of contrasting 3-D canopies, the stochastic model is able to summarize, and replicate in simulations, key features of the light dynamics. When light patterns simulated from the stochastic model are used as input to a model of photoinhibition, the predicted reduction in carbon gain is similar to that from calculations based on the (extremely costly) ray-tracer data. Conclusions The model provides a way to summarize highly complex data in a small number of parameters, and a cost-effective way to simulate realistic light patterns. Simulations from the model will be particularly useful for feeding into larger-scale photosynthesis models for calculating how light dynamics affects the photosynthetic productivity of canopies.


INTRODUCTION
Plant canopies are complex three-dimensional (3-D) structures in which the light distribution is complicated and dynamic, for example due to solar movement. Diurnal changes in solar position and occlusion caused by overlapping leaves mean that leaves alternate throughout the day between periods in which they are sunlit and periods in which they are shaded. Sun rays that temporarily penetrate to the lower layers of the canopy give rise to 'sunflecks' that are highly intermittent. The spatio-temporal dynamics of direct light influences many fundamental physiological functions, such as photosynthesis, photoacclimation and photoinhibition (Walters, 2005;Athanasiou et al., 2010;Ruban and Belgio, 2014;Vialet-Chabrand et al., 2017), and secondary biophysical processes such as drought tolerance, water-use efficiency (Qu et al., 2016), plant growth and crop yield (Maddonni et al., 2002). This is because photosynthesis does not directly track the fluctuations in light; for example, delays in photosynthetic induction to high light result from the time taken to activate enzymes in the Calvin cycle, open stomatal pores and build up metabolite pool sizes, and delays in recovery from photoprotection in low light result from the xanthophyll cycle, impacting productivity (Lawson and Blatt, 2014;Burgess et al., 2015Burgess et al., , 2017bRetkute et al., 2015;Kromdijk et al., 2016;Townsend et al., 2018). Optimizing photosynthesis by addressing these inefficiencies is clearly a target for improving crop yield but doing so requires a clear understanding of the dynamic light conditions in a canopy, rather than just static or time-averaged conditions. Light dynamics may be measured empirically by various methods, such as hemispherical canopy photographs (Pearcy and Yang, 1996), a photosynthetically active radiation sensor moving on a horizontal track (Ross et al., 1998), an electromagnetic 3-D digitizer (Sinoquet et al., 1998) or a near-ground imaging spectroscopy system (Zhou et al., 2017). However, spatial resolution of these techniques is typically very poor. This limitation is overcome by digitally reconstructing plants and canopies (Pound et al., 2014) then using ray-tracing to compute light dynamics (Song et al., 2013). In spite of technical challenges, for example due to occlusion and very fine structures such as wheat ears, digital reconstruction of fieldgrown plants tends to provide a highly accurate description of canopy geometry. However, our understanding of photosynthetic characteristics in canopies is hampered by a current reliance on using ray-tracing to understand the light dynamics in 3-D reconstructed canopies (Kim et al., 2016).
Current ray-tracing approaches are costly in computer resources and produce vast data sets as output, especially if computing at high spatio-temporal resolution. Here we develop a novel mathematical model to describe and rapidly simulate sunlit-shaded patterns within a canopy. The model involves two states, sunlit and shaded, and rates of switching between them that we model as functions of time of day and the depth within the canopy. We construct several different realistic digital canopies and use a ray-tracer to identify the times of switching between sunlit and shaded states at positions throughout the canopies. We then use these switching times to estimate the rate functions for switching between states. This offers insight into how light dynamics in a particular canopy depends on time of day and depth within canopy, and how light dynamics varies between canopies involving different plant species, canopy planting density and canopy leaf area index (LAI).
We use light patterns simulated from the fitted models as an input into a model to predict the reduction in photosynthetic yield attributable to photoinhibition.

Digital canopy reconstruction and ray-tracing
To investigate light dynamics in a range of canopies with different structural characteristics, we constructed digital canopies by assembling imaged and digitally reconstructed plants of wheat (lines 1 and 2 in Burgess et al., 2015a) and Bambara groundnut (from Burgess et al., 2017a, at two different growth stages: 39 and 80 d after sowing) in various configurations. The reconstructions represent the surface of a plant with a large number, N, of small triangular patches. Figure 1A shows an example of a reconstructed wheat plant, with an individual leaf at the lower part of the plant shown in blue. A triangular patch indexed, say, by j is defined by the set of coordinates { , , x x x ( } x 3 are respectively the minimum and maximum heights amongst all the vertices in the canopy. The models developed later involve dependence on these normalized heights. We constructed canopies in silico by arranging into various configurations several individual-plant reconstructions of Burgess et al. (2015) and Burgess et al. (2017a), exploiting the periodic boundary conditions of the ray-tracer (explained below) which give a natural way to 'tile' individual plants to form an effective canopy. We investigated two ways to do this: (1) by putting the bounding box just outside the plant (as shown by the red rectangle in Fig. 1D); or (2) arranging plants on 3 × 3 square lattice a distance d apart, and putting the bounding box through the centres of boundary plants (as shown by the blue rectangle in Fig. 1D). The periodic boundary conditions mean that case (1) amounts to considering an infinite square lattice of identical copies of the same plant. Case (2) is similar, but it introduces additional heterogeneity through randomizing the orientation of the different plants. We positioned the plants at distances d equal to 200 mm, 150 mm, 125 mm and 100 mm. In case (2), we analysed the light dynamics for the plant in the centre of the 3 × 3 lattice. Configuring plants in these various ways led to canopies with a wide range of different structures and LAIs.
To compute the light distribution within the constructed canopies we used Fast-Tracer v3.0 (Song et al., 2013), a software implementation of a forward ray-tracing algorithm. This simulates three categories of light (direct, diffuse and scattered light), and determines where individual rays of light are eventually absorbed on leaf surfaces. Figure 1B shows a configuration for the ray-tracer software (Song et al., 2013). In-bound rays are arranged over a grid above the plant. The direction and amplitude of each ray depends on latitude and time of day. Ray tracing is performed in a cubic domain with periodic boundary conditions on the vertical faces so that when a ray exits one boundary of the domain it re-enters on the opposite vertical face. We used latitude 53° (for Sutton Bonington, UK), atmospheric transmittance 0.5, light scattering 7.5%, light transmittance 7.5% and day 182 (1 July), corresponding to the location where the plants were grown and the day they were imaged (Burgess et al., 2015). We calculated the direct light intercepted during the day at 1 min resolution for every patch in the canopy. The high temporal resolution enabled us to investigate even short-term light fluctuations in the canopy. Figure 1E shows an example of the light pattern computed for a particular patch.

Computing sunlit-shaded patterns from ray-tracing data
To construct sunlit-shaded patterns for each patch we compared values of direct light computed by the ray-tracing algorithm (Song et al., 2013) with the direct light irradiance, A dr , on a unit surface in the absence of any shading (Cambell and Normal, 1998); the latter, defined in eqn (18) in the Appendix, depends on latitude, day of year, time of day, and the angle between a light ray and the normal to the patch in question. Figure 1E shows, for a particular patch in the lower part of a canopy, the direct light computed from the ray-tracer (in black) and A dr (in red). We designated a patch at a given time point as being shaded if the value of direct light computed by the ray-tracer differed from A dr by >10%. The shaded periods are indicated in Figure 1E by vertical grey bars. The substantial shaded period between 1000 and 1100 h, for example, shown in Fig. 1E is a consequence of the shading shown in Fig. 1C. These binary sunlit-shaded light patterns, computed for each patch in the canopy, are the inputs to the models we develop below. Figure 1F shows the sunlit-shaded patterns for all the patches constituting the leaf shown in blue in Fig. 1A, with each row corresponding to an individual patch, the patches (and hence rows) having been ordered according to the normalized heights of the patch centroids. The diagram reveals an intricate pattern, with shadows from the upper leaves moving along the surface of the leaf as the sun changes position in the sky.
In the following sections we develop models for the sunlit-shaded patterns: first Model 1, a simple preliminary model which we use to introduce ideas and notation; and then Model 2, which is the novel modelling contribution of this paper. In each case, we present (1) the model definition; (2) how the model can be fitted to experimental data; and (3) how the fitted model can be simulated to generate realistic light patterns.

Sunlit-shaded dynamics: Model 1
In this initial model, we limit attention to a single patch and consider how its rate of switching from sunlit to shaded, or vice versa, changes with time, t, in a time interval of interest, (0,T). The central assumption is that switching events arise from a non-homogeneous Poisson process (e.g. Ross, 2006). A nonhomogeneous Poisson process is a stochastic process defined via: (1) an intensity function λ(t) ≥ 0 such that, for 0 < δt ≪ 1, where O(δt 2 ) denotes terms involving squared or higher powers of δt, which are negligible for small δt; and (2) the assumption that the probabilities of events in distinct intervals are independent (Ross, 2006). From this independence, and eqn (1), it follows that for any interval (t, t + u) ⊆ (0,T), . Equation (2) is useful in the following section for constructing expressions needed for fitting the model to data.
Fitting Model 1. The goal is to fit the model by estimating the intensity function λ(t) based on a set of switching times 0 < v 1 < · · · < v n < T. We will use maximum likelihood estimation, a standard statistical principle for estimating model parameters from data (Cox, 2006). This involves constructing the likelihood function for the model, which is the probability (density) function evaluated at the observed realization of switching times but regarded as a function of the parameter λ(t) to be estimated. The likelihood function for this model is Equation (3) can be derived by discretizing the interval (0,T) with increments of size δt, writing the likelihood as a product of factors (using independence of increments) with each factor either eqn (1) or its complement, depending on whether the increment contains an event, then taking the limit δt → 0. The four factors in square brackets have the following interpretations: the first factor is a contribution from having no events in the interval (0,v 1 ); the second factor from having no events in (v i , v i−1 ) for i = 2, ..., n; the third from having no event in the interval (v n ,T); and the fourth is the contribution from the switching events occurring at times v 1 , ..., v n . These interpretations are helpful in constructing likelihood functions for Model 2 below, but in the present case, telescoping in the exponent means that eqn (3) simplifies to Maximizing L(λ(t)) directly with respect to an unrestricted λ(t) is ill-posed (since the maximizing λ(t) would blow up at the switching instants t =v 1 , ..., v n , and be zero elsewhere). A solution to this is to impose a functional form for λ(t) in terms of a small number of parameters, θ = (θ 1 , ..., θ p ). We then write λ(t) = λ(t; θ), and fit the model by maximizing the likelihood eqn (4) with respect to θ. In fact, it is equivalent and usually more convenient to compute this maximum likelihood estimate (MLE) of θ by maximizing the log of the likelihood function, which is We discuss below specific choices for the form of λ(t;θ). Function (5) can be maximized by a numerical optimization routine, and for the calculations in this paper we have used the Nelder-Mead simplex method (Nelder and Mead, 1965). If λ(t;θ) is linear in θ then eqn (5) is concave in θ, making the numerical optimization particularly straightforward.
Simulating from Model 1. From eqn (1), the distribution function for the additional time until the next event occurs given that an even occurred at time v is and a random variable can be simulated from this distribution using the inversion method (Ross, 2006). An algorithm to simulate a sequence of event times v 1 , v 2 , v 3 , ... is thus as follows.
Let v 1 be a simulated value from the distribution F 0 . Then let v 2 equal v 1 plus a simulated value from the distribution F v 1 . Continue in this way, letting v i+1 equal v i plus a simulated value from the distribution F v i until v i+1 > T.

Sunlit-shaded dynamics: Model 2
The main contribution of this paper is to extend Model 1 in two ways: (1) to incorporate distinct rate functions, λ on (t) and λ off (t), for switching 'on' (from shaded to sunlit) and 'off' (from sunlit to shaded), respectively; and (2) to describe multiple patches, with the rate functions for different patches depending on the normalized height, h, within the canopy (in addition to time, t, as in Model 1).
Extension (1) requires a notational distinction between the times of on-switching events, say x i , and off-switching events, y i . For a given patch, on-and off-switching events necessarily alternate, and hence a sunlit-shaded pattern is characterized by the ordered set of times {x 1 , y 1 , x 2 , y 2 , ..., x n , y n }. We represent a state initially 'on' at time 0 by having x 1 < 0, and 'off' at time T by y n > T (the particular values of x 1 and y n in these cases do not need to be specified) but besides these exceptions we otherwise assume that 0 < x i < y i < T for all i. and, where I(·) is the indicator function, equal to 1 if its argument is true and 0 otherwise. Equations (7) and (8) generalize eqn (3) to distinguish between sunlit-to-shaded and shaded-to-sunlit switches, and they are constructed in a similar way to eqn (3); see Fig. 2, in which sections of example sunlit-shaded patterns are coloured to indicate how they contribute to either eqn (7) or eqn (8). The final step is to generalize to multiple patches, incorporating dependence of the rates on the heights of the different patches. Let j = 1, ..., m index the different patches, and quantities specific to the jth patch be indicated by suffix j. As before, we assume x 1,j < 0 and y n,j > T if the state is 'on' at the beginning and end, respectively, of the interval (0,T). We let h j denote the height of the jth patch and use subscripts on the rate functions to denote their dependence on height, i.e. the rate functions for the jth patch are λ on (t) and λ off (t). Assuming independence of patches (an assumption discussed later in the Discussion section), the likelihood functions for λ on (t) and λ off (t) can be constructed as a product of factors of the form eqn (7) and x 1 y 1 x 1 x 1 y 1 y 1 x 2 x 2 x 2 y 2 y 1 y 2 x 2 x n-1 x n-1 y n-1 y n-1 y n-1 x n x n x n At time t = 0 , a sunlit state is indicated by x 1 0 < and a shaded state by x 1 0 > ; at time t T = a sunlit state is indicated by y T n > and a shaded state by y T n < . The different sections are coloured to indicate how they contribute to the (log) likelihood functions: red denotes a contribution to on-switching functions [eqns (7) and (9)] and yellow to off-switching function [eqns (8) and (10)].
where h is the normalized height of the patch's centroid, so that patches high in the canopy tend to start off sunlit whereas those at the bottom tend to start shaded. The distribution for the time until the next event depends on whether switching is from sunlit to shaded or vice versa. We denote the distribution for the time to the next 'on' event given an 'off' event occurred at time x 1 by F x 1 on ; and the time to the next 'off' event, given an 'on' event occurred at time y 1 by F y 1 off . An algorithm to simulate from Model 2 is then as follows. Simulate the initial state as either sunlit or shaded. Supposing it is sunlit, let x 1 be a simulated value from F 0 off . Then let y 1 equal x 1 plus a simulated value from F x 1 on . Continue letting x i+1 equal y i plus a simulated value from F y i off and y i+1 equal If in the first step above the initial state is instead shaded, then the following two steps are replaced by simulating y 1 from F 0 on , but the algorithm otherwise proceeds the same. This algorithm simulates the binary state of whether the patch is sunlit at time t. The corresponding direct light flux density (adjusting intensity during sunlit periods to account for factors including solar position at time t and patch orientation) is flux density p atch sunlit at time where A dr is as described earlier and defined in eqn (18) in the Appendix.
Case study: photoinhibition model To assess the models, we investigate whether light patterns simulated from Model 2 and used as input into a photoinhibition model lead to similar results compared with when the ray-tracer dynamics are used as input. Photoinhibition is a light-dependent decline in the maximal quantum yield of photosynthesis and can lead to a lowering of photosynthesis and potential growth (Long et al., 1994) and hence it is a good physiological quantity with which to test the impact of light dynamics. The effect of photoinhibition can be characterized by changes in the shape of the light-response curve, in terms of changes in the parameters that define it. The light-response curve is often modelled by a non-rectangular hyperbola (defined in the Appendix) involving two shape parameters: the quantum yield of PSII, ϕ , and convexity, θ.
Following Burgess et al. (2015), we quantify the impact of photoinhibition by predicting the reduction in carbon gain over a day within a wheat canopy. We use the same canopy, photoinhibition model and physiological measurements as Burgess et al. (2015), so that the only difference here is that the light dynamics are simulated from the model, rather than coming directly from the ray-tracer. The model of photoinhibition was parameterized by field data consisting of chlorophyll fluorescence and light-response curves of carbon dioxide assimilation. The canopy was divided into three layers (top, middle and bottom), and for leaves at each layer light-response curves and dark-adapted maximum quantum yield, F F v m / , were measured at midday, giving scaling factors 0.857 for the top layer and 0.955 for the middle layer. . . Here time t is measured in hours over a T = 12-h period starting at 0600 h, so that t = t md ≡ 6 h represents noon. The coefficients have been chosen somewhat arbitrarily to simulate a high degree of variation over the period, in which the rate of switching increases from sunrise, reaches its maximum near the middle of the day, then decreases until sunset. Figure 3B shows λ t ( ) plotted in grey, and Fig. 3A shows a single realization from this model.  Fig. 3B). The estimated intensity function matches the true intensity function reasonably well, but not exactly because the estimate is based on a small amount of data. Typically, the MLE gets closer to the true answer as the amount of data increases. This is illustrated by the blue and red curves in Fig. 3B, which are the MLEs based on data from multiple realizations.

Model 2 fitted to ray-tracer data
We constructed canopies by assembling 3-D reconstructions of wheat and Bambara groundnut plants, as described above.
so that the switching rates depend linearly on height, h, and parabolically on t. This is the simplest form we can choose for eqns (12) and (13) such that they depend on h and t, and with their dependence on t being both smooth and symmetrical about midday.
We estimate the parameters θ = ( ) ff ff ff from the sunlit-shaded patterns extracted from ray-tracing data by maximum likelihood estimation, as described above. Table 1 shows the fitted parameters for the various canopies we considered, and each canopy's LAI. Notable from the table is that a on and a off both tend to be far from zero, indicating that the switching rates are strongly dependent on depth within the canopy. For many of the canopies a off is very close to 1, so that the 'off' rate at the very top of the canopy is close to zero; this is because patches at the very top are not obstructed by other leaves and are hence permanently sunlit. Typically, the parameters b 1 off and b 2 off contributing to the 'off' rate are larger for canopies with higher LAI and the corresponding parameters b 1 on and b 2 on in the 'on' rate are slightly smaller. This is consistent with the intuition that in dense canopies sun flecks are typically shorter and less frequent.
The information in Table 1  This has the interpretation of contrasting the height-dependent part of the 'on' rate with the constant and time-dependent parts of the 'off' rate. Taking this together with Fig. 4(iii), which shows clear clustering in PC2 according to species, lines and planting density, this PC provides insight into how the light dynamics between different canopies differ by depth and time of day. Plotting PC1 versus PC2, as in Fig. 4(iii), indicates very clear clustering of canopies we expect to be similar, showing clearly that the PCs (and the fitted parameters from which they were computed) encode meaningful information about the canopies.

Model evaluation: summary plots and photoinhibition case study
To assess the goodness of fit of Model 2, we show in Fig. 5 a comparison of the distributions of sunlit and shaded periods, aggregated by canopy over h and t. The periods for the raytracer data tend to be slightly more variable than for the fitted model, which is consistent with our imposing, via eqns (12) and (13), stringent smoothness in the dependence of rates on h and t (and imposing the condition that there is no dependence at all on the other spatial coordinates), which restricts variability between patches. This aside, the histograms match well.
As a further evaluation, we consider how different the outcome is if we feed into a photoinhibition model the light dynamics simulated from Model 2, rather than from the ray-tracer. To do this, it is necessary to estimate diffused light values, as the rate of photosynthesis depends on the total intercepted irradiance. In contrast to direct light and its properties discussed above, the diffused light does not fluctuate during the day, but depends on the position of a patch within a canopy, latitude, day of the year and time of the day. The latter three attributes (latitude, day and time) can be used to calculate the diffused light profile over a day on a horizontal surface. Diffused light over all patches has the same shape as this profile, but each patch has an individual scaling of diffused light amplitude. Figure 6A shows profiles of diffused light during a day on a particular patch obtained from the ray-tracer (red) and by fitting a scaling factor to the analytic expression of direct light (given in the Appendix). We have fitted scaling factors using a least-squares method to all patches of line 2 in Burgess et al. (2015). This is shown in Fig. 6B as grey dots. To determine the scaling-factor dependence on the normalized height, we calculated an average value of the scaling factor in intervals Fig. 6B).
Photosynthetic rate is light-intensity-dependent and so depends on the position of the patch, and the light-response curves were measured at the top, middle and bottom of the canopy (Burgess et al., 2015). The maximum photosynthetic capacity was estimated as 28.6 µmol m −2 s −1 for the top layer, 12.6 µmol m −2 s −1 for the middle layer and 4.7 µmol m −2 s −1 for the bottom layer. Light response curves were taken from Burgess et al. (2015) (Fig. 6C). As the LAI of the canopy from line 2 in Burgess et al. (2015) was close to the LAI of canopy G, we used parameter values from Table 1 associated with this canopy. We simulated light patterns for all patches for the line 2 canopy (Burgess et al., 2015) with direct light calculated using simulations from Model 2 and diffused light calculated using the relationship of the scaling factor and normalized height as   Table 1. discussed above. A few of the light patterns from different layers are shown in Fig. 6D. We compared daily carbon gain calculated based on light patterns from both model simulations and ray-tracer output for 1000 patches selected uniformly at random (Fig. 6E). The values plotted on the vertical axis are averages over ten realizations of sunlit-shaded patterns simulated from the model. The results show strong correlation for the two sources of light patterns (Pearson correlation coefficient 0.92, P < 10 −6 ). In Fig. 6E we have plotted a locally estimated scatterplot smoothing (LOESS) curve for the data, and the 1:1 line for comparison. These lines deviate somewhat and we note two reasons why. First, we have assumed, via eqns (12) and (13), a very smooth dependence of the switching rates on height, h. Second, we have made no attempt to characterize heterogeneity amongst patches at common h, so the model characterizes an 'average' patch at each height h such that, for example, there are no predictions of patches with exactly zero carbon gain, unlike for the ray-tracing patterns, in which some patches remain permanently shaded. Either or both of these can be relaxed at the expense of making the model (which is deliberately very parsimonious, involving only six parameters) more complex (see the Discussion section).
Finally, we have used light patterns obtained using the stochastic model to infer the effect of photoinhibition. We analysed three scenarios: reduction in quantum use efficiency, ϕ , reduction in the convexity, θ , and reduction in both φ and θ. It has been shown previously in Burgess et al. (2015) that the latter scenario gives the largest reduction in carbon gain relative to a non-inhibited canopy, and this reduction mostly comes from the top layer. Results in Fig. 6F show generally good agreement between using the simpler stochastic model and using the full ray-tracing data, as in Burgess et al. (2015), in predicting the reduction in carbon gain. In the top layer the reduction is consistently slightly lower than for the ray-tracer, but this is actually more in line than Burgess et al. (2015) with other photoinhibition studies, e.g. Zhu et al. (2004).

DISCUSSION
We have used ray-tracing to compute the light dynamics in complex canopies and developed a novel model to characterize the dynamics. The model is useful for summarizing vast and complex ray-tracing data in a small number of parameters, and for simulating light dynamics in a simple and computationally cheap way. Comparing fitted models offers a way to understand differences in light dynamics between different canopies, and the models can be easily simulated to generate realistic light patterns to use as inputs to larger-scale models, for example for computing absorbed radiation and photosynthetic production of a canopy.
In the new field of plant and crop phenotyping, high-resolution 3-D canopy reconstructions can now be developed routinely, but bottlenecks exist in analysing them for physiological function. For example, using the reconstructions available in Pound et al. (2014), running the ray-tracer Fast-Tracer to provide data from a wheat canopy (nine plants) for a simulated 24-h period can take several days. In comparison the stochastic model takes less than a minute to simulate an individual direct light pattern without the need to run calculations for all of the canopy. Light dynamics characterized by the model are a means to investigate canopy photosynthetic responses (as in Fig. 6) and various aspects of crop cultivation, such as varietal selection and altered architectural characteristics, and cultivation practices such as cropping system and row spacing.
In this paper we have fitted the models based on ray-tracing data, and so have not avoided the computational cost of ray-tracing. However, in work not presented here we have also investigated fitting the model to only a small random subset of the patches and have found that models fitted this way typically do not differ much from the full fitted models. For the small subset of patches, sunlit-shaded patterns can be computed by simple geometrical reasoning (considering whether there is line of sight between a patch and the sun as the day progresses), sidestepping ray-tracing altogether. This is highly promising for making model-fitting very fast, and thus opens possibilities for using the model for high-throughput analysis.
As with any model, our model is only an abstraction, intended to be a simple description of something complex, which retains only the features of greatest importance at the expense of discarding others. We have made no attempt, for example, to describe spatial correlation between the light patterns of different patches. There seems no obvious way to do so without retaining the full 3-D geometry of the canopy, and this would forsake the simplicity that makes the model useful. In any case, we do not foresee many applications of a light-dynamics model requiring such high spatial resolution that spatial correlation is important. The assumption of independent patches, made in constructing eqns (9) and (10), embodies the decision to neglect spatial correlation.
There are many natural extensions to the modelling we have introduced. We have considered only very simple functional forms [eqns (12) and (13)] for the rate functions, but there is scope (especially given the scale of the data from ray-tracing studies) for exploring much more elaborate forms, or using non-parametric methods such as splines. The model could also be made more elaborate by allowing for greater heterogeneity amongst leaves at a common height, h, perhaps by the inclusion of random effects (e.g. Dunson, 2008). The maximum likelihood framework naturally extends to model selection, so criteria such as the likelihood ratio (Cox, 2006), and various information criteria such as Akaike and Bayes (Burnham and Anderson, 2002), each of which is based on the likelihood, can be used for formal comparison between different candidate models. We have focused our attention on direct light, modelling a binary sunlit-shaded state stochastically and the amplitude during sunlit periods by a deterministic light amplitude envelope function. We could similarly model scattered and diffuse light, and thus model the total incident light flux as an additive combination of direct, scattered and diffuse contributions. A limitation of the current work is that we have focused on light dynamics within a static canopy and not yet considered the effects of canopy motion, for example due to wind. Even moderate wind may substantially impact canopy photosynthesis (Burgess et al., 2016) and a goal of ongoing work is to characterize the effect of canopy movement on light dynamics. The technical challenges of imaging and ray-tracing moving canopies are much more substantial (Burgess et al., 2016). However, the mathematical model presented here will, at least as a starting point, be appropriate to apply to ray-tracing data from dynamic canopies once such data are forthcoming. An ultimate goal is to connect the light dynamics to the movement of the canopy, and to connect movement of the canopy to the mechanical properties of the plants comprising it. Achieving this will enable identification of which plant mechanical properties can be targeted for improving biomass production and yield (Burgess et al., 2016).
The heterogeneity of the light environment influences how plants respond to and exploit available resources for photosynthesis and crop production. This has been recently demonstrated using recovery from photoprotection (Kromdijk et al., 2016). However, to quantify the impact of a particular photosynthetic process (Rubisco activation, stomatal opening, photoprotection) on productivity requires knowledge of the precise 'signature' of light-shade dynamics. For example, longer periods in high light and low light are likely to be less productive than rapid fluctuations (Roden and Pearcy, 1993;Burgess et al., 2016). This is because rapid fluctuations are likely to result in a higher induction state of photosynthesis. A high induction state means, for example, that Rubisco is maintained in a high state of activation and stomata remain open for longer. Longer periods of low light cause de-activation of enzymes and stomatal closure. The situation is complex since, for example, stomata that remain open during a period of low light will have a higher transpiration rate and hence their instantaneous water use efficiency will be lower during this period (Lawson and Blatt, 2014) despite the enhanced ability to respond to any new high-light event. Additionally, the rapid deactivation of non-photochemical quenching can be an advantage in low light (Kromdijk et al., 2016) and during the subsequent high-light induction (Hubbart et al., 2012). It is only by understanding the precise spatio-temporal light dynamics in different canopy structures, aided by models such as those as we have presented here, that we can predict the impact of these different processes on whole-plant photosynthesis.

Direct and diffused light
Solar ray direction depends on the time and location via day, d, hour, t, and latitude, l a (Cambell and Normal, 1998). The sun declination angle is The hour angle is where α is atmosphere transmittance, A s is a solar constant ( 2600 mol µ m −2 s −1 ) and β is the angle between the light ray and the normal to the surface.
Diffused light irradiance on a horizontal plane is Diffused radiation does not depend on orientations of a leaf (Cambell and Normal, 1998).

Light response curve
The response of photosynthesis to light irradiance, A, is calculated using a non-rectangular hyperbola: The light response curve is defined by four parameters: the quantum use efficiency, ϕ, the convexity, θ, the maximum photosynthetic capacity, A max , and the rate of respiration, which we assume is proportional to maximum photosynthetic capacity, . αA max