integrate_slp: Modify Slope object by adding coefficients for slope and...

View source: R/Slope.R

integrate_slpR Documentation

Modify Slope object by adding coefficients for slope and elevation calculations

Description

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.

Usage

integrate_slp(slp)

Arguments

slp

A Slope object

Details

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.

Value

A data.frame that is a modified version of the Slope object with additional columns x, m, b, and c.

See Also

plot.Slope, expand_slp, remove_slp_transitions

Examples

slp <- read_slp(system.file("extdata", "071000090603_2.slp", package="WEPPR"))
integrate_slp(slp)


jarad/WEPPR documentation built on Nov. 3, 2023, 5:42 a.m.