PySWR- A Python code for fitting soil water retention functions - Memari, Sama S.; Clement, T. Prabhakar (Computers & geosciences, 2021)
Soil water retention (SWR) function is an important model that provides an empirical relationship between soil moisture and capillary pressure. We present a simple Python tool for fitting different types of SWR functions to laboratory-measured soil moisture data. Three different optimization methods including the Levenberg-Marquardt (LM) method, Trust Region Reflective (TR) method, and Dog Box (DB) method are considered. We used all three methods to fit the van Genuchten (VG) and Brooks and Corey (BC) models to ten soil moisture datasets. Our results show that the TR method, which allows the user to search for optimal parameter values within a constrained region, is the best approach for fitting these models. We developed a new graphical procedure for evaluating the guesstimates and bounds for different SWR model parameters. Overall, the TR method available in Python, together with the proposed graphical procedure, is an excellent approach for fitting both VG and BC models to soil moisture data. [Display omitted] •A Python code for fitting soil water retention models to experimental data is provided.•PySWR can fit both van Genuchten and Brooks and Corey water retention models.•PySWR supports two constrained and one unconstrained non-linear fitting methods.•A graphical approach has been developed to provide good initial guesses and parameter bounds.•Trust region reflective method is the best approach for fitting soil water retention models.