I apologize in advance if this question is not formatted up to standards, as this is my first time asking a math related question on here.
I am currently working on a problem for work that I have recognized to be an optimization problem.
A bit of background. The problem I am working on involves purchasing a specific commodity, so the overarching goal is to determine when to purchase and how much to purchase at that time to minimize a specific metric (in this case, days on hand). The data I am given is grouped into weeks. When purchasing items, we are purchasing $8$ weeks in advance. For this particular problem, we are assuming that our forecasts are accurate. In addition to this, we have to buy a full train car of this commodity, which is approximately $195$ thousand pounds (so we can only buy multiples of $195$ thousand pounds). With that in mind, I have created the following optimization problem.
For simplification, let's say we are only purchasing for $3$ weeks rather than $8$. The following are the equations and the conditions for the optimization:
Week_1_Qty= Initial_Qty - Forecast_week_1 + 195x_1
Week_2_Qty = Week_1_Qty - Forecast_week_2 + 195x_2
Week_3_Qty = Week_2_Qty - Forecast_week_3 + 195x_3
Initial_Qty, and the forecast at each week are all constants.
I am trying to minimize the following calculation of days on hand for the full three weeks in which I am purchasing(NOTE: this is not the typical financial calculation). More specifically, I am trying to find the values for $X_i$ that minimize the days on hand for this period.
sum(Week_i_QTY)/ 3*Avg_Daily_Useage
Average daily useage is also a constant.
The only conditional statements I have are the following:
Week_1_Qty>0
Week_2_Qty>0
Week_3_Qty>0
I am not too familiar with optimization. Have I set up this optimization problem correctly and what type of optimization would I use to solve this. I am also unsure as to whether the constraints I created are set up properly (I only want to make sure that the quantity of the commodity does not go negative at any week). I was thinking linear programming, but am not for sure if this is the correct way to approach this problem.
Any advice is greatly appreciated. Once again, I apologize for the poor formatting.
I have tried running through these on online linear optimization calculators with some values for the equations I have given above and keep getting error messages on the equation I am attempting to optimize and I am unsure what I am doing wrong.
Do you believe the way that I set this up is the correct way to go about doing this? If not, what would some alternatives be.