Skip to content

Thermostat PID

Adds feedback -- backward information flow within a single evaluation.

GDS Decomposition

X = (T, E)
U = measured_temp
g = pid_controller
f = update_room
Θ = {setpoint, Kp, Ki, Kd}

Composition

(sensor >> controller >> plant >> update).feedback([
    Energy Cost: plant -> controller CONTRAVARIANT
])
flowchart TD
    Temperature_Sensor([Temperature Sensor]) --> PID_Controller[PID Controller]
    PID_Controller --> Room_Plant[Room Plant]
    Room_Plant --> Update_Room[[Update Room]]
    Room_Plant ==Energy Cost==> PID_Controller

What You'll Learn

  • .feedback() composition for within-timestep backward flow
  • CONTRAVARIANT flow direction (backward_out → backward_in)
  • ControlAction role — reads state and emits control signals
  • backward_in / backward_out ports on block interfaces
  • Multi-variable Entity (Room has both temperature and energy_consumed)

Key distinction

Room Plant is ControlAction (not Mechanism) because it has backward_out. Mechanisms cannot have backward ports.

Files

Experimental SysML v2 view

The SysML export experiment projects this model into four parts and three forward connections, with a companion mapping/loss manifest. That artifact passed the pinned official Pilot validator with zero diagnostics. The backward Energy Cost feedback is omitted with diagnostics; the view does not reproduce the thermostat's execution behavior. See the interoperability guide for tool integration status.