Compartmental modelling refers to modelling the transport of substances in a system consisting of multiple compartments, which is characterized by the transfer rates among the relevant compartments. In a generalized compartmental system, recycling of substances among the compartments is allowed. Compartmental modelling is a generic technique which is needed in many branches of applied physics. The most challenging task is to determine the transfer rates. The present work described the use of the Hooke and Jeeves (HJ) derivative free direct search method in determining the transfer rates to construct a multi-compartmental model with recycling among the compartments. The use of a direct search method ensures the applicability of the model to functions which are not continuous or differentiable. The present model was successfully validated using previously reported experimental data for distribution of trace elements in four compartments in an animal.
Compartmental modelling is a generic technique which is needed in many branches of applied physics ranging from medical physics  to environmental physics , etc. As an example used here to provide background information, in medical physics, analyses on the transfer of drugs among different organs in the human body are required. Compartmental models are being widely used in biokinetic applications. Previously, Upton  discussed the two-compartment recirculatory pharmacokinetic model which consisted of the lungs and the remainder of the body. Similarly, Petráš and Magin  developed a two-compartment model for drug uptake by the gut and the target tissue. Sharma et al.  developed a multi-compartment model for radon contamination in the human body. In another work, Garcia et al. [6,7] developed a statistical method for multiple-compartment biokinetical models, where the least-squares technique was employed to determine the flow parameters from experimentally available curves of concertation versus time. From experimental studies, the drug concentrations in various organs are obtained as a function of time. In compartmental modelling, these organs are modeled as multiple compartments, and the rate of change in the drug concentration in a particular compartment is related to the rates of change in the drug concentrations in all other relevant compartments through linear differential equations [8,9]. More specifically, the temporal change in the drug concentration in each compartment is controlled by the respective parameters: (1) uptake and excretion rates, (2) initial drug concentration, (3) compartment volume, and (4) transfer rates among the relevant compartments. The task of compartmental modelling is to determine these parameters based on experimental data. Notably, a most challenging task is to determine the transfer rates, particularly in a generalized compartmental system where recycling of drugs among the compartments is allowed. The present work described the use of the Hooke and Jeeves (HJ) derivative free direct search method  in determining the transfer rates to construct a multi-compartmental model with recycling among the compartments. The use of a direct search method ensures the applicability of the model to functions which are not continuous or differentiable.
2 Materials and methods
The HJ method mainly involves two steps, namely, (1) exploratory search and (2) pattern move. The HJ method perturbs the current point (which is initially the guessed transfer rates) by a small amount in each variable direction (determined by the number of compartments in the system and the presence or absence of recycling among the compartments) and checks whether the value of the objective function [which in the present case is the sum of absolute values of (experimental value – fitted value)/(fitted value)] improves or worsens. More information on the well-established HJ method can be found in refs. [11,12] and references therein. Remarkably, the method does not necessitate very precise starting points (i.e., guessed values) and complex Jacobian matrices (as it is derivative free) . Furthermore, it is much more user-friendly since the users need to control fewer parameters (only the step size, tolerance, and maximum iterations) and the accuracy and convergence of the present method have been found to be phenomenal . The overall computational speed of this method is another advantage that stands out when compared to other methods.
The general outline of our developed algorithm is shown below:
Read number of compartments (N).
Dynamically allocate arrays based on N.
Read the input data into arrays; volume ( V ), excretion ( ξ ), uptake ( P ), initial concentrations ( X 0 ), guessed transfer rates ( R i ).
Read the time (t).
Get step size factor (ρ), tolerance (δ), maximum iterations (iter).
Call Hooke–Jeeves function.
Calculate concentration vector x t .
Calculate sum of absolute values of (experimental value x tE – fitted value x t )/(fitted value x t )
Determine new transfer rates ( R ) based on the accepted exploratory search and pattern move.
Check tolerance and iteration and, if reached, terminate.
If t > t n (total number of time points), terminate; if not, (t = t + 1) then go to step 5.
Determine mean and standard deviation of the transfer rates ( R ).
Report the final transfer rates ( R ) and associated errors.
The user needs to input the required parameters such as volume, uptake, initial concentration, and the initial guessed transfer rates. Our model used in the present work was developed with the FORTRAN90 programming language. This model was highly flexible and faster in terms of computational speed and convergence, thanks to the derivate free method and also the FORTRAN90 programming language. While derivative free methods use function values, derivative-based methods involve differentiation of the objective functions. When compared to derivative-based methods, derivative free methods have a major advantage in that they can have applications in a wide variety of mathematical problems, e.g., when the objective function is unknown (i.e., black box functions), when determination of derivatives would be impractical, when the objective function has stochastic noise that may lead to inaccurate finite differencing, or when it is computationally expensive to evaluate large dimensional gradient of a system . However, some previously published works found that derivative-based methods provided a better estimate of the objective function, and the computational time needed by derivative-based methods was shorter . We refer interested readers to ref.  and references therein for a more detailed comparison between the pros and cons of derivative-based and derivative free methods for different applications. We refer interested readers to the supplementary materials associated with the present paper for more information on our numerical model and its benchmarking.
3 Results and discussion
Our model was tested using previously reported experimental data  for distribution of trace elements in four compartments in an animal, namely, (a) blood, (b) muscle, (c) fat, and (d) lung tissue. In that study , there was uptake of trace elements only during the first 60 days, and the diet was switched back to contamination-free diet afterwards. The temporal changes of trace-element concentrations were reported. Fits obtained using the present model as well as those obtained in ref.  are presented in Figure 1 for comparison. Good agreement is observed between our fits and the experimental data, which demonstrates the feasibility of using the HJ method in multi-compartmental modelling. The model searches for the best transfer rates through minimizing the sum of absolute values of (experimental value − fitted value)/(fitted value) and does not necessitate very precise guessed initial transfer rates. The entire fitting process is carried out automatically, with minimal human interaction and point correction. We plan to develop a graphical user interface program in future which will be available to the research community for multi-compartmental modelling and analysis.
Our present model was found capable of fitting multi-compartmental data using the direct search algorithm (i.e., HJ method). The employment of direct search HJ method in the present work was the main innovative step in the present work when compared to previous works [6,7]. In addition, the present model allows users to control all the required parameters to fine-tune the fitting of experimental results; this is useful to achieve the best possible fit. The implementation of derivative free method would enable us to further develop this into a versatile computer program that can be used in a variety of applications even when the objective function is unknown. Therefore, in the future we aim to further develop this into a graphical user interface program that would be useful in multi-compartmental modelling and analysis in a variety of applications.
Conflict of interest: Kwan Ngok Yu is an Editor in Open Physics journal but was not involved in the peer review process.
 Jeremica MZ, Matovic MD, Krstic DZ, Pantovic SB, Nikezic DR. A five-compartment biokinetic model for 90Y-DOTATOC therapy. Med Phys. 2018;45:5577–85. Search in Google Scholar
 Assimakopoulos PA, Ioannides KG, Pakou AA. A general multiple-compartment model for the transport of trace elements through animals. Health Phys. 1991;61:245–53. Search in Google Scholar
 Upton RN. The two‐compartment recirculatory pharmacokinetic model – an introduction to recirculatory pharmacokinetic concepts. Br J Anaesth. 2004;92:475–84. Search in Google Scholar
 Petráš I, Magin RL. Simulation of drug uptake in a two compartmental fractional model for a biological system. Comm Nonlinear Sci Numer Simulat. 2011;16:4588–95. Search in Google Scholar
 Sharma N, Hess CT, Thrall KD. A compartmental model of water radon contamination in the human body. Health Phys. 1997;72:261–8. Search in Google Scholar
 Garcia F, Mesa J, Arruda-Neto JD, Helene O, Vanin V, Milian F, et al. The STATFLUX code: a statistical method for calculation of flow and set of parameters, based on the multiple-compartment biokinetical model. Comput Phys Commun. 2007;176:347–61. Search in Google Scholar
 Garcia F, Arruda-Neto JD, Manso MV, Helene OM, Vanin VR, Rodriguez O, et al. A new statistical method for transfer coefficient calculations in the framework of the general multiple-compartment model of transport for radionuclides in biological systems. Phys Med Biol. 1999;44:2463. Search in Google Scholar
 James AC. A microcomputer algorithm for solving first-order compartmental models involving recycling. Health Phys. 1989;56:857–68. Search in Google Scholar
 Lassey KR. The usage of transfer coefficients to describe radionuclide transport from a cow’s diet to its milk. Health Phys. 1980;39:321–5. Search in Google Scholar
 Hooke R, Jeeves TA. “Direct search” solution of numerical and statistical problems. J ACM. 1961;8:212–29. Search in Google Scholar
 Altinoz OT, Yilmaz AE. Multiobjective Hooke–Jeeves algorithm with a stochastic Newton–Raphson-like step-size method. Expert Syst Appl. 2019;117:166–75. Search in Google Scholar
 Price CJ, Robertson BL, Reale M. A hybrid Hooke and Jeeves – direct method for non-smooth optimization. Adv Model Optim. 2009;11:43–61. Search in Google Scholar
 Lewis RM, Torczon V, Trosset MW. Direct search methods: then and now. J Comput Appl Math. 2000;124:191–207. Search in Google Scholar
 Cartis C, Roberts L. A derivative-free Gauss–Newton method. Math Program Comput. 2019;11:631–74. Search in Google Scholar
 Körkel S, Qu H, Rücker G, Sager S. Derivative based vs. derivative free optimization methods for nonlinear optimum experimental design. In Current trends in high performance computing and its applications. Berlin, Heidelberg: Springer; 2005. p. 339–44. Search in Google Scholar
 Rios LM, Sahinidis NV. Derivative-free optimization: a review of algorithms and comparison of software implementations. J Glob Optim. 2013;56:1247–93. Search in Google Scholar
© 2021 Mehrdad Shahmohammadi Beni and K. N. Yu, published by De Gruyter
This work is licensed under the Creative Commons Attribution 4.0 International License.