1 Introduction

According to the late Nobel laureate, Prof. Richard Smalley, energy is the most important challenge facing humanity today [1]. Not only can solar energy help in the democratization of energy, but it also has the potential to profoundly improve the lives of communities worldwide. The Sun provides a tremendous source of energy and has an important role to play in the energy generation mix of many nations. In particular, photovoltaic (PV) technology is a mature, proven and reliable method for converting the Sun’s vast energy into electricity.

The Sun therefore provides a free source of energy, which can be harnessed and converted into electricity using photovoltaic (PV) technology. PV technology has the benefit of being modular and scalable. It can therefore be very quickly installed in a wide range of locations. These locations can vary from conventional ground installations to domestic and commercial buildings. However, among the challenges in achieving widespread use of this technology is the price of solar electricity in comparison to conventional sources of energy. Innovation into the development of new materials and solar cell architectures is therefore important in order to help drive the cost of solar electricity down and to develop new solar cells that can generate more electricity per unit area. However, thanks to advancements in computation capacity and speed, artificial intelligence is now emerging as another effective technique to help achieve these targets. We will focus on how AI can be applied to the field of PV in three main areas, which are (1) Forecasting and modelling of meteorological data, (2) Basic modelling of solar cells and (3) Sizing of photovoltaic systems.

Machine learning (ML) is an artificial intelligence technique that involves feeding data to algorithms, which aim to figure out patterns in the data. Examples of AI algorithms include Neural Networks (NN), Fuzzy Logic (FL), Simulated Annealing (SA), Genetic Algorithm (GA), Ant Colony (ACO), Particle Swarm Optimization (PSO) and Hybrid Techniques (HT). Consequently, the aim of this chapter is to provide an overview of these AI techniques and to demonstrate how some of them can be used to improve PV system performance in three areas.

2 Brief Introduction to Artificial Intelligence Techniques

Artificial Intelligence (AI) is a computational technique that is concerned with designing systems, which are able to understand reason and solve problems in a similar way to humans [2]. Nowadays, intelligent computing technologies are either replacing conventional techniques or are being integrated into existing systems.

AI is a vast subject containing many topics and subdivisions. One particular topic that has attracted increased attention is the field of Machine Learning (ML), whereby algorithms are designed with the ability to learn without being explicitly programmed to [3]. By using statistical techniques, these algorithms are capable of analysing an input dataset in order to make useful predictions about missing or future data.

In general, ML solutions can be divided into the ways in which learning is performed by the algorithms. There are three major branches, which are supervised learning, unsupervised learning and reinforcement learning. The following sections will provide a brief introduction to each ML branch, as well as an explanation into how other AI algorithms have been used for various PV applications.

2.1 Supervised Learning

With this type of learning, a supervisor or teacher is required to assist the algorithm in learning its parameters. These algorithms require a dataset that has information about both the input data as well as the output. During its learning phase, as the algorithms try to make predictions about the dataset, the teacher corrects and guides the algorithms in the right direction, making them improve over time.

In addition, supervised learning methods can be divided into two main categories, depending on the output variable that they are trying to predict. If the output data is a discrete variable, such as trying to determine if the next day will be sunny, cloudy or rainy (Class 1, 2 or 3), then these cases are said to be a classification problem. On the other hand, if the output required is a continuous or real value, such as trying to predict the irradiation levels of a city during a specific time, or trying to determine the best size of a PV panel, then the case becomes a regression problem [4].

Some examples of supervised learning algorithms include linear and logistic regression, k-Nearest Neighbours, Neural Networks, as well as more robust algorithms such as deep neural networks and their variations. Figure 1 summarises the concept of an Artificial Neural Network (ANN), which is inspired by biological networks in the brain [5,6,7,8,9]. An ANN therefore contains three layers (input, hidden and output), connections, biases, weights, an activation function and a summation node. These weights and biases are important parameters that influence the output function.

Fig. 1
figure 1

General ANN concept

2.2 Unsupervised Learning

Unsupervised learning algorithms, on the other hand, do not re-quire a supervisor in order to learn or make predictions about the input data. In this case, these types of algorithms require only a dataset with input data and their goal is to correctly learn a model that best represents the given data [4]. Consequently, since these algorithms rely on finding patterns in the input data, unsupervised learning methods mainly consist of clustering algorithms, such as K-means and self-organizing maps.

