Optimization problem with inventory rollover I need help with a constraint related to inventory rollover. 
Say you own a flower shop and the demand for flower seed packs is such:


*

*January: 200

*February: 300

*March: 500

*April: 800


So you need to order at least this many every month:


*

*January >= 200

*February >= 300

*March >= 500

*April >= 800


Given fluctuations in your supplier's prices, perhaps it would be optimal to buy a surplus of seeds in one month and sell them over the next several months (depends on the cost of storing inventory but we won't worry about that in this question). Any leftover seeds can certainly be sold in the later months.
This inventory rollover is the part I cannot figure out how to formulate in the constraints above. Any tips? 
 A: Let's generalize things a bit and say that the demand in the $i$th month of the year is $d_i$, so January's demand would be $d_1$, February's demand would be $d_2$, and so on. Let's also generalize the supply in the same way, so that $s_i$ is the supply you need in the $i$th month of the year. The general idea of the examples you gave in your question would then be:
$$s_i \geq d_i$$
In order to account for rollover, you could use the following:
$$s_i \geq d_i -(s_{i-1}-d_{i-1})$$
All this says is that the amount of seeds you would need in the $i$th month is at least the demand for that month minus the amount you had left over from the previous month (assuming you sold as many seeds in the previous month as you had expected to sell). Is that closer to what you were looking for?
Edit: Let’s redefine $s_i$ to be the number of seeds you buy in the $i$th month and $d_i$ to be the number of seeds you sell in the $i$th month (or how many you expect to sell, but we'll assume that those are the same for now).
Now say, in January, you buy $350$ seeds and sell $200$, so $s_1=350$ and $d_1=200$. You’ll have $s_1-d_1=150$ left over.
That means that in February, you’ll need to buy at least $150$ seeds, because $s_2 \geq 300\ –150 \implies s_2\geq 150$. But let’s say you decide to buy $200$ just to be safe. You now have $350$ seeds. Let’s assume that you sell exactly $300$ of them, and that you end up with $50$ seeds. You’ll need to buy at least $450$ seeds for March, because $s_3 \geq 500\ – 50 \implies s_3 \geq 450$. And so on and so forth.
See how the values for every month depend on the values for the previous month? $s_{i-1}$ and $d_{i-1}$ will always depend on $s_{i-2}$, $d_{i-2}$, $s_{i-3}$, $d_{i-3}$, and so on, so I think all the information you need for a given month would be contained in $s_i$, $d_i$, $s_{i-1}$, and $d_{i-1}$.
I won't rule out the possibility that there might exist a way to do this still more generally, but it seems easiest to me to take it one month at a time.
