Mamdani fan controller

An old-school rule of thumb, wired up as a fuzzy controller: if it's hot and humid, run the fan hard; if it's cold, leave it off. Two crisp inputs get fuzzified into overlapping term sets, seven rules fire with varying strength, the output terms get clipped and aggregated, and the centroid of that aggregated shape is the crisp fan speed.

Math runs server-side through Hazy (Haskell) via the Ish /inference/mamdani endpoint. Drag the sliders to watch the rule firings, output shape, and defuzzified crisp value respond.

Top row shows each input fuzzified into its term set, with a dashed crisp line and dots marking the degree of membership at that input. Middle shows each rule's firing strength — colored by the fan speed term it votes for. Bottom layers each rule's clipped consequent underneath the aggregated envelope; the white marker is the centroid.