2.3 Reinforcement Learning

Lastly, the third major branch of ML is the field of reinforcement learning. In contrast to the previous two fields, reinforcement learning algorithms rely on a goal seeking approach, whereby the learner tries different actions in order to discover which ones are best in achieving a certain goal [10]. Some examples of reinforcement learning algorithms include Q-Learning and Monte Carlo methods.

2.4 Other Techniques

Other intelligent ML approaches include Expert Systems (ES), Fuzzy Logic (FL), Simulated Annealing (SA), Genetic Algorithms (GA), Ant Colony (ACO) and Particle Swarm Theory (PSO). In contrast to conventional software programs that solve specific tasks within a range of boundary conditions, Expert Systems (ES) are designed to solve problems using the same approach as humans. An ES therefore consists of two main parts: an inference engine and a knowledge base. The knowledge base contains facts and rules, whereas the inference engine aims to apply these rules and facts to infer new facts [11, 12].

Similarly, a number of optimisation techniques have been developed that were inspired by nature. These include Genetic Algorithms (GA), which were first developed by Holland in 1975 and are based on the principles of genetics and evolution [13, 14]. Furthermore, Ant Colony (ACO) is another computational optimisation problem that was inspired by the behaviour of ants in finding the shortest path from their nests to their food. It was first formulated by Marco Dorigo in 1992 [15]. Here, ants lay down there pheromones as they randomly move towards their food. The stronger the pheromones, the more likely ants will follow that particular path. This technique is nowadays used to optimise machine scheduling and telecommunications networks [16]. Other nature-inspired techniques include Particle Swarm Optimisation (PSO), which is influenced by the swarm and flocking of birds [17,18,19,20].

Another optimisation technique that was introduced by Zadeh in 1965 includes Fuzzy Logic (FL), which is a branch of computer logic that is different from Boolean or classic logic [21]. In contrast to classic logic, which has binary values of 1 (true) or 0 (false), Fuzzy Logic permits multiple intermediate possibilities within that set. Fuzzy Logic is often used in combination with Expert Systems and Artificial Neural Networks [22]. Moreover, Simulated Annealing (SA) is an effective optimisation technique that was inspired by the process of heating and slow cooling of solids and can be used for maximizing or minimizing a function [23, 24].

3 AI in PV Systems

We will demonstrate how AI has been successfully applied in three different applications of photovoltaics. With each of these applications, a comparison between conventional and AI techniques is presented. The first step in PV system sizing and modelling is weather forecasting. Consequently, it is only appropriate that this section starts with the application of AI in weather forecasting.

3.1 Forecasting of Meteorological Data

Predicting the weather is of critical importance for determining the power output of a PV system. Meteorological data such as solar radiation, ambient temperature, humidity, wind speed and sunshine duration are among the vital input parameters. These parameters play an important role in PV system performance. Instruments such as a Pyranometer, Pyrheliometer and two-axis tracker must be used to measure global and direct solar radiation. However, in some cases these parameters are impractical to obtain due to two main reasons:

  1. 1.

    The PV system is located in a remote or isolated area, where the required input data is not available.

  2. 2.

    The high cost and complexity of the equipment needed to measure these parameters.

A review of the role of AI in weather forecasting will be provided in this section. The main objective is to review some of the successfully implemented techniques in the literature and to present some of our own techniques for predicting solar radiation.

3.1.1 Important Concepts

First, it is perhaps important to introduce a few key concepts related to the Sun, which is often regarded as a giant thermonuclear reactor that runs on hydrogen fuel. The Sun radiates energy in all directions in the form of electromagnetic radiation [25]. When describing the Sun’s energy, there are four commonly used parameters in the PV community:

  • Solar Irradiance - This is a term that describes the intensity of solar power per unit area. Its units are therefore in \(W/m^2\).

  • Solar Irradiation - This is the total amount of solar energy collected per unit area over time (\(Wh/m^2\)).

  • Insolation - This describes the amount of solar irradiation collected during one day (\(kWh/m^2/day\)).

  • Solar Constant - This is the average amount of solar irradiance that arrives above the Earth’s atmosphere, which is approximately (1353 W/m\(^2\)) [25].

Consequently, due to atmospheric effects, there are four main types of solar radiation, which are Direct, Diffuse, Reflected and Global radiation. Figure 2 illustrates the various types of solar radiation. The global solar irradiation (\(G_T\)) on the Earth’s surface is the sum of three main components:

$$\begin{aligned} G_T=G_B+G_D+G_R\; \end{aligned}$$
(1)

where \(G_R\), \(G_D\) and \(G_B\) are the components of reflected, diffused and direct solar radiation. At normal incidence to the Earth’s surface, \(G_R\) can be neglected, which means that \(G_T=G_B+G_D\).

Fig. 2
figure 2

Different components of solar radiation

On a clear day and when the Sun is directly overhead, almost 70% of the incident solar radiation reaches the Earth’s surface. The magnitude of solar radiation that is scattered or absorbed depends on the amount of atmosphere it must travel before reaching the Earth’s surface [25]. Consequently, Air Mass (AM) depicts the relative distance that solar radiation must travel to reach the Earth’s surface. Thus, \(AM=1/cos\theta =sec\theta \), where \(\theta \) is the zenith angle, as shown in Fig. 3. Similarly, Air Mass One (AM1) refers to the thickness of the atmosphere a sunbeam passes through at normal incidence to the Earth’s surface. A list of accepted values of solar flux at AM1 can be found in [25], where the direct solar radiation at standard sea level is considered 0.930 kW/m\(^2\).

Fig. 3
figure 3

Explanation of AM0, AM1 and AM(\(sec\theta \))

Mathematically, we are able to predict the intensity of the Sun’s energy arriving at a point on Earth using the Meinel and Meinel approximation [26]:

$$\begin{aligned} I= 1.353 \times 0.7^{(cosec{\alpha })^{0.678}} \end{aligned}$$
(2)

where \(cosec\alpha =1/sin\alpha \). The solar latitude, \(\alpha \), is the angle between the Sun’s rays and the horizon. Thus, the light intensity is maximum when \(\alpha = 90^{\circ }\). Therefore, from Eq. 2, \(I_{max}=0.95\) kWm\(^{-2}\) [27].

Experimentally, the measurement of solar irradiance requires specialist equipment. For example, to measure global solar radiation, a Pyranometer is needed, which is usually mounted horizontally away from tall objects that may obstruct its field of view. Since the Sun contains a spectrum of different wavelengths, the best instruments are designed to respond equally to all wavelengths. Due to its ease of use, Pyranometers are widely used for collecting the vast majority of solar insolation data [25].

Furthermore, a ring-shaped hoop may be added to the Pyranometer in order to exclude direct sunlight. This process permits the measurement of diffuse sunlight. When this reading is subtracted from the data collected by a standard Pyranometer, the result is the direct solar radiation. This instrument is called the Shaded-ring Pyranometer [25].

Similarly, to measure direct solar radiation, a Pyrheliometer is used. The Pyrheliometer has a small field of view, which is approximately 6\(^{\circ }\). It is usually mounted onto a dual axis Sun tracker in order to continuously measure the Sun’s direct normal radiation. Pyrheliometers are often needed to predict the performance of concentrator photovoltaic systems, which also require the use of dual axis trackers [25].

3.1.2 Machine Learning for Weather Forecasting

This section deals with how ML techniques can be used for predicting the amount of solar radiation. The authors in [8] compared four different ANN techniques for predicting the components of diffused and global solar radiation in Kuala Lumpur. The main input parameters to these networks included constants such as the longitude and latitude coordinates of Kuala Lumpur, as well as artificially generated variations in humidity, temperature and daily sunshine ratio. 80% of this data was used for training, while the remaining 20% was used for testing. According to their study, the GRNN technique provided the most accurate prediction results in comparison to the Feed-Forward back propagation Neural Network (FFNN), the Elman Back propagation Neural Network (EBNN) and the cascade-forward back propagation neural network (CFNN).

