This commit is contained in:
33333-33333 2026-09-29 19:10:03 +09:00
commit 01204dfa2f
34 changed files with 1498 additions and 0 deletions

7
ecology/units.js Normal file
View 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;