tpt-rust4

Rust

Simulation engines, dispatch optimizers, and digital twin observers for the TPT platform — turns historical and live telemetry into optimal physical setpoints.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust100.0%
README

tpt-rust4 — The Brain & Digital Twins

TPT Solutions — part of the TUP (Telemetry Unified Protocol) platform.

tpt-rust4 is the Brain: it provides the simulation engines, dispatch optimizers, forecasting baselines, and digital-twin observers that turn current and historical state (from the Memory layer) into the optimal Command Envelopes (setpoints) that the Reflexes layer executes.

            ┌──────────────── tpt-rust-4 (The Brain) ────────────────┐
 Read Path  │  tpt-state-snapshot / tpt-parquet-partitioner (tpt-rust-3) │
   ───────► │      │                                                    │
            │      ▼                                                    │
            │  tpt-forecast-bridge ─► tpt-forecast-naive                │
            │  tpt-twin-observer (KF) ◄─ tpt-twin-thermal / hydraulic    │
            │      │                                                    │
            │      ▼                                                    │
            │  tpt-dispatch-model ─► tpt-dispatch-solve                 │
            │      │                       │                           │
 Write Path │      │                       ▼                           │
   ◄─────── │      └──── Command Envelope ──► tpt-actuation-gate (tpt-rust-5)
            └────────────────────────────────────────────────────────────┘

Crates

CrateRole
tpt-sim-clockDeterministic, multi-rate simulation clock (decoupled from wall-clock).
tpt-sim-engineDiscrete-event + fixed-step execution loop, dependency graph, snapshotting.
tpt-sim-scenarioSeeded scenario generation, Monte Carlo wrapper, batch harness.
tpt-dispatch-modelPhysics → math bridge: battery/pump/tank constraints → LP/conic problem.
tpt-dispatch-solveOrchestration, solution mapping, TUP Command Envelope, CommandSink.
tpt-forecast-bridgeTUP telemetry → matrix adapter (windowing, resampling, gap-fill).
tpt-forecast-naiveBaseline forecasters: persistence, diurnal, degree-day.
tpt-twin-observerState estimation framework + Kalman filter + sensor-failure inference.
tpt-twin-thermalLumped-capacitance thermal models (zones, tanks, heat exchangers).
tpt-twin-hydraulicSteady-state pipe network model (Hazen-Williams).

tpt-dispatch-model / tpt-dispatch-solve support both good_lp and clarabel solver backends behind Cargo feature flags, sharing a backend-independent DispatchProblem type.

Upstream dependencies (mocked locally today)

tpt-rust-2 (Physics), tpt-rust-3 (Memory), and tpt-rust-5 (Reflexes) are spec-only today. This workspace defines small local trait abstractions to stand in for them — PhysicsConstantsSource, StateSnapshotSource, HistoricalTelemetrySource, and CommandSink — each with an in-memory implementation. These are swapped for the real upstream crates once those repos are scaffolded (see todo.md Phase 7).

tpt-protocol (tpt-protocol-tup / tpt-protocol-core) is a real, implemented dependency providing the DataPoint telemetry envelope and core traits.

Conventions

  • std-only throughout (LP/conic solvers, Kalman filtering, Monte Carlo harnesses).
  • Dual-licensed under MIT or Apache-2.0.

See spec.txt for the full design document and todo.md for the build checklist.

License

Licensed under either of

at your option.