Simulation reveals counterintuitive stability in system dynamics
A Monte Carlo model built in Elm demonstrates how specific response delays can stabilise oscillating feedback loops in car dealership stock.
Martin Janicek has published a detailed analysis titled "Systems and Delays," which utilises a car dealership inventory model to illustrate how delays in feedback loops can cause system oscillation. The post, based on concepts from Donella Meadows’ book *Thinking in Systems*, demonstrates that while removing delays causes overreaction to demand spikes, introducing a 'response delay' to smooth orders initially leads to instability. However, increasing this delay further stabilised the system, proving that minimizing delays is not always optimal and that system behaviour must be modelled rather than assumed.
The analysis centres on a manager aiming to keep inventory at 10 times the daily sales amount. Customer demand starts at 20 cars per day, ramps up to 22, and includes a spike of 70 cars on one specific day. Sales are calculated as the minimum of customer demand and inventory. The model considers 'delivery delay' (time for orders to arrive) and 'response delay' (time taken to adjust orders based on discrepancy). Janicek notes that the book *Thinking in Systems* introduces concepts such as sources, sinks, stocks, flows, and feedback loops, corresponding roughly to mathematical models and differential equations.
Janicek developed a Monte Carlo simulator in the Elm programming language to model the car dealership example. The source code for the simulator is available on GitHub. He created the tool while reading the book, which he purchased using his work education budget. The simulation allows for testing different parameters to observe how the system responds to changes in delay structures, providing a practical application of the theoretical framework presented in Meadows’ work.
The initial model, which assumed no delays, showed that the dealership would overreact to demand spikes by buying too many cars, which would then take a long time to sell. To address this, Janicek introduced a 'response delay' where the manager orders only a fraction of the discrepancy between current and desired inventory. However, the combination of the delivery delay and the response delay caused the system to oscillate indefinitely, even when customer demand remained constant. The manager entered a cycle of ordering too many cars, then ordering more as the first batch arrived, only to find herself with excess stock once the deliveries were completed.
Contrary to intuition, shortening the delays to reduce the feedback loop time made the oscillations worse, with inventory swinging from 132 to 518 cars. However, when Janicek increased the response delay further, making the manager more patient by ordering only a small fraction of the discrepancy, the oscillations died out and the system stabilised. This finding underscores that many managers and leaders may take the lever that researchers provide and crank it in the wrong direction, acting on intuition rather than data.
Janicek published the blog post on 24 July 2026 on Hacker News, Lobste.rs, BlueSky, and GitHub. He also noted that he created a bitmap font and read a Czech post-apocalyptic novel titled *Nachové pustiny* during a week-long holiday. The post serves as a reminder that system behaviour must be modelled to understand the true impact of delays, rather than assuming that faster feedback is always superior.