The literature provides more examples of using neural networks for prediction purposes. In each case, four parameters were chosen as inputs to a neural network for predicting a particular aspect of the weather. For example, the authors in [28, 29] used ANNs for predicting global solar radiation in Saudi Arabia using data collected from 41 weather stations. The input parameters to their network included the latitude, longitude and altitude, as well as the sunshine duration. Their network also consisted of 10 hidden layers and was tested using data from 31 cities. The prediction results for the remaining 10 cities showed a Mean Absolute Percentage Error (MAPE) variation between 6.5 and 19.1%. Similarly, the authors in [30] trained a neural network with 77% of data from a weather station in La Sirena. Wind speed, air temperature, soil temperature and humidity were used as inputs and the Average Absolute Relative Deviation (AARD) was <9%. Similarly, the feed forward multilayer perception model was used to predict global and diffuse radiation in Malaysia using longitude, latitude, day number and sunshine ratio [31]. 82% of data from 28 different weather stations was used for training, while the remainder was used for testing. Their network consisted of one hidden layer and the calculated Root Mean Square Error (RMSE) was 7.96%. More accurate prediction can be obtained by increasing the number of inputs and the number of hidden layers in a neural network. This was achieved by Mellit and Pavan in [32], whereby the correlation coefficient between experimental and predicted values varied between 95 and 98%. A thorough review of these ML techniques can be found in in [7, 33].

Similarly, we have applied a supervised learning technique for predicting the solar irradiation levels for a location in the city of Beijing, China. Beijing Sunda Solar Energy Technology Company collected the data over the period of two years [34]. Consequently, we were able to design a Support Vector Machine (SVM) regression model that is able to predict, to a certain extent, the irradiation levels for the next couple of days. The data collected consisted of solar radiation levels for the months of January and July of 2007, with measurements taken for the whole 31 days of each month in intervals of one hour. Based on that, we designed a SVM model that took as inputs the radiation level of previous days in order to predict the radiation levels of the next day.

Given this model, different time horizons were tested, in which the algorithm could consider the solar radiation levels of either one, three, or five previous days in order to predict the levels of the next day. The approach that yielded the best results was considering the previous three days. In addition, the dataset was split into training and test data, in which 51 days were utilized to train the network and the remaining 7 days were used to test it (some days were not accounted because of the time horizon).

Figure 4 shows our results of the proposed solution using the best approach for one week of test data. Both the real and predicted values of solar radiation are shown. A comparison with other regression techniques was performed, including the Regression Tree and the Tree Ensemble. It was found that the SVM technique provided best fit with the actual data, whereby the Root Mean Square Error (RMSE) was 12.41% and the Mean Absolute Error (MAE) was 6.95%. A summary of the results is presented in Table 1.

Fig. 4
figure 4

Predictions of the SVM model using data from 3 previous days to predict the solar radiation levels of the next day

Table 1 Comparison between different regression methods

3.2 Modelling of Solar Cells

A mathematical model that accurately describes a solar cell is an invaluable tool for better understanding the characteristics, performance and optimization of a PV cell system. Consequently, having introduced the conventional and AI techniques for solar radiation forecasting, it is now important to familiarise the reader with the concept of a solar cell.

3.2.1 Solar Cell Theory

A solar cell (SC) is a basic device that is used to convert the Sun’s energy into electricity. Ultimately, semiconductor materials are commonly used for the purpose of producing currents and voltages as a result of the absorption of sunlight, which is a phenomenon known as the photovoltaic effect. Most solar cells are fabricated from either monocrystalline or polycrystalline silicon (Si) materials. In its most basic form, a solar cell consists of a pn junction diode. Typical solar cell efficiencies range from 18% for polycrystalline to 24% from highly efficient monocrystalline technologies. These high end devices typically include special light trapping structures that absorb as many of the incident photons as possible.

