A Novel BIPV Reconﬁguration Algorithm for Maximum Power Generation under Partial Shading

: The feasibility of electricity production via solar energy in the Middle East is high due to the enormous value of solar radiation. Building-integrated photovoltaics (BIPV) are systems used to utilise the unused spaces that can be installed on the façade or roof by replacing the building’s main element. However, the main problem associated with electricity production by BIPV is partial shading on the roof, which can produce multiple hot spots and disturbances to the system if the insolation values within the whole BIPV array vary. Partial shading, in this case, is observed due to the complexly shaped roof. This paper studies the partial shading e ﬀ ect on one of Qatar’s most recent projects (metro stations), and models the Education City station, which is a major station. The rooftop is complex, and it has many wavy shapes that can a ﬀ ect the BIPV system’s performance. The station is modelled using building-information modelling (BIM) software, wherein all of the station’s models are gathered and linked using BIM software to illustrate the BIPV and indicate the solar insolation distribution on the rooftop by simulating the station’s rooftop. The system is optimised for maximum yield to determine the optimal conﬁguration and number of modules for each string using a genetic algorithm. The outcomes from the algorithm are based on clustering the solar insolation values and then applying a genetic algorithm optimisation to indicate the optimum BIPV array layout for maximum yield. Author Contributions: Conceptualisation, S.A.A.-J., O.E. and S.G.A.-G.; Formal analysis, S.A.A.-J.; Funding acquisition, S.G.A.-G.; Investigation, S.A.A.-J.; Methodology, S.A.A.-J., O.E. and S.G.A.-G.; Project administration, S.G.A.-G.; Supervision, S.G.A.-G.; Visualisation, S.A.A.-J., S.G.A.-G.; Writing—original draft, S.A.A.-J.; acquisition, S.G.A.-G.; Investigation, S.A.A.-J.; Methodology, S.A.A.-J., O.E., and S.G.A.-G.;


Introduction
There has been major growth and improvement in utilising solar energy worldwide, as it is considered one of the most reliable and significant renewable and green energy sources. A remarkable quantity of research has been conducted to develop the quality and efficiency of the energy generated by Photovoltaics (PVs) [1]. Recently, world energy consumption has been 10 TW and this is expected to reach 30 TW by 2050; however, the additional 20 TW needs to be generated with renewable energy with zero CO 2 emissions in order to stabilise the CO 2 levels in our atmosphere [2]. Therefore, much work is in progress to implement PV systems in major building projects, which can result in less CO 2 associated with these projects and more free electricity generation for use within the buildings. These efforts can decrease greenhouse gas emissions and create economic savings [2,3]. Qatar is planning to create a megaproject targeted to produce 2%, or 200 MW, of the nation's electricity via PVs by 2020 and 20%, or 2 GW, of the nation's electricity via PVs by 2030. The country's CO 2 emissions will be remarkably decreased, as 0.24 million tonnes of oil equivalent (Mtoe) and 2.13 Mtoe will be saved from natural gas

Building-Information Modelling (BIM) and Solar Irradiance Analysis
Building-information modelling (BIM) can be utilised to predict the insolation values for every day throughout the year for any object, as it can predict the performance of any building and the energy it needs [22]. In addition, it can digitally represent the physical building and the facility's characteristics; furthermore, the BIM platform can be the basis for data sharing for all stakeholders. BIM is considered a sophisticated tool for accurately measuring irradiance data throughout the year. Many studies used BIM to gain the irradiance data needed for modelling buildings. The design of the BIPV should be considered during the design phase, as the architectural design of the building will affect the radiation of the installed BIPV system, which will then affect the electricity generated by the BIPV system and the electrical connection related to the system [23,24]. It is recommended that BIPV information be integrated into the BIM database to develop the constructability of the BIPV during the design stage. In addition, BIM is a friendly tool for technically evaluating a BIPV system and for doing solar insolation analysis [25,26].
However, BIM software can also be used to measure the insolation values for certain periods and areas at any time during the year. A case study used BIM to predict the PV power output of a 2.5-kWp PV system installed in Cardiff. The results showed that there was an average error of 4.2% between the monitored and simulated results [24]. Dixit and Yan (2012) used BIM to obtain solar insolation data for three different cities: Jacksonville, Florida; Dallas, Texas; and Brunswick, Georgia. Their results showed that, by using BIM, specifically Autodesk Revit (Autodesk, San Rafael, CA, USA), the insolation values of the simulated and measured insolation values were nearly the same within ±10% of the measured values [27]. In the same field, Gui et al. (2017) modelled the irradiation of a building. Their results showed that some modules have low irradiation values; thus, it was possible to optimise the system by reducing the number of modules which can be neglected due the low irradiance values received by them using Autodesk Revit [23]. Furthermore, BIM energy-based BIPV analysis was carried out by Kuo et al. (2016) to validate the measured real data with simulated data using BIM software (Autodesk Revit). The information for the analysis was validated, such as the location, weather data, orientation, longitude, and latitude of the model in real life. The results showed that the simulated results were approximately accurate compared to the measured values used at the building because, at the building site, the measured irradiance was obtained using pyranometers and then compared with the irradiance simulated by BIM. This caused a small error between the electricity outcomes, but it can be assumed that the results were approximately the same [28].

