Mathematical Model for Regular and Irregular PV Arrays with Improved Calculation Speed

Photovoltaic (PV) systems are usually developed by configuring the PV arrays with regular connection schemes, such as series-parallel, total cross-tied, bridge-linked, among others. Such a strategy is aimed at increasing the power that is generated by the PV system under partial shading conditions, since the power production changes depending on the connection scheme. Moreover, irregular and non-common connection schemes could provide higher power production for irregular (but realistic) shading conditions that aere caused by threes or other objects. However, there are few mathematical models that are able to predict the power production of different configurations and reproduce the behavior of both regular and irregular PV arrays. Those general array models are slow due to the large amount of computations that are needed to find the PV current for a given PV voltage. Therefore, this paper proposes a general mathematical model to predict the power production of regular and irregular PV arrays, which provides a faster calculation in comparison with the general models that were reported in the literature, but without reducing the prediction accuracy. The proposed modeling approach is based on detecting the inflection points that are caused by the bypass diodes activation, which enables to narrow the range in which the modules voltages are searched, thus reducing the calculation time. Therefore, this fast model is useful in designing the fixed connections of PV arrays that are subjected to shading conditions, in order to reconfigure the PV array in real-time, depending on the shading pattern, among other applications. The proposed solution is validated by comparing the results with another general model and with a circuital implementation of the PV system.


Introduction
The recent world challenges that are related to environmental and energy subjects have lead photovoltaic (PV) systems to become a competitive option for electricity generation. In recent years, this technology has gained popularity, which is evidenced in the 627 GW installed in 2019 [1] and in some reports that predict a growth of 46% by 2023 [2]. Therefore, it is important to develop procedures for predicting the behavior of such systems under a given operating condition. In this way, it will be reducing the calculation burden of the numerical method that solves the equation. Moreover, the inflection points are also used in order to restrict the search range for the solution of the string current, which considerably reduces the solution time.
The modeling procedures that were introduced in [14,15] allow for modeling a PV array with any size and connected in any connection scheme. Both procedures use the single diode model to represent the modules in a PV panel, and they are based on the circuital nodes and meshes principles to define a system of nonlinear equations that represents the array. That system of equations is solved to finally obtain the global output current of the array for a given voltage; then, performing a voltage sweep, it is possible to calculate the array I-V and P-V curves. However, the solutions of the models proposed in [14,15] require a high number of both mathematical operations and numerical method iterations due to the large search space (voltage and current range), in which the solution must be searched for; hence, the calculation times could be long. Therefore, that general solution could be impractical for some PV application such as: dynamic or static reconfiguration including heuristic methods [16,17] in which the calculation of the power provided by the array must be done in short time; validation and evaluation of Maximum Power Point Tracking (MPP) techniques, as the ones introduced in [18,19], in which optimization algorithms are implemented in order to improve the performance of the control stage in PV systems; or even to provide an optimal design for large PV plants. With the procedure that is presented in [14], a 10 × 5 irregular PV array takes 10 min. and 8 s to be solved for a given irradiance and temperature conditions, while by using the procedure introduced in [15], the time is reduced to 5 min. and 18 s. Despite the improvement in the execution time, in a planning of PV systems or reconfiguration scenario, it could be impractical if several configurations must be evaluated in order to define the best for a given operating condition; moreover, the execution times will increase if a larger array is evaluated.
In the previous literature analysis, two key points are identified. The first one is that there is a lack of fast modeling techniques able to analyze PV arrays in any configuration with any size, since the models proposed in [14,15] require a high number of mathematical operations that imply high execution times. Those high execution times make those models impractical for important applications like reconfiguration, MPPT, or PV array sizing. The second key point is that the inflection points concept has been used to reduce the solution time of SP arrays models; however, the inflection points concept has not been used for models of other PV array configurations or for the general models that are proposed in [14,15]. Therefore, this paper is based on the following hypothesis: it is possible to improve the computation times for analyzing PV arrays with any size and configuration by combining the inflection points modeling technique of [10] with the circuital nodes principle that is presented in [14]. In this way, the new solution provides the same analytical versatility to model any PV array (any size and configuration), but with much shorter processing times. This feature will be useful for reconfiguration techniques, analysis, and design of large PV fields, among others. Moreover, the adoption of the inflection points concept also improves the convergence rate of the general model, which reduced the prediction errors in comparison with the models that were reported in [14,15].
The rest of the paper is organized, as follows: Section 2 describes the mismatching conditions problem, and shows the use of different connection schemes in order to improve the power production; then, Section 3 describes the inflection point concept and usability. Section 4 presents the proposed method for calculating the inflection points of a PV array with any connection scheme, and Section 5 describes the use of those inflection points to efficiently calculate the PV current and power. The performance of the proposed model is evaluated in Section 6, where both the accuracy and speed of the proposed solution are contested with a reference model. Similarly, Section 7 illustrates the use of the proposed model in a reconfiguration application. Finally, the conclusions close the paper.

