0

Known

$$ a , B=\begin{pmatrix}b_0\\b_1\\ \vdots \\b_i\end{pmatrix} , C=\begin{pmatrix}c_0\\c_1\\ \vdots \\c_i\end{pmatrix} $$

Equation

$$ Y=\begin{pmatrix}y_0\\y_1\\\vdots\\y_i\end{pmatrix}, $$

$$ Y = a B x - C $$

Condition

$$ y_i \ge 0, a = \sum_{j=1}^i y_j $$

About this question background

  • a: total count for a product I should order, which my colleagues give (can make little change).
  • B: each store's 14days mean salecount of this product
  • C: stock number of this product , which can be sold on next day
  • x: a single raito to control the daily replenishment for each store
  • Y: the replenishment for each store, sum need equal to a

Question

How do I solve a best x (single varriable) ??

Maybe wee need set a = sum(Y) to optimization target ? I don't know , for me sum(Y) should as much as close to a and y_i also should >= 0 , so I think they are all condition .


Sorry, I don't know how to write a proper format. Feel free to alter my equation expression .

Mithril
  • 109
  • 1
  • 5
  • I think B,C and Y are vectors and not sets, right? What about $x$. Is it a variable or a vector, too?. – miracle173 May 28 '20 at 08:59
  • What is the meaning of this equation. From where does it come? – miracle173 May 28 '20 at 09:01
  • @miracle173 Yes, they are vectors . I would append the detail . – Mithril May 28 '20 at 09:02
  • @miracle173 I have updated the background – Mithril May 28 '20 at 09:11
  • and what is the meaning of Y? – miracle173 May 28 '20 at 09:29
  • @miracle173 Y is replenishment for each store . – Mithril May 28 '20 at 09:30
  • 1
    wha should $c_i$ be part of the model and how should it influence it? Assume that you have two stores and $b_1$ is equal to $b_2$, then $y_1=y_2=a/2$, I think. Independent of $c_j$ – miracle173 May 28 '20 at 09:49
  • maybe https://economics.stackexchange.com/ is a better place to discuss a model, but I don't know – miracle173 May 28 '20 at 09:54
  • @miracle173 The final replenishment order depend on $c_i$, because if I have enough stocks(in the warranty period), I should not give it addition replenishment ... wait . This is a good question . Acctually , we should keep each stock $c_i$ in a stable value, so missing a equation for $c_i$ . Let me think about it ... – Mithril May 28 '20 at 10:00

1 Answers1

1

You have $i+1$ equations and $i+1$ variables. If you sum up you get $$\sum_{j=1}^i y_j=a (\sum_{j=1}^i b_j)x+\sum_{j=1}^i c_j$$ and if you replace $\sum_{j=1}^i y_j$ by $a$:

$$a=a (\sum_{j=1}^i b_j)x+\sum_{j=1}^i c_j$$ From this you get $$x=\frac{a-\sum_{j=1}^i c_j}{a(\sum_{j=1}^i b_j)}$$ You have to check if $y_j\ge 0$ for your solution.

It seems that your model is not appropriate for your situation.


Maybe the following is appropriate for your situation:

I will assume that $b_j$ is the avarage number of items sold in store $j$ per day. calculate the number of days that it will take until a store is empty. This ist

$$T_j=\frac{c_j}{b_j}$$

Now assume that the indexes are chosen that $$T_1\le T_2\le T_3\ldots$$

After $T_1$ days the first store, store 1, is empty. Now se add every day $b_1$ items from the ordered products. This is exactly the number of products that the store needs to fulfill the customer requests

After $T_2$ days the next store, store 2, is empty. So now we qdd every day $b_2$ items from the ordered products to store 2. This can be done for store 3,4 and so on until wee have no more ordered items.

So we use the following strategy to distribute our ordered products:

  • renumber the stores such that $$\frac{c_1}{b_1}\le \frac{c_2}{b_2}\ldots$$
  • find $k$ such that $$b_1(T_k-T_1)+b_2(T_k-T_2)+\ldots b_{k-1}(T_k-T_{k-1})\le a$$ and $$b_1(T_{k+1}-T_1)+b_2(T_{k+1}-T_2)+\ldots b_{k-1}(T_{k+1}-T_{k-1})+b_{k}(T_{k+1}-T_{k})\gt a $$

we want that store 1 to k+1 run out of items at the same time, so we choose $T$ such that

$$b_1(T-T_1)+b_2(T-T_2)+\ldots b_{k-1}(T-T_{k-1})+b_{k}(T-T_{k})= a $$ so $$T=\frac{a+b_1 T_1+b_2 T_2+\ldots b_k T_k}{b_1+b_2+\ldots+b_k}=\frac{a+c_1 +c_2 +\ldots c_k }{b_1+b_2+\ldots+b_k}$$ From $T$ wer now calculater the number of items we deliver to each store:

$$y_j=(T-T_j)b_j, j\le k$$ $$y_j=0, j\gt k$$

$T$ is the smallest time that is possible to avoaid that one store runs out of product $T.$

miracle173
  • 11,049
  • But this would give me some negtive values , can't ensure $y_i >= 0$ . If I clip every $y_i<0$ to zero. The total number would grows and result to sum(Y) > a – Mithril May 28 '20 at 09:22
  • That's why I think there may be an optimization equation to catch the best x. But I have no idea about it . It looks like linear programming , but different from what I know as https://cvxopt.org/examples/tutorial/lp.html – Mithril May 28 '20 at 09:29
  • Yes, maybe there should be some optimization. But at the moment I am to busy to think about that. – miracle173 May 28 '20 at 09:36
  • a negative $y_j$ means that you should put this number of items from the store $j$ and put it to other stores. This makes sense if the number $c_j$ of items in store $j$ is large. If you don't want tto do this, you must make another model. – miracle173 May 28 '20 at 09:45
  • I added a proposal for a new model – miracle173 May 28 '20 at 10:33
  • My situation is something complicated . T is depended to the supplyer and purchasing staff , would not be the exactly run out time , they also don‘t like run out . The purchasing staff in chrage want an x to adjust the goods distribute to each store , they usually order more than a store need , also some product's amount would less than the demand . – Mithril May 28 '20 at 13:41