Optimising BIPV System Layout Using a Genetic Algorithm (GA)
Energy maximisation should be done by finding the most optimal configuration of a BIPV system. If the tilt and orientation change, the energy outcome will change due to the different direction of irradiation due to partial shade, which will enable the determination of the optimal layout configuration of any BIPV system under different partial shade conditions. A designed BIPV system based on the orientation of the sun for which the energy output will be optimised and how the BIPV modules are placed. However, the authors did not rely on any optimisation algorithms to increase the energy output [29]. There are many techniques that can be used to optimise the BIPV system by determining the most applicable configuration of the BIPV strings.
Krishna and Moger (2019) discussed several optimisation techniques and algorithms to reconfigure the system to mitigate the partial shade effect on PV systems. First, in the uniform irradiance condition, the PV modules' system received the same irradiance value throughout the modules, which guaranteed that the system had the same maximum power and that there was only one peak value in I-V and power voltage (P-V) of the BIPV system. However, this is not the case for the partial shading condition. With the partial shading condition, some of the modules were shaded, thus receiving less irradiance than the unshaded modules. This may cause hot spots in the system and damage to the PV's cells and modules. Therefore, there will be mismatch losses throughout the system, which can be caused by different temperatures and irradiance values. Furthermore, with the partial shading condition, the maximum power was less than that achieved under the uniform irradiance conditions. These losses cannot be totally prevented but can be mitigated using several methods.
One of the most used techniques is using a bypass diode for each module, which provides the path for the current, which it will allow or prevent based on the current generated by the modules, which depends on the solar irradiance and the elimination of the hot-spot problem in the system. Adding bypass diodes is classified as a passive technique to mitigate the partial shading condition of a BIPV system. However, active techniques are more effective, including reconfiguration strategies, which are classified as the most promising techniques for this category for minimising the partial shade effect. Reconfiguration techniques are based on irradiance levels and work by interconnecting the modules with each other as needed to reduce the mismatch losses and maximise the power output.
There are two main reconfiguration techniques: Total Cross-Tied (TCT) and Series-Parallel (SP). For TCT, all the modules with the same irradiance level are connected in one row to equalise the irradiance level. The SP technique is used to connect all the modules with the same irradiance level in a series in one string and then connect all the strings in parallel. As a result, the output current is not limited to the lowest irradiance-exposed module in the string.
The most commonly used algorithm for adopting any static or dynamic reconfiguration is a Genetic Algorithm (GA). It has been used to identify the most optimum reconfiguration that arranges switches under partial shading such that the current in each row is the optimum and to connect the modules with the same irradiance level in one string [30,31]. A GA is used to solve optimisation problems by using the algorithms to generate the next generation by selecting two individuals, which are considered parents [32,33]. These algorithms are based on techniques from evolutionary biology like mutation, selection, and crossover. To begin, random individuals need to be generated to create an initial population. Typically, the initial population can have hundreds or thousands of solutions. The next step is to select a portion of the initial population to breed a new generation. The solutions with higher fitness values are selected and the solutions with lower fitness values are discarded. The next step is crossover, where parents are selected from the fitness pool generation to generate a new child. This new child will have many characteristics from the parents. The next step is mutation, which ensures that the individuals are different. The mutation step is important for maintaining the genetic diversity of the population and achieving the desired global optimum [34,35]. Ismail et al. (2013) used a GA to extract the most optimal parameters of simulated solar panels. The GA analysed different cases to predict the optimum parameters for the solar panels and then these parameters were used as optimum ones throughout the simulation [33]. Deshkar et al. (2015) Energies 2020, 13, 4470 5 of 25 discussed the different reconfiguration of 9 × 9 PV modules in three cases with different partial shade distributions. A GA was used to reveal the best power output from the PV array [32]. The same approach was discussed by Rajan et al. (2017) concerning a 9 × 9 PV array with different distributions of shade. The method changed the electrical connection so that each row had the same irradiance level while keeping the physical locations of the modules the same. Their results showed good performance, and power generation was improved by 44.14% when a GA was used [36].

Novel Approach
In this paper, we implement the novel approach of linking BIM to GA. Qatar has a high intention toward solar irradiance, and the country is now looking to reduce its CO 2 footprint. Consequently, a case study on the Qatar Rail metro station will be analysed. The choice of the Qatar Rail metro station was made because it is a new major infrastructure project in Qatar used by the public. In addition, the rooftop of the station is curved, which will help us analyse changes in the irradiance level of the BIPV system. The general method for the paper is as follows. Firstly, the BIM model of the station is created. Secondly, a BIPV array on the rooftop of the station is integrated in the BIM model. Thirdly, a solar analysis is simulated to determine the irradiance level at each module. Finally, the system is optimised to overcome the multiple peaks and to eliminate the hot spot of the system by levelling up the irradiance level for each string using a GA. The sequence of modelling this approach is shown in Figure 3. The papers reviewed used either only BIM, such as [37] and [28], or they only used GA optimisation techniques on random solar irradiance values, such as [36] and [32]. Therefore, the novelty of the paper is that it uses the model of the station, then simulates the solar irradiance data of the station model using BIM, and then determines the best configuration of the BIPV system using a GA optimisation method that optimises based on real simulated values.

