The present paper deals with an economic order quantity (EOQ) model of an inventory problem with alternating demand rate: (i) For a certain period, the demand rate is a non linear function of the instantaneous inventory level. (ii) For the rest of the cycle, the demand rate is time dependent. The time at which demand rate changes, may be deterministic or uncertain. The deterioration rate of the item is time dependent. The holding cost and shortage cost are taken as a linear function of time. The total cost function per unit time is obtained. Finally, the model is solved using a gradient based non-linear optimization technique (LINGO) and is illustrated by a numerical example.