Robust dynamic experiments for the precise estimation of respiration and fermentation parameters of fruit and vegetables

Dynamic models based on non-linear differential equations are increasingly being used in many biological applications. Highly informative dynamic experiments are valuable for the identification of these dynamic models. The storage of fresh fruit and vegetables is one such application where dynamic experimentation is gaining momentum. In this paper, we construct optimal O2 and CO2 gas input profiles to estimate the respiration and fermentation kinetics of pear fruit. The optimal input profiles, however, depend on the true values of the respiration and fermentation parameters. Locally optimal design of input profiles, which uses a single initial guess for the parameters, is the traditional method to deal with this issue. This method, however, is very sensitive to the initial values selected for the model parameters. Therefore, we present a robust experimental design approach that can handle uncertainty on the model parameters.


Introduction
Model-based approaches are commonly used in the analysis, control and optimization of biological systems. These models rely on knowledge of physical, chemical and biological laws, such as mass balances, transport phenomena and reaction kinetics, and are often described by a system of non-linear differential equations, with inputs and outputs. So, often, the structure of a model can be determined from first principles. However, the model will generally also rely on parameters whose numerical values cannot be determined from physical laws. These parameters must then be inferred from experimental data before the model can be put to use. The experiments required to estimate these parameters are often laborious and cost prohibitive. It is therefore important to determine experimental conditions which are rich in information and thus allow a precise estimation of the unknown model parameters.
At present, the model parameters are often estimated from data collected using multiple experiments at various combinations of input levels, which are kept constant throughout each individual experiment. Even if an appropriate experimental design technique is used to reduce the number of experiments that have to be performed, the experimental effort remains considerable. Alternatively, experiments in which the inputs vary in time can be conducted. This has been shown to be a cost-effective way to generate a highly informative data set [1]. Such experiments are called dynamic. In optimal design of dynamic experiments, time-varying input profiles are constructed to optimize the information content of a single experiment.
The major challenge for experimental design for any non-linear model is the dependence of the optimal experiment on the true values of the unknown model parameters, whose estimation is the primary goal of the experiment. Most of the experimental design literature uses a scalar metric of the Fisher information matrix as the measure of information content in an experiment, as this matrix is inversely related to the covariance matrix of the model parameters. An informative experiment thus ensures a small covariance matrix of the model parameters. Locally optimal design of input profiles uses initial guesses for the model parameters to calculate this information matrix [2]. This method has already been used to construct informative time-varying inputs in chemical engineering [3] and in biological fields such as systems biology [4], predictive microbiology [5,6], food engineering [7,8] and synthetic biology [9]. However, an input profile that is highly informative for one set of parameter values may lack information for other parameter values. Thus, if the initial guesses of the parameters differ substantially from the true values, then the locally optimal design might not allow precise parameter estimates. So, locally optimal design is sensitive to the initial parameter guesses and is thus not robust.
Much recent research in experimental design for non-linear models aims at robustifying the design to the true, but unknown, values of the model parameters. A robust design provides a large information content regardless of the true values of these parameters. For dynamic experiments, in particular, a min-max based approach has been used by [10,11]. Here, the design is optimized for a worst case scenario. Fisher information matrices are calculated for a set of possible parameter values and the experiment is scored based on the least informative matrix in this set. In contrast, an expected value approach is taken by [12,13]. In this approach, the average information content of the experiments over all possible parameter values is optimized. The expected value approach tends to perform better than the min-max approach for a large subset of probable parameter values, but not for extreme sets of parameter values. The expected value approach is also called pseudo-Bayesian experimental design, because the possible parameter values can be expressed using a prior distribution [14]. The expected value approaches of [12,13] rely on parametric distributions to describe the uncertainty about the model parameters before the experiment has taken place. However, for non-linear models, a parametric distribution will often not be appropriate to quantify the uncertainty about the model parameters. Therefore, in this work, we allow arbitrary distributions to quantify the model parameter uncertainty. More specifically, we show how the results of a Bayesian analysis of historical data using Markov-chain Monte-Carlo can be used as a prior distribution, when optimizing an experimental design. This Markov-chain can then be used to calculate the average Fisher information matrix, and has the advantage that it can represent arbitrary distributions [15].
Post-harvest storage of fresh fruit and vegetables is one biological application where optimal experimental design is useful. The ideal storage temperature as well as O 2 and CO 2 partial pressures depend on the respiration characteristics, which in turn depend on species, cultivar, ripeness and multiple other factors. Determining the ideal storage conditions therefore requires much experimentation. Traditionally, this was done by independently storing the product at many different combinations of temperature as well as O 2 and CO 2 partial pressures, and by monitoring the respiration and fermentation [16]. Many modern storage applications, such as modified atmosphere packaging [17] and dynamic controlled atmosphere [18], adopt a model-based approach, where the product is described as a dynamic system with inputs and outputs. The resulting models enable us to use the tools of optimal dynamic experimental design to construct informative experiments. The respiration and fermentation kinetics are generally described by a model of the Michaelis-Menten type [19]. Robust experimental design is particularly needed for post-harvest applications because of the large biological variability of fresh fruit and vegetables. As a consequence of that variability, the parameters of the aforementioned kinetic models vary substantially between seasons and origins. In this paper, we therefore focus on constructing robust experimental techniques to estimate the respiration and fermentation kinetics of pear fruit. This paper describes the first use of robust optimal experimental design techniques in post-harvest research.

