Metadata-Version: 2.4
Name: moat-dev-heat-sim
Version: 0.0.1
Summary: Plant simulator and closed-loop test harness for the MoaT heating controller
Author-email: Matthias Urlichs <matthias@urlichs.de>
Project-URL: homepage, https://m-o-a-t.org
Project-URL: repository, https://github.com/M-o-a-T/moat
Keywords: MoaT
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AnyIO
Classifier: Framework :: Trio
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: anyio~=4.2
Requires-Dist: asyncclick~=8.3
Requires-Dist: moat-util~=0.64.8
Requires-Dist: moat-lib-path~=0.4.1
Requires-Dist: moat-link~=0.11.4
Requires-Dist: moat-dev-heat~=1.0.0
Dynamic: license-file

# Heating simulator

% start synopsis
% start main

A simulated heating plant for the heat controller (`moat-dev-heat`),
for tests and dry runs: no part of it is needed to run the heating.

% end synopsis

The plant model (`moat.dev.heat.sim.Plant`) is deterministic (seeded)
and sans-IO, advanced by `step(dt)`:

- a stratified buffer (N layers, mixing, losses) with sensor taps for
  `tb_water`, `tb_heat`, `tb_mid`, `tb_low`, and the hot-water section;
- the heat pump: output = load × Pmax(t_air) with a COP curve,
  `t_out = t_in + P / (c · flow)`, start delay, minimum load, power
  draw, compressor speed, de-ice cycles, over-temperature trip, error
  codes;
- the circulation pump: flow(PWM) with dead zone and lag;
- the heating circuit: radiator demand from the outside temperature,
  valve modes, return temperature; the switchover valve;
- hot-water draw events;
- the pellet burner: KWB state-code sequence, ignition time and
  warm-up, ignition failure, load → power, top temperature;
- the weather: outside temperature profile and forecast;
- fault injection: stuck or stale sensors, a dead flow pump.

`moat dev heat sim` publishes the simulator on a MoaT-Link tree (a
real or a test one) at the paths the pollers use, with a configurable
time scale, for end-to-end tests and operator dry runs. Scenario files
set up the plant and schedule events.

The closed-loop runner (`moat.dev.heat.sim.loop.ClosedLoop`) wires the
plant and the units' cores in-process, in simulated time; traces of its
runs are compared with stored references (`moat.dev.heat.sim.trace`).
The heat controller's tests use both.

% end main
