KomuraSoft LLC
Chapter 5

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.

  1. Input sliders: room temperature (16–34°C, step 0.1) and humidity (20–90%, step 1).
  2. 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%)."
  3. 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.
  4. 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%.
  5. Two membership graphs: temperature and humidity membership functions with a marker at the current value.
  6. Active rule list: of the 9 rules, this lists those with firing strength > 0 along with the firing-strength value.
  7. 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.
  8. Temperature-sweep graph: with humidity fixed, an overlay of "temperature vs fuzzy output" and "temperature vs threshold output."

What the four main graphs represent

1. Aggregated output
Across the output axis (fan strength 0–100%), this is the function μ_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.
2. Centroid
The vertical line shown inside the aggregated-output graph — the computed centroid position. This becomes the fuzzy output value directly.
3. Fuzzy output
The final result obtained by reading the x coordinate of the centroid as a single number. The percentage shown large in the readout.
4. Threshold output
A reference value for comparison: applying the threshold table from Chapter 1 to the same input gives one of 20 / 50 / 85%.

Move the inputs

As you change temperature and humidity, the membership degrees, firing rules, and aggregated output update in real time.

Fuzzy control output
62.1 %
Medium
Threshold control 50 % / Medium
Difference The fuzzy output starts moving a little before each threshold step.
Aggregated output Centroid Fuzzy output Threshold output

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

  1. 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%.
  2. 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%.
  3. Press the Comfortable afternoon preset and watch the aggregated graph collapse to a single clean peak when only one rule fires.
  4. 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?

%

Q2. With preset 'Watch the boundary' (26.8°C, 69%), how many rules are firing?

Q3. Approximately what fuzzy output is displayed for the 'Watch the boundary' preset?

%

Q4. With preset 'Comfortable afternoon' (24°C, 55%), how many rules are firing?