# Using Stochastic Ray Tracing to Simulate a Dense Time Series of Gross Primary Productivity
## 2 Methods
### Model Inversion  
In forward mode, stand-level \(P_{gs}\) is obtained by integrating leaf-level assimilation over the canopy. In inverse mode, the leaf model parameters are inferred using the EC-estimates of \(P_{gs}\), \(T\), \(h\), and simulated \(E_{al}\). Model inversion is achieved numerically by minimizing the cost function:  
\[\underset{\Theta}{\text{argmin}}\sum_{t}\left[P_{gs,\ sin}\left(\Theta;E_{ic},\ T,\ h;t\right)-P_{gs,\ EC}\left(t\right)\right]^{2} \tag{10}\]  
where \(P_{gs,sim}\) and \(P_{gs,EC}\) are the simulated and EC-derived estimates of \(P_{gs}\) obtained from Equation (9) and methods described in Section 2.2, respectively. A number of optimization techniques exist [58] and in this study, the Levenberg-Marquardt method was applied that minimizes the cost function iteratively and requires initial estimates of the parameter set \(\Theta\) used to define leaf-level photosynthetic assimilation. To study the effects of different down-regulation functions, four cases were considered (Table 1): The first case ignores down-regulation and uses fixed values for \(P_{max}\) and \(\alpha\) across all photosynthetic scene elements, \(p_{l}\). The second case investigates down-regulation of photosynthetic capacity and quantum yield based on temperature and relative humidity conditions. The third case includes the seasonal adjustment of photosynthetic capacity and the fourth case includes the acclimation of foliage elements to sun and shade conditions, following [57]. To establish convergence, \(\chi\) was constrained to 0.9, which is slightly higher than 0.8 used by [17] yet within the range specified by [59] for leaf-level photosynthesis (_i.e._, 0.5 to 0.9). In addition, some parameter values used in cases three and four were fixed to estimates obtained from cases two and three, respectively. Temperature parameters (_i.e._, \(\beta_{T}\), \(\gamma_{T}\), \(T_{opt}\)) were fixed in case three and both temperature and relative humidity parameters (_i.e._, \(\beta_{T}\), \(\gamma_{T}\), \(\gamma_{opt}\), \(\beta_{h}\), \(\gamma_{h}\)) in case four. Initial values for free parameters were 10 \(\upmu\)mol-C-m-2-s-1, 0.1 \(\upmu\)mol-C-m-mol-1 photons, 20 \({}^{\circ}\)C, 1000 \({}^{\circ}\)C-days, 100%, 20 \({}^{\circ}\)C, 1000 \({}^{\circ}\)C days, 0, 0, 0.5 for \(P_{opt}\), \(\alpha_{opt}\), \(P_{opt}\), \(D_{opt}\), \(\beta_{h}\), \(\beta_{T}\), \(\beta_{D}\), \(\gamma_{h}\), \(\gamma_{T}\), and \(k_{rub}\), respectively. All 2094 half-hourly data points were used in optimization. A test with bootstrapping (20 iterations) to obtain parameter uncertainties for cases two and three resulted in no significant change in parameter estimates (results not shown), while bootstrapping could not be performed for case four due to hardware limitations. Figure 3 provides an overview of the modeling design and embedded test functionality to assess the verisimilitude of the model and effects of model approximations.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Case** & **Enabled Modifier Functions** & **Fixed Parameters** & **Free Parameters** \\ \hline
1 & None & \(\chi\) & \(P_{opt}\), \(\alpha_{opt}\) \\
2 & \(h_{mod}\), \(T_{mol}\) & \(\chi\) & \(P_{opt}\), \(\alpha_{opt}\), \(T_{opt}\), \(T_{h}\), \(\gamma_{T}\), \(\beta_{h}\), \(\beta_{T}\) \\
3 & \(h_{mod}\), \(T_{mol}\), \(D_{mod}\) & \(\chi\), \(T_{opt}\), \(\gamma_{T}\), \(\beta_{T}\) & \(P_{opt}\), \(\alpha_{opt}\), \(D_{opt}\), \(\gamma_{h}\), \(\beta_{h}\), \(\beta_{D}\) \\
4 & \(h_{mod}\), \(T_{mol}\), \(D_{med}\), \(E_{mad}\) & \(\chi\), \(T_{opt}\), \(\gamma_{T}\), \(\beta_{T}\), \(\beta_{h}\), \(\gamma_{h}\) & \(P_{opt}\), \(\alpha_{opt}\), \(D_{opt}\), \(\beta_{D}\), \(k_{rub}\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Overview of the different model inversion cases, the down-regulation mechanisms investigated and their fixed and free parameters.  
Figure 3: Schematic diagram of methods including test functions; GPP = gross primary productivity, PAR = photosynthetically active radiation.