Robust optimal experimental design for dynamical systems
In this section, we first present the type of dynamical models considered in this paper. Then, we show how to quantify the information gained from measurements, using the Fisher information matrix. Next, we discuss how to maximize this information content using appropriate control inputs. Finally, we explain how to make the optimal control inputs robust.

Dynamic models
In this paper, we consider experimental design for dynamic models of the form: where t denotes the time ranging from 0 to t e , the end time of the experiment. The column vector y k contains the measurements taken at time point t k , with k ranging from 1 to N, the number of measurement times. The time between measurements is equally spread, so that t k = kt e /N. A measurement at the end of the experiment is thus included, but not at the start. The measurements are subject to independent Gaussian noise. More specifically, � k is identically and independently multivariate normally distributed with zero mean and covariance matrix R(y), which may depend on the true value of the measurements, uncorrupted by noise. The measurements depend on the dynamic state column vector x(t) through the measurement function h. The states x(t) have to be calculated from the system of ordinary differential equations f, with initial conditions x 0 . This system depends on the unknown model parameter column vector θ, and the controllable input column vector u(t).

Information content of an experiment
Our goal is to optimize the controllable inputs u(t) so that the measurements y k contain as much information as possible about the unknown parameters θ. A popular way to quantify the information content of an experiment is the Fisher information matrix (FIM) [2,21]. The (m,n)th entry of this matrix is given by: with n y the measured output dimension. The sensitivities of the states to the unknown parameters, @x(t k )/@θ, cannot be computed directly, as the evolution over time of the states x(t) is described by the system of differential equations in Eq (1). However, these sensitivities can be calculated from the forward sensitivity differential equations [22]: The FIM is the inverse of the Cramer-Rao lower bound of the variance of an unbiased estimator of θ. This lower bound can be interpreted geometrically as a hyper-ellipsoid defined by the eigenvectors and the inverse of the eigenvalues of the FIM. We want this lower bound to be as small as possible, and thus the eigenvalues of the FIM to be as large as possible, because this implies precise estimates for θ are possible. In the literature, several scalar functions of the eigenvalues are used to quantify the size of the FIM [23]. To this end, we use the product of the eigenvalues which equals the determinant of the FIM, and is thus also called the D-optimality criterion. This criterion is inversely related to the volume of the hyper-ellipsoids, measuring the uncertainty about the parameter vector θ.

