## 1 Introduction  
Rapid reduction of fossil fuel resources and growing evidence of global warming phenomena cause the necessity of urgent search for alternative energy sources. Recent studies shows that renewable energy has great potential and can be used to fulfil world energy demand [1]. According to [2], the PV industry has grown more than 40% per year since last decades due to rapid decrease in PV technology cost. PV technology may become major alternative energy source in the future since it has several positive attributes, low maintenances, free and inexhaustible energy source and robust and long life time system's components [3]. However, solar energy is not always reliable, because solar radiation varies and frequently changes, due to unpredictable nature and dependence on weather and climate changes. Hence, generated energy does not match with load demand all the time. Energy generated in PV systems depends mainly on solar energy available at the site. Geographical location, ambient temperature, clearness index, tilt and orientation of PV panel are the main factors that affect solar energy collected by a PV panel. Hence, studying these meteorological data is very crucial in preliminary design of a PV system. Other factors may affect energy generated, such as shading effect, cable reduction factor, system elements and configurations losses. There are two types of PV power systems namely grid connected and standalone systems. Grid connected photovoltaic (GCPV) systems engage PV technology with electricity grid network. In the GCPV system, an inverter converts DC electricity generated by PV modules into AC electricity. Then, output power from inverter is fed to the utility grid [4]. On the other hand, standalone photovoltaic (SAPV) systems are off grid systems, where PV technology is not connected to the grid, and power generated is not sold to the utility [5]. Before recommending and installing a PV system, it is crucial to ensure that the system is not over/under sized. In other words, the designer has to investigate the viability of system carefully. To efficiently and economically use solar energy, optimal sizing of the system is necessary so that the proposed system can operate in optimum condition in term of produced units costs and power reliability [6]. Electricity consumption is very important in when it comes to system sizing, as well as economical analysis, since overproduction can affect the feasibility of the system negatively. Thus, large self-consumption is desirable so as to ensure the lowest investment with full use of PV array and/or battery bank. Some review papers for PV system optimization can be found in the literature. In [7], a review of grid connected PV system in terms of technical and economic aspects was done. Electrical performance of PV modules, energy analysis, potential technical problems, and inverter's role in GCPV was explained exquisitely. However, the authors did discuss the optimization of these systems. In the meanwhile, photovoltaic technology and its power generating capability are reviewed in [8]. The authors discussed different existing PV systems performance and reliability, evaluation models, sizing and control methodologies, grid connection and distribution configurations. However, the authors did not give the major focus to the optimization techniques and constrains. On the other hand, in [9], general discussion for optimization methods applied to renewable energy is presented. However, the PV systems were not given enough focus in this paper. In [10; 11], the use of artificial intelligence techniques for PV system optimization is reviewed. The work done in these reviews mainly focuses on the implementation of a specific technique without focusing on the optimization problem itself. Furthermore, in [11], there is no mention of optimization methods for a grid connected photovoltaic system. In [12], a detailed review of the PV system optimization is presented for standalone, hybrid and grid connected systems.