A predictive maintenance model usually answers one question well: which machine is likely to wear out next, and roughly when. Plant managers face a second question that the model rarely answers on its own. Which spare parts should be stocked, in what quantity, and at which site, so that a forecast leads to a repair that happens on time? Too few parts turn a warning into a week-long stoppage. Too many tie up money in bearings and drive belts that never leave the store. A factory digital twin, a real-time virtual copy of the plant, gives teams a place to test that link before the shop floor relies on it.
The setup starts with the structure of the assets. The twin holds each production line as a hierarchy: machines, their components, the bill of materials (the list of parts) for each component, and the supplier lead time for every part number. Live data from vibration sensors, motor current, temperature and cycle counters feeds a wear estimate for each component. The forecast for a gearbox is not a single date. It is a distribution that gives the probability of reaching its replacement threshold within the next two, four or eight weeks. These distributions are the input to the stock simulation.
With that input, the team can run what-if scenarios against the stock policy. Suppose a packaging line runs two shifts and a critical sealing bar has a six-week supplier lead time. The simulation can test what happens if the forecast moves ten days earlier, if a second line uses the same part, or if a supplier delivers only half the order. Each run records how often the line would wait for a part, how many emergency orders would be needed, and how much stock would sit unused at the end of the quarter. The goal is not one perfect number. It is a clear view of which parts are sensitive to forecast error and which can be kept in small quantities.
Two cautions matter in practice. First, a failure forecast is only as good as the labels behind it. If maintenance logs say only that a bearing was replaced, without recording how worn it was, the model learns the wrong pattern and the stock recommendation inherits the error. Second, the stock policy should be checked against actual replacements, not only predicted ones. A part swapped during a planned shutdown tells a different story from one that failed in service. A useful habit is to compare forecast-driven orders with what technicians actually used each month, and to adjust thresholds where the gap keeps repeating.
For operators, the practical gain is a short list instead of a crowded dashboard. Each week the twin can flag the few components where a stoppage before the next scheduled shutdown is likely and local stock is below the simulated safe level. Planners then decide whether to rush an order, borrow a part from another site, or move a planned service window earlier. TwinUp, which builds digital twins for industrial and urban settings, approaches this problem by linking asset data with logistics data so both teams work from one model. A forecast is worth something only when the right part is in the right place before the machine needs it.