Figure 5 shows the basic operation principles of a solar cell, which was adopted from the literature in [27]. Both drift and diffusion of carriers takes place across the depletion region of width, \(W\). The built-in electric field \(E_0\) in this depletion layer prevents further diffusion of minority carriers. The finger electrodes on the surface of the n-type semiconductor material allows light to penetrate into the device. Furthermore, these electrodes result in a small series resistance. The photogenerated electron hole pairs in the depletion region become separated by the built-in electric field, \(E_0\). Through the process of drift, electrons reach the neutral n-region and make it negative by an amount of charge \(-q\). Similarly, holes drift to the p-region, which effectively turns that region more positive. Consequently, an open circuit voltage, \(V_{oc}\), develops between the terminals of the device, whereby the p-region is positive with respect to the n-region. The total current flowing through a solar cell can determined using Kirchhoff’s law, whereby:

$$\begin{aligned} I=I_{ph}-I_d \end{aligned}$$
(3)

Here, \(I_{ph}\) is the photocurrent, \(I_d\) is the diode current, which is proportional to the saturation current by the following relationship:

$$\begin{aligned} I_d=I_o \times (e^{V/{\eta V_t}}-1) \end{aligned}$$
(4)

where \(I_o\) is the reverse saturation current, \(V\) is the voltage imposed on the diode and \(V_t\) is the thermal voltage, \(V_t=kT/q\), where \(k\) is the Boltzmann constant, \(q\) is the charge and \(T\) is the temperature. Similarly, the diode ideality factor, \(\eta \), typically depends on the type of solar cell technology used. For the case of monocrystalline silicon, this is usually \(\eta =1.2\) [35].

Fig. 5
figure 5

The basic principle of operation of the solar cell, as depicted by Kasap in [27]

In reality, photogenerated electrons need to travel across a semiconductor region in order to be collected by the nearest electrode. Consequently, an effective series resistance, \(R_s\), is introduced in the photovoltaic circuit. Similarly, photogenerated carriers flow through the crystal surfaces or through grain boundaries in polycrystalline devices. These effects can be described in terms of a shunt resistance, \(R_p\), which drives photocurrent away from the load, \(R_L\). Consequently, the equivalent electrical circuit representation of a typical solar cell can be modelled as shown in Fig. 6 [27, 36].

Fig. 6
figure 6

Electrical circuit representation of a an ideal solar cell and b practical solar cell with series and shunt resistances

Thus, from Fig. 6, an expression for the total output current of the cell, \(I\), can be deduced:

$$\begin{aligned} I=I_{ph} - I_0 (e^{q(V+IR_s)/\eta kT}-1) - ((V+IR_s)/R_p ) \end{aligned}$$
(5)

where \(q\) is the electric charge, \(V\) is the voltage, \(k\) is the Boltzmann constant and \(T\) is the cell temperature in Kelvins, K. Consequently, we can determine the \(I-V\) characteristics of a SC as a function of input solar radiation, series resistance and shunt resistance.

3.2.2 Machine Learning for Solar Cells

The accurate modelling of a solar cell involves the prediction of five important parameters, which are \(\eta \), \(I_0\), \(R_s\), \(R_p\) and \(I_{ph}\). Numerical and analytical techniques have been proposed to extract these parameters. However, since the \(I-V\) relationship is highly non-linear, many algorithms suffered from drawbacks. For example, the non-linear least error squares approximation approach by the authors in [37] was strongly dependent on the choice of initial values. Other analytical methods suffer from heavy computation complexity, algebraic manipulation and curve fitting [38]. Consequently, we will examine the machine leaning techniques that can be used for parameter extraction. We will focus on three techniques, which are the Simulated Annealing approach, the Harmony Search approach and the use of ANNs.

Among the successful techniques that have been proposed is a neural network method by the authors in [39]. Their research relied on two different approaches. The first involves generating \(I-V\) curves using the Sandia National Laboratory (SNL) PV performance model for different operating temperatures and solar irradiation [40]. Later, five points are chosen from these \(I-V\) curves, which are located at \( V=0,V_{oc}/2,V_{mp}, ((V_{oc}+V_{max})/2), V_{oc}\). Here, \(V_{oc}\) is the open-circuit voltage and \(V_{max}\) is the maximum voltage. According to Sandia, these five points represent an accurate representation of the \(I-V\) curve.

The authors in [39] then trained the neural network with 191 operating conditions of temperature and radiation. The five solar cell parameter were determined using Eq. 5 and the solar cell equations in SNL. Subsequently, the five extracted parameters were then fed into the one diode solar cell model to obtain the \(I-V\) characteristics of a PV module, as depicted in Fig. 7.

