get_N0: Generate a starting value for N

Description Usage Arguments Details Value References See Also Examples

View source: R/run_LeMans.R

Description

Generate a starting value for N, which represents the number of individuals in each length class for each species.

Usage

1
get_N0(nsc, nfish, mid, wgt, sc_Linf, intercept = 1e+10, slope = -5)

Arguments

nsc

A numeric value representing the number of length classes in the model.

nfish

A numeric value representing the number of fish species in the model.

mid

A numeric vector of length nfish representing the mid-point of the length classes.

wgt

A matrix with dimensions nsc and nfish representing the weight of each species in each length class.

sc_Linf

A numeric vector of length nsc representing the length class at which each species reaches its asymptotic length.

intercept

A numeric value representing the number of individuals in the first length class. The default is 1e10.

slope

A numeric value representing the slope of the community size spectrum. The default is -5.

Details

The total number of individuals in the community in each length class is equal to intercept*mid^slope. Within each length class, the number of individuals of each species is determined using the proportion of each species' biomass that is found in that length class.

Value

A matrix with dimensions nsc and nfish representing the number of individuals in each length class.

References

Andersen, K.H., Blanchard, J.L., Fulton, E.A., Gislason, H., Jacobsen, N.S., van Kooten, T. (2016). Assumptions behind size-based ecosystem models are realistic. ICES Journal of Marine Science, 73(6):1651-1655.

See Also

run_LeMans

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Set up the inputs to the function
nfish <- nrow(NS_par)
nsc <- 32
maxsize <- max(NS_par$Linf)*1.01 # the biggest size is 1% bigger than the largest Linf
l_bound <- seq(0, maxsize, maxsize/nsc); l_bound <- l_bound[-length(l_bound)]
u_bound <- seq(maxsize/nsc, maxsize, maxsize/nsc)
mid <- l_bound+(u_bound-l_bound)/2

# Set up the inputs to the function - species-specific parameters
Linf <- NS_par$Linf # the von-Bertalanffy asymptotic length of each species (cm).
W_a <- NS_par$W_a # length-weight conversion parameter.
W_b <- NS_par$W_b # length-weight conversion parameter.
k <- NS_par$k # the von-Bertalnaffy growth parameter.
Lmat <- NS_par$Lmat # the length at which 50\% of individuals are mature (cm).

# Get phi_min
tmp <- calc_phi(k, Linf, nsc, nfish, u_bound, l_bound, calc_phi_min=FALSE,
                  phi_min=0.1) # fixed phi_min
phi_min <- tmp$phi_min

# Calculate growth increments
tmp <- calc_ration_growthfac(k, Linf, nsc, nfish, l_bound, u_bound, mid, W_a, W_b, phi_min)
sc_Linf <- tmp$sc_Linf
wgt <- tmp$wgt

# Get an initial population
get_N0(nsc, nfish, mid, wgt, sc_Linf)

LeMaRns documentation built on Dec. 9, 2019, 5:09 p.m.