Skip to content

Transient model - #27

Open
mrke wants to merge 1 commit into
mainfrom
transient-model
Open

Transient model#27
mrke wants to merge 1 commit into
mainfrom
transient-model

Conversation

@mrke

@mrke mrke commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Adds new transient (accounting for lags due to thermal inertia) behavioural algorithms, building on the addition of transient heat transfer calculations in HeatExchange.jl (currently a parallel PR for transient-model branch). It imports the 'trans_behav.R' functionality from the NicheMapR package and extends it to a more diverse range of behaviours, notably burrowing and climbing and nocturnal activity.

The general approach is to integrate with callbacks following the pattern in DEBtool_J.jl, with an extendable suite of conditions for the callbacks, allowing shuttling between sun and shade, retreating to a burrow or the surface or a tree when resting, escaping to a burrow in an overheating emergency, etc.

A preliminary application to endotherms is included where the gradual change in body temperature after a sudden transition to a new metabolic rate (active vs. resting metabolic rates) can be modelled to compute how heat load drives intermittent locomotion.

The steady state model has been extended to allow only climbing (arboreal habit) or only burrowing (fossorial habit). The terms 'critical_thermal_minimim/maximum' have been replaced with 'escape_temperature_min/max' to better reflect what these thresholds do in the code (the former have a specific physiological meaning - loss of righting response).

@mrke
mrke requested a review from rafaqz July 28, 2026 02:58
@rafaqz

rafaqz commented Jul 28, 2026

Copy link
Copy Markdown
Member

@mrke there are 10k lines of old code mixed into this, the git history is broken probably from the other branches being squashed.

I suggest you merge in main, then get claude to squash everything you changed down to one commit on top of the current main. Make a backup branch first!

…ms and endotherms

Event-driven ODE model (simulate_transient_behavior/simulate_endotherm_activity_cycle)
alongside the existing steady-state hourly loop: seven ectotherm behavioral phases
(sleep/bask/forage/cool/climb/burrow/refuge) and endotherm active/resting cycling,
driven by EnvironmentForcing time series and OrdinaryDiffEqTsit5. Includes a
user-extensible phase interface (phase_forcing/phase_posture/phase_state/phase_key/
phase_condition/next_phase), per-phase metabolic rate multipliers, configurable
cool-resume thresholds, and validation against the shared ectotherm threshold ordering.
Ported against and compared to NicheMapR's trans_behav.R reference output.
@mrke
mrke force-pushed the transient-model branch from f560a8b to 8c71f32 Compare July 28, 2026 08:12
@mrke

mrke commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

it was actually mainly a big csv file used as a test that didn't need to be there - smaller now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants