1 Introduction

In the last decade, solar energy has become increasingly tempting as the environmental repercussions of using fossil fuels have gotten more serious. Most cities are blanketed in pollution during the winter seasons, posing a serious threat to human health and life. Excessive use of scarce fossil resources is another strong argument for to appreciation of solar energy[1,2,3]. The scarcity of fossil fuels is a worldwide challenge that necessitates the pursuit of sustainable energy sources like solar photovoltaics.

Due to the growing use of solar electricity, forecasting solar irradiance is becoming more important. Because generation from photovoltaic (PV) is directly proportional to this parameter, solar radiation is an important quantity in solar energy applications. Solar radiation data is critical for developing and evaluating solar energy power outputs[4, 5]. Practical measurable data is the most exact, but it is not always easily available, due to the large initial investment and maintenance costs of measuring instruments. There are 756 meteorological stations in China, for example, but only 122 of them contain worldwide solar radiation statistics[6]. Subsequently, when there is no record of estimation, assessing solar radiation information by corresponding it with other handily estimated meteorological boundaries like daylight length, encompassing temperature, overcast cover, dampness, etc. is an elective technique for getting wanted solar radiation information.

Accurate forecasts of solar PV are more difficult, owing to its dependency on solar radiations and other specifics (e.g., area, equipment data, direction of solar panels, and so on) for all interconnected frameworks [6,7,8,9,10]. This means that data on solar radiation availability on a horizontal surface is critical for effective PV system design and analysis.

For a country like India, the successful utilization of solar energy seemed reasonable due to the year-round availability of sunlight[11]. The conventional method of estimating the quantity of global solar radiation (GSR) in a given region is to place pyranometers in as many sites as possible in that region, which necessitates daily maintenance and data collecting, raising the expense of GSR data gathering. As a result, developing techniques for calculating the GSR using climatological data is more cost-effective. Based on this idea, several models have been proposed and developed. Artificial neural networks, support vector machines, genetic programming, and other artificial intelligence technologies are among them. Meanwhile, solar radiation data is predicted using multiple models based on satellite data and atmospheric factors such as Rayleigh scattering, aerosol extinction, and ozone absorption.

System operators have the option of purchasing predictions from third-party suppliers or meteorological research organizations, or developing their predictions in-house[10]. These predictions must be integrated with real-time system operations, which necessitates modern information technology, standardized data sets, and certifications to forecast relevant data. For incorporating these forecasts in dispatch decisions, control center employees may require extra training on renewable energy plant models and new decision support tools. All these things shall escalate the per-unit cost of solar energy power which is unacceptable. Hence, the focus shifted to developing cost-effective prediction methods. One of the important techniques that have proven its metal is the Artificial Neural Network (ANN) to solve multi-variable problems[12,13,14]. ANNs offer a unique capacity to address the dynamics of nonlinear systems in various applications. Various operators have a part in the development of a good ANN model in general. The first operator is defined as input–output data, where model quality is primarily influenced by the data quality. The network architecture is the subject of the second operator. Performances vary depending on the network architecture. The third operator is the model's size and complexity. Due to its limited bandwidth, a small network may not be able to reflect the real state of the model test, but a large network may have noise in the training data and hence lack substantial generalization capacity. The correctness of the process model is the responsibility of the final operator, who largely depends on network learning. The third stage is arguably the most crucial since it includes determining model parameters that are compatible with the outcomes. While the Backpropagation algorithm has grown in popularity in recent years for performing training tasks, it is not without flaws. It has several disadvantages, including a slow training convergence speed and a high likelihood of being trapped in a local minimum[15, 16]. There is no doubt that Artificial Neural Networks are being widely used for generating forecasts of solar radiations. However, ANN training is usually time-consuming and multi-dimensional. Many researchers already tend to train ANNs with backpropagation algorithms. From the output error, error gradients are estimated which are used to update the weights and biases. Because locating the most suitable weights is incredibly dependent on preliminary weights, there are chances that the model algorithm might get trapped in the sub-optimal solutions, if the preliminary weights were above the local minimum. This is a key challenge that needs to be addressed while generalizing using these networks. The conventional gradient seek method is at risk of local optimal convergence. To overcome this issue, a variety of techniques has been proposed through neural communities to overcome the slow convergence rate and the early entrapment in a nearby solution. Various algorithms have been proposed to address these shortcomings [17,18,19,20]. The discovery potential of evolutionary algorithms like PSO can overcome this downside.

Several studies have used evolutionary and bio-inspired algorithms to train artificial neural networks (ANNs) as a fundamental kind of learning[21]. Local search, population approaches, and others, such as cooperative co-evolutionary models, are used as metaheuristic approaches for training neural networks[22].In [21]the authors have given a detailed literature review on using evolutionary algorithms for training ANNs. In [23], a new metaheuristic algorithm is described.

In [24] the authors created a hybrid model by merging Simulated Annealing (SA) with genetic programming, which resulted in a very accurate forecast of solar radiation. For solar radiation prediction [25], suggested a hybrid Support Vector Machine-Firefly Algorithm model and a hybrid Support Vector Machines-Wavelet model for predicting solar radiations.

