For some petroleum fields, optimization of production operations can be a major factor on increasing production rates and reducing production cost. In this work we investigated the formulations and solution methods for the following optimization problem: determining the optimal production rates, lift gas rates, and well connections for a gathering system with tree-like structures to maximize daily operational objectives subject to multiple flow rate and pressure constraints. While some aspects of this problem have been studied by other investigators, existing methods are either inefficient or they are based on significant simplifications that lead to suboptimal solutions. Hence, it is necessary to develop approaches that can solve the problem efficiently and without unreasonable assumptions. We first investigated efficient procedures for simulating the production system and computing sensitivity coefficients of production rates relative to system parameters. These procedures have useful applications in simulation, sensitivity analysis, and optimization of a petroleum field.