Regarding the significant potential of solar energy in Iran, implementation of optimally designed photovoltaic (PV) systems can be effective. Hence, this study proposes two objective functions: first, the maximum possible output energy for a given area and, second, the minimum area receiving a given yearly energy from PV fixed collectors in a solar field, both of which are calculated. In addition, the shading and masking effects are considered in the calculations. A modified particle swarm optimization (MPSO) algorithm is used to solve the optimization problem. The case study of this article is a shopping center in Isfahan-Iran (latitude 32.5°N) with the minimum yearly energy demand of 171 MWh and the 5000 m2 roof area. To evaluate the yearly energy, the calculated hourly radiation approach is applied to the case study. The results show that the maximum possible generated energy is 881 MWh/year for the given area. In addition, to provide the minimum demand, 720 m2 area of roof is needed. To verify the effectiveness of the proposed MPSO, the results are compared with those of obtained by the relevant commercial software.