kozak_logs {timbeR} | R Documentation |
Simulate log extraction using a Kozak (2004) variable-form taper equation that describes the taper of the tree.
Description
Simulate the extraction of logs from a tree from its measurements, taper function (Kozak (2004) variable-form taper equation ), trunk quality characteristics and harvest parameters such as stump height and assortments.
Usage
kozak_logs(
dbh,
h,
coef,
p,
assortments,
stump_height,
downgrade,
broken,
defect_height,
eliminate,
total_volume,
only_vol
)
Arguments
dbh |
tree diameter at breast height, in centimeters. |
h |
total tree height, in meters. |
coef |
numerical vector containing nine coefficients of the Kozak taper equation. |
p |
numerical value representing the first inflection point calculated in the segmented model of Max and Burkhart (1976). |
assortments |
a data.frame with five columns and n rows, where n is the number of different wood assortments to be obtained from the tree stem. The first column must contain the names of the assortments, the second, numerical, contains the minimum diameters at the small end of the logs, in centimeters. The third column, numerical, contains the minimum lengths of the logs, in meters. The fourth column, numerical, contains the maximum lengths of the logs, in meters. The fifth column, numerical, contains the values in centimeters referring to the loss of wood due to cutting logs. The algorithm prioritizes the extraction of assortments along the stem in the order presented in the data.frame, starting from the first line, to the last. |
stump_height |
tree cutting height, in meters. Default is 0. |
downgrade |
if TRUE, the algorithm,from the defect_height onwards, simulates log extraction only for the last assortment in the assortments data.frame. Default is FALSE. |
broken |
if TRUE, the algorithm will simulate the extraction of logs only up to the defect_height. Default is FALSE. |
defect_height |
the height, in meters, from which the logs will be downgraded (if downgrade is TRUE) or log extraction simulation will be stopped (if broken is TRUE). Default is 0 for downgrade = TRUE (the whole tree is downgraded) and h * 0.5 for broken = TRUE (the tree is broken from half its original/estimated total height). |
eliminate |
if TRUE, the algorithm does not get logs for any assortment present in the assortments table. All will be zero. Default is FALSE. |
total_volume |
if TRUE, it adds an additional column to the results data.frame with the estimate of the total volume of the tree, from the ground height to h if broken argument is FALSE, or to defect_height if broken is TRUE. Default is FALSE. |
only_vol |
if TRUE returns only volumes (does not return the number of logs). Default is FALSE. |
Details
when the broken
and downgrade
arguments are set to TRUE, the defect_height
value is considered as the break height of the tree, and the entire tree is downgraded.
Value
a list of two data.frames, the first (volumes) with the calculated volumes per assortment, and the second (logs) with the number of logs per assortment.
Examples
library(dplyr)
library(minpack.lm)
library(timbeR)
tree_scaling <- tree_scaling %>%
mutate(did = di/dbh,
hih = hi/h)
kozak <- nlsLM(di ~ taper_kozak(dbh, h, hih, b0, b1, b2, b3, b4, b5, b6, b7, b8, p),
start=list(b0=1.00,b1=.97,b2=.03,b3=.49,b4=-
0.87,b5=0.50,b6=3.88,b7=0.03,b8=-0.19, p = .1),
data = tree_scaling,
control = nls.lm.control(maxiter = 1000, maxfev = 2000)
)
coef_kozak <- coef(kozak)[-10]
p_kozak <- coef(kozak)[10]
h <- 20
dbh <- 25
assortments <- data.frame(
NAME = c('15-25','4-15'),
SED = c(15,4),
MINLENGTH = c(2.65,2),
MAXLENGTH = c(2.65,4.2),
LOSS = c(5,5)
)
kozak_logs(dbh, h, coef_kozak, p_kozak, assortments)