In this paper we present a mathematical algorithm used to determine the photovoltaic power depending of position of the sun and the solar irradiation. The algorithm can be used to simulate the sun position, the solar irradiation and the electrical power production of an particular photovoltaic cell panel.