Mismatching Conditions and Internal Connections in PV Arrays
PV arrays are formed by multiple PV panels that are connected in both series and parallel schemes. Such a connection does not depends on the physical organization of the PV panels in the PV array; for example, the general PV array that is presented at the left of Figure 1 could be connected in different configurations. The same figure presents three electrical configurations that are commonly used in industrial applications: the series-parallel (SP), which considers the panels connected in independent strings, which are then connected in parallel; the total-cross-tied (TCT), which considers a complete interconnection of all the panels; the bridge-linked (BL), which considers a bridge-like structure.
Commercial PV panels include bypass diodes that are connected in anti-parallel with the modules, which protect the module from operating at the second quadrant, i.e., avoiding power consumption and artificial degradation under mismatching conditions, as is reported in [20]. An active bypass diode short-circuits the associated PV module; hence, different connections between the PV modules produce different voltages and currents into the modules, which affect the power that is produced by the PV array. Therefore, depending on the shading profile covering the PV array, some of those connections could provide higher power, as it is discussed in [6]. Therefore, it is convenient to select the connections that enable the PV array to produce the highest power possible. Such a challenge has been addressed in several works. For example, in [21], it was concluded that SP arrays produce higher power for shading profiles, in which all of the array modules experience different levels of irradiance, but the first column has lower levels; while, TCT arrays produce higher power for shading profiles, such short narrow, short wide, or diagonal with irradiance variations from 1000 W/m 2 to 400 W/m 2 [22]. However, according to [23] for combinations of different shading cases such short and long wide at irradiance levels from 200 W/m 2 to 900 W/m 2 , Su-Do-Ku configuration exhibits the best performance when compared to SP and TCT.  However, depending on the array location and the objects around the array, the shading profiles could have regular forms like rectangles or irregular forms with holes and branches. Such different shading conditions are presented in Figure 2 for a real PV installation, where the same PV array could have panels exposed to regular and irregular shades. Hence, under real operating conditions, it is difficult (or even impossible) to define a regular connection (SP, TCT, BL, etc.), providing the highest power possible; instead, those classical configurations will produce a sub-optimal power production, which reduces the installation profitability.
Moreover, commercial PV installations are constructed while using commercial PV panels, which could be formed by one, two, or even three modules that are connected in series; hence, for example, an apparent TCT configuration formed by two-module panels (e.g., a BP585) will not be, in fact, a TCT structure. Besides, some manufacturers offer replacement panels for well-adopted references. For example, the ERDM 85SM/5 PV panel provides the same power and current as the BP585, but the ERDM 85SM/5 only has a single module. Therefore, it is possible to replace some BP585 (two-module panel) with ERDM 85SM/5 (single-module panel) without any inconvenience, but the resulting apparent TCT structure will be, in fact, an irregular configuration, as depicted in Figure 1. Therefore, modeling such real-application cases requires a general model for PV arrays, such as that proposed in [14,15].  Furthermore, the work reported in [15] proposes adopting irregular connection schemes to the PV array to improve the power production under irregular shading conditions. Figure 1 shows an example of an irregular connection scheme (named Irregular), which does not follow any classical configuration (SP, TCT, BL, etc.). Such an irregular configuration enables the PV array of Figure 1 in order to provide a highest maximum power in comparison with the SP, TCT, and BL connection schemes for some irregular shading profiles, as depicted in Figure 3. This figure reports four irregular shading patterns, in which the shade intensity is reported as a percentage (0 % means no shading). The figure also reports the power production of the PV array with SP, TCT, BL, and the irregular connections. For the shading profile of Figure 3a, the irregular connections allow for the highest power production, followed by the SP option; while, the TCT and BL options produce the same power. Under the shading pattern 2 ( Figure 3b) the irregular option also produces the highest power, while SP and TCT produce almost the same power, and BL produces the lowest power. For the shading pattern shown in Figure 3c, SP produces the lowest power, TCT and BL produce the same power, but again the irregular option provides the highest power production. Finally, for the shading pattern shown in Figure 3d, the irregular option also produces the highest power, followed by TCT, BL, and SP.
The previous simulations show that the same PV array, under shading conditions, will produce different power, depending on the connection scheme. Moreover, those results also confirm that configuring the array connections using an irregular scheme could increase the power production in comparison with the classical options (SP, TCT, BL, etc.). Therefore, the general PV array models that were proposed in [14,15] can be used to select the best configuration scheme (regular or irregular) improving the power production, which can be very useful for:

1.
Design the fixed connection of a PV array subjected to shading conditions.

2.
Reconfigure the PV array in real-time to adjust the best connections, depending on the shading pattern, which changes, depending on the sun position.

3.
Design a simulation platform to estimate the power production of any PV array with regular or irregular connections.
However, since there are multiple possibilities for irregular connections, and such a number increases with the size of the PV array, the first two applications require a fast PV model to provide practical calculation times. Similarly, for the third application, fast calculation times are also desirable. Therefore, the following sections describe a modeling approach that is designed to reduce the calculation time of the general PV model without reducing the model precision in comparison with [14,15].