Discretizing the controls
Optimal experimental design for dynamic systems is an infinite dimensional optimization problem since it requires finding optimal controls u(t) for every t 2 [0, t e ]. To make this problem tractable, the controls have to be discretized in time. We utilize a bounded piecewise constant discretization allowing u(t) to switch values at M equally spaced time points, where u j is the constant control vector during the interval ð j À 1Þt e = M ; j t e = M ½ � , and χ A is the indicator function, and u min and u max are the minimum and maximum control values allowed. Piecewise constant input profiles do not only have the benefit of making our optimization problem tractable, but they are also easy to implement in practice.

Robustifying the experiment
Another issue with experimental design for models that are non-linear in the parameter vector θ, such as the model we described in Eq (1), is the dependence of the FIM on θ. This presents us with a cyclic problem because we are performing the experiment to quantify those parameters. Locally optimal experimental design is the traditional method to deal with this issue. In this approach, the FIM is calculated using a single initial guess θ � obtained from available prior knowledge. A locally optimal experimental design is thus given by: This method might give poor results if the initial guess deviates from the true value, and is thus not robust. One method to robustify the optimal experimental design can be achieved by averaging the information content of the experiment over multiple possible values of the parameters, taking into account the likelihood of each parameter value. More specifically, a weighted average is used to quantify the information content, where the weights are given by a prior distribution of the parameters p(θ). This distribution represents the belief of uncertainty concerning these parameters, before the experiment has been performed. A robust optimal experimental design is therefore given by: This criterion is also called the pseudo-Bayesian D-optimality criterion, because it uses a prior distribution, a tool from Bayesian statistics, in combination with the Fisher information matrix, a tool from classical frequentist statistics. Replacing the Fisher information matrix with the Bayesian information matrix [15] and the determinant with a log-determinant would lead to the fully Bayesian and decision theory based approach of [14].
Generally, the integral in Eq (7) cannot be evaluated analytically. To approximate it numerically, we draw R random model parameter vectors, θ r , from the prior distribution p(θ) and average the determinant of the FIM over these values: The robust criterion in Eq (7) is thus calculated by averaging the determinant of the FIM over a sample drawn from the prior distribution.

Numerical details
The entire optimization problem was implemented in the Julia programming language [24]. All differential equations were solved using the Tsitouras 5/4 Runge-Kutta method [25], as implemented in OrdinaryDiffEq.jl [26], with relative and absolute tolerances equal to 1 × 10 −3 and 1 × 10 −6 , respectively. The piecewise constant control switches were implemented using a periodic callback, provided by DiffEqCallbacks.jl. Note that u(t e ) in Eq (4) is undefined, but this value does not influence the FIM.
Because coding the sensitivity differential equations in Eq (3) by hand is quite laborious and error prone, we calculated them exploiting the automatic differentiation capabilities of DiffEqSensitivity.jl [27], more specifically its implementation of the discrete forward sensitivity analysis method.
To solve the non-linear optimization problems, we used the box constrained optimization capabilities of NLopt.jl [28], specifically the method of moving asymptotes [29], with a relative tolerance on the objective function of 1 × 10 −3 . The required gradients for this method are calculated using the nested differentiation capabilities of ForwardDiff.jl [30]. This optimization method requires an initial experimental design to improve upon and is a local optimizer. Thus, it is not guaranteed to find the absolute best experimental design. To deal with this issue, we utilize multiple starts, each with a different initial design. The TikTak global optimization algorithm [31] can carefully select these initial designs from the design space, using Sobol points. We use 1000 starts of the interior point optimization method in combination with the TikTak implementation in MultiStartOptimization.jl.

Respiration and fermentation model of pear fruit
In this paper, we apply our robust experimental design methodology to precisely estimate the respiration and fermentation characteristics of pear fruit. First, we present a respiration and fermentation model of pear fruit inside a jar. We then quantify the initial uncertainty concerning the various parameters in this model using a published data set.

