# AMPL model for the NSC problem param MONTHS; # Number of months in the planning horizon param c {1 .. MONTHS}; # c[i] = cost of producing one ton of steel in month i param d {1 .. MONTHS}; # d[i] = tons of steel needed in month i var P {1 .. MONTHS} >= 0; # P[i] = tons of steel produced in month i var I {0 .. MONTHS} >= 0; # I[i] = tons of steel in inventory at the end of month i minimize cost: sum{i in 1 .. MONTHS} (c[i]*P[i] + 120*I[i]); subject to demand {i in 1 .. MONTHS}: P[i] + I[i-1] >= d[i]; subject to inventory {i in 1 .. MONTHS}: I[i] = P[i] + I[i-1] - d[i]; subject to initial_inventory: I[0] = 1000; subject to final_inventory: I[MONTHS] >= 1500; subject to max_production {i in 1 .. MONTHS}: P[i] <= 4000;