Optimisation of Cost Functions with step functions

Hi I would like to know which algorithm is best suited to solve this Cost Minimisation problem:

Total Cost =

FC1           if  0 < W < 30
FC2           if  30 < W < 150
FC3           if  W > 150

+             W* ECL                     if q(e,b,W) ≤ BOD
W* ECH                     if q(e,b,W) > BOD

+ Price*Labor + Price*Capital + Price*Water + Price*Abatement

FC1, FC2, FC3 are constants while BOD is pollution standard, ECL and ECH are also constants

q is like the pollution concentration like BOD/liters of wastewater, I defined it as a function of e (emission), b (the firm's pollution abatement efforts) and W (water).

-
I'm not a programmer, and I don't know what q(e,b,W) is anyway. :( – anon Aug 24 '11 at 4:46
I know what BOD is, sure, but like anon, I wonder about q. Do give some background, please. – J. M. Aug 24 '11 at 4:50
i have updated my query. thanks anon and J.M. :) – Joseph Aug 24 '11 at 5:35
Just setup three different (constrained) optimization problems (to get rid of the step function), then use your preferred optimization problem solver for each problem separately, and then select the optimum from these three solutions. – Thomas Klimpel Aug 24 '11 at 7:37
@Thomas: I think there may be 6 problems, given the different values of ECL and ECH. – Henry Aug 24 '11 at 10:56