Inflection Point Concept
The main concept that will be used for reducing the processing time of the general model is the inflection point in the I-V and P-V curves. Figure 3 shows the different inflection points occurring in the 12-module PV array operation due to different shading patterns, which activate some of the bypass diodes protecting the modules. The main objective of the PV array model is to calculate the current and power at a given array voltage, which is also needed in order to predict the I-V and P-V curves. Therefore, a previous calculation of the inflection points will allow to narrow the range of the possible solutions for the I-V and P-V data and, subsequently, reduce the processing time that is required by the model.
An inflection point in the I-V curve occurs when a bypass diode is activated. This concept is illustrated while using the two-module string depicted in Figure 4: the string is formed by modules 1 and 2, which are protected by the bypass diodes 1 and 2. In this example, module 2 is affected by a partial shade that reduces the its short-circuit current (i sc2 ) to 40 % of the short-circuit current of module 1 (i sc1 ), which is fully irradiated. The figure depicts, at the bottom-left, the I-V curves of both modules, where the effect of the shade on the second module is observed.
However, the operating points of both modules depend on the string voltage v st and current i st . Moreover, the activations of the bypass diodes depend on the string and modules currents: • If the string current is lower than the short-circuit current of both modules, i.e., i st < i sc2 < i sc1 , which means that both modules could produce the string current, i.e., i pv1 = i pv2 = i st , which imposes null current to both bypass diodes, i.e., i d1 = i d2 = 0 [A]. Therefore, both bypass diodes are inactive, and both modules are active to produce usable power. For the example of Figure 4, when i st < i sc2 , both of the modules are active, despite having different short-circuit currents. • Instead, for the same irradiance and shading pattern, if the string current is higher than the short-circuit current of some modules, i.e., i sc2 < i st < i sc1 , this means that some modules are not able to produce the string current, i.e., i pv2 = i sc2 < i st and i pv1 = i st , which forces the activation of the corresponding bypass diodes, i.e., i d1 = i st − i sc2 > 0 and i d2 = 0. Therefore, some of the modules are inactive to produce usable power, i.e., in the example of Figure 4 the module 2 is short-circuit (inactive) when i st > i sc2 . • Finally, if the string current is higher than the short-circuit current of all the modules, i.e., i st > i sc1 > i sc2 , this means that all of the modules are not able to produce the string current, which forces the activation of all the bypass diodes. Therefore, the PV array is inactive in producing usable power.  In conclusion, the operating condition in which one (or multiple) bypass diode state changes (from active to inactive or vice versa) is known as an inflection point. The currents of the inflection point will enable limiting the possible values of the modules voltages for a given string current, which reduces the search space for the equations solver, as it will be shown in Sections 5-7. Finally, the following section presents a modeling approach to calculate the inflection points for a general PV array with any connection scheme, i.e., regular or irregular connections.

Inflection Points Calculation
This section presents a procedure for calculating the inflection point voltages, also known as inflection voltages, in a PV array with any configuration; an example is also presented in order to illustrate the application of the proposed procedure. The section begins with the explanation of the module model and it continues with the matrix representation of the PV array and its sub-arrays. These two elements are required for explaining the proposed procedure and example.

PV Module Representation
In this paper, each PV module is represented by the single-diode model, since it provides a tradeoff between accuracy and complexity [3]. The equivalent circuit of the single-diode model, including the bypass diode, is shown in Figure 5, where the current source (I ph ) represents the current that is generated by the PV effect, the diode D includes the nonlinear behavior of the PV cells and the resistors R h and R s represent the leakage currents and ohmic losses, respectively. Moreover, the bypass diode (D bd ) is connected at the output terminals of the PV module in order to provide an alternative path for the current when the module is shaded [20]. The module output current (I) can be expressed as a function of the node voltages at the positive (e a ) and negative (e b ) terminals, as shown in (1), where N s is the number of series connected cells that form the module, W 0 (·) is the LambertW function, I sat and I sat,bd are the inverse saturation current of diodes D and D bd , respectively, and V t and V t,bd are the termal voltage of diodes D and D bd , respectively. In turn, V t = n · k · T/q and V t,bd = n bd · k · T/q, where n and n bd are the ideality factors of D and D bd , respectively, k is the Boltzmann constant, q is the electron charge, and T is the module temperature in Kelvin [9].
On the one hand, the five parameters of the SDM (i.e I ph , I sat , n, R s , and R h ) can be calculated from the datasheet information or from experimental I-V curves by using the procedures proposed in [24,25], respectively. On the other hand, the two parameters of the bypass diode (i.e., I sat,bd , n bd ) can be calculated from the experimental measurements, as shown in [20], or from the information in the bypass diode datasheet. In general, the I ph depends on the module irradiance and temperature, I sat and I sat,bd vary with the module temperature, and n, n bd , R s , and R h can be assumed to be constant [3].
When the PV module is in short-circuit, the current that is provided by the module (I sc ) is calculated from (1) replacing (e a − e b ) = 0 [V]. The expression for calculating I sc is introduced in (2), and it is an important parameter that is used in the following sections to calculate the inflection voltages.