Model description
The respiration and fermentation of pear fruit inside a jar is modeled by two mass balances for O 2 and CO 2 : The square brackets in these expressions represent concentrations in mol/m 3 . These differential equations describe the change of O 2 and CO 2 concentrations inside a jar with volume V j , which equals 5 dm 3 in our examples. A time varying air mixture with an oxygen concentration [O 2 ] in (t) and a carbon dioxide concentration [CO 2 ] in (t) is blown into the jar with flow rate Q in (t) (units: m 3 /h). These three time varying functions form the controllable inputs to our system. Our measurement set up is schematically shown in Fig 1. Since the pressure inside the jar should remain equal to the atmospheric pressure, we can calculate the outflow Q out (t) from the jar using the ideal gas law: with � R the universal gas constant, P atm the atmospheric pressure. Concentrations throughout the jar and at the outlet are considered to be similar, due to the assumption of well mixing. In our constructed experiments the temperature equals 293.15 K, the amount of O 2 consumed and CO 2 produced is proportional to the mass of the pears m p , taken to be 4 kg and the initial conditions for O 2 and CO 2 will be equal to regular air.
The respiration rates in Eq (10) are specified using models of the Michaelis-Menten type [19]: The models for these respiration rates contain six parameters that have to be identified. V m;O 2 and V m;f;CO 2 are the maximum respiration and fermentation reaction rates, respectively. The Michaelis-Menten constant K m;O 2 represents the saturation of respiration at high oxygen levels, whereas K mn;CO 2 models the inhibition of respiration by CO 2 . The respiration quotient r q represents the percentage of O 2 that is converted to CO 2 by respiration. Finally, K m;f;O 2 models the inhibition of fermentation by O 2 .
The measured gas concentrations [O 2 ] m and [CO 2 ] m at time point t k are assumed to be equal to the true concentrations plus the additive Gaussian noise terms z k and η k , respectively: Since the two gasses are measured with different sensors, we assume that the two noise terms are independent. We assume that the noise variances scale linearly with the gas concentrations, plus a small value to ensure positive definiteness of the R matrix in Eq (2). s 2 O 2 and s 2 CO 2 are nuisance parameters that must be estimated, such that the respiration and fermentation of pear fruit can be studied, but their precise estimation is not of direct interest to us. Since the variance of a gas concentration measurement must have the units of squared concentration, both s 2 O 2 and s 2 CO 2 must have units of concentration. Several sensor principles are available for measuring O 2 concentrations in a practical setting, including gas chromatography, zirconium based sensors, paramagnetic sensors and fluorescence based optical sensors; CO 2 concentrations can be measured using gas chromatography, infrared absorption and chemical gas sensors. Before considering experimental design for this model, we first checked whether the model parameters can be correctly identified at all. This is because it is possible that two different model parameter values result in exactly the same output behavior, making it impossible to distinguish the true value of the model parameters from the data. We confirmed, using the STRIKE-GOLDD Matlab toolbox [32], that our respiration and fermentation model is structurally identifiable even with constant input levels, that do not change in time. Our piecewise constant input profiles form a super-set of the set of constant input profiles, which thus ensures that our experimental designs will result in an identifiable model.

