energyCosts | R Documentation |
A function that for a given world of possible movement calculates
the transition cost for each in terms of a pre-defined time, work, and energy
cost functions. energyCosts
calls timeCosts
if columns
named 'dt'
and 'dl_t'
are not present in the input data.table
timeCosts(DT, v_max, k, s, row_speed = NULL, water = FALSE)
energyCosts(
DT,
method = "kuo",
m = NULL,
BMR = NULL,
g = 9.81,
epsilon = 0.2,
l_s = NULL,
L = NULL,
gamma = NULL,
time = timeCosts,
water = FALSE,
row_work = NULL,
...
)
DT |
A data.table containing at minimum columns 'dz' representing the change in elevation and 'dl' representing planimetric distance |
v_max |
The maximum velocity of the animal moving across the landscape,
in meters per second; see |
k |
The topographic sensitivity factor; see |
s |
The dimensionless slope of maximum velocity;
see |
row_speed |
How fast can a person move over water? Default is |
water |
Logical. If |
method |
A character string for the method that energy costs per
unit stride should be calculated. One of |
m |
The mass of the animal moving across the landscape, in kilograms. |
BMR |
The base metabolic rate of the object moving across the landscape in Joules per second. |
g |
The acceleration due to gravity, in meters per second per second.
Default is |
epsilon |
The biomechanical efficiency factor for an animal moving across
the landscape. Default is |
l_s |
The average stride length, in meters. Required for
|
L |
The average leg length. Required for |
gamma |
The fractional maximal deviation from average velocity per stride.
Required for |
time |
The method by which time costs should be calculated by |
row_work |
How much work in joules per second does a person use to move over water?
Default is |
... |
Additional parameters to pass to |
For timeCosts
, A data.table object with two columns:
(1) $dl_t
The predicted walking speed in meters per second
when walking between the from
and to
cells
(2) $dt
The predicted amount of time spent walking between
the from
and to
cells
For energyCosts
, a data.table object with five columns:
(1) $dt
The predicted amount of time spent walking between
the from
and to
cells
(2) $dU_l
The predicted work against gravitational potential energy
in Joules when walking between the from
and to
cells
(3) $dK_l
The predicted kinematic work in Joules when walking
between the from
and to
cells
(4) $dW_l
The total predicted energy lost due to biomechanical
work when walking between the from
and to
cells.
(5) $dE_l
The net metabolic expenditure exerted when walking
between the from
and to
cells.
Heglund, N. C., Cavagna, G. A., and Taylor, C. R. (1982). "Energetics and
mechanics of terrestrial locomotion. III. Energy changes of the centre of
mass as a function of speed and body size in birds and mammals."
Journal of Experimental Biology 97(1):41-56.
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1242/jeb.97.1.41")}.
Kuo, Arthur D. (2007). "The six determinants of gait and the inverted
pendulum analogy: A dynamic walking perspective." Human Movement Science
26(4):617-656.
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.humov.2007.04.003")}.
Pontzer, Herman (2023). "Correction: 'A unified theory for the energy cost of legged locomotion' (2016), by Pontzer" Biology Letters 19(12): 20230492. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1098/rsbl.2023.0492")}
# Generate a DEM
n <- 5
dem <- expand.grid(list(x = 1:(n * 100),
y = 1:(n * 100))) / 100
dem <- as.data.table(dem)
dem[, z := 250 * exp(-(x - n/2)^2) +
250 * exp(-(y - n/2)^2)]
dem <- rast(dem)
ext(dem) <- c(10000, 20000, 30000, 40000)
crs(dem) <- "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +datum=WGS84"
# Export it so it doesn't just exist on the memory
dir <- tempdir()
writeRaster(dem, paste0(dir,"/DEM.tif"),overwrite=TRUE)
# Import raster, get the grid
dem <- rast(paste0(dir,"/DEM.tif"))
grid <- makeGrid(dem = dem, nx = n, ny = n, sources = TRUE)
# Select all tiles that exist between x = (12000,16000) and y = (32000,36000)
tiles <- ext(c(12000,16000,32000,36000))
tiles <- as.polygons(tiles)
crs(tiles) <- crs(grid)
tiles <- whichTiles(region = tiles, polys = grid)
# Make a world but limit it to the DEM grid size
defineWorld(source = grid, cut_slope = 0.5,
res = res(dem), dir = dir, overwrite=TRUE)
# Calculate the energetic and temporal costs
calculateCosts(costFUN = energyCosts,
tiles = tiles, dir = dir,
m = 70, v_max = 1.5, BMR = 76, k = 3.5, s = 0.05, l_s = 1,
L = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.