Matrix Representation a PV Array and Its Sub-Arrays
A PV array that formed by M columns and N rows, i.e., an N × M array, in any configuration can be represented by a set of matrices. One N × M matrix for each parameter of the SDM and the D bd (M I ph , M Isat , M n , M Rs , M Rh , M Isatbd , M nbd ), one N × M matrix for the short-circuit currents (M Isc ), and one (N − 1) × (M − 1) matrix (named M conn ) in order to represent the connections between the modules of the PV array.
The elements of M conn can be 1 or 0 in order to represent whether there is or not a tie between two consecutive strings of the array. Hence, a 1 in the row r and column c of M conn (M conn (r, c) = 1) indicates that the negative terminal of the modules in row r and column c (module (r, c)) is connected to the negative terminal of the module in row r and column c + 1 (module (r, c + 1)). Instead, M conn (r, c) = 0 means that there is no connection between the negative terminals of modules (r, c) and (r, c + 1).
According to [14], a sub-array is defined as a string or set of strings in the array that are connected to the rest of the array only in the ground and V arr nodes, i.e., the lower and upper nodes. Therefore, there are no additional connections to the left or right of the sub-array. From this definition, it is possible to identify the sub-arrays by finding the columns of zeros in M conn ; thus, each column of zeros in M conn indicates the end of a sub-array and the beginning of the next one. The number of sub-arrays in a N × M array is defined in (3), where N z is the number of columns of zeros in M conn [14].
A vector C z is defined, as shown in (4), in order to identify the first and last column of each sub-array, where the first and last elements are 0 and M, respectively, and the other elements (Z c,1 · · · Z c,N z ) are the column number of each column of zeros in M conn . Subsequently, it is possible to define the first (SA f c,i ) and last column (SA lc,i ) of the sub-array i, as illustrated in (5) [14].  (6), taking into account that all of the sub-arrays have N rows. Finally, the connection matrix of sub-array i (M sa conn,i ) is defined in (7), which takes into account that it has one row less and one column less than the sub-array [14].