Prior information
Optimal experimental design for our non-linear respiration and fermentation model requires prior information, concerning the six respiration and fermentation parameters. Such prior information for pear respiration and fermentation can be found in [20]. We cannot directly utilize the published results, as [20] only report confidence intervals for each individual parameter, but no correlations between estimates. To deal with this problem, we reanalyzed 50 time series data-sets, each containing O 2 and CO 2 measurements from a single jar, made available to us by the authors, and which can be found in the S1 Table of this paper. We used a Bayesian data analysis technique to achieve this. More specifically, we utilized a Markov-chain Monte-Carlo method to re-estimate the parameters and quantify the uncertainty in the data [33]. The Markov-chain can be found in the S2 Table of this paper. The Markov-chain stores values sampled from the posterior distribution of the parameters. The chain can thus be utilized for numerically approximating the expectation in the robust criterion in Eq (7). In other words, we use the MCMC chain as an input to the expression in Eq (8).
Because the data of [20] were collected at different temperatures, our analysis took into account the effect of temperature on the maximal respiration and fermentation rate by means of the Arrhenius equations: where V m;O 2 ;T r and V m;f;CO 2 ;T r are the maximal respiration rates at a reference temperature T r of 293.15 K, and E a;O 2 and E a;CO 2 are activation energies that describe how the reaction rates increase with the temperature T. These activation energies are nuisance parameters in our computation of optimal input profiles, as we only consider experiments at the reference temperature. Another difference between the experiments of [20] and our experiments is that they used closed jars, instead of flow through experiments. Their system dynamics thus differ:  Fig 3. The estimation of the respiration inhibition parameter, K mn;CO 2 , from the available data was problematic. For this reason, we had to reparametrize the model using the inverse of K mn;CO 2 . As can be seen in the third histogram in Fig 2, K À 1 mn;CO 2 takes values close to zero, which means K mn;CO 2 tends to infinity. The lack of information about K mn;CO 2 can be explained as follows: to precisely estimate this parameter, both high O 2 and CO 2 concentrations are needed. A high O 2 concentration is required because otherwise there is no respiration that can be inhibited, and a high CO 2 concentration is required because otherwise the inhibition has a negligible effect. Data points in which both gasses posses a high concentration do not occur in the data of [20]. The issues with the uncertainty about K mn;CO 2 were the catalyst for the development of our robust experimental design method.  We found no other reliable way to quantify the uncertainty on this parameter, except working with a Markov-chain. K m;f;O 2 is the second hardest parameter to identify from the data of [20], because the O 2 concentration needs to be in a specific range for this parameter to have an effect on the outputs. An O 2 concentration much higher than K m;f;O 2 means no fermentation is happening at all, while an O 2 concentration much lower than K m;f;O 2 implies maximal fermentation. The third most difficult to identify parameter is K m;O 2 , because the model is only sensitive to this parameter when O 2 concentrations are close to the value of this parameter.

Markov-chain details
The data analysis was performed using the No U-Turn Sampling Markov-chain Monte-Carlo algorithm [34], as implemented in Turing.jl [35]. We ran 4 parallel Markov-chains, each starting from the maximum likelihood estimates of the parameters, and each chain comprises 1500 steps. We utilized truncated wide Gaussian distributions as prior distributions in the physically possible regions of the unknown parameters. For all parameters only positive values are possible, with r q being at most 1. The means and standard deviations of these wide Gaussian distributions are found in Table 1. We used the posterior distribution resulting from our Bayesian analysis of the experiments in [20] as a prior distribution for the generation of the robust designs in this paper. However, as calculating robust optimal designs with the entire Markovchain is numerically quite intensive, we discarded the first 500 step, and thinned the remaining 1000 by a factor 40. This gave us 100 samples to calculate the robust D-optimality criterion in Eq (7). These are also the 100 values shown in the top right half of Fig 2.

Results
In our examples, we consider experiments lasting 24 h with measurements taken every minute, i.e. t e = 24 h and N = 1440. The maximum and minimum flow rates are equal to 4 l h −1 and 0.1 l h −1 , respectively. The input gas concentrations are allowed to vary between 0 kPa and 21 kPa. We did not use a minimum flow rate of 0 l h −1 , because at zero flow there is no difference in system response between a maximal or minimal gas input concentration. This implies that the design selection criteria from Eqs (6) and (8) are flat in certain directions, causing numerical issues for gradient based optimizers. Working with a strictly positive minimum flow rate avoids this issue. We also tried remedying this issue using gradient free optimizers, such as the subplex method and the Nelder-Mead method [36,37]. However, these methods did not converge for our robust experimental design methodology, even after 36 hours of computation time, nor did they find a better robust design than the gradient based methods during that time. All computations were run on an Intel Core i7-6700K CPU @ 4.00GHz.

