Source: https://www.math.univ-toulouse.fr/~schindle/cours/gestion_stocks.pdf