Energy supply security is one of the strategic issues of all states. Beside the energy supply management, the section that has received less attention is energy demand management. According to importance of residential and commercial sectors in energy consumption, in the present study energy demand of these sectors is estimated using linear and exponential functions and the coefficients are obtained from PSO algorithms. 72 different scenarios with various inputs are investigated. Data from the years 1968 to 2011 are used to develop the models and select the suitable scenario. Results show that an exponential model developed based on particle swarm optimization algorithm has had the best performance. Based on the best scenario the energy demand of residential and commercial sectors is estimated 1718 Mega barrel of crude oil equivalent up to the year 2032.