second
This commit is contained in:
parent
5f7fcb96ed
commit
01204dfa2f
34 changed files with 1498 additions and 0 deletions
7
ecology/units.js
Normal file
7
ecology/units.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export const HOURS_PER_DAY = 24;
|
||||
export const KELVIN_OFFSET = 273.15;
|
||||
export const DEFAULT_TIME_STEP_DAYS = 1 / HOURS_PER_DAY;
|
||||
export const CELL_AREA_M2 = cellSizeM => cellSizeM * cellSizeM;
|
||||
export const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
||||
export const rateToProbability = (ratePerDay, dtDays) => 1 - Math.exp(-Math.max(0, ratePerDay) * dtDays);
|
||||
export const annualSurvivalToDailyHazard = annualSurvival => -Math.log(clamp(annualSurvival, 1e-6, 1)) / 365;
|
||||
Loading…
Add table
Add a link
Reference in a new issue