1 Introduction

Distributed photovoltaic generators (DPGs) are an independent power source for demand-side locations with low generation capacity. The advantages of DPG are low carbon emissions, flexibility, low cost, cleanliness and high efficiency, which encourage its adoption as a multifunctional energy source. On July 7, 2015, National Development and Reform Commission and National Energy Administration of China launched the “Guiding Opinions on Promoting Development of Smart Grid”. The policy indicated that extensive access and effective interaction of DPG should be expanded to realize resource optimal distribution and energy structure adjustment [1].

The advantages of DPG are obvious. However, the distribution network is easily disrupted by the instantaneous and random fluctuations due to the randomness of large-scale photovoltaic power output, especially in the medium/low voltage network. It will cause a serious threat to system stability. Currently, there are three methods to solve the problem: pre-planning, network control and utilizing energy storage systems (ESSs). The first method is only applicable for new lines and the weak automation of lines below 10 kV in China is not conducive to the second method. Accordingly, the majority of research is aimed at ESS either alone or combined with the first two methods. Reference [2] considers the technical and economic performances of battery energy storage in active distribution networks with renewable energy access using the EnergyPLAN software. Reference [3] proposes a quasi-automated generation control (QAGC) strategy to coordinate multiple ESSs, responding to grid dispatch commands. Reference [4] establishes a new battery energy storage system (BESS) operation strategy, which is an optimal planning model of BESS in active distribution systems based on a cost-benefit analysis. Reference [5] considers a mobile BESS with an optimal sizing method based on reliability evaluation. Reference [6] analyzes the prediction errors of the output of DPG and loads to calculate ESS capacity. Reference [7] proposes a unified DPG/ESS system to mitigate the fluctuation of DPG. Reference [8] combines spectral analysis of DPG output and a low-pass filter to optimize ESS capacity. Reference [9] uses the genetic algorithm and sequential quadratic programming to allocate ESS capacity within a network with DPG. Reference [10] does the same by developing assessment indices based on the probability of loss of power supply and the percentage of energy excess. Reference [11] demonstrates a wind-solar-battery hybrid system model based on achieving the maximum match between the planned and actual power output curve of the system.

The above research has made contributions to reduce the negative impact of DPG in the network. The allocated ESS capacity covered approximately 30% of renewable energy capacity in [9,10,11,12,13,14]. The following strategies can be used to improve the efficiency of ESS allocation and reduce the cost of operation: 1) the penetration capacity of DPG in distribution networks should be boosted through the development trend of renewable energy without changing the network structure; 2) more accurate indices for capacity allocation can be obtained by analyzing the measured demand of distribution lines; 3) ESS capacity is better be classified by different features, and each class is adopted by different mechanisms to match the real-time power deviation on different time scales.

This paper focuses on the actual medium/low voltage distribution lines with DPG, and proposes a strategy for ESS capacity allocation based on the discrete Fourier transform (DFT). The DFT describes the characteristics of ESS clearly, which helps dispatch ESS conveniently and achieves power control with minimum deviation. The rest of the paper is organized as follows. Section 2 analyzes the impact of DPG on power flow in the lines through a specific index. In Sect. 3, the ESS capacity is classified into 6 classes, and these are controlled by DFT in different time scales to smooth the saw tooth power based on the deviation between the measured and planned power of the lines. Meanwhile, a reliable model for the stochastic output of DPG is established by Latin hypercube sampling. Section 4 presents numerical studies to verify the suitability of the strategy. Finally, Sect. 5 draws the conclusions.

2 Impact of DPG on power flow in distribution networks

Power flow reflects the operational state, security and reliability of power supply in a grid. The structure of the traditional medium/low voltage distribution network is incompatible with DPG, so its power flow is redistributed by high penetration of DPG. When the power flow varies greatly, the deviation of node voltage and system frequency is increased, reverse power flow may occur, and the range and sensitivity of relay protection are changed. These changes will cause inferior power quality, larger line losses, equipment malfunctions and other effects on the normal operation of distribution automation.