However, the general results of the literature study demonstrated that neural networks and evolutionary algorithms have good performance in estimating solar radiation but require the exact identification of numerous parameters, such as weights, number of hidden layers in a neural network, and training algorithm. In addition, the selection of input data parameters is also challenging.

Thus it’s clear that solar radiation is an important factor in designing PV systems. The power generated by PV systems is continuously increasing over the past 20 years. However, due to the volatile nature of PV power output, the PV designers are looking for a solution to optimally design them. The optimal design demands the exact forecasts of solar radiation. The short-time forecast information of solar irradiance is necessary for the management of the electricity grids and solar energy trading. On the other hand, long-term forecasts of solar irradiation are necessary to strategize the solar electricity development in a particular region[26,27,28]. In addition to solar radiation estimation, various factors are important for optimally designing PV systems. These include load assessment of utilities, correct module configuration, correct inverter configuration, etc. Hence correct design procedure is important to avoid under and overestimation of PV capacity.

To design solar photovoltaics, a lot of study has been done. A framework was developed in one study to fulfill the energy needs of six of India's major cities using solar PV by 2025 [29]. Another looked into inverter sizing and prepared a step-by-step guide for connecting it to the grid[30]. In another study, some looked into and validated the functioning of a grid-connected solar PV facility in the Tamil Nadu (South India) district of Sivagangai [31]. In addition, to satisfy the energy requirement of Jaipur's garment zone, a techno-economic analysis of a solar photovoltaic power plant was done [32]. Another article looked at the best way to size a grid-connected solar energy plant [33]. Other research [11, 34,35,36,37] has indicated that solar PV systems are the best option for powering residential and commercial utilities.

In the literature, various research works were found to optimally size the PV system based on the selection of PV module types, battery storage capacities, and inverter rating [2, 11, 36, 38]. However, a clear methodology providing the optimal sizing can only be achieved by correctly finding the load patterns of locality and solar radiation estimation. To efficiently match load patterns with the intermittent nature of solar power output, considerable effort is required to generate accurate forecasts of solar power using physical or Artificial Neural network models, etc. This is a relevant step in the optimal sizing of the PV system.

Given the above discussion, we are proposing a Multi-input Artificial Neural Network model which will be trained by Particle Swarm Optimizer to predict Global solar radiation. The PSO is used inside the ANN to improve the prediction performance by reducing the error with actual data and improving the convergence rate by minimizing the objective function.

The current study's integration of the ANN and PSO is fundamentally different from previous studies in that it was created to compute the objective function for the mean square error for the initialized regular parameters of the ANN to search for their optimal values of the initial parameters, which are considered multiple decision variables, using the PSO algorithm.

Furthermore, the current research proposes a unique framework for the ANN model (trained using PSO) that incorporates several input data parameters which will do multiple regression. This multifunctional regression relationship gives more accurate results compared to other methods having a single variable.

For this work, an improved architecture of the ANN-PSO algorithm is established so that the PSO algorithm's global ability to search increases and the algorithm can successfully escape from local optimums. In this work, tuning of hyperparameters (acceleration factors and inertia weight) was done until the error became low as compared to other models. Another component of the current paper that is novel is the detailed examination of various ANN models using single or multiple input variables for solar radiation prediction.

In addition, a procedure depicting the design methodology for the PV system is presented using solar radiation information. Two important parameters levelised cost of electricity and amortization time are evaluated to decide the prospects of PV systems. The novelty of using PSO as an optimizer is because of its fast convergence and non-entrapment to local minima. The accuracy of the developed hybrid ANN-PSO model is compared and evaluated with other existing models using reliable statistical indicators, such as RMSE, MSE, and Rsquare.

The objectives of this paper are (i) to evaluate the ability of the hybrid ANN-PSO model to predict global solar radiations, (ii) to compare the new method to the existing ANN models such as MLP, RBF, NAR and NARX and (iii) To utilize the global solar radiations information for techno-economic analysis of the site suitable for solar PV deployment.

The other sections of the manuscript are described as follows: Sect. 2 discusses the working mechanisms of ANN and PSO; Sect. 3 discusses the proposed methodology; Sect. 4 discusses results and Sect. 5 gives the conclusion of the study.

2 Background to artificial neural networks and particle swarm optimisation

2.1 Artificial neural networks (ANN)

Artificial neural networks use many levels of mathematical calculation to make sense of the data they are fed. Hundreds to millions of artificial neurons (called units) are stacked in layers to make up an artificial neural network. The input layer receives data in a variety of forms from the outside world. The notations x(n) are then used to mathematically denote these inputs for each n number of inputs. This is the data that the network seeks to learn or process. After leaving the input unit, the data is routed through one or more hidden units. The hidden unit's job is to turn the input into something usable by the output unit. The connections between various layers are multiplied by the weights assigned to them (These weights are the specifics that artificial neural networks employ to solve an issue). These weights, in general, describe the strength of connections between neurons inside the artificial neural network. Inside the computing unit, all of the weighted inputs are added together (yet another artificial neuron). A typical architecture involves three layers as shown in Fig. 1.

