Homework #5 earth surface processes Humphrey 2022,

These 2 questions may be difficult for some of you since it introduces the use of computer algorithms.  Question 1 is explained in detail and I hope you are all successful (it is slightly simpler than what I presented in class), question 2 is more difficult and some of it is left to you.  Even if you can’t get question #2 to work, you need to give it a try and see if you can conceptually understand.  All of you should read this entire blurb.  Unlike some of the homework problems, all the information you need is included in this question, and the answer method is [hopefully] clearly pointed out.  Please tell me of errors in this.

This homework is designed to improve your quantitative computing skills.  I want to make sure you can all do minimal calculations and plotting in some computing language such as EXCEL or MATLAB or Python (or the program of your choice).  I realize that most of you will use Excel, which is fine.  Excel is a good program for simple calculations.  You may find as you progress in your career that you may want to graduate up to some of the more powerful programs out there.  MATLAB or Python are particularly useful programs for the Geosciences.  MATLAB is expensive but available in the student computer labs. Python is somewhat better for pure science than MATLAB and free(!) for everyone.

The second purpose of this exercise is to explore a particularly useful concept in much of geomorphology: it applies whenever there is a need to route a distributed input that is focused into a concentrated or point output.  Technically, what we are doing is a convolution: that is a type of multiplication over time of two descriptors; in this case the time description of the rainfall, and the time description of the delays in the hillslope transport.  The concept of a convolution of the inputs to get the outputs should be in your mind whenever you think of drainage basins, and their inputs and outputs. If you are relatively new to computing, then do the “conveyor belt” solution in Excel outlined below. 

Homework Question #1:  Assume a straight uniform hillslope, with an angle of 12 degrees.  The hillslope has a uniform layer of soil over impermeable bedrock.  The length of the slope is 50m from the crest of the hill, down to our point of interest, which is the stream at the toe or outlet from the slope.  If the x coordinate of the hillcrest is x=0, the stream is at x=X= 50m * cos (12).  Saturated conductivity of the soil is 3.4x10-3 m s-1 (we make it very permeable to make the water flow quickly), and the thickness of the slope soil is 1m, above impermeable bedrock. The porosity is 50% (higher than typical soils).  The entire slope is initially at field capacity with no saturated zone, and at 1 hour past noon it starts to rain hard (10-5 m s-1), it rains steadily for 3 hours, stops for 1 hour, and then rains twice as hard (2x10-5 m s-1) again for 3 hours, stops for 2 hours, and with a final burst it rains at 3x10-5 m s-1 for three more hours.  Assume (to make this problem easier) that there is a constant time delay for rain to traverse the unsaturated zone, from surface to water table.  (In the real world this delay is variable, but to again make it simple, we will assume it is exactly 1 hr, which is the size of our time steps.  So we just delay our input by 1 hour.) 

·         The actual problem: find the water discharge per unit width of slope at the toe of the slope as a function of time.  To do this and to show your answer, you must make a computer plot of slope discharge into the stream each 1 hour at X =50m, over time; starting at 12 noon and going until midnight the next day.

You will find it necessary to answer the following questions:

·         What is the water velocity in the saturated zone?  Use Darcy’s Law, note that specific discharge [little ‘q’], has dimensions of velocity and is a reasonable scale velocity for the bulk water movement. 

·         How long does it take for water from the highest point on the slope to reach the “outlet”?

(Big hint: the answers to the above are, 2.5m per hour, 20 hours)

Solutions:

There are three ways of doing this problem.  One is to slice the hillslope up into ‘bins’ and then use a ‘conveyor’ belt analogy; another is to code the numerical convolution approach, which is discussed below, and finally you can do an analytic convolution.  Unless you feel ‘computer and math savvy’ I recommend for a first attempt to use the conveyor belt approach, which is most intuitive.  This is the Excel approach I sketched in class. Interestingly, after you figure it out, the convolution approach is identical to the conveyor belt code.

1.    Conveyor belt analogy

Since the water speed down the hillslope is constant, the hillslope acts like a conveyor belt that is moving parcels of water down the slope.  You can imagine the water as sitting, stationary, on the belt, while the belt moves at 2.5m per hour.  As the belt moves down the slope, more water is added, since it keeps raining.  If you think of the water as sitting in bins on the belt, you can ask the question: How deep does the water in the bins get, by the time they reach X.

It is easy to make EXCEL or Matlab or Python act like a conveyor.  A big thing to notice is that the time it takes for water to move down the slope [the conveyor belt speed] is 2.5m per hour.  We need the output in 1 hr increments, so we can simplify our conveyor belt by making the bins on the hillslope 2.5m long (so you need 20 of them to make a 50m long slope), and by taking 1 hour time steps. Thus a bin’s worth of water moves downslope to the next bin location every hour.  Note this just makes the calculations easier, we could use other bin sizes, but would have to take time steps of the length needed for the water to traverse a bin.

