(* Discounts on Purchase Price and Freight Costs *); demand = 3000; holding = 0.2; setup = 700; price = PWSFreeze[ PWS[ {{{1, 1500}, 20 &}, {{IA[1500], 4000}, 19 &}, {{IA[4000], Infinity}, 18.5 &}} ]]; purchase = demand setup/# & + demand price + (holding #/2 &) price; tariff1 = Table[{{IA[400(j - 1)], 400j}, Evaluate[400j (1 - 0.02(j - 1))] &}, {j, 25}] /. IA[0] -> 1; tariff2 = Table[{{IA[10000 + 400(j - 1)], 10000 + 400j}, Evaluate[5200 + 8j] &}, {j, 10}]; tariff = PWSFreeze[PWS[Join[tariff1, tariff2]]]; totalCost = purchase + (demand/# &) tariff; Plot[totalCost[q], {q, 1, 5600}, AxesLabel -> {"Quantity", "Cost"}, PlotStyle -> {{}, {Dashing[{0.01}]}}, PlotRange -> {60000, 74000}]; Plot[totalCost[q], {q, 200, 1800}, AxesLabel -> {"Quantity", "Cost"}, PlotStyle -> {{}, {Dashing[{0.01}]}}, PlotRange -> {63000, 70000}]; FindMinimum[totalCost[q], {q}]