**6. Analysis and modeling: the estimation of R**

## **6.1. Input data**

We select for the study mushrooms from species *Macrolepiota procera,* which is one of the most popular in consumption and frequency from our country. Experimental measurements of major parameters involved in our model (parameters from Eq. (1)) were done on mature samples collected from the natural habitat where the evidence of potential contamination with chemical compounds exist. The measured data were grouped by compartments—basal bulb, stipe, gills and cap—representing the main anatomical parts of the mushroom body. Their form is illustrated in **Table 1**.

To convert our problem from bi-dimensional to a one-dimensional one, we consider a weighted mean for concentrations and parameters. The piecewise constant parameters (*p*, *χ*, *Wc* , *ET*¯, *Upf* , *Baf* ) are weighted by height (*z*), and the concentrations are weighted by diameter, on sections approximately orthogonal to median axes (see **Figure 3**).

### **6.2. Differential operator and its approximation**

Once we have the averaged concentration we compute the rate using the formula:

$$R(\mathbf{z}) = \frac{d\langle p\Phi(\mathbf{z})\chi\mathbf{C}(\mathbf{z})\rangle}{dz} - \frac{d}{dz}\Big[p\Phi(\mathbf{z})\left(\mathcal{W}\_c - \overline{\mathcal{E}T}\right)\frac{d\mathbf{C}(\mathbf{z})}{dz}\Big] + p\Phi(\mathbf{z})\,\mathsf{U}p\_i\{\mathbf{C}(\mathbf{z}) - \mathcal{B}\mathcal{A}\_i\}\tag{2}$$

and the concentration by a smoothing spline (MATLAB function spaps, in the spline toolbox or in the curve fitting toolbox in newer versions). Since our approximations are piecewise polynomial, the computation of their derivatives is straightforward (using fnval and fnder functions) [34, 35]. The utilization of the smoothing spline for concentration allows us to reduce the propagated errors and to perform a correction equivalent to Tikhonov regularization [34].

We look for a spline function *f*, in the B-spline basis, that minimizes the expression: <sup>ρ</sup> <sup>E</sup><sup>f</sup> <sup>+</sup> <sup>F</sup>(D<sup>m</sup> f),

*wj* ‖*yj* − *f*

(*xj*)‖<sup>2</sup>

Numerical Modeling of Chemical Compounds' Fate and Kinetics in Living Organisms: An Inverse…

http://dx.doi.org/10.5772/intechopen.76611

205

, (3)

*λ*(*t*) ‖*Dm f*(*t*)‖<sup>2</sup> *dt*, (4)

is the distance of the spline function *f* from the given data, given by:

*j*=1 *n*

∫

*xmin xmax*

**6.3. The smoothing spline**

*Ef* = ∑

**Table 1.** Input parameters and input data structure.

*F*(*Dm f*) =

where *Ef*

F(D<sup>m</sup> f) is:

The numerical differentiations involved in Eq. (2) are critical operations, leading to large errors. Lettmann et al. [26] performed using finite differences methods followed by a Tikhonov leastsquares regularization [31–33]. Our approach is different and is based on smoothing splines. The diameter Φ is approximated by a cubic piecewise Hermite spline (MATLAB function pchip)

<sup>1</sup> MATLAB is a trademark of The MathWorks, Inc.


**Table 1.** Input parameters and input data structure.

and the concentration by a smoothing spline (MATLAB function spaps, in the spline toolbox or in the curve fitting toolbox in newer versions). Since our approximations are piecewise polynomial, the computation of their derivatives is straightforward (using fnval and fnder functions) [34, 35]. The utilization of the smoothing spline for concentration allows us to reduce the propagated errors and to perform a correction equivalent to Tikhonov regularization [34].

### **6.3. The smoothing spline**

We look for a spline function *f*, in the B-spline basis, that minimizes the expression: <sup>ρ</sup> <sup>E</sup><sup>f</sup> <sup>+</sup> <sup>F</sup>(D<sup>m</sup> f), where *Ef* is the distance of the spline function *f* from the given data, given by:

$$E\_f = \sum\_{j=1}^{n} w\_j \|y\_j - f(x\_j)\|^2 \tag{3}$$

F(D<sup>m</sup> f) is:

Model validation was performed by solving a two-point boundary differential equation relative to Eq. (1) on the interval given by extreme values of *z* and comparing with the measured values of *C*. The numerical method for target compounds' accumulation rate validation (the

dance was identified between the measured concentration and the concentrations computed by the solution of Eq. (1), given the rate *R* estimated during the validation process. The concordance is given by mean-square deviation. In the paper presented by Lettmann et al., [26] the approximation of the linear differential operator is performed by finite differences, while in our case its approximation was done through smoothing spline. Also, the rate estimation was generated randomly while in our case rate estimation was based on experimental data obtained in the laboratory. Their work, due to the nature of the practical problem, has no constraint on volume while in our case we were limited to the relative small volume and dimen-

We select for the study mushrooms from species *Macrolepiota procera,* which is one of the most popular in consumption and frequency from our country. Experimental measurements of major parameters involved in our model (parameters from Eq. (1)) were done on mature samples collected from the natural habitat where the evidence of potential contamination with chemical compounds exist. The measured data were grouped by compartments—basal bulb, stipe, gills and cap—representing the main anatomical parts of the mushroom body.

To convert our problem from bi-dimensional to a one-dimensional one, we consider a weighted mean for concentrations and parameters. The piecewise constant parameters (*p*, *χ*,

Once we have the averaged concentration we compute the rate using the formula:

*dz*[*p*Φ(*z*)(*Wc* <sup>−</sup> *ET*¯

) are weighted by height (*z*), and the concentrations are weighted by diameter, on

) *dC*(*z*) \_\_\_\_\_

The numerical differentiations involved in Eq. (2) are critical operations, leading to large errors. Lettmann et al. [26] performed using finite differences methods followed by a Tikhonov leastsquares regularization [31–33]. Our approach is different and is based on smoothing splines. The diameter Φ is approximated by a cubic piecewise Hermite spline (MATLAB function pchip)

*dz* ] <sup>+</sup> *<sup>p</sup>*Φ(z) Up<sup>f</sup>

(C(z) − BAf

) (2)

bvp4c function [29, 30]. Good concor-

solution of BVP) was implemented using MATLAB<sup>1</sup>

**6. Analysis and modeling: the estimation of R**

sections approximately orthogonal to median axes (see **Figure 3**).

*dz* <sup>−</sup> \_\_\_*<sup>d</sup>*

**6.2. Differential operator and its approximation**

sions of the studied mushroom species.

204 Numerical Simulations in Engineering and Science

Their form is illustrated in **Table 1**.

*<sup>R</sup>*(*z*) <sup>=</sup> *<sup>d</sup>*(*p*Φ(*z*)*C*(*z*)) \_\_\_\_\_\_\_\_\_\_\_

MATLAB is a trademark of The MathWorks, Inc.

, *Baf*

**6.1. Input data**

*Wc* , *ET*¯, *Upf*

1

$$F(\mathcal{D}^{\rm un}f) = \int\_{\rightharpoonup}^{\rm x} \lambda(t) \| \| \mathcal{D}^{\rm un}f(t) \|^{2} \, dt,\tag{4}$$

**Figure 3.** Schematic representation of target chemical compound concentration distribution around mushroom anatomical compartment.

and ρ is the smoothing factor. The spaps function uses the algorithm described in Reinsch's work [32]. For additional details on smoothing and interpolation splines, see deBoor's book [33] and the MATLAB curve fitting toolbox user's guide [36, 37].