Case Study
Qatar is currently developing a new major infrastructure project related to the transportation sector in the country, and this paper's methodology is applied to this real case. Qatar built a new metro network, which has 37 stations across its three main lines. Some of these stations are elevated and others are underground. However, the underground stations have their main entrances at ground level. These main entrances' shelters have no purpose except to provide accesses to the station. Therefore, installing BIPV on these shelters will reduce the energy demand on the grid, which is a good utilisation of the free areas on their roofs. In addition, this study will satisfy the implementation of optimisation method under partial shading for BIPV modules and mitigate the effect of partial shade. The roofs of Doha Metro entrances are complexly shaped, making them a good example for analysing the effect of partial shading. Moreover, to examine the weather conditions in a practical example, as Qatar has high solar insolation values across the year, with an average of 4449 h of sunlight per year, which entails that there is sunlight for 70% of the year [5]. However, the environment of Qatar is harsh and the high temperature, high moisture, and dust affect the performance of the PV [15]. The chosen station shelter is at the Education City station. This station was chosen because it is considered one of the two major stations across the whole network; thus, it is a good example for helping the public realise the importance of clean energy [38,39]. The building of this station started in 2013 and finished by early 2019. The station began operating by the end of 2019. Its architecture draws inspiration from the arch expressions of Islamic architecture, the lightness of the dhow sail, and the tensile profiles of the nomadic tents. The "vaulted spaces" design signals a step forward in the interpretation and morphological implementation of these elements. In other words, these elements represent the values of the country and are reflected in the sophisticated curvatures of the roof. Figure 1 shows the rooftop curvature of the Education City metro station with the dimensions of the roof and the height of the station. Figure 2 shows the perspective view of the station.  Amorphous Silicon (a-Si) showed the best performance in Qatar's weather [14,15]. Therefore, an integrated a-Si PV was chosen for analysing the energy performance of the system in this application. Table 1 describes the electrical characteristics of the a-Si module chosen for the case study, which is a 146-W module factory-made by Xunlight. After searching PV databases, including the System Advisor Model (SAM) and web database, this module was chosen because it is an a-Si module and it   Amorphous Silicon (a-Si) showed the best performance in Qatar's weather [14,15]. Therefore, an integrated a-Si PV was chosen for analysing the energy performance of the system in this application. Table 1 describes the electrical characteristics of the a-Si module chosen for the case study, which is a 146-W module factory-made by Xunlight. After searching PV databases, including the System Advisor Model (SAM) and web database, this module was chosen because it is an a-Si module and it Amorphous Silicon (a-Si) showed the best performance in Qatar's weather [14,15]. Therefore, an integrated a-Si PV was chosen for analysing the energy performance of the system in this application. Table 1 describes the electrical characteristics of the a-Si module chosen for the case study, which is a 146-W module factory-made by Xunlight. After searching PV databases, including the System Advisor Model (SAM) and web database, this module was chosen because it is an a-Si module and it can be integrated with a building as a BIPV. The technology of this module is thin-film a-Si, and it can be used with BIPV. The electrical characteristics and data sheet for this module can be extracted from SAM and web databases [40,41].

Methods
The method primarily consists of modelling the whole system using several equations of the PV cell, module, and array. The equations will represent the interconnections between the several parameters that can affect the current, voltage, and power output, which will help model the PV system. The next step will concentrate on gathering the insolation data, which was achieved using BIM software (Revit), to assess the difference in insolation values across the rooftop of the Education City station in the Doha Metro network. Then, the best electrical connection for the modules installed on the rooftop of the station entrance are identified using GAs in Matlab/Simulink. A GA is used to optimise the BIPV system to maximise power generation, which mostly depends on the insolation absorbed by the modules.

BIPV Modelling Using Equations
The PV cell performs the key role of converting sunlight directed toward the cell, which contains photons that can free the electrons inside the cell. Electricity is produced by the motion of electrons within the cell. Nevertheless, the solar irradiance, ambient and cell temperatures, and operating voltage can create huge differences in the system's current and voltage and, thus, power. Generally, PV cells, modules, and arrays show nonlinear I-V and P-V curve characteristics. Solar insolation and temperature play key roles in these characteristics, which can affect the current and voltage limits for the whole system. However, to examine the performance and behaviour of the PV cell, module, and array, we need to model the whole system under different insolation values in the case of partial shade to determine the I-V and P-V characteristics of the system. Several equations pointed in the Appendix A are used to represent the cell and module and array models to determine the relationships between the parameters and the effect of insolation [42,43].

PV Modules/Arrays Modelling
In this paper, we focus more on modelling whole PV modules and arrays than determining the effects on single cells, as partial shade affects the performance of the modules and arrays in general rather than single cells. Moreover, partial shade is considered according to the effect on the modules and arrays. Usually, the cells are connected in a parallel series form of PV modules. PV modules are connected in a parallel series to reach the optimum power requirements of the PV array. PV arrays are groups of PV modules that are connected to provide the required power output. The PV modules and arrays can be modelled to determine the power from current (I) and voltage (V) using the following equations [44]: , and T C is the cell's operating temperature (K). The reference operating cell temperature is 298 K (25 • C). A is the ideal factor, which depends on the technology the cell uses, which in our case is 1.8 for the a-Si cell. R SH is the shunt resistance, and R S is the series resistance. N P represents the number of modules connected in parallel, whereas N S represents the number of modules connected in series. These connections are calculated to enable the array to generate the required voltage and current. The PV modules are not sensitive to R SH , but any small change in R S can cause a large change in the output value. Therefore, the value of R SH can be neglected, as in the PV cell model, and the equation can be written as: To create a more simplified equation, PV modules should have RS = 0, as the ideal operation of PV modules should not have any series resistance or current leakage. The equation can be rewritten as:

