:

## Inventory Optimization Problem under given Service Level Constraint

Maple
Hello everbody,

I will try to explain the problem from my previous blog in more detail:

The Problem I posted is part of an inventory optimization problem. There are n bases(warhouses) for which I wish to determine the stock level in such a way, that I meet a so called target fill rate. The fill rate is the percentage of demands that can be met at the time they are placed. The formula for the fill rate for base n given an Inventory Level S is the following:

tfrbase[n,S] := sum(basepipe[n]^j*evalf(exp(-basepipe[n]))/factorial(j), j = 0 .. S)

The variable basepipe[n] indicates the stock in the pipeline which consists of the average annual demand times the average lead time.

My goal is to find the integer S for each base n, so that the target fill rate for every base n is at least 85%. Thus I wish maple in the end to print the base n, the respective required stock level and achieved fill rate.

So my idea was to set up 2 loops, one for n and one for S and using indices. However, I don't get any results.

restart:
n:=0:
S:=0:
basepipe[1]:=0.2:
basepipe[2]:=1.8:
tfr:=0.85:
tfrbase[n,S]:=0.0:
for n from 1 to 2 do
for S from 1 to 10 while tfrbase[n,S] <= tfr do
tfrbase[n,S] := sum(basepipe[n]^(S-j)*evalf(exp(-basepipe[n]))/factorial(S-j), j = 0 .. S)
end do;
end do;

I would be more than grateful, if you could help me.

I look forward to hearing from you,

Fred

﻿