Skip to content

A 2d heat diffusion simuation wrapped in a Async Web API

License

Notifications You must be signed in to change notification settings

fxadecimal/MicroHEAT

Repository files navigation

MicroHEAT

A 2d FDTD heat diffusion simuation wrapped in a Web API

heat_diffusion.gif

Useful for:

  • Virtual Home Assistant Testing
  • Heat strategies using sensors and thermostats
  • Logging and python program development (sample included)

Quickstart:

# (optional) create a virtual env
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# (optional) test model
python3 ./simulation.py
# (optional) create mp4 / gif
bash ./build_mp4.sh

# run aiohttp webserver
python3 ./server.py
# server running at http://localhost:8080

Sample Heating System Agent

A sample heating "agent" or automation strategy is given in sample_heat_agent.py this will read the thermostat state and switch the heat on or off via the API

python3 ./sample_heat_agent.py

Logging Sample Program

A sample logging program is included for teaching purposes:

# create a sqlite3 database dict.sqlite3
python3 ./sample_logging_dict.py
#or
# create a sqlite3 database db.sqlite3
python3 ./sample_logging_sqlite.py

# dump database
echo .dump | sqlite3 db.sqlite3

API endpoints

Future Work

  • Exponential step function for the heating system
    • Switches on and comes up to temperature

About

A 2d heat diffusion simuation wrapped in a Async Web API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published