Homework #5 earth surface processes Humphrey 2014, please try this over the weekend.  We will go over the method again quickly on Tuesday, and it will help if you have tried it.

Hillslopes as conveyor belts, or as convolution integrals.

This homework may be very difficult for some of you, since it introduces the use of computer algorithms.  If you are relatively new to computing, then do the “conveyor belt” solution in Excel outlined below.  The more confident might want to try the convolution approach, best in Matlab.  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 has 2 purposes:

1 A purpose of this week’s homework is to make sure you can all do minimal calculations and plotting in some computing language such as MATLAB or Excel (or the program of your choice, such as Python).  I realize that many 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 available in the student computer labs, and Python is similar to MATLAB but free(!) for everyone.

2 The second purpose of this exercise is to explore the concept of a convolution in time.  As I mentioned in class, this is a particularly useful concept in much of geomorphology, particularly where there is a need to route a distributed input that is focused into a concentrated or point output.  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.

This week’s Homework Question:  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 (the stream at the toe).  The x coordinate of the hillcrest is 0 and the point of interest is at x=X.  The saturated conductivity of the soil is 6.8x10-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% (not needed).  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 4 hours, stops for 1 hour, and then rains twice as hard (2x10-5 m s-1) again for 3 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, of 1 hour. 

·         The problem is to find the water discharge at the toe of the slope as a function of time.  To do this, plot discharge each hour at X =50m, over time; starting at 12 noon and going until 12 noon the next day.

(You can think of this problem by analogy: the hillslope is a conveyor belt, moving at the bulk water speed.  The rain falls on the belt and stays in place on the belt.  The question is then: what does the output of the conveyor belt look like?)

You will find it necessary to answer the following questions:

·         What is the water velocity in the saturated zone?  (Darcy’s Law, note that specific discharge [little ‘q’], has dimensions of velocity and is a reasonable scale velocity for the water movement.  I will say more on this on Tuesday.)

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

(hint: answers, 5m per hour, 10 hours)

Solutions:

There are two ways of doing this problem.  One is to use the conveyor belt analogy; the other is to use the convolution approach which we will discuss more in class on Tuesday.  I recommend for a first attempt to use the conveyor belt approach, which is more intuitive, unless you feel comfortable with the convolution concept.  The resulting computer process is very similar.  In fact, after you figure it out, the convolution approach is identical to the conveyor belt code.

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 it moves at 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 Matlab or Excel 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 5m per hour.  So we can simplify our conveyor belt by making the bins on the hillslope 5m long (so you need 10 of them to make a 50m long slope), and by taking 1 hour time steps.  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 make a vector (MATLAB) or a column (Excel) of 11 zeros.  This represents the hillslope before the start of the rain, (12 noon), plus one extra bin to catch the exit water (the 11th bin).  Each bin represents 5m of hillslope and is going to be the place we put water. 

Now apply this algorithm:  each hour (or each model timestep) when it rains, apply (or add) 1 hour of rain-fall into each bin (that is input=Dx * R(t) * 3600), the 3600 is the number of secs in an hour.  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.  Record the amount of water in bin 11 (this is the OUTPUT for that time period) and the time (of the step), and then set bin 11 to zero.  Repeat, while keeping track of the model time, (and remembering to turn the rain off after 9 hours) until the rain has stopped and all the bins are empty.

Your result is the amount of water in bin 11 through time, starting at 12noon and going until everything is back to zero.  The amount of water in bin 11 is the water flux q.  The only difficulty is recognizing what q represents.  The flow into bin 11 is the flux per hour.  Therefore we need to divide q by 3600 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.  In matlab, you can open the ‘figure editor’ and do the same.

A note on EXCEL:  Some hints on doing the conveyor approach in Excel.  Make a spread sheet of 12 rows and 24 columns.  Each column represents the state of the slope at the end of consecutive hours.  Row 1 and 12 are special.  Row 1 is reserved for the rainfall.  Enter the hourly rainfall (times delta x) manually in the first 8 of the 24 hour columns; the last 16 columns will be zero.  The 12th row is the output.  Write your formula in cell B3 = A2 + A$1.  Then ‘fill down’ and ‘fill right’ (in ‘edit’ menu).  Note the absolute addressing of the A1 cell row.  The output cell should be filled with B12 = A11. 

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.  The absolute address of the A column means that Excel will also add from the A column, not from the next column, which is what Excel does by default.  An address such as A$1 means that excel can change the A column as you ‘fill’ the spreadsheet, but it will always point to the top entry (row 1) of that column.

A note on Matlab or Python:  This is a 2 or 3 line program in Matlab.  Enter the rain (R(t) as an array, and then just repeatedly shift and add 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).   A super short tutorial on Matlab from me is here.  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.

For the Braver, the convolution approach:

The equation we want to use is:

Which gives the water flux parameterized as a depth of the water table, and where the water velocity is just Ksat * sin a and X is the distance down slope from the crest to the point of interest.  Make the bin sizes a constant, say 1m.  The value of R(at some time) is just 0, if the time is before or after the rain, or 10-5 m s-1 if the time is during the rain.

You may find it hard to think of how to code this, since you are looking at (t-(X-x)/v) and it is not obvious that the () term refers to a time in the past.  You may do better with the following equation, where I have defined an intermediate variable t=(X-x)/v, which is the time it takes for water to flow from x to X, so that t- t  points to time in the past (remember t is the current time so that subtracting  t points to a past time).  T is the time it takes to flow from x = 0 to X:

this becomes even easier if we define the width of the bins (Dx) to be the distance water flows in 1 hour, i.e. Dx = vw * 3600 secs/hr, or 5m.  If we pull the v out of the sum and divide, the equation looks like:

where d is the thickness of the saturated zone a time t, R(t) is the rainfall rate at time=t, and R(t-t) points to a time in the past.  The index t is in 1 hour steps.  And the bins are 5m (or one hour) wide.  The water table depth is converted to q by multiplying by Ksat * sin a.

You can set it up as a spreadsheet or a MATLAB problem, and do the summation.  See below for a hint on how to use Excel.  For this problem include either your Excel formula, or your MATLAB code with your homework.

For MATLAB users: the solution will involve a loop over real time (t), starting at zero and going in hours until the end of the rain plus the time (T) it takes to drain the slope.  Inside the loop will be another loop, which will do the sum at each time (t).  The sum is also in time, but in term of the dummy time (t), which goes from zero in hours to T.  The main trick is that you have to write a way to tell the loops the value of the rainfall (R) at any real time.  You can do this with if statements, or with a vector R which has the rainfall rate at various hours (or elegantly, a function that returns the value of R given a time).

For Excel users: (assuming you use the 3rd equation): The basic idea is to make a vertical column made up of the values of the rainfall at various times.  Each row represents one time period: you can probably do the problem in one hour steps.  So make a column of at least 24 hours of zeros, then 9 hours of rain values, then another 24 hours of zeros.  You could label the times in another column: i.e. 6 would mean the sixth hour (the start of the rain is hour 12).  Now for each time, starting at time = 12, you need to write a formula in Excel that will sum all the cells in negative time (i.e. upwards) from the starting cell back through 10 cells (10 hours being the time of T).  You then repeat this at each time (i.e. move down one cell and repeat the process).  Keep track of the Sums and the time they are associated with.  These sums are the water depths.

Plot the resulting water depths versus time, and you are done!

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 10 hours), which makes the convolution very simple.