In this work, we propose to use technology-specific nonlinear energy flow models based on nonlinear operating characteristics of the storage devices. These models are incorporated into an optimization problem to find the optimal market participation of energy storage systems. We develop a dynamic programming method to solve the optimization problem and perform two case studies for maximizing the revenue of a Vanadium Redox Flow Battery (VRFB) and a Li-ion battery system in PJM’s energy and frequency regulation markets.