Feel it with sliders
See how the numbers you have been tracking by hand actually look when the simulator runs them.
From here on we use the simulator below. The initial values are set to 26°C and 68%, so the example worked through in Chapters 2 to 4 is displayed as-is. First, check that your hand calculations match the numbers on screen.
Layout of the simulator (text version)
The simulator has the following regions. The graphs do not render without JavaScript, but you can still understand the structure from this list.
- Input sliders: room temperature (16–34°C, step 0.1) and humidity (20–90%, step 1).
- Preset buttons: five buttons — "Comfortable afternoon (24°C, 55%)," "Rainy season (25°C, 80%)," "Midsummer (32°C, 60%)," "Dry cold day (18°C, 30%)," and "Watch the boundary (26.8°C, 69%)."
- Output readout: the fuzzy controller's output (%) and label (Low/Medium/High) appear large at the top, with the difference from the threshold controller's output shown below.
- Aggregated output graph: the main defuzzification graph, drawing the clipped peaks and a vertical line at the centroid position on the output axis 0–100%.
- Two membership graphs: temperature and humidity membership functions with a marker at the current value.
- Active rule list: of the 9 rules, this lists those with firing strength > 0 along with the firing-strength value.
- Calculation-notes table: a single text-version table aligning membership degrees, firing strengths, aggregated heights, and the final output for cross-checking with hand calculations.
- Temperature-sweep graph: with humidity fixed, an overlay of "temperature vs fuzzy output" and "temperature vs threshold output."
What the four main graphs represent
μ_agg(x) obtained by clipping each rule's claim and stacking them with max. The centroid method reads off the x coordinate of this shape's centre of gravity.x coordinate of the centroid as a single number. The percentage shown large in the readout.Move the inputs
As you change temperature and humidity, the membership degrees, firing rules, and aggregated output update in real time.
What is happening on the output side
We clip the low / medium / high peaks, stack them with max, and read the centroid as a single point.
Temperature membership
Humidity membership
Rules firing right now
Near a boundary, several rules light up at once. That is the source of the smoothing.
Calculation notes
A summary you can line up against your hand calculations: membership degrees, aggregated peak heights, and output value in one place.
Comparison while varying the temperature
Holding the current humidity fixed, this plots the output against room temperatures from 16 to 34°C. The grey dashed line is threshold control; the blue line is fuzzy control.
Things to observe
- At the initial 26°C and 68%, check that the numbers match Chapter 4's result of medium 0.50 / high 0.25 / output about 62.05%.
- Press the Watch the boundary preset and see how the threshold output stays at 50 while the fuzzy output has already climbed to roughly 70%.
- Press the Comfortable afternoon preset and watch the aggregated graph collapse to a single clean peak when only one rule fires.
- Press the Midsummer preset and see the "high" label dominate almost the entire output range.
Check 5 — Read numbers off the simulator
Operate the simulator below to answer. 1 or 2 decimal places, as shown on screen, is enough.
Q1. At the initial values 26°C and 68%, approximately what fuzzy output is displayed?
For the example we have been tracking throughout this course, the exact centroid method gives about 62.05%.
Q2. With preset 'Watch the boundary' (26.8°C, 69%), how many rules are firing?
Two rules on the comfortable side and two on the hot side fire simultaneously, so 4 rules.
Q3. Approximately what fuzzy output is displayed for the 'Watch the boundary' preset?
Just before the boundary, both medium and high are effective, lifting the output to about 70.13%.
Q4. With preset 'Comfortable afternoon' (24°C, 55%), how many rules are firing?
Comfortable = 1 and normal = 1, so only 'comfortable × normal → medium' fires.