unsatfit

Fitting functions of soil hydraulic properties

View the Project on GitHub or PyPI

View user manual on arXiv

Sample code for optimizing water retention curves

Easiest way to start learning how to use unsatfit is to run sample codes as instructed in this page. You can optimize parameters of WRF (water retention function)of various available models to measured data set. You can test with sample data provided in this page. SWRC Fit can also be used. For optimizing HCF (hydraulic conductivity function) also, please refer to this page.

List of sample codes

Multiple curves

UNSODA data

Here are sample codes to draw multiple fitting curves for the UNSODA database and figures which were produced with the code. pdfgridcat was used for arranging the figures.

Method

Trimodal models

While trimodal water-retention functions provide the flexibility needed for media with clear triple porosity, they also introduce additional degrees of freedom and may lead to non-unique parameterizations when data coverage is limited or noisy. Please use these sample code with cautions. See Seki et al. (2026) for detail.

Here is sample code for trimodal models. The fixed parameters are θs = max(θ), θr = 0 and he (for VVP) = 6.3e6.

By running the final code on the IL sandstone sample dataset, you can generate this figure, which is identical to the upper panel of Figure 1 in Seki et al. (2026).