Locally optimal designs for the respiration and fermentation model
We take the average values of the Markov-chains of the parameters of interest, as well as the average of the Markov-chain values of the parameters s 2 O 2 and s 2 CO 2 to evaluate the local D- criterion in Eq (7). These values are shown in Table 2, and indicated by a bullet in the histograms on the diagonal of Fig 2. We start by analyzing the effect of an increasing refinement of the discretization of the inputs u(t). In Fig 4, which shows the local D-criterion value as a function of the number of times M the input signal is allowed to switch, we see that the D-criterion no longer improves noticeably after M = 24, which corresponds to a switch every hour. The experimental design obtained with M = 12, which corresponds to a switch every two hours, already performs well. Therefore, in the remainder of this work, we consider O 2 , CO 2 and flow rate inputs that remain constant for two-hour time periods. The computational time required to optimize the designs are also shown in Fig 4. The optimization time increases linearly as the discretization becomes finer, but, even for M = 48, the optimization of the locally optimal design only requires 7 minutes. The locally optimal design for the scenario in which the inputs are allowed to vary every two hours is shown in detail in Fig 5a and 5b, together with the simulated outputs in Fig 5c, evaluated at the values of the model parameters used to optimize the design. During the first half of the experiment, no pumping actions occur, which causes the CO 2 concentration to rise inside the jar. However, the gas concentrations cannot remain high throughout the entire experiment, since the O 2 concentration must be low to learn about non-saturated respiration, and fermentation. The CO 2 concentration is not allowed to run up too high, as this compromises the ability to precisely determine the fermentation parameters. This can be intuitively understood by considering the system in an extreme scenario where the atmosphere in the jar consists entirely of CO 2 . In this scenario, the outflow will also be pure CO 2 regardless of the values of the fermentation parameters. Information about the fermentation parameters is then only incorporated in the outflow rate, but this is not a measured output. This illustrates how optimal experiments automatically take into account the specifics of the measurement setup.  The importance of low CO 2 concentrations is the reason why air, with almost zero O 2 and CO 2 inlet concentrations is pumped into the jar in the interval between 12 h and 14 h. The pumping action at 20 h, again involving zero O 2 and CO 2 concentrations, is performed for similar reasons. Fig 6a shows the coefficients of variation of all six model parameters, defined as the ratio of the standard errors, as given by the diagonal elements of the inverse of the FIM, and the model parameter values used for the generation of the local optimal design. The three inhibition parameters (K m;O 2 , K mn;CO 2 and K m;f;O 2 ) remain the most difficult to estimate ones. Now, however, in our experiment involving a single jar, instead of using the data from 50 jars, made available to us by [20], the model parameters can be estimated much more precisely. Fig 6b shows a map of the absolute values of the correlations of the estimates that would be obtained if the locally optimal experiment were to be used. Because there are no strong correlations between the first three parameters and the last three parameters, we can thus visualize the FIM in Eq (2) using two ellipsoids. The axes of the first ellipsoid are in the directions of the eigenvectors of the inverse of the top left quarter (a 3 by 3 matrix) of the FIM, and the lengths of the axes are the corresponding eigenvalues. The second ellipsoid is similarly based on the bottom right quarter. More specifically, we can use one ellipsoid to show the gain in information for the parameters V m;O 2 , K m;O 2 , and K mn;CO 2 and another ellipsoid to show the gain in information for the parameters r q , V m;f;CO 2 and K m;f;O 2 . These ellipsoids are shown in red in Fig  7a and 7b for the experiment allowing changes in inputs every two hours, and are compared to the ellipsoids in blue resulting from the heuristic experimentation technique used by [20] with the volume of the jar, mass of pears, initial conditions, sampling times and total experimentation time equalized between the two methods. The volume of the ellipsoids of the locally optimal experiment are smaller.

