Introduction: Solar energy is a crucial component and contributes a large portion of renewable resources, the demand for which has recently increased. During previous years, it was difficult to predict the amount of energy obtained from photovoltaic systems. The angle of inclination of the solar panel, the amount of radiation, the speed of the wind, the amount of humidity, and the temperature of the weather are major factors that effectively affect the production of electrical energy. Scientists have used many strategies to predict the power generated by PV modules accurately, but each method has different pros and cons. Method: This study tested three training algorithms for artificial neural networks (ANN): scaled conjugate gradient (SCG), Levenberg Marquardt (LM), and Bayesian regularization (BR), determining which one performed best in terms of prediction speed and accuracy. Twenty-eight thousand two hundred ninety-six samples of experimental data for primary influencing environmental factors were fed into the artificial neural network, which consists of 15 hidden layers. Before training the network, we preprocessed the data to remove factors that have a secondary effect. Result: The analytical results showed that the artificial neural network trained according to the LM algorithm is the best in terms of accuracy and speed of predicting the resulting photovoltaic energy. Conclusion: The results showed that although the regression evaluation and MSE values for the LM, SCG, and BR algorithms are close (98.129%, 0.0622, 97.849%, 0.0587, 98.151%, and 0.0585, respectively), the LM training algorithm is the best in terms of speed of calculation and display of results.