| dryingkineticmodels | R Documentation |
Fits 20 thin-layer drying kinetic models to experimental moisture
ratio data, ranks them by a composite goodness-of-fit criterion
(R^2, RMSE, and \chi^2), identifies the best model,
predicts moisture ratio (MR) using the best model,
performs residual diagnostic tests, and exports a fully formatted
report to a Word document.
dryingkineticmodels(
file_path,
verbose = FALSE,
models = NULL,
export_word = FALSE
)
file_path |
Either a character string giving the path to an
|
verbose |
Logical. If |
models |
Optional character vector naming which of the 20
models to fit (see Details for valid names). If |
export_word |
Logical. If |
The function expects the input to have at least two numeric columns. The first numeric column is treated as drying time as 'time' and the second as moisture ratio as 'MR'. Reorder your columns in Excel if needed before calling the function.
The 20 models fitted are: Lewis, Page, Modified Page,
Henderson & Pabis, Logarithmic, Two-Term, Two-Term Exponential,
Diffusion Approximation, Wang & Singh, Midilli-Kucuk,
Modified Henderson & Pabis, Verma, Weibull, Aghbashlo et al.,
Jena & Das, Hii et al., Parabolic, Thompson, Demir et al., and
Thin-Layer Exponential-Linear. The corresponding names to use with
the models argument are "Lewis", "Page",
"Modified_Page", "Henderson_Pabis",
"Logarithmic", "Two_Term",
"Two_Term_Exponential", "Diffusion_Approximation",
"Wang_Singh", "Midilli_Kucuk",
"Modified_Henderson_Pabis", "Verma", "Weibull",
"Aghbashlo", "Jena_Das", "Hii_et_al",
"Parabolic", "Thompson", "Demir_et_al", and
"Thin_Layer_ExpLin".
Starting values are obtained via a coarse grid search using
nlsLM, making the fitting robust across
a wide range of datasets without requiring manual starting value
specification.
Goodness-of-fit statistics reported are R^2, RMSE, MAE,
\chi^2, and RSS. Model ranking uses the combined rank of
R^2, RMSE, and \chi^2 following Goyal et al. (2007).
Residual diagnostics include the Shapiro-Wilk test (normality), Durbin-Watson test (autocorrelation), Breusch-Pagan test (homoscedasticity), and Runs test (randomness).
A list (returned invisibly) with five elements:
Data frame of all model fit statistics, sorted by composite rank.
The result list for the best-fitting model.
ANOVA table for the best model.
Data frame containing observed time, observed MR, predicted MR, residuals, and 95\ the best-fitting model.
Data frame recording which input columns were
used as TIME and MR. Always check this to confirm correct
column selection, especially when verbose = FALSE.
Goyal, R. K., Kingsly, A. R. P., Manikantan, M. R., & Ilyas, S. M. (2007). Mathematical modelling of thin layer drying kinetics of plum in a tunnel dryer. Journal of Food Engineering, 79(1), 176–180. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jfoodeng.2006.01.041")}
# Small, fast toy example (runs automatically during R CMD check)
toy_df <- data.frame(
time = c(0, 30, 60, 90, 120, 150),
MR = c(1.00, 0.72, 0.51, 0.36, 0.26, 0.18)
)
toy_result <- dryingkineticmodels(toy_df, models = c("Lewis", "Page"),
export_word = FALSE)
toy_result$comparison_table
# Fuller example using a bundled sample dataset (slower, includes Word export)
sample_file <- system.file("extdata", "sample_drying_data.csv",
package = "dryingkineticmodels")
df <- read.csv(sample_file)
result <- dryingkineticmodels(df, export_word = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.