Fig. 7
figure 7

PV model approach that was adopted by [38]

The second approach involved generating the \(I-V\) curves experimentally and determining the five operating points using the SNL model. This was done using a solar panel, an electronic load, a computer controlled \(I-V\) tracer and a weather station. Different values of irradiance and temperature were obtained by triggering the \(I-V\) tracing at different times throughout the day.

The neural network was trained to identify the five equivalent circuit parameters from 41 \(I-V\) curves. The network was tested on 8 curves. Despite the ease of setting up this experimental facility, a drawback of this technique is that it was not possible to decouple the effects of temperature and radiation. For example, it was not possible to determine the percentage error at a module temperature of 25 \(^{\circ }\)C and an irradiation level of 850 W/m\(^2\), since irradiation levels caused an increase in module temperature. Nevertheless, a percentage error of 1.2% in \(V_{mp}\) at an irradiation level of 851 W/m\(^2\) and a temperature of 46.7 \(^{\circ }\)C was achieved, which is approximately three times more precise than the conventional model described by the Townsend equations in [41, 42].

Other machine learning techniques include the simulated annealing (SA) approach by the authors in [43], which is compared with the GA and PSO prediction techniques. An objective function was defined and minimised. Their results were compared with experiments and a Root Mean Square Error (RMSE) of 0.0017 was achieved for the single diode solar cell model.

In comparison, the authors in [44] showed that the Harmony Search (HS) optimisation process provides better results. Here, HS is an optimization technique that aims to imitate the improvisation process of musicians. According to their research, an objective function based on the single diode model was minimised with respect to a particular range. Consequently, the HS technique was able to extract the five solar cell parameters with a lower RMSE than the SA technique by a factor of 0.075.

3.3 Sizing of PV Systems

Determining the size of a PV system for a particular application in order to yield the best return on investment (ROI) is of paramount economic importance. Generally, the main techniques for sizing a PV system rely on empirical, analytical and numerical methods. Most importantly, to ensure that the sizing method is accurate, the weather data for the particular location in which the system will be installed is essential. Consequently, all the aforementioned techniques are ineffective for PV system sizing applications in remote or isolated locations, where the required data is not available. Thus, to overcome this hindrance, AI techniques may be used.

In addition to the weather data, a system designer must understand the end user requirements and be aware of any government incentives or policies. Generally, system design entails optimising the size of the solar array, the size of the battery bank, the current rating of the charge controller and the size of the DC to AC inverter. Furthermore, the system designer must be aware of how PV system will be used. For example, will the system be used for the electrification of a village, for a telecommunications application, or for water pumping? To avoid economic waste, PV system sizing is an application oriented optimisation process that aims to meet a certain load requirement for the expected lifetime of the system [45]. In this section, particular attention is attributed to determining the Loss of Load Probability (LLP) of a stand-alone PV system. Comparisons between AI predicted results with other sizing methods will be made.

3.3.1 Introduction to PV Systems

A photovoltaic array (or string) is a combination of photovoltaic modules that are connected in series in order to obtain the desired system voltage. Subsequently, these strings are connected in parallel to increase the system’s output power [46]. A photovoltaic installation mainly consists of an array of photovoltaic modules or panels, an inverter, batteries (for off grid) and interconnection wires. However, the balance of system (BOS) components in a PV system include mounting materials for the modules, wires, distribution panel, junction box, lighting protectors, grounding connections, battery fuses, battery cables and battery containers. In general, PV systems can be grouped into grid connected or autonomous (or stand-alone) systems.

A standalone or autonomous PV system is not connected to the national electricity grid. Such systems were the first application of PV, where there was no electricity supply from a national grid. Applications of these systems range from pocket chargers to large water pumping systems. Figure 8 illustrates the main components of this system, which are:

Fig. 8
figure 8

