Selecting accurate and robust models is important for simulation and optimization of a clean energy system. This paper compares two photovoltaic (PV) models and two battery models in an open-source code, Opti-CE. The PV models are single diode model and its simplified model. The battery models are Improved Shepherd model and energy balance model. The models are compared from a perspective of overall system simulation and optimization in particular on both accuracy and computational time. The results indicate that simplified PV model causes 0.86% normalized root mean square error (nRMSE) compared with the single diode model, while decreases the simulation time from more than 800s to less than 0.01s. The energy balance battery model reduces simulation time from more than 5s to less than 0.03s. The energy balance model tends to underestimate the battery State of Charge (SOC) compared with the Improved Shepherd model. However, the error is not accumulative during the simulation. Compared to the Pareto front with single diode model and Improved Shepherd model, the simplified PV model increases the Pareto front values and result in both higher Self Sufficiency Ratio (SSR) and Net Present Value (NPV), while the energy balance battery model decreases the part of Pareto front, where individuals have low NPV.