In this paper, the fluctuation rate of power outflow (\(f_{P}\)) is introduced into feeders to express the extent of power variation. \(f_{P}\) is given by:

$$f_{P} = \frac{{\sqrt {\frac{1}{N - 1}\sum\limits_{i = 1}^{N} {(P_{it} - \bar{P}_{it} )^{2} } } }}{{\left| {\bar{P}_{it} } \right|}} \times 100\%$$
(1)

where \(P_{it}\) is the instantaneous value of the power outflow in time period t; \(\bar{P}_{it}\) is the mean power during t. In order to describe \(f_{P}\) in a day precisely, t is 15 min and the instantaneous power is measured every 4 s, so the number of measurements per period N is equal to 225. A higher value of \(f_{P}\) indicates a greater fluctuation of power flow and a worse quality of power supply.

Three real distribution lines are taken as examples for research. Their relevant parameters are shown in Table 1. This paper considers an extreme case: there is only one large-capacity DPG connected to a line, so the impact of photovoltaic volatility to the line is the worst and a counter flow may occur. This situation had the most demand for ESS capacity.

Table 1 Parameters of three real distribution lines

This section focuses on line CY, the schematic of which is shown in Fig. 1.

Fig. 1
figure 1

Schematic of line CY

A DPG with 9 MW capacity is connected to the central part of CY. The DPG output data is recorded by a photovoltaic power station on a sunny day and a cloudy day in July in Foshan, Guangdong. The sampling frequency of the raw data is 4 s, so there are a total of 21600 sample points in a day. The DPG output curves are shown in Fig. 2.

Fig. 2
figure 2

Output curves of DPG with 9 MW capacity

The power curves at the head node (number 1) under three test cases are presented in Fig. 3. This paper studies the impact of DPG on the network primarily, and the correlation between load and weather is neglected: the same underlying load curve is used for all three cases. In the simulation of this paper, the DPG is the only power source connected to the line, which is to simulate an extreme concentration of DPG. If the method in this paper can compensate power flow fluctuations well in extreme situations, it proves that the method can be applied in practice. There is power backflow when large-scale DPG accesses the distribution network or when DPG is the only power source on the line. Comparing the three curves, the fluctuation of DPG changes the original power curve greatly.

Fig. 3
figure 3

Impact of DPG in line CY

The fluctuation rate \(f_{P}\) for different capacities of DPG in CY during a day is shown in Fig. 4.

Fig. 4
figure 4

\(f_{P}\) for different capacities of DPG in CY

From Fig. 4, on the sunny day, the average of \(f_{P}\) is 3% and the maximum value is 6% when no DPG is in CY. After connecting a 9 MW DPG, the average of \(f_{P}\) is up to 51% and the maximum value climbs to 165%. With increasing capacity of DPG, both the average and the maximum of \(f_{P}\) are raised rapidly. In summary, the impact of DPG in medium/low voltage distribution networks cannot be ignored. Without other generators and with no supply from the external network, the line needs an advanced allocation strategy for ESS capacity to help a single DPG to supply stable power.

3 Energy storage allocation

Distribution system operators (DSOs) hope that the power at the head node in distribution lines can flow as the day-ahead schedule curve, which not only reduces \(f_{P}\), but also ensures the economics and reliability of the power supply. ESS can compensate the randomness of DPG and remove the fluctuations from the measured power so that it equals the planned power. Since ESS is expensive, the allocation of ESS capacity should considered the required power and energy output.

The objective of the proposed control strategy is no deviation between the measured power and the planned power at the head node of lines. This determines the actual required capacity of ESS. The main procedures are as follow:

  1. 1)

    ESS capacity is categorized into 6 classes by different features. Then these classes are deployed at certain times of a day to reduce investment. The dispatching principle is based on the deviation between the measured and planned power of the line.

  2. 2)

    Because it is not possible to select the appropriate class directly in the time domain, spectral analysis is used to describe the most prominent characteristics of ESS capacity in frequency domain. Specifically, DFT is used to transform the required ESS capacity from the time domain to the frequency domain. The result is matched with the 6 classes, so the real capacity of each class can be obtained by the frequency-time transform.

  3. 3)

    A multiple-case model is established by Latin hypercube sampling combined with Cholesky decomposition to simulate the randomness of DPG precisely. However, this approach will produce a large number of scenarios which makes sequential calculation inefficient, hence the backward reduction method is used to cut down the generated scenarios.

