 So, before that let me, customers can fulfill only when we have required inventory typically we want the inventory to be non-negative represent a physical availability of the goods that is orders not immediately pulse it or last forever. Suppose you go to retail shop and you want to buy something it is not there you go to the next shop. It is very rarely you will say ok I will come tomorrow and find out or we will wait for 2-3 days especially at a small retail shop setting or a time sensitive item you do not need to wait for it. You go it is not there that order is pretty much lost for the retailer ok so we need to model this. Let us just take a look whether our inventory is actually going negative I am not sure it is going to happen but let us see inventory yep it is indeed if you looked at the inventory graph in a previous setting you can find the inventory was 40 and then when demand increased even this simple setting it went below 0 from time period probably 12 to 15 it is negative inventory. So, this we do not want we do not want the inventory to go negative so meaning if inventory is not there that demand is lost so ideally what we want is a straight line right here when demand is when inventory is not there. So, what can we do what can we do we can create a new variables or customer orders let us keep it separate we will update the sales rate as per that and since we know the customer orders we directly change the sales we change your expected sales rate based on the customer orders and the expected sales rather than the sales rate. So, let us update this also in our model then how should the equation of sales rate be so what should be the equation of sales rate go ahead let me do this customer orders keep it a day what are the equation we had for sales rate we will just put it here step of 10 to 10 tell you this customer orders the expected sales rate is now changes based on customer orders so change in sales is basically expected sales rate actually represent expected a forecasted demand that is what it actually represents. Now, how should the sales rate be if I should not allow negative inventory let us do the simple one inventory and customer orders and sales rate minimum of inventory and customer orders should that do the trick units one match one first let me do both we simulate it let us plot the inventory graph does not hit 0 something has come in a truncated is right there, but if you do model units check so many units errors or adjustment of in transit except I am not given so let me do that model units check there will be units error for your minimum minimum we are comparing inventory and customer orders customer orders kg per day but inventory is kg so it is going to show an error for that how do you fix it how do you fix it units error means model is not correct either we have valid model and invalid model not much in between how do you fix it I cannot directly connect it let us call it what should the equation for this be what will I connect it to no inventory coverage is nothing to do with maximum you can sell how does maximum you can sell maximum you can sell is how much is inventory and how much you can actually say it is affected by the inventory good for inventories in kg and I want max sales in kg per day so you need to do one more variable for time let us call it as minimum order processing delay let us say max sales is inventory divided by minimum order processing delay let this be kg per day at the minimum order processing delay be one day that whatever inventory I have I can dispose it in the same day I do not have any issues in that and sales rate since of inventory let us call it max sales and customer order now if I do unit check I should not get any errors all units are okay to simulate I can get the actual inventory dynamics or inventory does not go below 0 which is what we have right here now this model is very close firstly started with a simple model to start how to adjust inventory then we try to include features in the model to better decision making and then we try to include features in the model to make it a little more realistic to capture what is actually happening within the scenario like we do not want the inventory to go negative because we are assuming it is going to be lost so that has to be captured explicitly in case it was not lost and if there is backlog then we need to create a separate backlog unit we will do it later and then we wanted to keep as less constants as possible which can be directly computed for example we had a desired in transit inventory but we got rid of it by using math we had desired inventory but since that is quite orbit we decided to map it to how much inventory coverage is needed which probably we can get more direct answer to rather than desired inventory we substituted that so we have only very few constants to start with supply delays inventory coverage and time to adjust inventory is an in transit and customer orders and model kind of set for the particular echelon or the retailer so this is the model that we have right now the complete retailer model of the first slide at least talked about supply chain so let us at least move towards the supply chain to see how it is going to look till now we have a model of the retailer let us suppose the distributor has the exact same decision structure as the retailer whatever the distributor retailer is ordering it actually is the order goes to retailer distributor will then check his inventory and supply that to the retailer and in turn the distributor is going to order from say some factory upstream here in the only retailer model what is assumed is whatever is order rate it is being provided by the distributor there is no capacity on that now let us see if you are able to include a distributor model so this order rate will actually go to the distributor who will then check his inventory and then based on that will provide the material to the retailer to do that make a copy of your existing retailer model go ahead or you can take a picture of it first you have to copy it and do not do all the steps you just try to just read it once with me open that new file set zoom to smaller size then pretty much what you are going to do is instead of drawing the model again we are just going to copy the entire structure and paste it so that is I am just going to select all this is a big sentence but all I am doing is select all copy this so let us go for that file save as rd1 you zoom 50 percent it will be too small it will be 305 percent fine so click somewhere in the white area first then select all copy when you paste unfortunately you will paste right on top of it so without clicking mouse anywhere else click on the black part right here you should be able to get this model we got it please do it you will have one set of variables with a subscript 0 right you have one set of variables on the right with subscript or a variable name with 0 and an end of it and other without the 0 so more times you copy paste you are going to get 0 1 2 3 4 whatever that is ideally we need to have proper names for each but for now we will just go with this we got these structures so now if you simulate it you will still run all you have is two independent models built on the same screen but still the dynamics will be completely independent there is no relation so first we need to capture that for that let us denote this part I am just adding a comment right in the top here I think this is your distributor and this is your retailer that is just for more convenience so that you know whom I am referring to so left side model is a distributor for me and right side is a retailer the one with subscript 0 is a retailer model okay now for the distributor distributor customer orders is not independent it actually comes from the retailer so let us add a link arrow from desired order rate to customer orders this is what he wants that is what he is going to order whatever he wants he is going to order so may customer order of distributor becomes equal to desired order rate so I just added this link okay now I am to go ahead and delete this link so desired order rate 0 customer orders equal to desired order rate 0 so that is all I did now based on this customer orders sales rate will happen based on the max sales that is possible and whatever is sold is what is going to be dispatched so this order rate is nothing but your dispatched rate so now let us connect this sales rate with your order rate this order rate sales rate only two links are here nothing else changed I am just saying whatever order came in it he just gave to this distributor and distributor has a decision structure to follow and now sales rate whatever is sold it has to pass down to the retailer so as soon as it is shipped so instead of sales rate you can call it a shipment rate if you want and this is your dispatched rate so this shipment rate should be equal to this shipment rate and instead of directly connecting them I am just connecting them as co flows so that you can physically see retail model and distributor model separately now let us simulate you can check units it should still match now once simulated click on customer order is 0 desired order rate and order rate just observe whatever I selected customer order rate is what the retailer end customer demand he faces that is a step function desired order rate is what the retailer ordered to the distributor and this order rate on the left top is what the distributor is going to order to the his upstream player could be a factory or a warehouse or someone else so let us see the graph here you can nicely see that as there is a step change in the end customer demand this desired order rate 0 that is the green line increases and since distributor is ordering based on that you can see that the distributors order rate is actually much higher and exhibiting much higher dynamics within the order so this was one of the basic ideas we started for us to look at the look at the dynamics as what we call as industrial dynamics and came into this book and nowadays we more popularly call this as the bullwhip effect that we are seeing where any change in the end customer demand is getting amplified as we go higher upstream two questions get simulated supply chain so now imagine if you are adding more and more from this distributor suppose there is another warehouse or there is a manufacturing and then there is another supplier and imagine dynamics the supplier is going to see because each player is only looking at the information he is presented with the distributor doesn't have any idea about the end customer demand he is only seeing what the order he is getting and he is reacting to that the division policy is the same the delays are the same it takes exactly the same delays so for distributor also took two days to supply for manufacture for the retail also taking two days both their time to adjust inventory is the same both are using the same exact same forecasting policy even if they have exact identical players still we are seeing this dynamics that is unfolding because of change in demand and just the sheer presence of these multiple stocks and units which is further and further away from the end customer orders which is right here two questions on this so yeah the only link we did was these two customer order rate of distributor is a desired order rate zero of retailer order rate zero of retailer determined by sales rate of distributor and we just simulated and observed it's a good modeling practice to go proper variable names and avoid all these subscripts as illustrated model can be copied and you can do it so you can think of appropriate names for the distributor excellent we call it shipment rates instead of sales rate and call it supply or delay or something something else