Fig. 1
figure 1

Architecture of artificial neural network

Conjugate, scaled conjugate gradient descent along with Levenberg approaches, all based on a fundamental gradient descent algorithm, have been developed to enhance convergence efficiency[39]. Because evolutionary algorithms (EAs) do not rely on gradient information, they can be used to solve situations when gradient knowledge is either unavailable or excessively expensive to obtain. Because of these advantages, they are more reliable and appealing than many other search algorithms[40]. The PSO is a straightforward method that excels at a wide range of optimization tasks.

2.2 Particle swarm optimization

This method was proposed by Eberhart and Kennedy as an optimization method for continuous nonlinear functions, in 1995. This method proved very effective for solving optimization problems and became the first choice among researchers. The PSO algorithm drives each particle across the multi-dimensional search space at a velocity that is dependent not only on the particle's encounters but also on the experience of entire swarms. It indicates that there are two experiences in the PSO algorithm. PSO with a local neighborhood and PSO with a global neighborhood, have been discovered. The gbest model is based on a global setup [41,42,43]. As per this, each particle is seen moving towards its best position previously traversed along with the position of best particle in the entire swarm. On the other side, as per the discrepancy on a local level, known as lbest [44], each particle travels towards its previous best location as well as the best particle in its immediate vicinity. Although PSO has a recollection of the past, all particles have experience of good solutions. Particles collaborate beneficially and may exchange knowledge within the swarm. As opposed to other scanning algorithms, PSO has the benefit of being able to search quickly and with easy calculations. Several researchers have used it for different applications due to these advantages. The author of [38] used PSO to calculate the energy of a hybrid system that included photovoltaics, wind, and battery power. It is used to optimize the benefit-to-cost ratio in another article[45]. It's also used to figure out how optimally big hybrid systems can be [46]. In [47] the author showed that PSO is very stable and prevents getting stuck in local minima. This demonstrates that PSO is both universal and effective in the solution of nonlinear problems. The flow chart depicting the working of PSO is shown in Fig. 2.

Fig. 2
figure 2

Flow chart showing the working of particle swarm optimization

The particle's maximum permitted velocity is Vmax. In other words, if the particle's velocity surpasses Vmax it is reduced to Vmax. Vmax determines the resolution and appropriateness of the search. Particles will migrate beyond excellent solution if Vmax is too high, while particles will be confined in local minima if Vmax is too low. The acceleration constants C1 and C2, also known as cognitive and social components, modify the velocity of a particle towards pbest and gbest (usually somewhere between pbest and gbest). The tension in the system is determined by velocity. In a search space, a swarm of particles can be exploited locally or globally. The gbest is replaced by the Ibest in the local version of the PSO, and the method remains the same.

3 Description of proposed model

This section explains how the suggested model was created and looks at the link between global solar irradiance and other variables such as (humidity, temperature, wind speed, pressure, and clearness index). Figure 3 depicts the proposed framework's general layout. The first step consists of the collection and selection of data followed by data processing. The data is then fed to the improved artificial neural networks trained by particle swarm optimizer. The proposed model was then validated using meteorological data for the site under consideration. The results were compared to three neural network models: the Multilayer Perceptron model trained by conventional optimizers, Nonlinear Autoregressive, and Nonlinear Autoregressive with exogenous inputs models based on statistical metrics. The obtained solar radiation information is utilized in designing the solar PV system for the site under consideration.

Fig. 3
figure 3

Architecture of the proposed model

3.1 Data collection & selection

This study involves the collection of solar radiation data along with various other meteorological parameters which are having good correlation with global solar radiation. Ground-installed stations or satellite-driven data sets can be used to gather these data. However, due to the absence of such stations at the chosen location, the data used here was taken from the National Aeronautics and Space Center Power database [48]. Measurements of Global Solar radiation were collected over ten years from 01.01.2010 to 01.01.2020. The data was taken with one-day time intervals for the municipal region of District Rajouri (J&K) India (Latitude: 33.37° & Longitude: 74.32°) as shown in Fig. 4.

Fig. 4
figure 4

Geographical location of data collection site (District Rajouri)

A total of eight parameters were chosen as inputs for training the artificial neural network model. These parameters are as follows

  • 1.Relative humidity

  • 2.Surface pressure

  • 3.Specific humidity

  • 4.Min temp

  • 5.Max temp

  • 6.Temperature at 2 m

  • 7.Wind Speed at 50 m height and

  • 8.Clearness index

The creation of an appropriate regression equation, as well as a study into particular predictor factors, are required for the selection of these parameters. The goal of selection is to decrease the number of predictor variables to just those that are required and account for nearly as much variance as the complete set. Selection, in essence, aids in determining the relative value of each predictor variable. It also aids in evaluating the impact once the other predictor factors have been statistically removed. The study's settings, as well as the nature of the research questions, dictate the choice of predictor variables.

$$Corr=\frac{n\sum xy-(\sum x)(\sum y)}{\sqrt{n\sum {x}^{2}-(\sum {x)}^{2}) }\sqrt{n\sum {y}^{2}-(\sum {y)}^{2} }}\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }(1)$$