3.1 Energy storage characteristics

The application of ESS is similar to adding a buffer unit with storage function into the distribution network, which can turn a rigid grid into flexible one [13]. There are great varieties of ESS. The kind of ESS that a DSO uses must depend on the particular situation. In all cases, the most fundamental characteristic of ESS is response time.

According to this feature, ESS can be organized into two major categories: power-type (PT) and energy-type (ET), as shown in Table 2. The response time of PT ESS is seconds to minutes, which is characterized by high specific power, fast response speed and long cycle life, but its storage capacity is low. The response time of ET ESS is minutes to hours, which is characterized by high specific energy, but its power density is small, charging-discharging efficiency is low. Therefore, there is a great complementary and economical superiority in combining both ESS types [14]. To ensure the continuity of dispatching, ESS capacity is divided into 6 classes in order of response time. Response times are compared in the frequency domain to distinguish easily between classes. Because the response time is 1/4 of total time [15], the reciprocal of frequency domain of each capacity is fourfold of the response time, as shown in Table 3 [16], where SMSE stands for superconductor magnetics energy storage.

Table 2 Characteristics of ESS
Table 3 Classification of ESS capacity

3.2 Dispatching strategy

The key to scheduling different kinds of ESS capacity is to obtain the required operational capacity. This is defined as the deviation between the measured and planned power of lines in a day. The required operational capacity is \(P_{R}\):

$$P_{R} = P_{i} - P_{i0}$$
(2)

where \(P_{i0}\) is the planned power and it is calculated from historical data in combination with the day-ahead schedule; \(P_{i}\) is the measured power and it is the difference between the real-time load value and the output of DPG, allowing for line loss. If \(P_{L}\) is the load, \(P_{loss}\) is the line loss and \(P_{G}\) is the output of DPG, then

$$P_{i} = P_{L} + P_{loss} - P_{G}$$
(3)

The proposed scheduling strategy determines the flow hourly, taking account of the following points: 1) the charge-discharge of ESS is alternated as few times as possible; 2) the flow follows a piecewise-linear curve as DSOs prefer; 3) the output of DPG and the daily power curves are divided into 12 intervals for this study. As shown in (4), \(P_{i0}\) is the average planned power in each interval and it can be adjusted based on the actual situation.

$$P_{i0} = \frac{1}{T}\int_{0}^{T} {P_{i} \text{d}t} \pm P_{A}$$
(4)

where \(P_{A}\) is the adjustment value and T is the length of each interval that equals two hours.

3.3 DFT

The DFT can convert a time signal into a frequency signal in which some patterns can be more easily recognized. The expression for the DFT is:

$$Y(n) = \sum_{k = 0}^{N - 1} {y(k){\text{e}}^{{ - {\text{j}}\frac{{2\uppi}}{N}kn}} }$$
(5)

where \(Y(n)\) is the frequency signal; \(y(k)\) is the time signal; N is the number of data samples. The indices of the samples in the time and frequency axes are k and n respectively. For the time axis, the interval between the adjacent sampling points of \(y(k)\) is \(T_{\text{s}}\), thus \(kT_{\text{s}}\) is the time of sample k. For the frequency axis, the frequency of \(Y(n)\) is fs, where \(f_{s} = {1 \mathord{\left/ {\vphantom {1 {T_{\text{s}} }}} \right. \kern-0pt} {T_{\text{s}} }}\), hence \(f_{s} n/N\) is the actual frequency of n until \(n = {N \mathord{\left/ {\vphantom {N 2}} \right. \kern-0pt} 2}\) (after that frequencies should be interpreted as negative and do not contain new information when \(y(k)\) is real). The relative value of spectral components is used for spectral analysis and pattern recognition [17], and with proper calibration the absolute amplitude is useful for other practical applications.

