1. Google the following: web plot digitizer
2. Load image "nassif-16percent-slope.png"
3. Create four csv files, one for each data set. Call them whatever you want. Legend: white circle = 312 mm/h, triangle = 234 mm/h, x = 156 mm/h, black circle = 78 mm/h.

The image is the second panel of Fig. 8, from

Nassif, S. H., and E. M. Wilson, 1975, "THE INFLUENCE OF SLOPE AND RAIN INTENSITY ON RUNOFF AND INFILTRATION", Hydrological Sciences Journal. https://www.tandfonline.com/doi/abs/10.1080/02626667509491586

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="ticks", font_scale=1.5)
from scipy.optimize import curve_fit
import matplotlib.patches as patches


Load all four files you created. Use numpy's function loadtxt. Make sure that the first point in each table corresponds to the appropriate rainfall rate. You can normalize the data if it is not.

Reproduce the original figure, make it look good, something like this: ## Horton's equation

$$f = f_c+(f_0-f_c)e^{-\beta t}$$
• $f$: infiltration rate
• $f_c$: infiltration capacity at large $t$
• $f_0$: initial infiltration capacity
• $\beta$: best fit empirical parameter

Write a function called horton, that receives time t and the three parameters, and returns the right-hand side of the equation above. Plot one of the data sets, together with a guess of the parameters that should roughly fit the data.

Find the best fit for the parameters $f_c, f_0, \beta$. Calculate the $R^2$ for each data set.

For the best fit, use scipy's curve_fit. Write a function to compute the R-squared of your fit.

Make a graph of the infiltration rate and of the runoff, as a function of time. Use any of the four data sets you have.

## Green & Ampt

$$f = \frac{A}{F} + B$$

where

• $A = K_\text{sat}\cdot|\psi_f|\cdot \left( \phi - \theta_0 \right)$
• $B= K_\text{sat}$

Write a function that calculates the cumulative of the infiltration rate.

$$F(t) = \int_0^t f(t) \text{ d}t$$

Use numpy's trapz function, that implements the "trapezoidal rule" Plot $f$ as a function of $F$. Try to guess $A$ and $B$ that give reasonable results.

Use the curve_fit to find the optimal values for $A$ and $B$.

## Homework

Go to Soil Texture Calculator, estimate the texture of "standard soil" in Nassif & Wilson, 1975.