 typically how much in transit do we need to maintain? Typically how much in transit do you think we should maintain? Just think logically, it takes two days for whatever order to come and every day I am going to place some orders, then how much should be in transit? So, let us, okay, sales rate is one, fine. There is no sales rate here. I have in transit, there is some sort of supply delay and I know in steady state, we always operate in steady state to determine these things. So, in steady state order rate equal to delivery rate, so it does not matter whether I am looking at order rate or delivery rate, that is fine. Suppose, I know the delivery delay which in this case is two days and I am ordering some quantity, let us take it as 20 kg per day, how much should be in transit? In steady state, 40 units, right? So, in transit should be equal to 40 kgs. Suppose my order rate became 30 kg per day, then what happens to in transit? 60. Same thing, if it becomes 10 kg per day, in transit should become 20 kg. Supply delay does not change because after some point we expect that order rate will be equal to delivery rate. So, we want it. So, whether I am going to call it order rate or delivery rate, it remains the, it does not matter. So, in this case what we are saying is in transit is equal to the order rate multiplied by supply delay. We want to look at units which kg per day multiplied by day or this is same as delivery rate multiplied by supply delay. So, this expression which actually neatly integrates or neatly relates quantity in transit or work in progress along with your throughput rate, that is how much your sales is happening per day, what is your throughput, multiplied by the flow time, the total duration which is going to flow. So, this particular relation is also known as Lidl's law aimed after John Lidl who formulated this. So, this process is equal to throughput rate or the delivery rate multiplied by the flow time, that is the supply delay right here. So, that much quantity has to be in transit. Who has seen Lidl's law before? You should not have asked the question how much should be in transit, you should tell. Good. So, it has to hold here also, right. The model is the model. Now, in steady state I know order rate equal delivery rate, but in reality what do I want? I want my in transit. So, if actual in transit is a product of delivery delay and a supply delay, my desired in transit should be product of lucrative model, desired delivery delay and the supply delay is exactly what we are going to do. I am already adjusting my desired quantity. So, the desired in transit quantity will be equal to desired delivery multiplied by supply delay. So, because you already computed how much is the desired delivery that we want and we are adjusting our ordering policy to reach it. So, at some point in future my delivery should be equal to my desired delivery. So, I am going to set our desired in transit quantity to how much I am going to desire it to be. So, that will give me my reference level in which I want to adjust our inventory. I am going to incorporate this chain and now save as your model as retailer or MDL and this model will continue for some time because the model is getting closer to a more supply chain player model rather than just an inventory model. So, let us go ahead and incorporate this. So, what I am going to do is desired delivery delay and supply delay is going to link to desired in transit. So, I added these two links here. So, those who are following this and this used a black arrow to distinguish it. So, you know which arrow I group click equation desired quantity in transit. So, you can see a desired delivery delay is kg per day supply delay is day ok, delay is desired in transit. Let us just make it as product of desired delivery and supply delay is only change that is being made within our model. Now, let us run it first we observe is order rate and sales rate and it is a similar but still there seems to be one extra jump ok. Now, let us observe the desired quantity in transit and quantity in transit. So, initially it was 0 quantity in transit then it rose up and saturated around 40. So, we are getting the desired value equal to the actual value then we are happy ok this is what we desired this is what we achieve whatever inventory and desired inventory. Last time we found that it fell down to 160. Let us see what happens now. Now miraculously it is able to recover and reach back to 200 which is our desired inventory value. Still there seems to be some small things within our models here. Let us look at the desired deliveries and compare it with the delivery rate itself. I hope you are observing what you are trying to do like whenever I am comparing I am comparing the desired values with access or reference of the what is the actual value that we are actually seeing which is how we are going to compare and make decisions. You know there is a gap that is what we want to adjust and make decisions. You find that even desired delivery, delivery is also saturated around 20 which in steady state that is what we want because steady state order rate has to be equal to delivery rate which has to be equal to your sales rate. If we compare all these three we can find that as a step increase in sales rate cause the order rate to first increase and delivery rate will be just offset because we have used a fixed pipeline delay. If you had used a third order delay then you will get a kind of a smoothing action that would have happened here but we assume the fixed pipeline delay so whatever we order definitely coming to be what we get right here. Now that we have set the desired supply line which was defined by Little's law or rather by the actual physical properties of what is expected to happen in reality. How do you determine how much should be desired inventory? Desired inventory we arbitrarily set at 200 units right 200 kgs. How do you determine the desired inventory? It depends on sales rate and safety stock good. Basic idea here is the desired inventory is actually determined by the management and not by the physical properties that is underlying it. We are hoping the management will be able to set some policies and it depends on how much actual inventory coverage you want right. It is going to have trade off. Customers demanding things whether you want to have one week of inventory, two weeks of inventory, five weeks of inventory to cover your now buffer against some uncertainties or changes in demand. So that is what you are going to use to determine and how many weeks of inventory you want to carry as a desired inventory. How much weeks of inventory? So typically it is based on number of weeks of inventory coverage that is desired. Not that desired inventory will be based on the management's decision. So we had actually estimate this is the main demand, this is the variance in the demand based on that we feel that we need at least 2 to 3 weeks and there is some variance in the lead time too. Suppose then we will use it to figure out how many weeks of inventory coverage you would like to keep. So now inventory is no more quantity in kg rather we are looking at how many weeks of inventory you want to keep corresponding to the demand. So let us update our model to reflect that. I am going to change the desired inventory values here. Let us introduce a new variable called as inventory coverage. What will be units of inventory coverage? Days. We are using time units days. Let us assume we are having 4 days of inventory coverage. Let us suppose. So now desired inventory, so how will I compute the desired inventory? The inventory coverage just told us that we need 4 days of inventory. 4 days of what? 4 days of inventory coverage. 4 days of actually the sales rate. But sales rate is something we know only after it happens. So we have to work with the expected sales rate. Include. Expected sales rate, nothing but inventory coverage into expected sales rate. So initially expected sales is 0. So inventory coverage is 4, so desired inventory will still be 0. And later when sales rate becomes 20, expected sales rate becomes 20, inventory coverage is 4. So desired inventory should be equal to 80. I mean inventory should adjust to 80. Let us simulate it and see what happens. Let us look at order rate. End of became worse. We are getting some negative orders. Why do you think there is a negative order? What is the negative order initially? The previous model you would have found that the order started at 0. Now there is a negative order. Why? Already there is some initial inventory. So how do you account for that? Then what should be the initial value of inventory? 0. Let us try 0. I just set the initial value of inventory to 0. Order rate is fine. Now it starts at 0 and goes around. Let us look at inventory and desired inventory. Eventually they both reach 80. So you are able to reach the desired inventory levels. You can check the desired supply line that also should be reached. But we also find that inventory is going negative here. It may not represent physical reality but for now let us just leave it as it is for a minute. The initial dynamics we already want the model to start in dynamic equilibrium. But initial value of inventory of 200 did not allow us to do so. So let us try this exercise. The model needs to start in dynamic equilibrium. What should the initial value of the stock be when initial sales is 0? When initial sales is 0, all the stock should be 0. What do when initial sales is 10 kgs per day? What should be the initial values? You need to tell the initial values for everything. When sales rate is equal to 10, what should be the initial values? When sales rate is equal to 10, eventually the expected sales rate should also be 10. So when sales rate is 10, expected sales rate will be 10. It is fine. When expected sales rate is 10, inventory coverage is 4, desired inventory is 40 and that should be equal to the initial inventory value is 40 because initially I do not want any dynamics. I want this model to start in dynamic equilibrium. So inventory should be 40. So if inventory is 40, desired inventory is 40. Adjustment for inventory is 0 but expected sales rate is 10. So if we decide delivery will be 10. Here correct. Desired in transit will be 10 multiplied by supply delay of 2 but desired in transit should be 20. And desired in transit is 20 that means quantity in transit also needs to be 20. So let us try that to see whether we start in dynamic equilibrium. So let us go to sales rate and just replace it with 10, just 10 kg. Just make sales rate equal to 10. Make expected sales rate is 10. Inventory is 40. Initial value is 20. In transit is 20. In transit is 20. Inventory is 40. Sales is 10. So when you run it, model should show a flat line. Let us see, verify it. No it does not. What did we miss? What did we miss? As we look at your model and tell me what we missed? What did we miss? It is important models are dynamic equilibrium because when you start this, one is you are trying to replicate reality but still we want the model to start in steady state. So then any change in the future can be attributed to the changes in the exogenous variables in the model. That is why you want to ensure that model starts in initial condition. This is called a simultaneous initial condition because many variables have to take those values to get in steady state. But logic we use is quite straightforward. If we decide inventory and inventory, time 0 both are at 40. See, when you observe the dynamics, things started at time 0 itself. Immediately after time 0, the dynamics are started. So something is wrong with the initial condition only. We have not affected it. The inventory and desired inventory, both seems to start at 40. Quantity in transit, desired quantity in transit both stops at 20. Sales and expected sales, both are 10. It does not change at all. It is not good. What else can we compare? Order rate, desired order rate. This is exactly the same. There is no change in equation. Order rate equal to desired order rate. What else? There is one more pair of things. Inventory, desired inventory we check. Yes, delivery rate and desired deliveries. Let us compare them. They seem to start at different time, different points. So desired delivery starts at 10 which is what we want. But the actual delivery starts at 0. So where do we set it to start 0? Where do we set it? So this is only delivery starting at 0. It should have started at 10. So that means you should look at the equation of delivery rate. And delay affixed, order rate, supply delay, 0. 0 is nothing but the initial value which is getting delivered. So that should also be 10. So this is what happens when you start putting constants inside equations. So that we will continue to do the same mistake. Now let us simulate. Hopefully there is no change in your, yep, order rate is perfectly flat. So things are on a dynamic equilibrium. Let us go to sales rate. And say we will do 10 plus step of 20 at time 10. So it is 10. Initially at time 10 again it increases by 20. So it goes up to 30. Let us simulate. Let us compare order rate and sales rate. We get a dynamic graph as shown here. Now things seem to be okay. Things are in steady state and all the dynamic changes that we are seeing is a result of us changing the sales rate only and because of our decision structure. So this is what the model should look like. This is what we have been looking at. In model settings, set smaller time step until no significant change in dynamics occur. Choose time step to be about 1-8 the value of the smallest time constant in the model. You have to understand that what we are actually doing is coming up setting up differential equations and using Euler method to do the integration. And Euler method is a fixed time step model. Suppose you are in the Euler method and we have taken a time step of 1. But based on the delivery delays, we need to keep updating it. Suppose supply delay was for say 2.5 weeks and your time step was 1. That means it is going to clearly miss the 2.5 delivery delay time. It is going to do the time 1, time 2, then time 3. A time 2.5 should have arrived but it did not come. So it effectively capture that we need to have a small time steps of integration. The thumb rule is to have 1-8 the value of the smallest time constant. So what are all the time constants in our model? What are all the time constants in our model? This is the time constant, inventory coverage, supply delay, time to adjust inventory, time to adjust in transit, as well as even this fraction adjusted. Fraction adjusted that is about 1 over time. So fraction adjusted is 0.2. So that is one time constant is 5, no problem. That is 5. Inventory coverage was 4. Time to adjust inventory is 3. In transit 3, supply delay 2. Smallest time constant is 2. So let us take 1-8th of it so we can set a time step of 0.25. Let us go back to our pencil model. Settings 0.25, we are simulating it. Now let us look at order rate graph. Now you get a much smoother graph as opposed to the previous one. That is because you now have multiple points at every 0.25 so it looks like a smooth graph. In the previous one it seems to have a lot of sharp edges. You can compare it right here. This is the order rate previously time step of 1. This is the order rate of the time step of 0.25. Here it peaks at around 50. Here it seems to peak at nearly 59. But here it is about 51. So this is more a true representation of what is actually happening. This is because of integration time step error. You can keep reducing it until this does not change. So 1-8th is a good thumb rule to keep. So if your delay falls down to suppose you have another delay, say inventory coverage became only one week instead of four weeks, then good idea to reduce your simulation time step a little more to ensure you get the correct results. If time step is really large, you can even see different dynamics in the model which is not the true dynamics of the system. You may see a lot of oscillations or you may see exponential growth because of integration time step error rather than the properties of the model per se. So keep a note on the integration time step. So you send it at 0.25. Fine. We have not moved to the supply chain yet. We are still with the retailer. So we need to do a few more things.