--- 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://-.hf.space` > Replace `-` with your actual Space URL (e.g., `rick-hes-homeostasis-explorer.hf.space`). --- ## How to use (students) 1. Open the link above. 2. Move the **PaCO₂** slider (20–80 mmHg). 3. Observe real-time updates to RR, pH, and CBF plus trend graphs. 4. Use the display to answer guided questions in your worksheet or quiz. --- ## Instructor notes - Coefficients are **illustrative** for teaching. Tweak them in `app.py` to 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))` - 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.py` exists at the repo root (or update **App file** to the correct path). --- ## Run locally (optional) ```bash python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt streamlit run app.py