Inflection Voltage Calculation for a Sub-Array
An inflection point in the I-V curve of a sub-array is produced by the activation/deactivation of the bypass diode of a sub-array's module. In general, if the current flowing through the module in the row i o and column j o is higher than its short-circuit current (I sc,i o ,j o ); then, the bypass diode is activated to provide an alternative path for the current in excess; otherwise, the bypass diode is inactive (reverse biased) and no current flows through it. The sub-array voltage when the module (i o , j o ) is in short-circuit (i.e., While taking into account that all of the currents in the sub-array decrease as the sub-array voltage increases, the bypass diode of and it is inactive otherwise. In order to calculate V o,i o ,j o , it is necessary to solve the sub-array node voltages, which can be performed independently from the other sub-arrays, as explained in the previous section. The number of nodes in a sub-array (N n ), excluding the ground node (bottom node) and the array voltage (V arr ) node (top node), can be calculated while using (8), where the left term corresponds to the number of node in an SP configuration and the right term is the sum of all the elements in M sa conn . Hence, when considering the top node voltage as unknown (i.e., V arr is unknown), a sub-array has N n + 1 unknown node voltages, i.e., e j ∀ j ∈ [1 · · · N n + 1], which form the unknowns vector, named V n . It is important to note that the top node voltage is e N n +1 , while the others are numbered from top to bottom and from left to right in the sub-array.
The system of N n + 1 nonlinear equations (named F o ( V n )) that are required to calculate V n is obtained by applying the KCL in the first N n nodes and from the 0 V restriction imposed between the positive and negative terminals of the module in short-circuit (i.e., In order to apply KCL in the first N n nodes of the sub-array, it is necessary to identify the node voltages at the positive and negative terminal of each module in the sub-array. This identification is expressed in an N × M sa matrix (M sa nvo ), where the element at row r and column c of M sa nvo (e.g., M sa nvo (r, c) = k) indicates that the voltage at the positive terminal of the module (r, c) is V n (k), or e a (r, c) = V n (k) = e k . Moreover, M sa nvo (r, c) = k also indicates the node voltage at the negative terminal of the module (r − 1, c), since the negative terminal of the module (r − 1, c) is connected to the positive terminal of the module (r, c); hence, Once the voltages at positive and negative terminals of all the modules have been defined with M sa nvo , it is possible to apply KCL to the first N n nodes of the sub-array, where the current of each module is calculated with (1). Moreover, the last equation is obtained from the module in short-circuit condition . Such a condition implies that the voltages of the nodes at the positive and negative terminals of the module (i o , j o ) are the same, as shown in (9).
The connection pattern of each sub-array is defined by M sa conn , as explained in the previous section. Therefore, the structure of F o ( V n ) is not defined by a fixed structure; instead, it is defined by an algorithm that describes how to evaluate F o ( V n ) for a given V n , which is introduced as pseudocode in Algorithm 1. In such an algorithm, i o and j o are the row and column of the module in short-circuit (i.e., I i o ,j o = I sc,i o ,j o ) and i f , l m , r m , n n , n 1 , n 2 are auxiliary variables used to simplify the pseudocode description. The two iterative (for) loops in lines 2 and 3 go over all the sub-array nodes to apply KCL in each one of them. When a new node is found (line 4), the columns of the leftmost (l m ) and rightmost (r m ) modules that are connected to the node are identified. Subsequently, the for loop defined in line 6 evaluates the KCL for all of the modules connected to that node, column-by-column. Lines 7 to 13 and 15 to 25 calculate the current of the module that is connected above and below the analyzed node, respectively, while lines 14 and 26 adds and subtracts the modules' currents in order to construct the KCL colum-by-column. Lines 1 to 31 allow for the evaluation of the first N n elements of F o ( V n ); while, lines 32 to 38 evaluate the last element of F o ( V n ), which shows that the node voltages at the positive and negative terminals of the module in short-circuit condition (i.e., module (i o , j o )) are the same.
The evaluation of F o ( V n ), with Algorithm 1, is used by a numerical method in order to solve V n . From such a solution, the inflection voltage that is produced by the module in row i o and column j o (i.e., V o,i o ,j o ) is defined in (10). Moreover, the nodes voltages V n (k) ∀ k ∈ [1 · · · N n ] are defined as node inflection voltages that are produced by the module (i o , j o ), as shown in (11). if j = 1 OR M sa conn (i, j − 1) = 0 then: 5: Identify l m and r m from M sa conn 6: for modules in the node j c = l m to r m do 7: Set n n = M sa nvo (i, j c ) and e a (i, j c ) = V n (n n ) 8: Set n n = M sa nvo (i + 1, j c ) and e b (i, j c ) = V n (n n ) 9: if i = i o AND j = j o then: 10: Set I i,j c = M sa Isc (i, j c ) 11:

15:
Set n n = M sa nvo (i + 1, j c ), e a (i + 1, j c ) = V n (n n ) 16: if i = N − 1 then: 17: 18: else: 19: Set n n = M sa nvo (i + 2, j c ) and e b (i + 1, j c ) = V n (n n ) 20: end if 21: if i + 1 = i o AND j = j o then: 22: Set I i+1,j c = M sa Isc (i, j c ) 23: else: 24: Calculate I i+1,j c with (1) 25: end if 26: Calculate When considering that all of the modules in the sub-array have bypass diodes, and that the sub-array has N rows and M sa columns, it is necessary to define an N × M sa matrix with all the sub-array inflection voltages (M Vo ), where M Vo (i, j) = V o,i,j , as shown in (12). Similarly, the node inflection voltages are also defined in N n matrices (from M 1 Vno to M N n Vno ), as illustrated in (13).
M Vo is transformed into a vector and sorted ascendantly ( V Vo ) to locate the inflection voltages along the sub-array I-V curve. The matrices M k Vno ∀ k ∈ [1 · · · N n ] are also transformed into vectors and sorted following the same order of V Vo in order to obtain N n vectors: V k Vno ∀ k ∈ [1 · · · N n ]. Subsequently, V Vo and the node inflection voltage vectors can be used in order to define the solution search range of the N n node voltages for a given sub-array voltage, as will be explained in the following section. Finally, the flow chart that is shown in Figure 6 summarizes the procedure to calculate the sub-array and node inflection voltages.

Calculation Example
The procedure described in this section is applied to the 3 × 3 array shown in that is Figure 7 to illustrate its application.  This array has three rows (N = 3) and three columns (M = 3) and, for the sake of simplicity, it is assumed that all of the modules have the same parameters, the cells temperature is 25 • C, and the global irradiance is 1 kW/m 2 . Moreover, the array is described by eight 3 × 3 matrices (M I ph , M Isat , M n , M Rs , M Rh , M Isatbd , M nbd , and M Isc ), and the connection matrix (M conn ), which has 2 rows and 2 columns. M Isc is shown in (14) as an example of the eight 3 × 3 matrices with the array parameters; while, (15) shows M conn for the analyzed array. It can be seen that M conn (2, 1) = 1, since there is a connection between the negative terminals of modules in the second row between columns 1 and 2 (see Figure 7). The other elements of M conn are 0, because there are no additional connections among the array columns.
In (15), the second column only has zeros (i.e., N z = 1 and Z c,1 = 2); then, there are two sub-arrays (N sa = 2) and the resulting vector C z is shown in (16). From C z , are obtained the first and last columns of sub-array 1 (SA1) and sub-array 2 (SA2), as given in (17) and (18), respectively. Moreover, with (17) and (18), it is possible to define the matrices of each sub-array by using (6) and (7). As an example, M sa Isc,1 , M sa Isc,2 , M sa conn,1 , and M sa conn,2 are illustrated in (14) and (15) while using the horizontal braces at the bottom of the matrices.
From Figure 7, it is observed that SA1 and SA2 have three and two nodes, respectively, excluding the ground and V arr nodes; hence, N n = 3 for SA1 and N n = 2 for SA2. For the inflection voltage calculation, the voltage at the top node is also unknown; therefore, V n = [e 1 e 2 e 3 e 4 ] for SA1 and V n = [e 1 e 2 e 3 ] for SA2. While using V n and M sa conn , it is possible to define the matrix M sa nvo of each sub-array, as shown in (19), where M sa nvo,1 corresponds to SA1 and M sa nvo,2 corresponds to SA2.
At this point, all of the parameters of both sub-arrays are defined and the inflection voltages can be calculated. The sub-array and node inflection voltages that are generated by the module in the position (1, 1) of SA1 are calculated by using the Trust-Region Reflective method, which uses Algorithm 1 with  (20) and (21). . Finally, those vectors are used in order to calculate the node voltages; such a procedure will be illustrated in the following section while using a numerical example based on the previous numerical vectors.

Sub-Array and Array Current Calculation Using Inflection Voltages
The main objective of the proposed model is to calculate the array current (I arr ) for a given array voltage (V arr ), which is imposed by the power converter where the array is connected to. When considering that each sub-array can be analyzed independently, this section explains the calculation process for a sub-array current, and the process to calculate I arr from the currents of all the sub-arrays.

Sub-Array Current Calculation
The objective of this section is to provide a procedure for calculating the sub-array node voltages, for a given V arr , with a restricted search range in order to reduce the calculation time.
The number of nodes in a sub-array, excluding ground and V arr nodes, is defined in (8), naming the nodes from top to bottom and from left to right. Subsequently, it is necessary to construct a system of N n nonlinear equations (F( V)) by applying KCL in the N n nodes of the sub-array, where V is the vector formed by the N n unknown node voltages, i.e., V = [e 1 · · · e N n ]. As explained in the previous section, the evaluation of F( V) must be defined by an algorithm, since the structure of F( V) is defined by M sa conn . Such an algorithm was proposed in [14] and it is described in Algorithm 2, where i f , l m , r m , and n n are auxiliar variables that are used to simplify the pseudocode description. Moreover, the matrix M sa nv contains the node voltage number of the negative terminals of the first N − 1 modules in each column; therefore, M sa nv (r, c) = k indicates that the node voltage at the negative terminal of the module in row r and column c is V(k), i.e., e b (r, c) = V(k). Algorithm 2 is used by a numerical method in order to evaluate F( V) and calculate V. The time that is required to obtain such a solution can be considerably reduced by providing a search range, for each element of V, to the numerical method. Therefore, this paper proposes a method to define the search range of V from the sub-array and node inflection voltages. Calculate I i,j c with (1) and 14: end if 15: Calculate I i+1,j c with (1) and end for 17: end if 19: end for rows 20: end for columns 21: Return F( V n ) In a sub-array, the voltages of all the modules increase as V arr increases, since V arr is distributed along the modules in the sub-array columns. As consequence, all the sub-array node voltages also increase as V arr increases. Combining this behavior with the sub-array ( V Vo ) and node ( V k Vno ∀ k ∈ [1 · · · N n ]) inflection voltages, defined in the previous section, it is possible to restrict the search range of the sub-array node voltages for a given V arr .
The first step is to identify the smallest sub-array inflection voltage ( V Vo (k)) that is higher than V arr , i.e., V arr < V Vo (k). Subsequently, when considering that V Vo (k) is sorted ascendantly, it is possible to bound V arr with two sub-array inflection voltages: V Vo (k − 1) < V arr < V Vo (k). Taking into account that the vectors of the node inflection voltages ( V k Vno ) are organized in the same order of V Vo , then the search range of the node voltages is defined, as given in (22), where e 1 · · · e N n are the sub-array node voltages (excluding both top and bottom nodes), named with the same order used in the previous section, i.e., from top to bottom and from left to right.
The upper and lower bounds that are provided in (22) can be used by a numerical method to reduce the time for solving V. Once V is solved, the sub-array current is calculated by adding the currents of the modules in the first row of the sub-array, as shown in (23).

Calculation of the Array Current
The procedure that was described in the previous section is used to obtain the currents of all the sub-arrays. Subsequently, the array current is calculated as the sum of all the sub-arrays currents, as illustrated in (24), where N sa is the number of sub-arrays. Evaluating (24) provides a point in the array I-V curve for a given V arr : (I arr , V arr ); then, the array I-V curve can be constructed by performing a voltage sweep of V arr and calculating the corresponding values of I arr . Finally, the P-V curve is easily obtained from the I-V data, which enables predicting the power production of the array.

Calculation Example
This example considers the same array that was introduced in Section 4.4, and the objective is to calculate I arr for V arr = 15 [V] to illustrate the definition of the search bounds for the node voltages in each sub-array. SUbsequently, the example shows the I-V curves of SA1, SA2, and whole array, as well as the array inflection voltages for each sub-array.
In this example, I arr = I sa,1 + I sa,2 according to (24), therefore, the first step is to find I sa,1 and I sa,2 for V arr = 15 [V]. In the SA1, the smallest sub-array inflection voltage that is higher than V arr = 15 [V] is V Vo (3) = 19.358 [V]; then, V Vo (2) < V arr < V Vo (3) and k = 3. From this analysis, the search range of the node voltages is shown in (25), where the components of the vectors V 1 Vno , V 2 Vno and V 3 Vno were defined in Section 4.4.
In this paper, the vector of the node voltages V is calculated using the Sequential Quadratic Programming algorithm, which uses the search range that is defined in (25)  The array I-V curve can be generated by repeating this process for different values of V arr . The I-V curves of SA1, SA2, and the entire array, are depicted in Figure 9a, Figure 9b, and Figure 9c, respectively. In the I-V curves of both sub-arrays, the sub-array inflection voltages are marked with red circles while using the legend SAIVs.
From Figure 9, it is evident that constraining the search space to the voltage range between the closest inflection points, instead of the voltage range between 0 [V] and the open-circuit voltage of the array, provides much less options to the Sequential Quadratic Programming method, which improves the calculation time, since every option evaluated by that method will be much closer to the final solution.
The following section provides a performance evaluation of this method in order to demonstrate the speed improvement that is provided by the proposed solution.

Performance Evaluation
In this section, the proposed model is compared with the model that was introduced in [14] (from here on reference model) in terms of the errors in the prediction of the array current and the computation time that is required to generate I-V curves. For all of the analyses, the ERDM 85SM/5 PV panel is used to generate the arrays; hence, the same SDM parameters that are defined in Section 4.4 are considered for the simulations.

Errors in the Current Prediction
In this analysis, two arrays are considered to evaluate the current error of the proposed and reference models with respect to the circuital implementation of the arrays in Matlab/Simulink (from here on circuital model). The proposed and reference models are both programmed in Matlab and solved with the function "fmincon" configured with "sqp-legacy" algorithm to provide a fair comparison. For the reference model, the lower and upper bounds for each node voltage are defined as −1 [V] and the array open-circuit voltage (V oc,arr ), respectively; while, for the proposed model, the lower and upper bounds of the node voltages are defined, as shown in Section 5 from the inflection voltages calculated, as explained in Section 4.
The two arrays are formed by three columns and two sub-arrays, as in the calculation example of  Figure 10 shows the I-V curves for the two evaluated arrays and Figure 11 introduces the errors in the current estimation of the proposed and reference models, regarding the circuital model. In Figure 10a, it can be observed that the proposed and reference models provide the same I-V curve for the 5 × 3 array, which is reflected in the same current errors, as illustrated in Figure 11a and the same value of the normalized sum of squared errors (NSSE) obtained for both models (0.0015%). For the 10 × 3 array, the I-V curves that are obtained with the proposed and reference models are almost the same (see Figure 10b); however, the reference model has significant errors around the second knee (between 105 [V] and 115 [V]), as shown in Figure 11b. Those errors can be evidenced in the NSSEs that were calculated for both I-V curves, which correspond to 0.0012% and 0.0027% for the proposed and reference models, respectively. Additionally, it is important to highlight that the proposed model provides similar NSSE values for the two arrays, demonstrating that it fits the circuital model.

Calculation Time for Different Number of Rows
The proposed and reference models are simulated for arrays formed by two sub-arrays and increasing the number of rows from three to fifteen in order to evaluate their calculation times. The structure of the arrays is the same used in the previous section; therefore, the matrices M conn and M I ph are generated as explained before. The I-V curve of each array is calculated ten times in order to calculate its average value and standard deviation, which are introduced in Table 1 and shown graphically in Figure 12.
From the calculation times that are shown in Table 1 and Figure 12, it can be observed that the reference model is faster than the proposed model for a small array (three rows). This behavior can is expected due to the additional calculations that are required to obtain the inflection voltages. However, for arrays with four rows or more, the calculation time of the proposed model is less than the one of the reference model. Moreover, Figure 12 shows that the calculation time of the proposed model is approximately linear regarding the number rows; while, the calculation time of the reference model has a significant increment in the slope for arrays with more than nine rows. Hence, the results in Table 1 and Figure 12 illustrate the reduction in the calculation time that was obtained by defining the upper and lower bounds of the sub-arrays node voltages from the calculation of the inflection voltages.

Application Example: Reconfiguration of Pv Arrays
In this section, the proposed model is used for a basic model-based reconfiguration PV array in order to illustrate its usefulness to model arrays in different configurations and the advantages of the reduction in the calculation time. The array that is considered in this section is formed by ERDM 85SM/5 modules; then, the SDM parameters that are defined in Section 4.4 are used. Figure 13 illustrates the array structure, which is formed by three columns of fourteen modules each. Twelve modules are reconfigurable through the five switches that are shown in Figure 13, which are controlled by the reconfiguration algorithm. The rest of the array is fixed and the connections between the columns are also illustrated in Figure 13. This strategy is used to reconfigure only the array section that is subjected to partial shading without introducing reconfigurable switches that will not be used. A previous example of this strategy was reported in [26].
For the example, it is assumed that the reconfiguration system evaluates all of the possible arrays that can be implemented with the five switches to find the best configuration. Hence, considering that there are five switches, there are 2 5 possible configurations to evaluate. For each possibility, the reconfiguration system calculates the I-V and P-V curves (with voltage steps of 1 [V]) using a model to identify the global maximum power point (GMPP). Moreover, those calculations should be performed as fast as possible due to the shading profiles over the array change with the time due to the paths of the sun in the sky. Additionally, the time that is srequired to evaluate the 32 configurations determines the minimum update period of the reconfiguration system.
The reconfiguration system is evaluated for three shading profiles that are defined with the matrix M I ph . Table 2 introduces the elements of M I ph for the reconfigurable part of the array, while the elements of M I ph for the fixed part of the array are defined as 2.5668 [A], i.e., for the first two columns M I ph (a, b) = 2.5668 [A] ∀ (a ∈ [7 · · · 14] ∧ b ∈ [1 · · · 2]) and for the last column The 32 possible configurations are evaluated while using the proposed and reference models for each shading profile to compare their calculation times and determine the minimum update period of the reconfiguration algorithm. Table 3 intorduces the calculation times for both models, which shows that the proposed model is between 1.8 and 2.1 times faster than the reference model. Such differences in the computation times results in a reconfiguration period of 20 [min] and 40 [min] with the proposed and reference models, respectively. Therefore, a reconfiguration system with the proposed model may reconfigure the array a double number of times with respect to a reconfiguration system with the reference model. Such an increment in the number of reconfigurations is translated into a better mitigation of the mismatching effects and an increment in the array power production.

Conclusions
A mathematical model for regular and irregular PV arrays, based on the inflection points concept, has been proposed. In this model, the array is divided into sub-arrays that are solved independently, which simplifies the model calculation. The main contribution of this model is the reduction of the processing time by using the inflection point concept to limit the search range of the node voltages in the solution of each sub-array, which enables analyzing larger arrays in the same time interval when compared with a previously published model.
Another contribution of the paper is the pseudocode that was developed to evaluate the system of nonlinear equations (F o ( V n )) for any regular or irregular configuration, which is used by a numerical method to calculate the sub-array inflection voltages for a given module in short-circuit. Moreover, the paper also provides an algorithm for calculating all of the sub-array inflection voltages, which are organized into the N n + 1 matrices (M Vo and M k Vno ∀ k ∈ [1 · · · N n ]), where N n is the number of nodes in the sub-array. From these matrices, the paper proposes a procedure for generating N n vectors (V k Vno ∀ k ∈ [1 · · · N n ]), which are used to define the upper and lower bounds of the solution of each sub-array node voltage. Those procedures are clearly illustrated through a calculation example of a small array that formed by two sub-arrays, which are useful for implementing the model in any programming language or platform.
The proposed model was evaluated by comparing its calculation time and estimation errors with the ones of the general model that was proposed in [14], which was defined as reference model. Both the proposed and reference model were solved while using the same numerical method to provide a fair comparison. Moreover, the estimation errors in the PV current of both methods were evaluated in contrast with the results provided by the circuital implementation of the same PV arrays using Simulink. In those tests, the proposed model reproduced the I-V curves of 5 × 3 and 10 × 3 arrays with a normalized sum of squared errors (NSSE) of 0.0015% and 0.0012%, respectively; while, the reference model obtained NSSE values of 0.0015% (5 × 3) and 0.0027% (10 × 3). Those NSSE results show that the proposed model reproduces, with higher accuracy, the larger PV arrays in comparison with the reference model. Such an improved convergence is achieved, in the proposed model, by reducing the search range of the node voltages by means of the inflection points calculation.
The calculation times of the proposed and reference models were evaluated with arrays that formed by three columns and a different number of rows. The calculation times of the proposed model were shorter for arrays with more than three rows, and those times grow linearly with the number of rows. Instead, the calculation times of the reference model grow exponentially with the number of rows, which put into evidence the improvement of the proposed solution over the reference general model: a faster and accurate model for estimating the power production of PV arrays under any electrical configuration and shading conditions.
The usefulness of the proposed model was also illustrated with a simple reconfiguration system that evaluates all of the possible configurations in order to determine the one with the highest power production. The reconfiguration system with the proposed model was approximately two times faster than the reference model for that particular case, but higher differences will appear for larger PV arrays. Such an increment in the calculation speed results in a reduction in the reconfiguration period and, consequently, an increment in the array power production along the day, since the best configuration is updated more frequently.
The only disadvantage of this new model, in comparison with the reference general model, concerns the additional memory that is required to store the matrices needed to calculate the inflection points. Therefore, a future development must be needed to reduce the memory requirements of the model, which could be focused on reallocating the memory that was used in the inflection points calculation to be used in the PV current calculation; hence, reaching the same memory requirements of the reference model. Another important future study concerns the implementation of the proposed model on embedded devices, which requires algorithms that are optimized for small platforms. Such a development is needed in order to deploy reconfiguration platforms that are based on the proposed fast model. Finally, the model is restricted to rectangular array configurations; therefore, all of the strings must have the same number of modules, which is a common practice in commercial PV installations. However, residential PV arrays could be formed by strings with a different number of modules due to roof space limitations; hence, a future study must consider the extension of the proposed model to support those kinds of PV arrays.