Modelling BIPV Modules to Generate Optimum Power
Modelling the BIPV modules on the rooftop of the station is the main focal point for this study to define the optimum configuration of the electrical connection between the arrays by using GA. This paper describes the parameters needed to connect the arrays in the best way. The main parameter is solar insolation, which determines which BIPV arrays will be connected to find the optimum I-V and P-V curves for the specified range of solar insolation cause by partial shading of the rooftop. Moreover, the solar insolation on each BIPV module will be gathered to model the best BIPV array layout to have an optimised BIPV array system based on the solar insolation values, as the solar insolation value will enable the GA optimisation process to predict the best BIPV array connection to optimise the BIPV. First, the models of the station need to be gathered from Qatar Rail (the public company that own the metro system) to link the models to the full BIM model. Second, BIPV arrays of the station rooftop are integrated. Third, the solar insolation is simulated using BIM software (Revit) by positioning the model in the exact coordinates to achieve an exact simulation, collecting data from the solar insolation analysis, and extracting the insolation data for each BIPV array. Finally, the optimum connection of the arrays is configured to achieve the optimum current, voltage, and power. Figure 3 describes and summarises the steps mentioned above. consists of running several iterations of the BIPV arrays in a shape of matrix that depends on the areas of the modelled station. That will allow us to examine all the possible layouts and determine the optimised layout by levelling up the currents in the rows of the BIPV arrays to equalise the currents in the rows. Figure 3 describes the sequence of the adapted methodology.

Integration of BIPV on the Station Rooftop and Solar Feasibility Analysis
Our model mainly focuses on the rooftop in examining the feasibility of installing BIPV on the rooftop of the station. In the BIM software, it is useful to clarify the real-world location of the object modelled. In our case, this is the Education City station, which is located near Al-Rayyan city within Doha metropolitan area. In addition, the software simulates the sun's movement, which enables us to determine the insolation values based on the exact latitude and longitude of the city's location in BIM. After that, the solar insolation analysis was performed, which allowed us to draw the layout for segregating the system. In the appendix Figure A1 reflect the solar insolation simulation process. Figure 4 shows the different insolation values of the BIPV modules integrated with the rooftop of the station. It shows the three main levels of insolation on this rooftop. However, Figure 5 illustrates the different areas of directive solar insolation. There are variations in the solar insolation along the rooftop due to the orientation and coordinates of the station and the shape of the rooftop. Each area has its own value of solar insolation.  Autodesk Revit 2020 was used to link the BIM models and simulate the solar insolation. It is considered one of highest-level BIM software tools worldwide and is used for major projects because of its high-quality design and models. The same software can be used to link the models and for solar insolation using a 360 plug-in tool that can simulate solar insolation on certain walls, roofs, objects on hourly, daily, monthly, and annual bases.
The next steps are to extract the insolation data from the BIM software for the BIPV arrays, import them to Matlab/Simulink to assess the differences in solar insolation caused by partial shade, and use a GA optimisation toolbox to determine the best layout and configuration that does not limit the power output. The optimisation process determines the best layout of the configuration and electrical connection in the BIPV array in a shape of matrix to maximise the power output without limiting the current throughout the system as well as to avoid multiple peaks in the I-V and P-V curves, which can produce hot spots and damage to the BIPV system. The process of GA optimisation consists of running several iterations of the BIPV arrays in a shape of matrix that depends on the areas of the modelled station. That will allow us to examine all the possible layouts and determine the optimised layout by levelling up the currents in the rows of the BIPV arrays to equalise the currents in the rows. Figure 3 describes the sequence of the adapted methodology.

