Accurate and efficient battery modeling is essential to maximize the performance of isolated energy systems and to extend battery lifetime. This paper proposes a battery model that represents the charging and discharging process of a lead-acid battery bank. This model is validated over real measures taken from a battery bank installed in a research center placed at “El Chocó”, Colombia. In order to fit the model, three optimization algorithms (Particle Swarm Optimization, Cuckoo Search, and Particle Swarm Optimization+Perturbation) are implemented and compared, being the last one a new proposal. This research shows that the model with the proposed algorithm is able to estimate and manage the real battery characteristics as SOC and charging/discharging voltage. The comparison between simulations and real measures shows that the model is able to absorb reading problems, signal delays, and scaling errors. The approach we present can be implemented in other types of batteries especially those used in stand-alone systems.