Stand-alone or autonomous PV System. The illustration shows two possible configurations. In the DC coupled configuration, DC loads are directly connected to the charge controller. In contrast, AC loads require an inverter

  • PV Module - An interconnected array of solar cells.

  • Charge Controller - Also known as a charger regulator, which aims to control the rate of current flow into and out from storage batteries. This is done to prevent overcharging and deep discharging of the battery, which can severely reduce battery performance and lifetime.

  • Battery Bank - Batteries are the heart of an autonomous solar electric system. They are the reservoir for storing electrical energy. The size of a battery is measured in terms of its storage capacity in Ampere-Hours (Ahr). There are different types of battery technologies, including Lithium Ion, Lead Acid, Nickel Cadmium and many others. The depth of discharge (DOD) is the amount a solar battery is discharged.

  • Inverter - This device is responsible for converting the PV panel’s direct current (DC) into an alternating current (AC) that can be fed into a commercial electrical grid, or to be used in a stand-alone system.

  • Loads - These can be a combination of either DC or AC appliances that are connected to the system. The vast majority of present day appliances require AC power. DC coupled systems do not require AC converters, which reduces overall system cost and increases system efficiency.

3.3.2 Sizing Autonomous PV Systems

In this chapter, particular attention will be devoted to sizing autonomous or off-grid PV systems. This can be achieved in a number of different ways, as depicted in Fig. 9. The first is called the Intuitive Method, which relies on the PV designer’s experience in sizing the PV array and the battery bank. Another is called the Numerical Method, which is more accurate than the Intuitive Method, but requires a large dataset of solar radiation values, which makes them complex to use [47]. Similarly, the Analytical Method involves describing the sizing problem as a function of the Loss of Load Reliability (LLR). In this section, we shall illustrate the most commonly used techniques in the literature for PV system sizing.

Fig. 9
figure 9

Standalone PV System sizing techniques

In brief, the Intuitive Method involves estimating the daily load demand, optimizing the tilt angle, calculating the size of the PV array and determining the size of the battery bank. By using simple mathematical equations, the size of the PV generator and battery bank can be determined [45]. Similarly, the size of the inverter can be determined by considering its efficiency and the maximum AC power it can deliver. This technique has been used for the optimum sizing of residential PV systems in Egypt [48] and in Bangladesh [49].

The Intuitive Method first relies on estimating the daily load demand and optimizing the tilt angle before calculating the PV array size and battery capacity. The equations for calculating these two parameters are similar to those in [45]. Figure 10 provides a summary of the main steps involved in sizing a stand-alone PV system intuitively. From Fig. 10 and assuming that all the modules in the system are identical, \(N\) is the number of modules, \(\eta _{pv}\) is the efficiency of the PV module, APV is the effective area of a single PV module and \(G_t\) is the global incident irradiation. Moreover, \(N_{aut}\) is the number of days of autonomy and \(DOD_{max}\) is the maximum depth-of-discharge of the batteries. The number of batteries (parallel) is \(N_{batt}\) and \(S_{pk-hr}\) is the peak Sun hours for the worst calendar month of the year.

Fig. 10
figure 10

Flow chart for the intuitive method of PV sizing

Having determined the size the PV generator and the capacity of the battery bank, the remaining PV system components need to be configured. For example, the simplest method to calculate the size of an inverter is to take the PV module peak power and divide this by the nominal AC efficiency of the inverter, \(P_{inv,AC}=P_{pv}/\eta _{inv}\) [26]. Similarly, charge controllers and cable cross-sections need to be sized accordingly. In this case, cable cross-sections need to be designed to deliver the least amount of voltage drop. Article 690 in the National Electric Code (NEC) describes the recommendations for PV wire gauge sizing the current protection mechanisms necessary in a PV system [50].

Nevertheless, the Intuitive Method is best used as a quick technique for approximating or validating the size of a PV system. It needs to be combined with other techniques to avoid over (or under) sizing of an autonomous system. Consequently, it can be combined with analytical and experimental methods, as demonstrated by the authors in [51] for a system in India. Their work relied on developing an iterative algorithm that takes into consideration the number of days of autonomy, system efficiencies, \(DOD_{max}\), battery cut-off voltages, cable losses, PV mismatch losses and the dust factor. Depending on the load profile, it was possible to reduce system investment requirements by 14%.