Integration of BIPV on the Station Rooftop and Solar Feasibility Analysis
Our model mainly focuses on the rooftop in examining the feasibility of installing BIPV on the rooftop of the station. In the BIM software, it is useful to clarify the real-world location of the object modelled. In our case, this is the Education City station, which is located near Al-Rayyan city within Doha metropolitan area. In addition, the software simulates the sun's movement, which enables us to determine the insolation values based on the exact latitude and longitude of the city's location in BIM. After that, the solar insolation analysis was performed, which allowed us to draw the layout for segregating the system. In the Appendix A Figure A1 reflect the solar insolation simulation process. Figure 4 shows the different insolation values of the BIPV modules integrated with the rooftop of the station. It shows the three main levels of insolation on this rooftop. However, Figure 5 illustrates the different areas of directive solar insolation. There are variations in the solar insolation along the rooftop due to the orientation and coordinates of the station and the shape of the rooftop. Each area has its own value of solar insolation.
segregating the system. In the appendix Figure A1 reflect the solar insolation simulation process. Figure 4 shows the different insolation values of the BIPV modules integrated with the rooftop of the station. It shows the three main levels of insolation on this rooftop. However, Figure 5 illustrates the different areas of directive solar insolation. There are variations in the solar insolation along the rooftop due to the orientation and coordinates of the station and the shape of the rooftop. Each area has its own value of solar insolation.    Figures 6 and 7 show that the station's rooftop has a high potential for solar energy production. It is clear that the solar insolation through summer, from May to September, is the highest. May has the highest insolation value, producing 969,399 Wh for the entire area of the rooftop, which is 3862 m 2 . This is equivalent to 251 Wh/m 2 . In contrast, the lowest insolation value was in December, with an average value of 383,895 Wh for the entire area, or 99 Wh/m 2 . In Figure 6, the numbers represent the average solar insolation values per m 2 , while Figure 7 shows the average insolation values for the whole area of the station, as applied in Figures 8 and 9 for the cumulative solar insolation values. The cumulative insolation values for each month are pointed out in Figures 8 and 9. The figures show that May has the highest potential for generating solar energy. The cumulative insolation for the entire area of the rooftop in May is 369,645,427 Wh. December has the lowest potential for generating solar energy, as it has the lowest insolation value of 108,069,467 Wh, which is nearly 30% of the total solar insolation in May. However, as is indicated in Table 2 Figures 6 and 7 show that the station's rooftop has a high potential for solar energy production. It is clear that the solar insolation through summer, from May to September, is the highest. May has the highest insolation value, producing 969,399 Wh for the entire area of the rooftop, which is 3862 m 2 . This is equivalent to 251 Wh/m 2 . In contrast, the lowest insolation value was in December, with an average value of 383,895 Wh for the entire area, or 99 Wh/m 2 . In Figure 6, the numbers represent the average solar insolation values per m 2 , while Figure 7 shows the average insolation values for the whole area of the station, as applied in Figures 8 and 9 for the cumulative solar insolation values. The cumulative insolation values for each month are pointed out in Figures 8 and 9. The figures show that May has the highest potential for generating solar energy. The cumulative insolation for the entire area of the rooftop in May is 369,645,427 Wh. December has the lowest potential for generating solar energy, as it has the lowest insolation value of 108,069,467 Wh, which is nearly 30% of the total solar insolation in May. However, as is indicated in Table 2, the whole year achieves a cumulative insolation value of 3,117,787,175 Wh, and the average insolation value for the year is 204 Wh. Moreover, the whole year is included in the averaged and cumulative values, which means that the results of the solar insolation values are applicable to all years. entire area of the rooftop in May is 369,645,427 Wh. December has the lowest potential for generating solar energy, as it has the lowest insolation value of 108,069,467 Wh, which is nearly 30% of the total solar insolation in May. However, as is indicated in Table 2, the whole year achieves a cumulative insolation value of 3,117,787,175 Wh, and the average insolation value for the year is 204 Wh. Moreover, the whole year is included in the averaged and cumulative values, which means that the results of the solar insolation values are applicable to all years.            The solar analysis was conducted for the rooftop of the station for each month during 2019. The results showed great solar potential for the rooftop even though some areas of the rooftop have low insolation levels due to the roof's curves.
However, to start simulating the insolation values for the station's rooftop, the rooftop of the station must be segmented because it has multiple curvatures. Each curvature was considered as one area. Segmentation of areas of the station's rooftop is shown in Figure 10. The station's rooftop has multiple shapes, and each shape was considered to be a separate area. This was done due to the multiple curvatures in the shape of the rooftop and their corresponding variety of solar insolation values. The photocurrent is directly proportional to the insolation value, and the lowest insolation value in the system can control and limit the whole system's photocurrent value. Consequently, we need to analyse each area individually to predict the areas with low, medium, and high insolation values. An annual simulation of solar insolation was carried out for each area and there were huge differences in the insolation values; for example, the maximum insolation value for A22 and A23 was 421 Wh/m 2 for the whole year, while in A16, the average insolation value was 4.32 Wh/m 2 . These numbers indicate a large difference in solar insolation across the rooftop and that the complexity of identifying the best configuration for the BIPV system comes from identifying the areas which have low, medium, and high insolation values. These variations are mainly due to the curvatures, which create partial shade. The reason for choosing the average annual solar insolation is that the configuration of the BIPV arrays will be static. Thus, the average annual solar insolation values ensure that all solar insolation values in all months are considered and that this configuration is fitted in over the whole year.   As shown in Figure 10, the rooftop of the station was divided into 45 main areas, and each area's insolation value was modelled across an entire year. Each area can have a certain number of BIPV modules installed upon it. The module chosen for our case study is the Xunlight XRS18-146, which has a surface area of 2.12 m 2 . In terms of spacing between BIPV modules and arrays, it has been discussed in [45] that spacing between the arrays' rows impacts their power output because of shade created by them. However, in our case, the BIPV will be directly integrated with the roof and there will be no mounted arrays that can create shade. Therefore, 20% of the surface area of each area can be eliminated for measurement, fittings, edges, connection, and maintenance purposes so long as there is no sufficient spacing studies conducted for BIPV applications. Finally, the number of modules was given for each area in the same table. The colour gradient in Figure 10 is the same as in Figure 5. Yellow indicates the areas with the highest solar insolation values. Green indicates the areas with medium solar insolation values. Purple indicates the areas with the lowest solar insolation values. Table 3 shows the different classifications for each area and how many BIPV modules can be installed in these areas. These areas are classified into five main insolation categories, as illustrated in Table 4. The categories represent the areas' insolation values from low to high. Category 1 refers to the areas with insolation values of 0 < x < 10 Wh/m 2 . Category 2 refers to the areas with insolation values of 10 ≤ x < 300 Wh/m 2 . Category 3 represents the areas with insolation values of 300 ≤ x < 350 Wh/m 2 . Category 4 represents the areas with insolation values of 350 ≤ x < 400 Wh/m 2 . Category 5 refers to the areas with insolation values of 400 Wh/m 2 and above.  There is great potential for installing many BIPV modules for each category, but the main issue will be how to electrically connect the modules of each category. This should be done using an optimisation method that allows us to determine the best configuration and layout for the system. Figures 1-9 were created to illustrate the integration of the BIPV modules on the selected building for the study using the BIM tool. Then, based on the average annual solar irradiance at the selected building location, the building's rooftop was classified into 45 zones. These solar insolation classifications will act as inputs for the GA optimisation algorithm which will optimally configure the physical connections between the 45 zones. In Section 4.2, the 45 BIPV array configurations will be modelled and analysed for optimum power extraction under the partial shading condition and different solar insolation values.

