Management of inventory using control theory