Advanced simulation software can also be used for PV system sizing. Currently, there are software tools that help engineers design PV systems. Examples of these tools include RETScreen, Homer, PVSyst, PV*Sol and Polysun. The majority of these tools rely on a combination of mathematical and analytical methods for PV Systems sizing. A system designer may also use these tools in combination with one another in order to meet a particular design requirement.

3.3.3 AI and PV Sizing

Among the first efforts into using neural networks for PV system design was performed by the authors in [19, 52] in 2005. A comparison between conventional sizing methods and ANN is provided in [53]. Furthermore, a parameter known as the loss of load probability, LLP, was simulated for different cities in Spain and the aim of their research was to be able to generate any LLP curve for any city in Spain. The LLP is a term that defines the ratio between energy deficit and energy demand. In fact, the LLP represents how often the PV and/or storage system will not be able to satisfy the load. Thus,

$$\begin{aligned} LLP=\dfrac{\int _0^{t} Energy\, Deficit }{\int _0^{t} Energy\, Demand} \end{aligned}$$
(6)

For the research presented in [52, 53], the LLP was simulated for different cities in Spain. Naturally, each city has a different clearness index throughout the year. Consequently, these two parameters in addition to the battery capacity were fed into a multilayer perceptron (MCP) neural network. Different tests were carried out by the authors to investigate the best number of neurons in the hidden layer. The network was trained on the data of seven Spanish cities and were validated with the data from 3 other cities. Their test showed that 9 hidden nodes were needed in order to obtain the value of the generator capacity ratio, \(C_A\).

The use of neural networks for SAPV system sizing has also been investigated extensively by the authors in [54,55,56]. Their technique involved feeding a number of numerically calculated parameters into the neural network in order to predict the number of solar PV modules and storage capacity needed to satisfy a given consumption. A block diagram of their system is shown in Fig. 11.

Fig. 11
figure 11

Method of obtaining the sizing parameters of an autonomous PV system, as defined by Mellit in [54]

The input parameters to their model are the latitude and longitude, while the output parameters are the optimum sizing coefficients of the PV panels, \(f_p\), and the battery capacity, \(u_p\). Furthermore, The LLP is the Loss of Load Parameter, whereas \(C_A\) is the ratio of average PV generator production during the worst calendar month to the average load energy demand. Similarly, the storage capacity of the battery bank, \(C_s\), is defined as the ratio of maximum storage energy to the average load energy demand [47].

Consequently, both \(C_A\) and \(C_s\) can be determined from:

$$\begin{aligned} C_A=\dfrac{\eta _{pvp}A_{pv}G_{av}}{L} \end{aligned}$$
(7)
$$\begin{aligned} C_S=\dfrac{C}{L} \end{aligned}$$
(8)

where \(A_{pvp}\) is the total area of the PV generators, \(\eta _{pv}\) is the PV module efficiency, \(G_{av}\) is the average daily global irradiation, \(L\) is the average daily energy consumption and \(C\) is the battery bank capacity. The output parameters of the system are the PV array area (\(A_{pvp}\)) as well as the useful battery capacity (\(C_{UP}\)).

Additional AI methods include an investigation that involves the use of fuzzy logic (FL) for optimizing the PV generator area and the size of the battery bank for an autonomous PV system located in Sfax, Tunisia [57]. Furthermore, hybrid optimisation techniques involving the merge of genetic algorithms (GA) and neural networks were also investigated by Mellit [58, 59]. A complete review of AI techniques for PV system sizing is provided by the same author in [56], as well as by the authors in [60].

4 Summary

Various AI techniques have been applied to three main PV applications, which include (1) Forecasting and modelling of meteorological data, (2) Basic modelling of solar cells and (3) Sizing of photovoltaic systems. In the case of solar radiation forecasting, it has been shown that AI can be used for the accurate prediction of solar radiation in the city of Beijing. Other scholars in the literature have successfully used various AI techniques for predicting the weather conditions of any geographic location. Consequently, AI techniques can then be extended to any geographic location. Furthermore, the estimation of energy production for a PV system has been shown using both conventional and AI techniques. Again, the results show the accuracy of AI techniques in comparison to analytical methods. Consequently, the chapter has illustrated how AI can be used to not only predict, but to accurately fill in the missing gaps of important information.