Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ averageTimeSeries = function(mdl, var, n_years = 10){
#'
#' @return Plain data frame without tibble attributes
#'
#' @noRd
#'
untibble <- function (tibble) {
data.frame(unclass(tibble), check.names = FALSE, stringsAsFactors = FALSE)
} ## escape the nonsense
Expand Down
22 changes: 12 additions & 10 deletions R/zoomss_mvf.R
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
#' McKendrick-von Foerster Equation Solver (Base R Implementation)
#'
#' @title Solve McKendrick-von Foerster equation for size-structured populations
#' @description Solves the McKendrick-von Foerster (MvF) partial differential equation
#' @description Solves the McKendrick-von Foerster (MvF) partial differential equation
#' for size-structured population dynamics using a finite difference approach in base R.
#' @details This function implements the numerical solution to the McKendrick-von Foerster
#' @details This function implements the numerical solution to the McKendrick-von Foerster
#' equation, which describes how populations change across size classes over time.
#' The equation is solved using an upwind finite difference scheme that handles:
#' - Growth through size classes (advection term)
#' - Diffusion between adjacent size classes
#' - Diffusion between adjacent size classes
#' - Source and sink terms from feeding and mortality
#'
#'
#' The function processes each functional group separately and applies boundary conditions
#' appropriate for size-structured models. The last size class is set to zero abundance
#' to represent maximum size limits.
#'
#'
#' This is a core computational component of ZooMSS that updates population abundances
#' at each time step based on growth, mortality, and reproduction processes.
#'
#' @param ngrps Number of functional groups in the model
#' @param curr_min_size Vector of minimum size class indices for each group
#' @param curr_max_size Vector of maximum size class indices for each group
#' @param curr_max_size Vector of maximum size class indices for each group
#' @param A_iter Matrix of advection coefficients for current iteration
#' @param C_iter Matrix of diagonal coefficients for current iteration
#' @param Nb_iter Matrix to store updated abundances for current iteration
#' @param S_iter Matrix of source terms for current iteration
#' @param A Matrix of advection coefficients
#' @param B Matrix of diffusion coefficients
#' @param B Matrix of diffusion coefficients
#' @param C Matrix of diagonal coefficients
#' @param Nb Matrix of abundances to be updated
#' @param S Matrix of source terms
Expand All @@ -40,19 +40,21 @@
#' ngrid <- 100
#' curr_min_size <- c(1, 10, 20, 30, 40, 50, 60, 70, 80)
#' curr_max_size <- c(30, 40, 50, 60, 70, 80, 90, 95, 100)
#'
#'
#' # Initialize coefficient matrices
#' A <- matrix(0, nrow = ngrps, ncol = ngrid)
#' B <- matrix(0, nrow = ngrps, ncol = ngrid)
#' B <- matrix(0, nrow = ngrps, ncol = ngrid)
#' C <- matrix(1, nrow = ngrps, ncol = ngrid)
#' S <- matrix(0, nrow = ngrps, ncol = ngrid)
#' Nb <- matrix(0.1, nrow = ngrps, ncol = ngrid)
#'
#'
#' # Run MvF solver
#' updated_abundances <- zoomss_mvf(ngrps, curr_min_size, curr_max_size,
#' A, C, Nb, S, A, B, C, Nb, S)
#' }
#'
#' @noRd
#'
zoomss_mvf <- function(ngrps, curr_min_size, curr_max_size, A_iter, C_iter, Nb_iter, S_iter, A, B, C, Nb, S){

for(i in 1:ngrps){
Expand Down
2 changes: 2 additions & 0 deletions R/zoomss_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
#' params <- zoomss_params(Groups, input_params, isave = 50)
#' }
#'
#' @noRd
#'
zoomss_params <- function(Groups, input_params, isave){

# Calculate dt and tmax from time column in input_params
Expand Down
2 changes: 2 additions & 0 deletions R/zoomss_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
#' final_abundances <- results$N[dim(results$N)[1],,]
#' }
#'
#' @noRd
#'
zoomss_run <- function(model){

# Pull out some useful parameters - just a shortcut
Expand Down
2 changes: 2 additions & 0 deletions R/zoomss_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#' results <- zoomss_run(model)
#' }
#'
#' @noRd
#'
zoomss_setup <- function(param){

## Dynamic prey availability matrix: dim1 is predators, dim2 is predator size classes,
Expand Down
6 changes: 1 addition & 5 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template:
bslib:
toc: true
toc-expand: 3
bootswatch: flatly
bootswatch: cerulean
reference:
- title: Data
desc: Data related functions and datasets
Expand All @@ -30,10 +30,6 @@ reference:
- starts_with("extract")
- starts_with("get")
- starts_with("reduce")
- title: Private functions
desc: Functions to be unexported
- contents:
- untibble
navbar:
structure:
right: [github, search]
4 changes: 2 additions & 2 deletions docs/deps/bootstrap-5.3.1/bootstrap.min.css

Large diffs are not rendered by default.

54 changes: 0 additions & 54 deletions docs/deps/bootstrap-5.3.1/font.css

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pkgdown: 2.1.3
pkgdown_sha: ~
articles:
zoomss: zoomss.html
last_built: 2025-08-25T00:06Z
last_built: 2025-08-25T00:52Z
41 changes: 0 additions & 41 deletions docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions man/untibble.Rd

This file was deleted.

94 changes: 0 additions & 94 deletions man/zoomss_mvf.Rd

This file was deleted.

Loading
Loading