Robust optimal designs for the respiration and fermentation model
We now continue by searching a more robust design than the locally optimal design in Fig 5. Instead of optimizing the determinant of the FIM in Eq (2) for the means of the Markov-chain values, we optimize the mean determinant for a thinned version of the Markov-chain. These 100 values from the thinned chain are graphically shown by the blue bullets in the upper right hand part of Fig 2. The design found by maximizing the robust optimality criterion in Eq (8) is shown in Fig 8a and 8b. The simulated output for all values of the thinned Markov-chain is shown in Fig 8c. The robust design exhibits several similarities to the locally optimal design, with one key difference: the second pumping action occurs two hours earlier in the robust design. Fig 9 shows the difference in performance between the robust and the locally optimal experiment. More specifically, the histogram shows the difference between the determinant of the FIM in Eq (2) for both the robust and locally optimal design at all 6000 model parameter values from four parallel Markov-chains. For many possible model parameter values, the local and robust design perform almost equally well. However, the histogram clearly has a heavy right tail, showing that, for some parameter values, the robust design performs significantly better. As the histogram does not posses a heavy left tail, the reverse is not true. The robust design is thus substantially less sensitive to the exact values of the model parameters. It therefore provides a better guarantee for a highly informative experiment than the locally optimal design. Since this result holds for the entire Markov-chain and not just the thinned version we can be confident that the thinned version is sufficient to summarize the prior uncertainty, and that the resulting robust design does not only work well for the specific model parameter values used to evaluate the optimality criterion in Eq (8), but also for parameter values other than the 100 values used in this equation. The heavy right tail consists of those elements of the Markov-chain which have a low value for the hard to estimate parameter K mn;CO 2 . For low values of this parameter, the parameter is best estimated at lower CO 2 concentrations in the jar,  while there is also still enough O 2 left for the inhibition effect on respiration to be noticeable. This explains the earlier pump in the robust experiment. Finally, the positive mean value for the difference in determinants, indicated by the orange dot in Fig 9, proves that the robust design is expected to do better for the region of prior uncertainty. We also calculated the locally optimal design for one of the model parameter values out of the right tail of Fig 9 and found that the locally optimal design for this parameter value was identical to the robust design. So, it seems that the robust design is influenced heavily by a few parameter values. However, for the parameter value for which the locally optimal design in Fig 5 performs the best, the robust design does not perform much worse, relative to the difference in performance between those two designs for model parameter values in the tail of Fig 8. To summarize: the robust design does significantly better for a few of the possible parameter values and only slightly worse for the majority of possible parameter values.
In Table 3, we also compare, using the full Markov-chain, our robust experimental design method based on a thinned Markov-chain, which can approximate arbitrary distributions, to the robust experimental design method of [12], which uses 13 sigma-points to summarize the uncertainty on the model parameters, and is thus computationally less intensive. These sigma-points can be found in the S3 Table of this paper. This method requires a mean and covariance matrix summarizing the prior uncertainty on the model parameters to calculate the sigma-points. We used the mean and covariance matrix our Markov-chain for this purpose. For the hard to estimate parameter K mn;CO 2 , we again reparametrized the model using the inverse, K À 1 mn;CO 2 . We followed the recommendation of [12] regarding the weights of the sigma-points. The sigma-point method results in a design that performs slightly worse than the locally optimal design, showing that sigma-points do not always provide good summary of the uncertainty in the model parameters. The inputs of the sigma-point based design are very similar to the locally optimal design. They only very slightly differ in the gas inputs between 4-8h. Table 3 also shows the computing times for the locally optimal design, the design based on the Markov-chain, and the design based on the sigma-point method. The robust design requires a computational time that is roughly 100 times longer than that of than the locally optimal design and 10 times longer than that of the design based on the sigma-point method.  Table 3. Parameters used for the optimization of the construction of the locally optimal designs.

