A recent increase in the integration of renewable energy systems in existing power grids along with a lack of integrated dispatch models has led to waste in power produced. This paper presents a mixed-integer nonlinear optimization model for hybrid renewable-generator-plus-battery systems, with the objective of maximizing long-term profit. Prior studies have revealed that both high and low state of charge (SOC) of the battery is detrimental to its lifetime and results in reduced battery capacity over time. In addition, increased number of cycles of charge and discharge also causes capacity reduction. This paper models these two factors with a constraint relating capacity loss to the SOC and number of cycles completed by the battery. Loss in capacity is penalized in the objective function of the optimization model, thereby disincentivizing high and low SOCs and frequent cycling. A rolling time horizon optimization approach is used to overcome the computational difficulties of achieving global optimality within a long-term time horizon. By incorporating battery degradation, the model is capable of maximizing the profits from the power dispatch to the grid while also maximizing the life of the battery. This paper exercises the model within a case study using a sample photovoltaic system generation time series that considers multiple battery capacities. The results indicate that the optimal battery lifetime is extended in comparison to conventional models that ignore battery degradation in dispatch decisions. Finally, we analyze the relationship between battery operational decisions and the resultant capacity fade.