Fit soil water retention function with hysteresis

As illustrated below, curves similar to those in Figure 6 of Zhou (2013) can be reproduced using this Python code, with the same parameter set applied in each figure. This demonstrates that the `hystfit`

tool effectively implements the algorithm proposed by Zhou (click to enlarge).

As illustrated in these figures, a larger advancing contact angle (γ_{A})—depicted in the upper figures—results in a greater deviation between the main wetting and drying curves. Conversely, a larger value of ‘b’ (shown in the right figures) causes a slower transition from the main drying curve to the main wetting curve, and vice versa.

The sample code utilizes matplotlib for rendering these figures. For further details, refer to the matplotlib documentation. The `smooth_theta`

method in the `hystfit`

class is used to draw smooth curves. For instance, executing the following code:

```
theta = f.smooth_theta((0.3, 0.7, 0.55, 0.9, 0.8))
```

results in a numpy array named ‘theta’, which begins at 0.3, gradually increases to 0.7, then decreases to 0.55, and continues similarly. The code:

```
h = f.h(p, theta)
```

calculates ‘h’ from this theta value.

This program utilized the UNSODA dataset and produced 15 figures, with full data links available through the UNSODA viewer. The model exhibits an **excellent fit for sand** in these figures, particularly for disturbed samples; see samples 1410, 2310, 4890, 4940 and 4941.

**Method:** The Python code used to generate the figures is provided. Laboratory drying curves were fitted using either the VG or FX model, depending on which had the lower corrected AIC. θ_{s} is fixed when measured and optimized otherwise. θ_{r} is set to 0. Laboratory wetting curves were fitted using the Zhou model. The saturated point may be omitted when fitting the wetting curve. In some cases, θ_{s} was altered in the wetting curve, as documented. Data points where h = 0 cm are displayed as h = 1 cm in the figures.

- Full data
- Rasmussen et al., Unsaturated Fractured Rock Characterization Methods and Data Sets at the Apache Leap Tuff Site, NUREG/CR-5596.
- FX: a = 3.22e+02 m = 0.463 n = 1.516 R
^{2}= 0.9950 - Zhou: cosγ
_{A}= 0.749 b = 0.50 R^{2}= 0.887### UNSODA 1410 sand (disturbed)

- Full data
- Shen and Jaynes, J. Hydr. Eng. (China) 10:11-20.
- FX: a = 22.1 m = 0.841 n = 12.259 R
^{2}= 0.9985 - Zhou: cosγ
_{A}= 0.541 b = 1.00 R^{2}= 0.865### UNSODA 2020 silty clay loam (undisturbed)

- Full data
- Ahuja and El-Swaify, 1975. Hydrologic Characteristics of Benchmark Soils of Hawaii’s Forest Watersheds. Univ. of Hawaii.
- FX: a = 10.9 m = 0.127 n = 1.701 R
^{2}= 0.9966 - Zhou: cosγ
_{A}= 0.328 b = 0.40 R^{2}= 0.963 - θ
_{s}= 0.684 for drying and θ_{s}= 0.711 for wetting### UNSODA 2022 silty clay loam (undisturbed)

- Full data
- Ahuja and El-Swaify, 1975. Hydrologic Characteristics of Benchmark Soils of Hawaii’s Forest Watersheds. Univ. of Hawaii.
- FX: a = 11.5 m = 0.080 n = 2.888 R
^{2}= 0.9969 - Zhou: cosγ
_{A}= 0.029 b = 0.50 R^{2}= 0.906 - θ
_{s}= 0.671 for drying and θ_{s}= 0.711 for wetting### UNSODA 2310 sand (disturbed)

- Full data
- Stauffer and Dracos, 1986. J. Hydrol. 84:9-34.
- FX: a = 37.4 m = 0.889 n = 16.851 R
^{2}= 0.9987 - Zhou: cosγ
_{A}= 0.145 b = 1.00 R^{2}= 0.965 - θ
_{s}= 0.348 for drying and θ_{s}= 0.296 for wetting### UNSODA 3340 sand (undisturbed)