Each ESS capacity can be identified by matching frequency intervals with \(P_{R}\) in the frequency domain. Parsevals’ theorem gives that the energy of a signal in the time domain is equal in the frequency domain. Consequently, the real capacity \(P(f_{1x} ,f_{2x} )\) of each class in Table 3 is:

$$P\left( {f_{1x} ,f_{2x} } \right) = \sqrt {\sum_{{n = f_{1x} }}^{{f_{2x} }} {\left| {Y\left( n \right)} \right|^{2} } } \qquad x = 1,2, \ldots ,6$$
(6)

where \(f_{1x}\) and \(f_{2x}\) are upper and lower bounds of frequency interval of each class of ESS, respectively.

3.4 Latin hypercube sampling

The traditional method to establish a multiple-case model for describing the stochastic nature of DPG, which generates corresponding random numbers by over-sampling, is inefficient and has low accuracy. Latin hypercube sampling [18] with Cholesky decomposition [19] can overcome the above disadvantages. Additionally, the excess generated scenarios are reduced by the backward reduction method [20]. The method includes the following steps.

  1. 1)

    Generation. The probability distribution of photovoltaic output can be fitted to normal distribution approximately.

Step 1: It is assumed that there are K independent random variables \(X_{1} , \, X_{2} , \, \ldots , \, X_{K}\). Moreover, the cumulative distribution function (CDF) of each \(X_{k}\) is \(Y_{k}\), and the total number of samples is N.

Step 2: The longitudinal axis of the CDF is divided into N equal but non-overlapping intervals. The mid-points of the intervals are the calculation points, and the inverse function of the CDF is applied to them to obtain the generated sample values:

$$X_{kn} = Y_{k}^{ - 1} \left( {\frac{n - 0.5}{N}} \right)$$
(7)

where \(X_{kn}\) is located at the kth row and the nth column of the sample matrix \(\varvec{X}_{S}\). The sample matrix \(\varvec{X}_{S}\) is:

$$\varvec{X}_{s} = \left[ {\begin{array}{*{20}c} {X_{11} } & {X_{12} } & \ldots & {X_{1N} } \\ {X_{21} } & {X_{22} } & \ldots & {X_{2N} } \\ \vdots & \vdots & {} & \vdots \\ {X_{K1} } & {X_{K2} } & \ldots & {X_{KN} } \\ \end{array} } \right]$$
(8)
  1. 2)

    Permutation. The elements in each row of \(\varvec{X}_{S}\) are sorted under a certain rule to eliminate the correlation between them.

Step 3: A matrix \(\varvec{L}\) is established to create the layout rule, in which rows comprise a series of random numbers from 1 to N and the dimension is same as that of \(\varvec{X}_{S}\).

Step 4: The correlation matrix \(\varvec{\rho}_{\varvec{L}}\) of \(\varvec{L}\) is computed, and then \(\varvec{\rho}_{\varvec{L}}\) is decomposed by Cholesky decomposition:

$$\varvec{\rho}_{\varvec{L}} = \varvec{DD}^{\text{T}}$$
(9)

Step 5: The sequence matrix \(\varvec{G}\) is solved by:

$$\varvec{G} = \varvec{D}^{ - 1} \varvec{L}$$
(10)

Step 6: The locations of elements in each row of \(\varvec{L}\) are rearranged in order of the size of corresponding elements in \(\varvec{G}\), which is to eliminate the connection between rows of \(\varvec{L}\), and the locations of elements in \(\varvec{X}_{S}\) are rearranged in order of the indices in \(\varvec{L}\).

  1. 3)

    Reduction. The generated scenarios are reduced to N* through the backward reduction method.

Step 7: The probability distance \(P_{S}\) is calculated for each pair of scenarios, and the minimum \(P_{S}\) is obtained.

