I've been given a problem where a company produces a product in 4 quarters, demand varying each quarter. Production is limited each quarter and so an inventory must be built up to supply to greater demand in the later quarters for which production cannot meet demand. If demand is not met instead the company can pay a penalty fee, but if inventory is greater than demand the company must pay a holding fee. These fees vary per quarter and the company wants to know by how much they should under/overproduced each quarter in order to minismise costs. The problem is the assignment requires me to solve this linearly and the only way I can think to model the costs is using an IF function (ie If production - demand > 0 then pay this holding fee, if production - demand <0 then pay this penalty fee) and this means the model is nonlinear. How can I avoid using an IF function and model the problem linearly?
Thank you