Spaces:
Running
Running
A newer version of the Streamlit SDK is available:
1.53.0
metadata
title: Homeostasis Explorer
emoji: 🫀
colorFrom: red
colorTo: blue
sdk: streamlit
app_file: app.py
pinned: false
license: mit
Homeostasis Explorer
Interactive teaching app for visualizing how changes in PaCO₂ affect respiratory rate (RR), pH, and cerebral blood flow (CBF). Designed for an online, asynchronous 300-level physiology course.
Student link (share this):
https://<owner>-<space-name>.hf.space
Replace<owner>-<space-name>with your actual Space URL (e.g.,rick-hes-homeostasis-explorer.hf.space).
How to use (students)
- Open the link above.
- Move the PaCO₂ slider (20–80 mmHg).
- Observe real-time updates to RR, pH, and CBF plus trend graphs.
- Use the display to answer guided questions in your worksheet or quiz.
Instructor notes
- Coefficients are illustrative for teaching. Tweak them in
app.pyto match your model:- RR:
RR = RR_base + 0.6 * (PaCO2 - 40) - pH:
pH = 7.40 - 0.01 * (PaCO2 - 40) - CBF (relative):
CBF = 1.0 * (1 + 0.015 * (PaCO2 - 40))
- RR:
- Suggested activities:
- Have students capture screenshots at PaCO₂ = 30, 40, 50, 60 mmHg and explain trends.
- Ask them to predict values before moving the slider, then verify and reflect on any mismatch.
Files in this Space
app.py— Streamlit app (main entry point).requirements.txt— minimal Python deps.README.md— this file.
If you see “Welcome to Streamlit” instead of the app:
- Ensure Settings → SDK is Streamlit and App file is exactly
app.py. - Confirm
app.pyexists at the repo root (or update App file to the correct path).
Run locally (optional)
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.py