where x and y are dependent and independent parameters.

Aside from the numerous geographical elements like temperature, pressure, wind speed, humidity, and so on, the Clearness Index was chosen as an input parameter in our research. The clearness Index is a measure of atmospheric impacts on insolation at a certain location. It is a stochastic parameter that is affected by the time of year, season, weather, and geographic location. As a result, a model for the clearness index is required to account for atmospheric influences on insolation at a particular location[49]. The extraterrestrial radiation Ho and global solar radiation H at any given location can be used to calculate the clearness index. It can be calculated using the equation below.

$${\text{Clearness Index}},{\text{K}}_{{\text{t}}} = \frac{{\text{H}}}{{{\text{Ho}}}}{ }$$
(2)

The daily extraterrestrial solar radiation can be calculated using the following equation [50].

$${\text{Ho}}=\frac{\left(24\times 3600{{\text{G}}}_{{\text{on}}}\right)}{\uppi }\left({\text{cos}}\varnothing {\text{cos}}\delta {\text{sin}}\omega s+\frac{\mathrm{\pi \omega s}}{180}{\text{sin}}\varphi {\text{sin}}\delta \right)$$
(3)

Where

$$\delta ={23.45}^{0} sin({360}^{0}(284+n)/365$$
$$\omega s={cos}^{-1}(-tan\varphi tan\delta )$$
$${G}_{on}={G}_{sc }\left[1+0.033{\text{cos}}\left(\frac{{360}^{0}n}{365}\right)\right]$$

\({G}_{sc}\) is the solar constant and it is approximately 1367 W/m2,\(n\) is the day number of the year,\(\varnothing\) is the solar azimuth angle, \(\delta\) is the declination angle,\(\omega s\) is the daily sunrise hour.

3.2 Data processing

The statistical values of the input and output parameters used as data in our proposed framework are given in Table 1. The data processing involves locating the missing data, removal of outliers, normalization, and standardization. To avoid features with larger ranges from dominating the distance measure, normalization and standardization are used. As can be seen in the table, the ranges of initial characteristics differ, which may pose problems during calculation.

Table 1 Statistical values of various attributes

3.3 Prediction of solar radiation

The artificial neural network (ANN) is a computer method for identifying a non-linear connection between one or more inputs and one or more outputs. The artificial neural network (ANN) has been used to model, identify, and forecast complex systems. The ANN design architecture is given in Fig. 5. It involves eight input parameters each consisting of 3653 samples. The weights of the feed-forward network were updated using particle swarm optimization. The performance was tested using mean squared error (MSE) and Regression value (Rsquare).

Fig. 5
figure 5

Multivariate ANN architecture

To evaluate each individual, it is required to define the individual and the fitness functions throughout the training stage. The size of a person is determined by the magnitude of both the input and desire patterns. Individuals will grow across time to determine the optimal answer (with a minimum error). The ANN is anticipated to give satisfactory accuracy during the training and testing stages after the learning process.

The following seven steps have been used to train ANN using PSO.

Step 1. Input data collection

Step 2. ANN network creation

Step 3. ANN network configuration

Step 4. Initializing the weights and biases of the ANN network

Step 5. ANN training using PSO

Step 6. ANN network validation

Step 7. Use the ANN network

The flowchart depicting the procedure followed in implementing ANN with PSO is described in Fig. 6.

Fig. 6
figure 6

Flow chart depicting the strategy to update weights using the PSO optimizer

PSO, unlike backpropagation (BP), is a population-driven global search algorithm that has been used to train the ANN. It is used in the network structure to optimize weights. Since it is not based on gradient knowledge, it avoids trapping in a local minimum. It is used to find the optimized weights through optimization by assessing each particle's own best as well as the swarm's overall best positions by moving the particles in the search space.

A neuron possesses a position and a certain velocity. A neuron's weight represents its position. To update the weight, the velocity is utilized. The velocity determines the rate at which the location is updated. PSO compares the fitness of each weight in a data set on each pass. The worldwide best network is the one with the highest fitness. The other weights are updated depending on the global best network, not on their inaccuracy or fitness. This algorithm's purpose is to reduce a learning error (cost function) generated using MSE. This approach is repeated until the complete number of patterns to train has been reached. The algorithm's goal is to upgrade all of the weights while reducing the overall mean squared error for a successful procedure. To reduce learning error, the particle will travel inside the weight space. The following are the parameter values used in the proposed model:

  • C1 = 1.5 and C2 = 2.5 (Acceleration factors)

  • Pop size = 10 (Population size)

  • Max_iter = 1000(Maximum iterations)

  • Initial velocity: 10% of position

To achieve a balance between local and global search, so that the convergence performance of the algorithm improves, the value of inertia weight \({\varvec{\omega}}\) was computed using the following formula.

$$\upomega ={\upomega }_{{\text{max}}}-{\text{k}}\times \frac{({\upomega }_{{\text{max}}}-{\upomega }_{{\text{min}}})}{{\text{Maxite}}}$$
(4)

where \({{\varvec{\omega}}}_{{\varvec{m}}{\varvec{a}}{\varvec{x}}}\) and \({{\varvec{\omega}}}_{{\varvec{m}}{\varvec{i}}{\varvec{n}}}\) are the initial and final values representing \({\varvec{k}}\) number of iterations and is \({\varvec{M}}{\varvec{a}}{\varvec{x}}{\varvec{i}}{\varvec{t}}{\varvec{e}}\) maximum number of iterations.

3.4 Models used for comparative analysis

For comparative analysis in addition to the multiple perceptron model already described in the section, two more models (used for predicting the global solar radiations) found in the literature are implemented. These are as follows.

  • (a) Non linear autoregressive model (NAR model)

For deterministic as well as stochastic models, NAR approaches are effective for predicting. The neural network based on the nonlinear autoregressive model is a feed-forward network that aims to approximate F [51, 52]. The feed-forward algorithm is defined by.

$${\text{z}}\left({\text{t}}\right)={\text{F}}\left({\text{z}}\left({\text{t}}-1\right),{\text{z}}\left({\text{t}}-2\right),\bullet \bullet \bullet \bullet \bullet ,{\text{z}}\left({\text{t}}-{\text{p}}\right)\right)+\upvarepsilon \left({\text{t}}\right)$$
(5)

Here F is the neural network mapping function z(t) denotes the anticipated output given previous time series data \(z\left(t-1\right),z\left(t-2\right),\bullet \bullet \bullet \bullet \bullet ,z\left(t-p\right)\).p represents the delay number. \(\varepsilon \left(t\right)\) represents an error of approximation for time series.

  • (b) Non-linear autoregressive model with exogenous inputs (NARX model)

In time series modeling, a NARX is a nonlinear autoregressive model that incorporates exogenous inputs [53]. This means that the model derives the present value of a time series from both previous values of the same series and current and previous values of the exogenous series[13, 54]. The NARX model can be represented either as an open loop or closed loop by mathematical equations

$$\widehat{{\text{y}}}\left({\text{t}}+1\right)={\text{F}}({\text{y}}\left({\text{t}}\right),{\text{y}}\left({\text{t}}-1\right),..,{\text{y}}({\text{t}}-{{\text{n}}}_{{\text{y}}}),{\text{x}}\left({\text{t}}+1\right),{\text{x}}\left({\text{t}}\right),{\text{x}}\left({\text{t}}-1\right),\dots ,{\text{x}}\left({\text{t}}-\widehat{{\text{y}}}\left({\text{t}}+1\right)={{\text{n}}}_{{\text{x}}}\right)$$
(6)
$${\varvec{F}}(\widehat{{\text{y}}}\left({\text{t}}\right),\widehat{{\text{y}}}\left({\text{t}}-1\right),\dots ,\widehat{{\text{y}}}\left({\text{t}}-{{\text{n}}}_{{\text{y}}}\right),{\text{x}}\left({\text{t}}+1\right),{\text{x}}\left({\text{t}}\right),{\text{x}}\left({\text{t}}-1\right),\dots ,{\text{x}}\left({\text{t}}-{{\text{n}}}_{{\text{x}}}\right)$$
(7)

Here \(\widehat{y}\left(t+1\right)\) is the predicted output for the past values of the time series \(\widehat{{\text{y}}}\left({\text{t}}\right),\widehat{{\text{y}}}\left({\text{t}}-1\right),\dots ,\widehat{{\text{y}}}\left({\text{t}}-{{\text{n}}}_{y}\right)\) and input values \({\text{x}}\left({\text{t}}\right),{\text{x}}\left({\text{t}}-1\right),\dots ,{\text{x}}({\text{t}}-{{\text{n}}}_{x})\).nx and ny are the input and output delays.

This method generally requires more memory but takes less time. Training is automatically terminated when generalization stops improving, as evidenced by an increase in the mean square error of the validation samples.

  • (c) Radial basis function

A radial basis function (RBF) network is a network that solves issues using radial basis functions. There are three layers in total: an input layer, a hidden layer with a non-linear RBF activation function, and an output layer (linear). The hidden layer performs nonlinear mapping by using a Gaussian or another kernel function to translate the input space into a higher-dimensional space.

3.5 Evaluation metrics for performance estimation

The quality of fit must be measured to verify the performance of forecasting models. The following are some of the most popular metrics used to calculate this:

  1. (a)

    Mean square error

It's the average of the squared difference between the estimated/predicted and actual values. It is found to give significant discrepancies greater weight. The following equation is used to find it mathematically.

$${\text{MSE}}= \frac{1}{{\text{n}}}\sum_{{\text{i}}=1}^{{\text{n}}}{\left({{\text{y}}}_{{\text{i}}}-{\widehat{{\text{y}}}}_{{\text{i}}}\right)}^{2}$$
(8)
  • (b) Root mean square error

The (normalized) difference between the vector of anticipated values and the vector of observed values is the root mean square error (RMSE). We may use the following formula to compute the standard deviation of a typical observed value based on our model's forecast. If our observed data can be dissected, the RMSE is a helpful statistic to utilize.

$${\text{MSE}}=\sqrt{\frac{1}{{\text{n}}}\sum_{{\text{i}}=1}^{{\text{n}}}{\left({{\text{y}}}_{{\text{i}}}-{\widehat{{\text{y}}}}_{{\text{i}}}\right)}^{2} }$$
(9)
  • (c) Rsquare

Rsquare is a goodness-of-fit metric that shows the percentage of variance in the dependent variable that the independent factors account for when taken together. Higher Rsquare values indicate fewer discrepancies between the observed data and the fitted values for the same data set. It is an indicator to explain how best the regression line fits the dataset. When the Rsquare value approaches 1, it indicates a significant association between the predictors and the response variable, whereas an R-square around 0 indicates the reverse.

$${{\text{R}}}_{{\text{square}}}= 1-\frac{\sum_{{\text{i}}}{\left({{\text{y}}}_{{\text{i}}}-{\widehat{{\text{y}}}}_{{\text{i}}}\right)}^{2}}{\sum_{{\text{i}}}{\left({{\text{y}}}_{{\text{i}}}-\upmu \right)}^{2}}\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }$$
(10)

where (\({y}_{i}-{\widehat{y}}_{i})\) is the difference between actual and prediction values and \({(y}_{i}-\mu )\) is the difference between actual and mean value.

3.6 Designing of photovoltaic system

The section deals with using the values of global solar radiation along with other design parameters for designing the PV system for a locality. An optimal design of a PV system is required to generate optimal power outputs However shortcomings of design procedures for optimal sizing of PV setups can lead to over-sizing and under-sizing of PV systems. The probable reasons could be the following.

  • Faulty load assessment procedure

  • Number of batteries requirement

  • Wrong selection of inverter types and ratings.

To overcome these shortcomings we are proposing a step-by-step methodology to optimally size the PV system. How improve the designing procedure so that we could accurately estimate the required size of the solar PV for the utility is a tedious task but, it can be made easy if one follows the following steps. It involves.

  • Systematic planning of the system

  • Systematic designing of the system

  • Systematic implementation of the system

  • Systematic maintenance of the system

a Solar PV system will involve the following steps

1. Load assessment of utility

2. Designing Methodology for Solar PV. It involves following

(i) Feasibility of Solar Radiations

(ii) Capacity of the plant. It involves following

(a) Number of modules required

(b) Inverter sizing

(c) Battery sizing

3. Project Cost Estimation

4. Financial Analysis.

A sample program in MATLAB has been developed to design a solar PV system of any rating using the following information. Load assessment of utility was formulated using connected load, maximum demand, load curve, and electricity bill. The feasibility of solar radiation was found using the proposed method of solar radiation estimation. The capacity of plants was found using the following expression for array load and array sizes

$${\text{Array Load}} = \frac{{\text{Total daily load}}}{{{\text{Battery efficiency}} \times {\text{Charge controller efficiency}}}}$$
(11)
$${\text{Array Size}} = \frac{{\text{Array Load}}}{{{\text{Insolation}} \times {\text{Charge controller efficiency}}}}$$
(12)

The equation for array load requires the rated battery efficiency and rated charge controller efficiency. The charge controller is used to avoid under and overcharging of batteries. The charge controller generally used maximum power point tracking algorithms to supply the maximum collected power. The next step is to evaluate the array size, which uses the information on global solar radiation. Generally for setting up PV plants, the average global solar radiation/annum is used. Once the array load and array sizes are known, the optimal number of solar modules depending upon the size of solar modules available in markets are found using the following equation.

$${\text{Array Load}} = \frac{{\text{Total daily load}}}{{{\text{Battery efficiency}} \times {\text{Charge controller efficiency}}}}$$
(13)

As far as inverter sizing is concerned, it must be chosen based on the peak load rating of the utility. To bear a future increase of load one can choose an inverter rating 25–30% more than the Peak power demands of the utility so that it could easily handle the sudden Peak Power. Batteries should be large enough to provide at least two days of electrical autonomy. In addition, the battery's depth of drain should be estimated at 25%. Individual item costs given by multiple vendors and proposed by government bodies are used to calculate the project cost. The various performance indices utilized in the calculation reflect whether one should go for the development of PV systems or instead use a grid power supply. These are as follows.

  • (a) Net present value

A technique of assessing the present value of all future cash flows generated by a project, including the original capital investment, is known as net present value. In contrast to initial investments, it is the present value of future cash flows.

$${\varvec{N}}{\varvec{P}}{\varvec{V}}=\sum_{{\varvec{t}}=1}^{{\varvec{T}}}\frac{{{\varvec{C}}}_{{\varvec{t}}}}{{\left(1+{\varvec{i}}\right)}^{{\varvec{t}}}}-{{\varvec{C}}}_{{\varvec{o}}}$$
(14)

where.

Ct = Net cash collected t.

Co = Initial costs.

i = discount rate.

t = no. of time periods

  • (b) Levelised cost of electricity (LCOE)

The LCOE is the average total cost of building and running a power plant per unit of total electricity generated over its projected lifespan. LCOEs are often computed over 20 to 40 year lifespan and expressed in Rs/kWh

$${\varvec{L}}{\varvec{C}}{\varvec{O}}{\varvec{E}}=\frac{\sum_{{\varvec{t}}=1}^{{\varvec{n}}}\frac{\left[\left({{\varvec{I}}}_{{\varvec{t}}}+{{\varvec{M}}}_{{\varvec{t}}}+{{\varvec{F}}}_{{\varvec{t}}}\right)\right]}{\left[{\left(1+{\varvec{r}}\right)}^{{\varvec{t}}}\right]}}{\boldsymbol{ }\boldsymbol{ }\boldsymbol{ }\sum_{{\varvec{t}}=1}^{{\varvec{n}}}[\frac{{{\varvec{E}}}_{{\varvec{t}}}}{{\left(1+{\varvec{r}}\right)}^{{\varvec{t}}}}]}$$
(15)

where.

It = cost of investment per year t; Mt = cost of maintenance per year t; Ft = cost of fuel per year t; Et = Total Electricity produced per year; r = discount rate and n = system life.

  • (c) Amortization time

Amortization is the practice of repaying debt over time in regular interest and principal installments sufficient to pay off the loan in full by the maturity date. Amortization time helps make decisions regarding various investments to be made.

  • (d) Internal rate of return

IRR is a discounted cash flow method for calculating the rate of return on a project. It is a measure of an investment's profitability. It's a discount rate that makes the net present value of an investment zero. It is computed using the formula below.

$${\varvec{N}}{\varvec{P}}{\varvec{V}}=\sum_{{\varvec{t}}=1}^{{\varvec{T}}}\frac{{{\varvec{C}}}_{{\varvec{t}}}}{{\left(1+{\varvec{I}}{\varvec{R}}{\varvec{R}}\right)}^{{\varvec{t}}}}-{{\varvec{C}}}_{{\varvec{o}}}=0$$
(16)

4 Results an discussion

In this part, the findings of simulation experiments based on historical data are provided. Out of the total data set, the data from 01–01-2010 to 01–12-2019 was used in the training of the Hybrid ANN-PSO network. The results of the proposed multi-input Hybrid ANN-PSO methodology were compared with those of the conventional ANN algorithms such as MLP, NAR, and NARX models for the site under consideration. The performance of the proposed models was validated in terms of MSE, RMSE, and Rsquare. The results are described in two sub-sections as follows.

4.1 Prediction of solar radiation

Figure 7 shows the architecture used in the proposed model. Figures 8 and 9 show the architecture of NAR and NARX models used in the comparative analysis. The proposed model architecture involved 8 input parameters in the input layer and one parameter i.e., global solar radiations in the output layer. The size of the hidden layer chosen is 7. The size was decided based on the evaluation parameters as described in Table 2. The training of ANN was performed using a PSO optimizer. The MSE and RMSE for the proposed model were found 0.18 and 0.432 respectively as shown in Table 3. The regression value came out 0.97 as shown in Fig. 10 and Table 3. The convergence curve of the proposed model along with other methods is also shown in Fig. 11.

Fig. 7
figure 7

Chosen architecure for the proposed model

Fig. 8
figure 8

Architecture of NAR model

Fig. 9
figure 9

Architecture of NARX model

Table 2 A comparative analysis of proposed model outcome by changing the hidden layer size
Table 3 Comparative analysis of proposed model with different ANN models
Fig. 10
figure 10

Regression output for the proposed model

Fig. 11
figure 11

Regression output for the proposed model

Table 2 shows that the optimal number of hidden layer sizes for the given data set is 7 as the error tends to a minimum for this size. The Rsquare value however doesn’t seem to be changing much by changing the number of hidden layers. Figure 12 shows the comparison between predicted value and actual value of global solar radiation. The predicted values can be seen almost superimposing the actual values.

Fig. 12
figure 12

Prediction curve Vs actual curve

In contrast, while comparing the proposed model against RBF, MLP, NAR, and NARX (trained using levenberg optimizers) for the same dataset on evaluation, it was found that the performance of our model is better. This highlights the fact that following the proposed ANN-PSO based architecture the weight updating got better as compared to conventional optimizers like levenberg-Marquadrt optimizers. The overall comparison is given in Table 3. It is clear that ANN-PSO is giving less error as compared to other models.

The proposed model was tested on an unforeseen dataset obtained from NASA from 01–12-2019 to 01–01-2020 for the location under consideration (i.e., District Rajouri). The result obtained gave RMSE of 0.19 and Rsquare of 0.96. This shows that the proposed model worked well both for the training and testing dataset.

Further, the proposed model is compared with various other ANN models using different training algorithms and optimization methods. The results obtained are shown in Table 4.

Table 4 Comparative Analysis of Proposed method with other optimization methods

In addition, as shown in Table 5, the proposed model's findings are compared to other approaches for estimating global solar radiations that are accessible in the literature. These include Empirical models; ANN models; Support Vector Machines; ANFIS; Gene Expression Programming; Fuzzy-SVM; Wavelet-SVM; Kernel Ridge Regression; Bristow Campbell and NAR Models. These models are compared with the proposed model based on performance indicators root mean square error (RMSE) and Rsquare. It has been observed that our model outperformed the other models by giving the lowest error of 0.432 with Rsquare value of 0.97.

Table 5 Validation of the proposed model with different models for estimating global solar radiations

4.2 Use of a predicted value of solar radiation for optimal designing of PV system

In Rajouri, which is a small outlying region of the vast Pir Panjal mountain range (in the state of Jammu & Kashmir), Baba Ghulam Shah Badshah University is located above the Dhanidhar Mountains. The campus of the university is situated at latitude 33° 38' N and longitude 74° 36' E, 975 m above mean sea level. The region has a subtropical to temperate climate.

Although the university is currently served by the Jammu and Kashmir Power Development Department (JKPDD), its remote location frequently results in power outages, forcing it to switch to installed diesel generator sets and incurring additional power costs. The School of Engineering and Technology (SOET), a crucial part of the university, is primarily the focus of the problem. Since the School of Engineering and Technology is the foundation of the university, we are searching for a self-sustaining solution for it.

Calculating the number of power-consuming appliances installed in the space and their daily, monthly, or annual kilowatt-hour (kWh) consumption are the first steps in doing an energy demand assessment. When properly carried out, a load analysis may offer significant insight into the energy usage of a facility, enabling cost savings, better productivity, and the preservation of vital assets. Table 6 shows the different equipment installed on the SOET premises along with their quantities and ratings.

Table 6 Electrical load assessment of SoET

The average daily load is found to be roughly 396 kilowatt-hours (kWh). The daily load requirement is set at roughly 400kWh due to expected future demand growth and seasonal load changes.

The daily mean solar radiation was found around 4.4 kW/m2 at the location under consideration. Using the solar radiation information in the proposed PV design described in Sect. 3.5, the following parameters were deduced as shown in Table 7.

Table 7 Evaluated parameters while designing PV setup

For a 100 kW capacity plant, we need to find out the annual yield. Annual yield is the ratio of total energy generated to the peak capacity of the solar PV plant installed. Annual yield is influenced by various factors such as the amount of solar radiation falling on the PV panel, the angle of solar panels, types of solar modules and their temperature dependencies, system losses, etc.

In our case for a 100 kW plant, the monthly energy generated from the solar PV plant is found equal to 12,400 kWh resulting in the yearly energy generated from the solar plant being equal to 148,800 kWh. Using this information, the annual yield for the 100 kW solar plant was evaluated as equal to 1488. For both the situations without and with subsidy, a 25-year useful life of the plant was assumed, and a feed-in tariff of Rs.5 (the current commercial tariff) was considered to analyze the various characteristics.

PV resulted in the levelised cost of electricity (LCOE) equal to Rs.4.609 and Rs.3.7070 with and without battery backup for the scenario when no subsidy was given as shown in Table 8. However, when the subsidy was offered by the government (in J&K almost 70%), the levelised cost of electricity was estimated to equal to Rs. 1.490 and Rs. 1.112 with and without battery backup respectively as shown in Table 9. This shows that there is huge potential in the given location for setting up a Photovoltaic plant to meet the load demands in the absence of grid power. Various other parameters such as Amortization time and internal rate of return were also evaluated indicating a higher rate of return as compared to purchasing electricity from the grid.

Table 8 Photovoltaic design (Without Subsidy)
Table 9 Photovoltaic design (With Subsidy)

5 Conclusion

The utilization of ANNs has been proven to be a successful strategy in predicting global solar radiation. Various external parameters are required to be selected for efficiently generalizing the model using various learning techniques among the different neural networks. This study compares various nonlinear approximation techniques with the suggested ANN-PSO model since it is crucial to choose the best training method for a neural network. The weights and biases of Backpropagation algorithms are adjusted in the direction of the negative gradient. There are several restrictions to be aware of when using these techniques to train ANNs, including slow convergence and the possibility of a local minimum trap. On the other hand, hybrid PSO-ANN expresses weights and biases through particle locations. To discover both individual and global optimal values, the particles' velocities and locations are changed. By doing this, the weights and biases are kept from becoming trapped in a local minimum.

A rigorous investigation was carried out to optimally choose the suitable architecture that delivers the best performance for convergence and processing time. Experiments demonstrated that the Hybrid ANN-PSO approach suggested in this paper, when used with the chosen architecture (8–7-1), can accurately estimate daily solar radiation In addition, the use of average values of global solar radiations per annum in the proposed systematic design can be used for estimating the various decision making parameters such as LCOE, Amortization time and IRR while setting up PV plant anywhere. The future aspect of the proposed methods are as follows:

  1. i.

    Before using the prediction algorithms, new methods for feature selection might be investigated to choose a smaller collection of informative characteristics at the first stage of the proposed model. More characteristics in the modeling algorithms may be added, and their impact on accuracy could be studied.

  2. ii.

    The proposed methods in this research work were implemented using datasets collected from NASA. These methods can be tested on other datasets, with different characteristics. This will aid in determining the resilience of our approaches to investigating the various forms of solar radiation.

  3. iii.

    New hybrid models can also be developed for predicting solar radiations on tilted surfaces. These models can be compared with our proposed models.