Field Notes Journal Entry
Seasonal Ecology on a School Calculator
Porting seasonal ecological ODE models to a TI-84 Plus CE-T Python calculator
Most ecological modelling work tends to live on laptops, notebooks, servers, and scientific software stacks.
Naturally, therefore, I wondered whether a school calculator could run mine instead.
Having completed the desktop implementation, I spent a day porting the seasonal ecology ODE models developed for the Wildlife Seasonal Modelling project onto a TI-84 Plus CE-T Python calculator. Against all reasonable expectations, the result now works surprisingly well.
The calculator can now successfully run:
- The seasonal presence model
- The winter visitor model
- The resident detectability model
- The shared ODE solver itself
…and render the resulting curves directly on the calculator screen.
Why?
There is admittedly no practical reason to do this.
The desktop versions are faster, easier to maintain, vastly more capable, and dramatically more comfortable to work with. The calculator version exists almost entirely because it felt amusingly improbable.
That improbability, however, turned out to be interesting.
The TI-84 environment is extremely constrained compared to modern desktop Python. Memory is limited, the interpreter is slow, and seemingly harmless programming patterns suddenly become important in ways that are largely invisible on normal hardware.
As a result, the port slowly transformed from a novelty into a surprisingly educational exercise in constrained scientific computing.
The Models
The three ecological model families each survived the transition surprisingly intact.
The seasonal model continues to handle concentrated seasonal emergence patterns such as bluebell or swift and the winter visitor model still supports year-wrapping seasonal structure for species such as redwing and fieldfare
Most pleasingly, the resident detectability model retained its asymmetric suppression and recovery behaviour representing species whose detectability changes seasonally despite year-round presence.
Despite the severe hardware constraints, the resulting curves remain recognisably close to the desktop originals.
The Unexpected Bottleneck
The most interesting problems were not mathematical.
The ODE solver itself worked relatively quickly once ported. The real difficulties emerged from memory allocation and object management inside the calculator’s Python environment.
One particularly revealing example involved dictionaries.
The resident model originally returned diagnostic component information using a dictionary structure during each derivative evaluation. On a desktop machine this overhead is effectively invisible. On the calculator, however, repeated dictionary allocation inside the Runge-Kutta solver rapidly exhausted available memory.
Replacing:
return target, {
"winter": winter,
"autumn": autumn,
"summer": summer,
}
with:
return target, winter, autumn, summer
immediately solved the problem.
In retrospect this makes perfect sense. The calculator environment strongly rewards fixed compact structures and heavily penalises repeated dynamic allocation.
The exercise became less about ecological modelling itself and more about learning how small interpreters behave under pressure.
Chasing Memory
A surprising amount of effort eventually went into reducing object churn and runtime overhead:
- Replacing dictionaries with tuples
- Reducing temporary allocations
- Simplifying data structures
- Minifying the source files before transfer
- Moving species presets into tiny wrapper scripts
- Avoiding large runtime lookup tables
At one stage I attempted to build a full species preset system allowing the calculator to select species dynamically from a generated parameter catalogue.
The idea worked in principle.
The calculator disagreed.
In the end, the cleanest solution proved to be extremely small launcher scripts for individual species:
from seasonal import run
MODEL_PARAMETERS = (...)
run(MODEL_PARAMETERS)
In practice this turned out to be a surprisingly elegant compromise. The core models remain reusable while individual species can still be launched without modifying the model source itself.
Portable Ecological Computing
There is something unexpectedly satisfying about carrying ecological models around on a device originally designed for school mathematics.
The entire system now fits into a battery-powered, pocket-sized, handheld device while still performing numerical integration, seasonal forcing calculations, and graphical rendering entirely on-device.
None of this is remotely necessary.
But perhaps that is partly the point.
The exercise sits somewhere between embedded programming, numerical methods, field instrumentation, and natural history curiosity. It feels oddly consistent with the broader spirit of field notes itself: small portable tools being pushed slightly beyond their intended purpose in pursuit of understanding seasonal structure.
The Results
The final result is probably best described as a tiny ecological modelling workstation disguised as a school calculator.
Which, admittedly, is a fairly niche category of device.
Repository
TI-84 Python
Small scientific and modelling experiments for the TI-84 Plus CE-T Python
As a slightly improbable side project, a growing collection of numerical, modelling, and scientific computing experiments have gradually been implemented on the TI-84 Plus CE-T Python calculator.
The repository explores what can realistically be achieved within the calculator's highly constrained Python environment, including ODE solving, ecological modelling, graphical rendering, and various optimisation techniques required to make small scientific applications run on limited handheld hardware.