So how to proceed with a program like Excel?  Make a column in Excel of 22 zeros (a vector in MATLAB).  Each cell in the column represents a 2.5m wide bin on the hillslope, and the zero is the current amount of water in the bin.  This column represents the hillslope at time = 12 noon.  Bins 1 and 22 are special. The bins 2-21 represents the hillslope before the start of the rain, (12 noon), plus one extra bin to represent the stream in which to catch the exit water (the 22th bin).  The special bin (1) at the top represents hilltop bin, with no input other than the rainfall rate that is falling at that time.  Each bin represents 2.5m of hillslope and is going to be the place we put water. 

We apply this algorithm*:  each 1 hour (or each model timestep) when it rains, apply (or add) 1 hour of rain-fall into each bin (that is input=Delta_x * R(t) * Delta_t), where Delta_x is the length of the bin, and Delta_t is the time step size (1hour).  After adding the water to the bin, shift the contents of every bin down 1 row.  The shifting process represents 1 hour of time occurring and the water moving 2.5m downslope.  Record the amount of water in bin 22 (this is the OUTPUT for that time period) and the time (of the step), and then empty bin 22 by setting bin 22 to zero.  Repeat, while keeping track of the model time, (and remembering to adjust the rainfall rate with time) until the rain has stopped and all the bins are empty.  Make sure all units are the same!! (don’t mix hours and secs etc) 

(*this is the algorithm, see note below on how to do this logically in Excel)

Your result is the amount of water in bin 22 through time, starting at 22noon and going until everything is back to zero.  The amount of water in bin 22 is the water flux q.  The only difficulty is recognizing what q represents.  The flow into bin 22 is the flux per 1 hour.  Therefore we need to convert q to secs to get the flux per sec (since Ksat is in seconds).

Now plot q versus time, label the axes with both labels, and numerical values, and you are done! When plotting the results in Excel, note that you can ‘right-click’ on any of the features of the plot, such as the axes or the wording or the lines and change their properties such as font size or line styles.  This can really help the plot become more readable.  (please turn off the automatic smoothing, or ‘spline’, in EXCEL, it ruins the plots) In matlab or Python, you can open the ‘figure editor’ and do the same.

Notes on this approach: (Some hints on doing the conveyor approach in Excel.)  Make a spread sheet of 22 rows and ~50 columns.  You can think of time increasing from left to right, and positions on the slope going downslope from top to bottom.  Each row represents a specific bin on the slope. Each column of cells represents all the bins at a specific time.  And time increases from left to right columns.  While the content of each cell in a column is the amount of water in that bin at a specific time.  Row 1 and 22 are special.  Row 1 receives only the rainfall, while Row 22 only receives from uphill.  Enter the hourly rainfall manually in row 1 (of the first 21) of the 50 columns. This represents the input rainfall. The rest of the columns of row 1 will be zero.  The 22th row is the output.  Write your formula in cell B3: B3 = A2 + A$1.  Then ‘fill down’ and ‘fill right’ (in ‘edit’ menu).  This ‘filling’ step is important so you don’t need to do much typing by hand.  See below, or ask somebody to show you if you don’t know how.  Note the absolute addressing of the A1 (ie. A$1) cell row, this makes the rain add to every cell in the column.  The output cell should be filled with B12 = A11.  In effect you are implementing the algorithm from above, but you are keeping the intermediate results.  Marching across the spreadsheet is marching in time, rows going down are going down the slope in space.

Cells in Excel are addressed absolutely with their names and a dollar sign, eg $A$11 which means the actual cell at column A row 11.  More usually you refer to cells relatively by their column and row address, eg A11.  Using relative addresses means that you can copy and paste (or fill) formulas and Excel can (will) change the addresses to match the location you put the formula into [ eg. If you copy A11 into column C cell 11, it will appear as C11].  The absolute address of the A$1 cell means that Excel will also add from the A or B or C column, but only from the 1st cell of the column, (Excel does relative addressing by default).  An address such as A$1 means that excel can change the A column to the B or C or etc as you ‘fill’ the spreadsheet, but it will always point to the top entry (row 1) of that column.

If you want to do this in Python or Matlab:  This is a 2 or 3 line program in Matlab or Python.  Enter the rain (R(t) as an array, and then just repeatedly (for loop) add to another array, shift and plot, all at the same time. Tutorials on Excel and MATLAB:  There are numerous tutorials out there, in book form or on the web.  They may help you in the above problem.  Two that I have found to be useful are for Excel and MATLAB. (note these are web pages at other Universities, so you get whatever is there).   Super short tutorials on Python or on Matlab (from me).  The best way to learn either is to get a brief tutorial from one of your peers.  Try to find someone to show you the basics, once you have a minimal knowledge, most students can advance on their own.

2.    Mainly for your interest, the numerical convolution approach: (worth reading but you do not need to do the problem this way… [you do get the same answer]):

Our basic equation is:

,     this is the equation I verbally sketched in class. It states that the water flux at some point on the slope is the sum of all the rain that fell at locations upslope, back in the time it took to flow to the observation location. It is written to show that we are summing the water downslope, and the time step is written in terms of distance and water velocity.

This gives the water flux at time t, and the water velocity is just Ksat * sin a  and X is the distance down slope from the crest to the point of interest.  It is not obvious, but since we know the velocity and can convert distance to time, the summation is actually over time. We can make this equation specific to our problem by defining the length of the bins (Dx) to be the distance water flows in 1 hour, i.e. Dx = vw * 3600 secs/hr, or 2.5m.  Finally we recognize that the time the water takes to travel across each bin is Dt, which is constant.  Replacing the sum in space coordinates with a sum backwards in time, the equation looks like:

  , where Dt is 1 hour, and ‘t’ and therefore ‘j’ are also in 1 hour steps, ‘j’ is a time index that make the time of the rain go backwards. The T in the summation limit is the time in hours for water to flow from the crest to X: T=20.

You can set it up as a spreadsheet or a MATLAB problem, and do the summation. 

3.    For the Analytically inclined:

If you have learned convolutions in a math class, you can do this problem as a convolution of 2 functions: namely the input (the rainfall R(t)) with the transfer function of the hillslope.  The transfer function in this case is a boxcar function (constant amplitude and length of 20 hours), which makes the analytic convolution very simple.  As a hint, you can add the 3 convolutions, 1 for each rainfall period.  That way the output is just the sum of 3 boxcar to boxcar convolutions. The only difficulty with this approach is to be careful of the limits of the integrals.

 

And now for the more difficult problem #2:

(difficult) We will apply the same rain to a sigmoidal hill, using our simple shallow soil groundwater approximation.  The hill is defined by the curve Z = 5 * (cos{ (x +1)/7 } + 1)..[careful with the brackets etc, and this is in radians] where x is the distance from the hill crest, and the distance to the stream is 20m and z is the altitude above the stream.  Use a slightly slower Ksat of 0.002 m/s (this hill is shorter than the first).

Some hints: the water velocity now varies, depending on local slope.  That means the time to cross a constant width bin will change depending on location on the slope.  We can simplify if we make the bins different lengths so that the time to cross each bin is constant.  If we do this, then we can use basically the same algorithm as above.  However, we need to take into account the different bin sizes when we add rain to them; bigger bins get more rain. Bin sizes will be inversely related to slope since Vwater ~ Ksat sin(alpha), therefore delta time to cross a bin is delta x/(Ksat sin(alpha)), which gives you an equation for the bin size (delta x = delta t * Ksat sin(alpha)).  The bins at the top and bottom of the slope are only about 1/7 the width of the bin in the center of the slope.

To get the gradient of the hillslope for calculating water flow, remember that the derivative of cosine is negative sine (you can cancel the negative, since water flows in the negative head gradient).  The slope [sin(alpha)] at any point x is 5*sin( (x+1)/7 )/7.  Good luck, and the hillslope is sketched below so you can check your hillslope and gradients. I recommend using almost the same Excel algorithm, but I would put the bin’s delta x lengths in the first column, so you can use that information to calculate the rain that should go into each bin.  And therefore you would start your calculations at column 2, not 1 as above.  To be specific, for each uniform time step (delta t), each bin receives delta x * delta t * rainfall rate (at that time).  Note this is identical to question #1 except we multiply by a variable delta x.

 

 Chart, line chart

Description automatically generated

I did this problem, and the “book keeping” is more complex.  As a major hint I show the approximate result, and if you need help in calculating bin sizes, ask me and I will try to help.  The blue curve is the unit hydrograph for this slope.

Chart, line chart

Description automatically generated

 

 And a META note:

 A couple of details for you might think about: Perhaps a better velocity to use in this problem is the effective velocity, which is the previous scale velocity divided by the porosity.  This effective velocity, (which in this case is just twice the ‘q’ velocity) represents the approximate velocity of a tagged water particle. An interesting question  to think about is should we use the scale velocity or the effective velocity? [As an aside, since groundwater is flowing through pores, along tortuous paths, the actual water velocity is highly variable. Thus there are several ‘velocities’ we can talk about: the actual speed of the water, or the velocity the water apparently has, flowing in a straight line, instead of the tortuous path, or the scale velocity, or even others. For this particular problem which is the most appropriate velocity?

Also the x distances in these problems should really be written as slope length distances, however as I pointed out in class, the correction is small, and for curved slopes as in question #2 it make the problem much more algebraically complex for little difference in the final answer.