Optimise the Classified Areas of BIPV for Maximum Power Extraction Using Genetic Algorithms
Based on the analysis of the shading pattern on the roof of the station, it is clear that there is a great difference between the irradiance levels of the areas. These differences will lead to mismatch losses throughout the system if they are connected without considering the partial shading of the BIPV, which causes multiple peaks in the 1-5 and P-V curves that disturb the system. However, to minimise and eliminate these effects within the proposed BIPV system, the rows of the system should be equalised to nearly the same current, and areas should be interconnected based on their solar insolation, as solar insolation plays a key role in generating the current in these different areas. The BIPV module locations will be unchanged, but the interconnections between these areas will be changed based on their solar insolation to make the whole rows have the same solar insolation, which will result in a stabilised BIPV system and maximised power.
The TCT configuration is configured in the circuit by connecting cross ties across each row in a simple Series-Parallel (SP) configuration. In this configuration, the rows are connected in parallel and the columns are connected in series. In this case, the voltage outcome will result from the columns, and the current will result from the rows. As the current relies on the irradiance value, all rows need to be equalised for nearly the same total solar insolation to minimise and eliminate the mismatch losses and the multiple peaks. Otherwise, the BIPV area with the lowest solar insolation will limit the current of the string [46]. Both studies prove that using a GA method for optimising the system performed best and enhanced the stabilisation of the system as reflected by the power output of the modules. The two studies were initiated with 9 × 9 matrices with 81 PV modules. Each row consisted of nine PV modules and each column consisted of nine PV modules [32,36].
The same matrix, interconnection, and optimisation approaches were adopted in our study, but our data were obtained from the solar insolation simulation used in BIM, as we had 45 different areas and each area had multiple PV modules with the same solar insolation. Thus, the whole area was treated as one BIPV module and the total solar insolation of the BIPV modules was taken. The following are illustrations of the BIPV system connections and matrix implemented in our paper.
As shown in Figure 11, the configuration of our system was modified by connecting them in a series and a parallel configuration, and cross ties are connected across each row of the system. The system in Figure 11 can be illustrated in matrix form of which two matrix connections will be considered, as we have 45 areas. Therefore, firstly, the BIPV system was considered for the 5 × 9 matrix. Secondly, the 9 × 5 matrix was tested to analyse both matrices, as the voltage and current values changed. Inside each area, the modules that have the same solar insolation values were connected in series. The current and voltage in the optimisation process can be expressed as follows: where I is the current, I m is the current in a specific module under specific solar insolation equal to K = G/G 0 (G 0 = 1000 W/m 2 ). V a is the voltage across the array, and V mk is the voltage in a specific module [32,36]. Figure 12 illustrates the matrix connection for both systems.
our data were obtained from the solar insolation simulation used in BIM, as we had 45 different areas and each area had multiple PV modules with the same solar insolation. Thus, the whole area was treated as one BIPV module and the total solar insolation of the BIPV modules was taken. The following are illustrations of the BIPV system connections and matrix implemented in our paper. As shown in Figure 11, the configuration of our system was modified by connecting them in a series and a parallel configuration, and cross ties are connected across each row of the system. The system in Figure 11 can be illustrated in matrix form of which two matrix connections will be considered, as we have 45 areas. Therefore, firstly, the BIPV system was considered for the 5 × 9 matrix. Secondly, the 9 × 5 matrix was tested to analyse both matrices, as the voltage and current values changed. Inside each area, the modules that have the same solar insolation values were connected in series. The current and voltage in the optimisation process can be expressed as follows: where I is the current, Im is the current in a specific module under specific solar insolation equal to K = G/G0 (G0 = 1000 W/m 2 ). Va is the voltage across the array, and Vmk is the voltage in a specific module [32,36]. Figure 12 illustrates the matrix connection for both systems.  The following steps needed to be performed to begin the optimisation process. Previous studies proved that GA optimisation enhanced the stabilisation of the PV modules and their power extraction. Consequently, we adopted a GA optimisation method.
A GA can be used in our case because we have changing environmental conditions. Rajan et al. (2017) developed a new GA technique relative to a previous technique developed by Deshkar et al. (2015), and both used the matrix approach [32,36]. Rajan el al.'s (2017) GA technique is less complex, which involves minimising the standard deviation of the row currents. A standard deviation is the average amount of variation within a set of values. A low standard deviation means the values are close to the average of the set while a high standard deviation value indicates that the values comprise a wide range of values that deviate from the average. The GA standard-deviation-based optimisation focuses on minimising the value of the standard deviation of the row currents using the solar insolation data. Minimising the standard deviation values of row currents enhances the stabilisation of the BIPV array and eliminates the multiple peaks and thus maximises extracted power. The following steps needed to be performed to begin the optimisation process. Previous studies proved that GA optimisation enhanced the stabilisation of the PV modules and their power extraction. Consequently, we adopted a GA optimisation method.
A GA can be used in our case because we have changing environmental conditions. Rajan et al. (2017) developed a new GA technique relative to a previous technique developed by Deshkar et al. (2015), and both used the matrix approach [32,36]. Rajan el al.'s (2017) GA technique is less complex, which involves minimising the standard deviation of the row currents. A standard deviation is the average amount of variation within a set of values. A low standard deviation means the values are close to the average of the set while a high standard deviation value indicates that the values comprise a wide range of values that deviate from the average. The GA standard-deviation-based optimisation focuses on minimising the value of the standard deviation of the row currents using the solar insolation data. Minimising the standard deviation values of row currents enhances the stabilisation of the BIPV array and eliminates the multiple peaks and thus maximises extracted power.
The above problem needs to be formulated to define the objective function of the BIPV arrays associated with the BIPV system of the 45 areas to minimise the standard deviation of the row currents, which depends on the individual rows current values. The objective function is, where, fitness(i) is the fitness of the ith element in the current population.
where σ 1 is the standard deviation of individual row currents and N is the number of rows.
where I j is the current of the jth row. The GA code is implemented in Matlab where the optimisation process was conducted. The first phase was the initialisation, where the initial population for the first iteration was selected. The population was the 9 × 5 and 5 × 9 matrices, and each population contained the values of these matrices. As the values of the matrices' elements were already defined as in Figure 13 and they corresponded to the locations in Figure 12, values were rearranged to evaluate the values of the standard deviation for each matrix to find the smallest standard deviation. Then, in the crossover, the values of the 9 × 5 and 5 × 9 matrices were interchanged with other matrices in the population. The next step was the mutation, where the elements inside the matrix were interchanged for a certain probability value. After this step, standard deviation was evaluated for all matrices stored to find the matrix with the lowest standard deviation. After doing so, the first iteration was finished. After selecting the best resulted matrix in the first iteration, the next iteration took place and so on. The GA optimisation process was performed for both matrices to find the best outcome (minimum) standard deviation for the summation of the matrices' rows. Figure 14 shows the iteration progress of the GA optimisation method in identifying the best solution after 100 iterations.  The GA optimisation process was performed for both matrices to find the best outcome (minimum) standard deviation for the summation of the matrices' rows. Figure 14 shows the iteration progress of the GA optimisation method in identifying the best solution after 100 iterations. The GA optimisation process was performed for both matrices to find the best outcome (minimum) standard deviation for the summation of the matrices' rows. Figure 14 shows the iteration progress of the GA optimisation method in identifying the best solution after 100 iterations. The GA technique was reconfigured to the BIPV arrays which were subject to partial shading and the results equalised the pattern of the interconnection between the areas based on their solar insolation to uniformly distribute the partial shading across all the areas. The currents in the rows were the following:  The GA technique was reconfigured to the BIPV arrays which were subject to partial shading and the results equalised the pattern of the interconnection between the areas based on their solar insolation to uniformly distribute the partial shading across all the areas. The currents in the rows were the following: There were 100 iterations for both matrices, and afterwards, the standard deviations for the 9 × 5 matrix and the 5 × 9 matrix were 0.4969 I and 0.5831 I, respectively. Both the I-V and P-V curves show that the mismatch losses and the multiple peaks were reduced, and this affected the power extraction of the BIPV arrays. For the 9 × 5 matrix BIPV arrays, the current based on the solar insolation was equalised in rows one, two, three, and four with 33.5 kWh/m 2 of annual average solar insolation of current in each row. Rows four, seven, and eight had a 34 kWh/m 2 of annual average solar insolation, and rows six and nine had 35 kWh/m 2 and 37 kWh/m 2 of annual solar insolation, respectively. For the 5 × 9 matrix arrays, the solar insolation was equalised more than the 9 × 5 array because it had more element spaces in the rows. Rows one, two, and three had 61 kWh/m 2 of annual average solar insolation each, and rows four and five had 62.5 kWh/m 2 of annual average solar insolation. Figure 15 shows the minimised standard deviations of each row's summation. and rows six and nine had 35 kWh/m 2 and 37 kWh/m 2 of annual solar insolation, respectively. For the 5 × 9 matrix arrays, the solar insolation was equalised more than the 9 × 5 array because it had more element spaces in the rows. Rows one, two, and three had 61 kWh/m 2 of annual average solar insolation each, and rows four and five had 62.5 kWh/m 2 of annual average solar insolation. Figure  15 shows the minimised standard deviations of each row's summation. When the GA optimisation was completed for equalising the rows, power extraction was simulated for both BIPV arrays, and it was found that the average annual power extraction for the 9×5 array as reflected in Table 5 was 169.6 × 103 W of average power during the year while the power extraction for the 5×9 array was 169.4 × 103 W of average power during the year, as illustrated in Figure 16. Optimal results of I-V and P-V curves for both BIPV system configurations. The two charts at the top show the results for the 9 × 5 BIPV array reconfiguration. The two charts at the bottom show the results for the 5 × 9 BIPV array reconfiguration. Table 5. Power output, current, and voltage modelled in Simulink based on the GA configuration of distributing equalised solar insolation within the 9 × 5 and 5 × 9 BIPV arrays. The small difference in power between both matrices is because, in the 5 × 9 matrix, there is more series connection with more solar insolation differences, which causes more current limitation than When the GA optimisation was completed for equalising the rows, power extraction was simulated for both BIPV arrays, and it was found that the average annual power extraction for the 9 × 5 array as reflected in Table 5 was 169.6 × 103 W of average power during the year while the power extraction for the 5 × 9 array was 169.4 × 103 W of average power during the year, as illustrated in Figure 16. Optimal results of I-V and P-V curves for both BIPV system configurations. The two charts at the top show the results for the 9 × 5 BIPV array reconfiguration. The two charts at the bottom show the results for the 5 × 9 BIPV array reconfiguration. Table 5. Power output, current, and voltage modelled in Simulink based on the GA configuration of distributing equalised solar insolation within the 9 × 5 and 5 × 9 BIPV arrays. The small difference in power between both matrices is because, in the 5 × 9 matrix, there is more series connection with more solar insolation differences, which causes more current limitation than in the 9 × 5 matrix. Moreover, the curves of both systems reveal that the GA optimisation method succeeded in equalising the rows to stabilise the BIPV system and to reach the global power extraction without any disturbance or multiple peaks.