- Full data
- FX: θ
_{s}= 0.311 a = 20.3 m = 0.762 n = 4.790 R^{2}= 0.9925 - Zhou: cosγ
_{A}= 0.359 b = 1.00 R^{2}= 0.718### UNSODA 4700 silty clay loam (disturbed)

- Full data
- Moore, R.E., Hilgardia 12(6):383-427, 1939
- FX: θ
_{s}= 0.322 a = 54.8 m = 0.199 n = 7.935 R^{2}= 0.9980 - Zhou: cosγ
_{A}= 0.276 b = 0.87 R^{2}= 0.64 - θ
_{s}= 0.322 for drying and θ_{s}= 0.396 for wetting### UNSODA 4710 loam (disturbed)

- Full data
- Moore, R.E., Hilgardia 12(6):383-427, 1939
- FX: θ
_{s}= 0.364 a = 38.5 m = 0.710 n = 2.772 R^{2}= 0.9973 - Zhou: cosγ
_{A}= 0.503 b = 1.00 R^{2}= 0.891 - θ
_{s}= 0.364 for drying and θ_{s}= 0.406 for wetting### UNSODA 4890 sand (disturbed)

- Full data
- Bull. IASH XI No.1:69-110. 1966
- FX: a = 1.17e+02 m = 0.858 n = 6.542 R
^{2}= 0.9962 - Zhou: cosγ
_{A}= 0.393 b = 1.00 R^{2}= 0.951 - θ
_{s}= 0.298 for drying and θ_{s}= 0.301 for wetting### UNSODA 4910 loam (disturbed)

- Full data
- Elrick and Bowman, 1964. Soil Sci. Soc. Am. Proc. 28:450-452
- FX: θ
_{s}= 0.520 a = 59.7 m = 0.416 n = 2.244 R^{2}= 0.9956 - Zhou: cosγ
_{A}= 0.000 b = 0.79 R^{2}= 0.998### UNSODA 4920 silt loam (undisturbed)

- Full data
- Green, et al., 1964. Soil Sci. Soc. Am. Proc. 28:15-19
- FX: θ
_{s}= 0.539 a = 1.3e+02 m = 0.672 n = 1.433 R^{2}= 0.9995 - Zhou: cosγ
_{A}= 0.000 b = 0.98 R^{2}= 0.814### UNSODA 4922 silt loam (undisturbed)

- Full data
- Green, et al., 1964. Soil Sci. Soc. Am. Proc. 28:15-19
- FX: θ
_{s}= 0.521 a = 77.3 m = 0.678 n = 1.550 R^{2}= 0.9995 - Zhou: cosγ
_{A}= 0.104 b = 1.00 R^{2}= 0.781### UNSODA 4923 silt loam (undisturbed)

- Full data
- Green, et al., 1964. Soil Sci. Soc. Am. Proc. 28:15-19
- FX: θ
_{s}= 0.521 a = 77.3 m = 0.678 n = 1.550 R^{2}= 0.9995 - Zhou: cosγ
_{A}= 0.104 b = 1.00 R^{2}= 0.781### UNSODA 4940 sand (disturbed)

- Full data
- Poulovassilis, 1970. Soil Science 109(1):5-12
- FX: θ
_{s}= 0.305 a = 6.23e+02 m = 2678.129 n = 2.345 R^{2}= 0.9952 - Zhou: cosγ
_{A}= 0.586 b = 1.00 R^{2}= 0.992### UNSODA 4941 sand (disturbed)

- Full data
- Poulovassilis, 1970. Soil Science 109(1):5-12
- VG: θ
_{s}= 0.275 α = 0.0339 n = 4.84 R^{2}= 0.9963 - Zhou: cosγ
_{A}= 0.438 b = 1.00 R^{2}= 0.957