← Learn

Safety Stock Simulator

A 52-week teaching year: forecast, uncertainty, replenishment, then the consequences for service, turns, and cash.

Teaching tool only

This is a teaching tool only. It is not suitable for real operational use, and it is not a planner or an optimiser.

The simulation runs in this browser. Nothing is stored on a server. Temporary choices stay in sessionStorage for this tab and clear when the tab closes.

To use your own forecast, stock, and prices, open the separate own-data simulator. It does not change the results on this page.

Teaching prices are fixed at a $100 sell price, a $70 cost, and $30 gross profit per unit. They cannot be edited.

The Mode section is next, before the settings. Choose One year or Monte Carlo, then press the matching button. Nothing is drawn until you do. Changing a setting clears the last results. Switching to Monte Carlo does not start the fifty years.

Mode

Base demand pattern

Forecast demand is the base demand. Variability and the shock are applied on top. The pattern itself is not a weekly editor.

Replenishment

Each week's demand is split evenly across seven days, and those seven days add up to the week. A receipt due on a day is in stock before that day's demand. A day with no receipt takes demand off the opening stock. At the start of each week the plan is rebuilt from the forecast and from orders already released, counted on the date they are still expected. A new receipt cannot arrive until the full base lead time has passed. An order released in week 1 with a 5-week lead time is due on the first day of week 6, before that day's demand. Until the goods arrive the plan keeps the normal lot quantity. A miss is recognised when that day passes with no receipt. The plan then expects that same quantity one week later, and moves the expectation forward again if the goods still have not arrived. It does not learn the actual arrival date in advance. A short shipment is recognised only when the goods arrive. The release is as many normal lots as the forecast needs to finish the week at or above safety stock. An order already on the way is counted on its expected date, and another lot can be due that same week if the forecast still finishes below safety stock. Lead-time variability adds whole extra weeks after the base lead time. It cannot bring the receipt forward.

Fixed lots are a whole number from 1 to 1000. Fixed safety stock is a whole number from 0 to 1000. Weeks cover sums the first 2, 4, 6, or 10 weeks of base demand. Starting stock is that full normal lot plus the safety stock for this run. Fixed and weeks cover use the quantity you set. Formula uses the computed result. Monte Carlo uses the one frozen quantity for every year in the batch. The week-1 forecast is not added, and delivery variability does not change this opening lot. The year is a snapshot of a plan already running. Orders that plan would already have released before week 1 are still on the way. They show up as receipts on their due dates, at the normal lot quantity until the goods arrive. They are not added into the opening stock. A new order placed during the year still waits the full base lead time.

Base lead time is the time it takes from placing a purchase order to receiving the goods — including the supplier's lead time and shipping. Longer lead times usually mean you need more protection (inventory or safety stock), because problems show up later and take longer to fix.

Formula safety stock uses the standard textbook calculation that's widely taught in planning courses and built into many planning systems. It treats weekly demand as varying randomly around its average or forecast in a bell-curve pattern. If you know how much demand usually varies, you can work out how much extra stock covers that variation over the lead time for the service level you choose. Robert G. Brown's Statistical Forecasting for Inventory Control (McGraw-Hill, 1959) helped bring this statistical approach into everyday inventory practice, and it's covered in standard texts such as Silver, Pyke and Thomas, Inventory and Production Management in Supply Chains (4th ed., CRC Press, 2017). It assumes the lead time is fixed and demand only moves randomly, so it doesn't allow for late deliveries, short shipments or demand shocks. Testing those situations is what this simulator is for.

Formula safety stock is round(Z × σD × √L). Z is 1.282, 1.645, 2.054, or 2.326 at 90%, 95%, 98%, and 99%. σD is the population standard deviation of this year's demand after the demand factor and before any shock. L is the base lead time: short 2, medium 5, or long 10. The result is constant across the 52 weeks. Monte Carlo keeps that same quantity for every year in the batch. The base lead time is the earliest gap between releasing an order and receiving it. It is also used for √L and for the maximum extra delay when lead-time variability is on.

Variability

Sales often fluctuate around a mean. A forecast of 100 a week does not mean you expect to sell exactly 100 every week — some weeks will be more, some less. That is demand variability. Large is the extreme band: each week can be anywhere from none of that week's forecast up to double it. The forecast is the expected mean. Across many runs those weeks average to the forecast. One year's realized mean can sit above or below it. Small and Medium stay nearer the forecast. The draw is for the whole week, then that week is split evenly across its seven days. Lead time variability is stock arriving earlier or later than expected. That can come from things like vessel availability, port congestion, or manufacturing delays. Delivery quantity variability is not receiving the exact quantity you ordered — often because of supplier manufacturing issues, stock availability, or picking errors.

Demand shock

The chart, weekly table, and Monte Carlo summary stay empty until you press the button for this mode. Changing a setting clears them.

A demand shock is a sudden, short-lived jump in demand that your forecast didn't expect. In practice that can look like a large unexpected customer order, an unplanned promotion, or a competitor running out of stock and sending extra demand your way. Shocks like this are hard to plan for, and they're one of the main reasons businesses hold safety stock. When you turn the shock on, the simulator doubles demand in three separate weeks between week 21 and week 52. Those weeks are at least four weeks apart and chosen at random, so you can't pick them.

One simulated year

No year yet. Press Run year at the end of the settings. Changing settings does not draw this chart or table.

Inventory turns, average stock, and working capital use the daily points drawn on the chart. A day with no receipt contributes the stock after demand. A receipt day contributes the stock just before the receipt and the stock after that day's demand. A plotted point below zero counts as zero in that average, for the chart label, for turns, and for working capital. A stockout does not improve turns or reduce working capital. If the average is zero, turns are not applicable. Working capital is that average times the $70 cost. The weekly table is still one row per week. Its pre-receipt column is the lowest stock before a receipt is added: the morning stock on a receipt day, and the stock after demand on every other day. It is not the lowest close after a receipt. Gross profit is simulated demand times $30 and does not change because of backorders.

High turns with weak service is a poor outcome. The warning appears when turns are at least 8 and either customer service is below 95% or three or more weeks are out of stock. A week is out of stock if stock is below zero before a receipt due that morning, or after demand when nothing arrives. Touching zero is not a stockout. Customer service is the share of the 52 weeks that are not out of stock.