Step 8: The scenarios with the minimum \(P_{S}\) are eliminated. Next, the remaining \(P_{S}\) is renewed. Step 7 to Step 8 is repeated until the number of scenarios is the required N*.

3.5 Process of ESS capacity allocation

  1. 1)

    The measured and the planned power of the line are obtained by (3) and (4).

  2. 2)

    The operational required capacity is computed according to (2) and then it is transformed into the frequency domain by (5).

  3. 3)

    The 6 classes of ESS capacity are determined in frequency bands and the capacity of each class is calculated by (6).

  4. 4)

    The simulated scenarios are built by Latin hypercube sampling with Cholesky decomposition.

  5. 5)

    The generated scenarios are reduced to a specified number by the backward reduction method.

  6. 6)

    According to the index \(f_{P}\), the results of ESS capacity allocation are evaluated.

4 Simulation analysis

Numerical simulations are conducted on lines CY, LC and YX by MATLAB to verify the effectiveness of the proposed strategy. A 9 MW DPG is connected in the middle of each line. Because of space limitations, this section illustrates the process of ESS capacity allocation of CY in detail for one day in July and then during a year, and only presents the results of the others for one day in July.

4.1 Sunny weather

The measured and planned power curves at the head node of CY on a sunny day are shown in Fig. 5.

Fig. 5
figure 5

Measured and planned power of CY on a sunny day

The corresponding required operational capacity curve is the deviation between the measured and planned power. It is shown in Fig. 6.

Fig. 6
figure 6

Operational required capacity of CY on a sunny day

The time domain function in Fig. 6 is transformed to the frequency domain by (5), and the real capacity of each type is determined by (6). The results of capacity allocation are presented in Fig. 7, where the numbers of each ESS class correspond to the classification in Table 3.

Fig. 7
figure 7

Real capacity of ESS of CY on a sunny day

The first two classes are sufficient to eliminate the power variations in the night (00:00–09:00 and 17:00–24:00) and the first four are used to smooth the fluctuations in the daytime (09:00–17:00). As for the last two, they are set to be the backup capacity. According to the principle of ESS classification in Table 3, the first three are PT (it can be seen in Fig. 7 that their total capacity is 1.01 MW) and the fourth is ET (its capacity is 0.57 MW). The night capacity and daytime capacity of ESS are 0.68 and 1.58 MW, and their percentages compared to the DPG capacity are 7.56% and 17.56%.

The upper limit of stored energy at maximum charging capacity of the ESS is 1.58 MWh, and the lower limit is 0 MWh. The midpoint of these limits is set to be the initial state of charge of the ESS to ensure it does not go outside the bounds during operation. The operational curve is the charge-discharge curve of the ESS. When the actual power is greater than the planned power, which means that the load is too high, the ESS discharges to compensate the extra load and the operational curve fall. When the actual power is less than the planned power, proving that the load is insufficient, and the ESS should charge to absorb excess energy. The resulting operational curve is shown in Fig. 8.

Fig. 8
figure 8

Operational curve of ESS of CY on a sunny day

Figure 8 indicates that the operational curve of ESS does not exceed limits on the sunny day. The ESS alternates between charge-discharge 18 times. If the flow is modified hour by hour, this increases to 47 times. Accordingly, if the ESS control interval is too short, the number of charge–discharge alternations will surge and this may reduce the ESS lifetime. This result indirectly shows that it is reasonable to fix power flow every two hours in this paper.

For this case, the \(f_{P}\) is recalculated and compared with the same situation but without ESS in Fig. 4. As Fig. 9 shows, the ESS drops \(f_{P}\) to zero, which proves that the measured power of CY is modified to equal the planned power at all times.

Fig. 9
figure 9

Comparison of \(f_{P}\) of CY on a sunny day

Finally, 1000 scenarios on a sunny day are generated by Latin hypercube sampling with Cholesky decomposition, and then reduced to 10 by the backward reduction method. As Table 4 displays, there is a strong correlation between the generated scenarios and the original scenario.

Table 4 Correlation between generated and original scenarios