Alternative design selection criteria
In this paper, we presented a robust experimental design methodology for dynamic models and applied that methodology to precisely estimate the respiration and fermentation parameters of fruit and vegetables. We achieved this by quantifying the information content of the experiments using the determinant of the Fisher information matrix averaged over a prior distribution, represented by a Markov-chain. However, the Fisher information matrix is only an approximation of the inverse of the model parameter covariance matrix. Another approach to approximate the covariance matrix based on simulating multiple possible data-sets, and estimating the model parameters from each data-set is suggested by [38]. This approach is numerically much more intensive than an approach based on the FIM, and is therefore infeasible in the context of optimal experimental design. Another promising approach would be to quantify information based on the expected Kullback-Leibler divergence (KL-div) between the prior and posterior distributions [39]. For experiments with a large number of observations, the expected KL-div is asymptotically equal to our robust D-optimality criterion. For a small number of measurements, the KL-div approach might be superior as it does not utilize normal approximations. One major downside of using the KL-div is its computational complexity, as it involves calculating a high dimensional integral over all possible outcomes y of the experiment. This is generally done using a double loop Monte-Carlo integration method [40]. Some research has been done using this method for determining optimal sampling times of dynamic systems [41], but this work does not consider optimal control. Therefore, the dynamic system in [41] does not need to be solved repeatedly for different control actions. Instead, only a single dynamic system needs to be solved that can be evaluated at different possible sampling times. Selection of input profiles based on the KL-div is considered in [42], but only for a small discrete set of possible input profiles. In contrast, in our paper, we optimize the experimental design over a large continuous space of possible experimental designs. Recently, advances have been made in lowering the computational burden of the KL-div based approach by considering surrogate functions that approximate the KL-div based on polynomial chaos expansions [43]. Another approach to lower the computational burden is based on variational Bayesian techniques [44], where the inner Monte-Carlo loop is replaced by optimizing a variational distribution. This technique then allows for jointly optimizing the design and variational parameters [45]. In future work, we will employ these variational Bayesian techniques for adaptive dynamic experiments, where the design is modified online as data is collected.

Model uncertainty
Throughout this paper, we have assumed that the model structure has been identified correctly, and that only the model parameters must be estimated. However, often there is also substantial uncertainty about which model structure is correct. An experiment (or sequence of experiments) must then be constructed such that a precise determination of both the model structure and the model parameters is ensured. For robust experimental design, this involves constructing a joint prior distribution over the possible model structures and their model parameters. For the techniques used in this paper, constructing such a joint prior would be difficult, since the Markov-chain Monte-Carlo methods we employed, such as NUTS, can only deal with continuous parameters, and not discrete ones like different possible model structures [33]. Possibly, this issue could be overcome using Gibbs sampling [35]. We also assumed that the measurement noise was heteroscedastically normally distributed. Since the gas concentrations should always be positive, other distributions, such as the log-normal distributions might also be considered. For these distributions, however, the definition of the Fisher information matrix in Eq (2) would have to be generalized [2], which would lead to much more complex optimization problems.

State discretization
In this work, we discretized only the controls u, but not the states x. The discretization of states is applied using multiple shooting and collocation based dynamic optimization approaches [46]. Generally, these methods lead to optimization problems that are faster to solve, but which might result in poorer designs. Besides the faster computing time, one additional reason to consider discretization of the states would be the presence of additional constraints on the states, which our problem does not contain. This is because violations of such constraints are difficult to check without a discretization, and adding these discretized states as variables to the optimization problem. In our work, the dynamic states are integrated away by the differential equation solver. We could still use the solution of the differential equation to check state violations and add a term to the optimization objective that punishes such violations. A more detailed discussion on the incorporation of constraints into optimal dynamic experiments is provided by [13].

Reverse automatic differentiation
We used forward mode automatic differentiation to calculate the sensitivities to the unknown parameters θ, required to obtain the FIM in Eq (2), and this was further nested to calculate the gradient of the D-criteria in Eqs (6) and (8) with respect to the control parameters u. Forward mode automatic differentiation generally performs well for functions with a small number of inputs, relative to the number of outputs. For our respiration model, it thus was a good choice for calculating the unknown parameter sensitivities present in the FIM. Reverse mode automatic differentiation performs better for functions with many more inputs than outputs. It thus seems like a natural choice to calculate the gradients necessary for the optimization of the control parameters. However, there is currently not yet a mature implementation of reverse over forward mode automatic differentiation in the Julia ecosystem [27].
Supporting information S1