integrate_slp | R Documentation |
The Slope object contains slope information at specific distances relative to the start of each overland flow element (OFE) that comprises the hillslope. This function will augment the columns in the Slope object to include the coefficients for the slope and elevation functions.
integrate_slp(slp)
slp |
A Slope object |
To calculate the slopes and elevation at different distances, it is
convenient to calculate the total distance for the hillslope which is found
by adding the total length of all previous OFEs to the distance for the
current OFE. This function adds a column called x
that
represents this total distance.
The slope at intermediate total distance not explicitly specified by the slope object are found by linear interpolation between the slope endpoints. Specifically, let s_i be the slope at a distance x_i, then the slope at a point x, s(x), where x_i < x < x_i+1 is
s(x) = m_i (x-x_i) + b_i
where
b_i = s_i and m_i = (s_i+1-s_i) / (x_i+1).
This function calculates these b
and m
.
The elevation at an intermediate total distance is the integral of the slope function. We define the start of the elevation as (0,0). Then the elevation at a point x, e(x), where x_i < x < x_i+1 is
e(x) = m_i (x-x_i)^2 + b_i (x-x_i) + c_i
where
c_i = y_i.
A data.frame
that is a modified version of the Slope object
with additional columns x, m, b, and c.
plot.Slope
, expand_slp
, remove_slp_transitions
slp <- read_slp(system.file("extdata", "071000090603_2.slp", package="WEPPR"))
integrate_slp(slp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.