The results of ESS capacity allocation of these 10 scenarios are described in Table 5, which proves that the proposed strategy compensates the randomness of DPG.

Table 5 ESS amounts and percentage of each scenario

4.2 Cloudy weather

It is worthwhile to note that the volatility of power flow may be more serious during periods of cloudy weather than during sunny weather as in Fig. 4, thus ESS capacity allocation in cloudy weather also needs to be considered. The measured and planned power at the head node of CY on a cloudy day are depicted in Fig. 10.

Fig. 10
figure 10

Measured and planned power of CY on a cloudy day

The same method is used to acquire the capacity requirement for the 6 classes of ESS on a cloudy day. The results are shown in Fig. 11.

Fig. 11
figure 11

Real capacity of ESS of CY on a cloudy day

The principle of ESS application is identical as for the sunny day. The night capacity and daytime capacity of ESS are 0.49 and 1.48 MW, and their percentages compared to the DPG capacity are 5.44% and 16.44%.

The upper limit of stored energy at maximum charging capacity is 1.48 MWh, and the lower limit is 0 MWh, so the initial state of charge is set at 0.7 MWh as discussed above. The operational curve is shown in Fig. 12.

Fig. 12
figure 12

Operational curve of ESS of CY on a cloudy day

From Fig. 12, the operational curve does not exceed the limits. Figure 13 compares \(f_{P}\) with and without ESS under the same circumstances, which as before shows that the measured power curve is controlled to match the planned power curve.

Fig. 13
figure 13

Comparison of \(f_{P}\) of CY on a cloudy day

4.3 Results of ESS capacity allocation over one year

The scenarios by Latin hypercube sampling are restricted by the original scenario. Therefore, this paper allocates the ESS capacity for CY on a random day of every month during a year. It contains different weather conditions, output of DPG (the DPG capacity is still 9 MW) and load cases. The results are shown in Table 6.

Table 6 Allocation results of CY in one year

The results indicate that the ESS capacity is approximately 18% of the DPG capacity. This is better than the results of [9,10,11,12,13,14], which all required about 30%. Furthermore, the different classes of ESS capacity are dispatched at different times. Therefore, this strategy prolongs the service life of ESS by using a mixture of energy storage equipment, and also potentially reduces the total investment in this equipment, depending on the relative cost of each ESS technology.

4.4 Results of ESS capacity allocation in other lines

For lines LC and YX, the parameters of which are shown in Table 1, the same strategy is used to allocate the capacity of ESS. The amounts of ESS, and their percentage capacity with respect to DPG with 9 MW capacity, maximum load and transformer capacity are given in Table 7. This confirms that an ESS capacity no more than 18% of the DPG capacity is enough to smooth the power fluctuations in these two lines.

Table 7 Allocation results of LC and YX

Figure 14 depicts the comparison of \(f_{P}\) with and without ESS in the two lines respectively. From that, the actual power curves of the lines can be corrected to equal the planned curve without derivations.

Fig. 14
figure 14

Comparison of \(f_{P}\) in other lines

In summary, the proposed strategy needs only small amount of ESS capacity to reduce \(f_{P}\), which is suitable for multiple distribution network lines and accords with the developing trend of smart grids to host larger amounts of DPG.

5 Conclusion

In this paper, a new strategy based on the DFT is proposed to allocate ESS capacity for smoothing the severe fluctuation of power flow in medium/low voltage distribution networks with DPG. The following conclusions can be obtained from the above theoretical analysis and numerical simulation.

  1. 1)

    The ESS allocation strategy can be applied to all kinds of distribution lines and helps a DSO dispatch ESS conveniently.

  2. 2)

    The ESS power capacity, at only 18% of photovoltaic system capacity, reduces the fluctuation of power flow considerably to achieve no deviation from the planned power curve at the head of the line. This permits existing DSO management methods to continue to be used.

  3. 3)

    Scheduling different kinds of ESS capacity at different times of the day and night is consistent with energy conservation and environmental protection advocated by the national policy of China. Moreover, the mixed system of PT and ET technologies can extend the lifetime of ESS overall.