AI & ML
The Thermal Shock Series #2: Designing a Thermal Shock Scoring Algorithm
Janvi Bhardwaj Dev.to (EN Zone)
3 views
Designing a Thermal Shock Scoring Algorithm
A concept exploration exploring the math behind quantifying cumulative temperature stress on the human body.
In my last post, I wrote about the invisible health risk of walking in and out of AC buildings all day. The research is clear. Repeated thermal transitions cause real physiological stress, and nobody is tracking it.
So I started thinking about what it would take to actually measure this. Not with hardware, and not with expensive sensors. Just with logic, published research, and the kind of data a phone already has.
Here is the algorithm I came up with, on paper and not in code yet, for turning "I walked outside" into a meaningful health risk number.
What are we actually measuring?
I needed to define what thermal shock means mathematically. It is not just temperature. A 5 degree change when you step into a corridor is very different from a 20 degree change when you step into the Chennai sun. Doing it once is also very different from doing it six times.
So the score needs to capture three things:
How big was each temperature jump?
How quickly are the jumps happening?
Which direction did it go, cold to hot or hot to cold?
Step 1: Detect transitions
The phone knows where you are. GPS tells you outdoor versus indoor location. WiFi network names tell you which building you are in. You do not need a temperature sensor in every room. You just need zone classification.
I divided the campus into three zone types:
Cold zone (~18°C): AC labs, AC classrooms, library.
Transition zone (~28°C): Corridors, covered walkways, lobbies.
Hot zone (real time): Outdoors, pulled from a weather API.
A typical day might look like this:
9:50 AM:AC Lab (18°C) to Outdoor (37°C) — +19°C
10:00 AM:Outdoor (37°C) to AC Lab (19°C) — -18°C
11:30 AM:AC Lab (19°C) to Corridor (30°C) — 11°C
11:35 AM:Corridor (30°C) to Outdoor (38°C) — +8°C
12:00 PM:Outdoor (38°C) to AC Lab (18°C) — -20°C
1:00 PM:AC Lab (18°C) to Outdoor (36°C) — +18°C
Step 2: Direction weighting
Not all transitions are equal. When you go from cold to hot, your blood vessels dilate rapidly. That is vasodilation, and it is abrupt and physiologically expensive. Hot to cold is still stressful, but the body handles it slightly better because vasoconstriction is a faster and more controlled response.
So I added a direction weight:
Hot to cold: multiply by 1.0
Cold to hot: multiply by 1.3
The 1.3 factor reflects the asymmetry in thermoregulatory response documented in the research I cited in my first post.
Step 3: Recovery time
If you walk out of AC, stand outside for two hours, and then walk back in, your body has had time to adjust. But if you cross a parking lot for 10 minutes and immediately enter another AC building, your body never recovered from the first shock.
So I added a recovery factor:
Less than 30 minutes since last transition:multiply by 1.5
30 minutes to 2 hours:multiply by 1.0
More than 2 hours:multiply by 0.8
The formula
Shock = |Temperature Delta| × Direction Weight × Recovery Factor
Example:Transition at 12:00 PM (outdoor 38°C to AC lab 18°C, only 25 minutes after previous transition):
Shock = 20 × 1.0 × 1.5 = 30.0
Example:Transition at 1:00 PM (AC lab to outdoor, one hour after previous transition):
Shock = 18 × 1.3 × 1.0 = 23.4 *(This is a cold to hot transition, so the direction weight kicks in.)
Where AI would come in?
Everything above is just a calculator. Artificial intelligence would come in when the system starts learning from real data. Over weeks, the model could notice:
Personal baseline:You tolerate heat better than average, so the thresholds adjust.
Symptom correlation:You experience headaches on days when the score exceeds 120.
Schedule patterns:Tuesdays are lab heavy and consistently produce the highest scores.
Weather adjustment:A score of 100 when it is 42°C is much worse than when it is 34°C.
This is where it would become a genuine machine learning problem rather than a rule based system pretending to be artificial intelligence.
Why not use phone temperature sensors?
Your phone has a thermometer, so why not just read it?
Because phone ambient temperature sensors measure the internal temperature of the device. They are heavily influenced by battery heat, CPU load, and whether the phone is sitting in your pocket. They are not measuring the room at all.
Instead, this approach uses zone classification. If GPS and WiFi say you are in the AC lab, we know it is approximately 18°C. If you are outdoors, the system pulls the temperature from a weather API. Is it perfectly accurate? No. Is it good enough to detect a 19°C jump versus a 5°C change? Absolutely.
The honest limitations
-The direction weight of 1.3 is based on physiological principles but has not been validated with this specific formula.
-The risk bands are proposed rather than clinically established.
-Self reported symptom data comes with compliance and bias issues.
-Indoor temperature estimation by zone type is approximate.
-I have not coded this yet; it is currently a conceptual design.
I am a first year computer science and engineering student, not a medical researcher. But the underlying research is real, the math is defensible, and the gap in existing solutions is genuine. Sometimes the value is not in having the perfect algorithm, but in being the first person to think through an algorithm at all for a problem that nobody else is measuring.
Read original: https://dev.to/janvi_bhardwaj/the-thermal-shock-series-post-02-38n8
← Previous
Kubernetes and Swap: Why It's Disabled by Default (And How That's Changing) - A kubeadm Debugging Story
Next →
The Email Headers That Actually Stop Out-of-Office Auto-Replies
Related
FastMCP 3 4 migration: the breaking changes that compile
AI & ML
0
Dev.to (EN Zone)
My AI reviewer proved the fix worked. It didn't.
AI & ML
0
Dev.to (EN Zone)
Building Automation LLMs: What 66 Studies Reveal About Deploying Agents in HVAC Systems
AI & ML
0
Dev.to (EN Zone)
Considering our collective AI future
AI & ML
0
Dev.to (EN Zone)
Comments0
No comments yet — be the first