unsatfit

Fitting functions of soil hydraulic properties

View the Project on GitHub or PyPI

View user manual on arXiv

Sample code of unsatfit

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) and HCF (hydraulic conductivity function) of various available models to measured data set. You can test with sample data provided in this page. For optimizing only WRF parameters, please use SWRC Fit.

List of sample codes

VGM (van Genuchten - Mualem) model

\[\begin{cases} \theta(h) &=& (\theta_s - \theta_r)S(h) + \theta_r\\ K(h) &=& K_s {S(h)}^p \bigl[1-(1-S(h)^{1/m})^m\bigr]^2\\ \end{cases}\]

where

\[\begin{eqnarray} S(h) &=& \biggl[\dfrac{1}{1+(ah)^n}\biggr]^m\\ m &=& 1-1/n \end{eqnarray}\]

Result with sample data of clay (Unsoda 2362) is shown below.

Result with sample data of Gilat loam is shown below. In this case, bimodal model is appropriate, as shown below.

Bimodal model with general HCF

Bimodal model with general HCF (Seki et al., 2022) can represent water retention and hydraulic conductivity of various types of soil in a wide range of pressure head, as verified in Seki et al., 2023. You can conduct the same fitting as written in the paper by using the following sample codes.

KBC (KO1BC2-CH) model (θr=0, r=1)

\[\begin{cases} \theta(h) &=& \theta_s S(h)\\ K(h) &=& K_s {S(h)}^p \gamma^{-1} \Biggl[ b_1 Q \biggl[\dfrac{\ln(h/H)}{\sigma_1} + q\sigma_1\biggr]+ b_2 (h/H)^{-\lambda_2 - q} \Biggr] \end{cases}\]

where

\[\begin{eqnarray} S(h) &=& \begin{cases}w S_1(h) + (1-w)\left(h/H\right)^{-\lambda_2} & (h>H)\\ w S_1(h) + 1-w & (h \le H)\end{cases}\\ S_1(h) &=& Q \biggl[\dfrac{\ln(h/H)}{\sigma_1}\biggr]\\ Q(x) &=& \frac{1-\mathrm{erf}(x/\sqrt{2})}{2}\\ b_1 &=& w \exp\biggl(\frac{q^2 \sigma_1^2}{2}\biggr)\\ b_2 &=& (1-w)\biggl(\frac{q}{\lambda_2} + 1\biggr)^{-1}\\ \gamma &=& b_1+b_2 \end{eqnarray}\]

DVC (dual-VG-CH) model (θr=0, q=1)

\[\begin{cases} \theta(h) &=& \theta_s S(h)\\ K(h) &=& K_s {S(h)}^p \bigl[w\Gamma_1(h) + (1-w)\Gamma_2(h)\bigr]^r\\ \end{cases}\]

where

\[\begin{eqnarray} S(h) &=& w\bigl[1+(ah)^{n_1}\bigr]^{-m_1} + (1-w)\bigl[1+(ah)^{n_2}\bigr]^{-m_2}\\ m_i&=&1-1/{n_i}\\ \Gamma_i(h) &=& 1-\biggl[1-\big[1+(ah)^{n_i}\bigr]^{-1}\biggr]^{m_i} \end{eqnarray}\]

DBC (dual-BC-CH) model (θr=0, r=1)

\[\begin{eqnarray} \theta(h) &=& \theta_s S(h)\\ K(h) &=& \begin{cases}K_s {S(h)}^p \gamma^{-1} \bigl[ wB_1 \Gamma_1(h) + (1-w)B_2 \Gamma_2(h) \bigr] & (h>H)\\ K_s & (h \le H)\end{cases}\\ \end{eqnarray}\]

where

\[\begin{eqnarray} S(h) &=& \begin{cases}w \left(h / H\right)^{-\lambda_1} + (1-w)\left(h / H\right)^{-\lambda_2} & (h>H)\\ 1 & (h \le H)\end{cases}\\ B_i &=& \biggl(\frac{q}{\lambda_i} + 1\biggr)^{-1}\\ \gamma &=& wB_1+(1-w)B_2\\ \Gamma_i(h) &=& \left(h / H\right)^{-\lambda_i-q} \end{eqnarray}\]

Peters model (θr=0)

\[\begin{cases} \theta(h) &=& \theta_s S(h)\\ K(h) &=& K_s \bigl[ (1-\omega)K_1(h)+\omega K_2(h) \bigr]\\ \end{cases}\]

where

\[\begin{eqnarray} S(h) &=& w S_1(h) + (1-w)S_2(h)\\ S_1(h) &=& Q \biggl[\dfrac{\ln(h/H)}{\sigma}\biggr]\\ Q(x) &=& \frac{1-\mathrm{erf}(x/\sqrt{2})}{2}\\ S_2(h) &=& \begin{cases}\dfrac{L(h_0)-L(h)}{L(h_0)-L(H)} & (h>H)\\ 1 & (h \le H)\end{cases}\\ L(h) &=& \ln(1+h/H)\\ K_1(h) &=& {S_1(h)}^p \Biggl[ Q \biggl[\dfrac{\ln(h/H)}{\sigma} + \sigma \biggr] \Biggr]^2\\ K_2(h) &=& \begin{cases}(h/H)^a & (h>H)\\ 1 & (h \le H)\end{cases}\\ \end{eqnarray}\]

Multiple curves

Contour plot

contour