× 5 BIPV
Energies 2020, 13, x FOR PEER REVIEW 19 of 24 in the 9 × 5 matrix. Moreover, the curves of both systems reveal that the GA optimisation method succeeded in equalising the rows to stabilise the BIPV system and to reach the global power extraction without any disturbance or multiple peaks. Figure 16. Optimal results of I-V and P-V curves for both BIPV system configurations. The two charts at the top show the results for the 9 × 5 BIPV array reconfiguration. The two charts at the bottom show the results for the 5 × 9 BIPV array reconfiguration.

Discussion
This paper presented a novel methodology for integrating BIM tools with a GA optimisation technique. The results showed a great possibility for power production, as the cumulative solar insolation for the year was 3,117,787,175 Wh for the whole area of the station's roof of 3862 m 2 . The Figure 16. Optimal results of I-V and P-V curves for both BIPV system configurations. The two charts at the top show the results for the 9 × 5 BIPV array reconfiguration. The two charts at the bottom show the results for the 5 × 9 BIPV array reconfiguration.

Discussion
This paper presented a novel methodology for integrating BIM tools with a GA optimisation technique. The results showed a great possibility for power production, as the cumulative solar insolation for the year was 3,117,787,175 Wh for the whole area of the station's roof of 3862 m 2 . The greatest solar insolation values were found in the summer (May-August), while the lowest solar insolation values were found in the winter (November-February). Due to the difference in solar insolation values in the 45 areas of the roof, which are caused by the curvatures of the roof, the performance of the BIPV system arrays is disturbed by partial shading. The GA optimisation technique was used to start arranging the BIPV arrays based on solar insolation values by equalising the solar insolation values in each row of the two proposed BIPV matrix arrangement. In [28] and [37], BIM tools associated with predicting the energy production of the two models were based on the solar insolation values. However, in these studies, there was no partial shading. Consequently, there was no difference in solar insolation values, and the roofs of these models were aligned in a straight manner. By contrast, we had to solve the partial shading issue using an optimisation method, as the BIPV arrays need to be connected in a way that maximises their power extraction under partial shading conditions. The partial shading problem was solved in both [32] and [36] using a GA optimisation method that equalises the rows with the same solar insolation values in a 9 × 9 matrix. However, the solar insolation values in both studies were based on assumptions. The contribution of this work was solving the partial shading problem and dealing with the difference in solar insolation values by importing the results from a BIM tool using the simulated solar insolation values from the actual site location. Moreover, the GA optimisation method was used to best connect the BIPV arrays for the 45 areas in 9 × 5 and 5 × 9 matrix shapes in order to maximise the power extraction of their BIPV modules. The system's component was not included in this paper. This paper solves the problem of the partial shading condition on the BIPV and designs the system based on the solar insolation values of the BIPV so as to not limit the current in the system by using GA optimisation. The system's component and grid connectivity issues will be discussed in our next paper. The optimisation problem in this article aims to determine the optimum power generation of the BIPV system under partial shading conditions. The existing design of the roof and the solar insolation values represent the optimisation problem constraints. The authors have excluded the demand-side of the station as it will not impact the results. In addition, it is notable that the station's operation started less than a year ago and remained under commission during the first two years. The authors are planning to include the station's load profile in a future work when full-year reliable data are available. The curves shown in Figure 16 confirm the improvement in the system's stability and the achievement of the objective of this article to design the BIPV arrays for maximum power production under partial shading conditions without any disturbance to the system. Furthermore, the installation is only done once in the design phase and is based on the resulting system configuration throughout the year. The wire layout can also be optimised to limit current loops and the cables can be shortened.

Conclusions
The concept being adopted is to implement renewable energy technology in one of the most recent major projects in Qatar to mitigate pollution (environmental benefit) and conserve energy sources for export and other uses (economic benefit). The first stage of this paper was to model the station using the BIM software Autodesk Revit and create BIPV modules on the roof of the station. The station's roof is geometrically complex, as there are many curvatures, which can cause partial shading that can disturb the BIPV system arrays. The station's roof was divided into 45 areas and the average yearly solar insolation was simulated for each. These values where used in the GA optimisation process to eliminate differences in the solar insolation values caused by partial shading by uniformly distributing the shading pattern across the areas. Two BIPV array configurations were considered, 9 × 5 and 5 × 9 BIPV system configurations, whose optimisation required the minimisation of the standard deviation of the summation of their rows. This process was conducted to stabilise the current in the rows and eliminate the multiple peaks and the mismatch losses. The power output was modelled in Simulink for which the power for the 9 × 5 BIPV array was 169.6 × 10 3 W, which was slightly higher than the 5 × 9 BIPV array's power output. This is a sign that the GA optimisation method using the actual solar insolation values of the BIPV system succeeded in reaching the global optimum power without any disturbance to the system. In conclusion, the paper has proposed a new methodology for integrating BIM with GA