Presently, photovoltaic systems are an essential part of the development of renewable energy. Due to the inherent dependence of solar energy production on climate variations, forecasting power production using weather data has a number of financial advantages, including dependable proactive power trading and operation planning. Megacity electricity generation is regarded as a current research problem in the modern features of urban administration, particularly in developing nations such as Iran. Machine learning could be used to identify renewable resources like transformational participation (TP) and photovoltaic (PV) technology; based on resident motivational strategies, the smart city concept offers a revolutionary suggestion for supplying power in a metropolitan region. The sustainable development agenda is introduced at the same time as this approach. Therefore, the article’s goals are to estimate Mashhad, Iran’s electrical power needs using machine learning technologies and to make innovative suggestions for motivating people to generate renewable energy based on the expertise of experts. The potential of solar power over the course of a year is then assessed in our research study in Mashhad, Iran, using the solar photovoltaic modelling tool. The present idea in this research uses linear regression techniques to forecast utilising artificial neural networks (ANN). The most important factor in sizing the installation of solar power producing units is the daily mean sun irradiation. The amount of power that will be produced by solar panels can be estimated using the mean sun irradiance at a particular spot. A precise prediction can also be used to determine the complexity of the system, return on investment (ROI), and system load metrics. Several regression techniques and solar irradiance-related metrics have been combined to forecast the mean sun irradiation in terms of kilowatt hours per square metre. Azimuth and zenith factors considerably enhance the performance of the model, as demonstrated by the proposed method. The results of this study demonstrate 99.9% reliability rate for ANN model prediction of the electrical power usage during the summer and winter seasons. Thus, the maximum of power requirement during the hottest and coolest periods can be managed by using the photovoltaic system’s renewable power projections.