**A Piecewise Bound Constrained Optimization for Harmonic Responsibilities Assessment under Utility Harmonic Impedance Changes**

#### **Tianlei Zang 1,2,3 , Zhengyou He 1,\*, Yan Wang 1, Ling Fu 1, Zhiyu Peng <sup>2</sup> and Qingquan Qian <sup>1</sup>**


Academic Editor: Frede Blaabjerg

Received: 22 April 2017; Accepted: 1 July 2017; Published: 6 July 2017

**Abstract:** Considering the effect of the utility harmonic impedance variations on harmonic responsibility, a method based on piecewise bound constrained optimization is proposed in this paper to evaluate the load harmonic responsibilities. The wavelet packet transform is employed to determine the change times of the utility harmonic impedances. The harmonic monitoring data is divided into several segments where the utility harmonic impedances are considered as constants. Then, the problem of harmonic responsibility assessment under utility harmonic impedance changes are settled by the piecewise bound constrained optimization model. Furthermore, the interior point, the sequential quadratic programming and the active set algorithm are respectively adopted to calculate all the instantaneous harmonic responsibilities of harmonic loads. Finally, the weighted summation is used to calculate the total harmonic responsibility. To demonstrate the validity, simulation tests are carried out on an experimental circuit and the IEEE 13-bus distribution system.

**Keywords:** harmonic responsibilities assessment; utility harmonic impedance changes; wavelet packet transform; piecewise approach; bound constrained optimization

#### **1. Introduction**

With the development of smart grids, increasing numbers of power electronic devices have been connected to distribution networks, which inject a large amount of harmonics [1–5]. Various electrical power equipment and electronic products have a strong sensitivity to the harmonics in the distribution network, making harmonic elimination of great importance [6]. To address the problem of harmonic pollution, appropriate punishment scheme should be executed according to the harmonic limits recommended by the IEEE or IEC standards. To ensure its implementation, it is necessary to quantitatively evaluate the harmonic responsibility of the major harmonic loads at the point of common coupling (PCC) in distribution networks [7–9].

In traditional methods, the key of harmonic responsibility evaluation is to determine the utility harmonic impedance. These works can be mainly classified as fluctuation quantity methods [10,11], linear regression methods [12–14] and independent component analysis (ICA) [15,16] methods. Fluctuation quantity methods rely on the fluctuation quantity proportion of harmonic voltage to current for calculating the harmonic impedance. The various regression analysis methods, such as the complex linear least squares [12], non-parametric regression [13] and multiple linear regression [14] methods, formulate an equation and solve the regression coefficient so as to get the utility harmonic impedance. The complex ICA [15] and FastICA [16] are usually used to estimate the utility harmonic impedance when the utility harmonic variations are neglected. Meanwhile, most of the above methods are based upon the supposition that the utility harmonic are invariant. In a real power grid, the utility harmonic voltage fluctuates due to the load fluctuation. The utility harmonic voltage has a certain influence on the amplitude as well as angle of the harmonic current which affects the harmonic voltage [17,18]. Under certain condition, the harmonic voltage and current all fluctuate simultaneously. The methods above cannot reflect the variation of harmonic voltage and current while the influence of utility harmonic voltage fluctuation is considered in [19–21]. In the previous study of the authors, an adaptive assessment approach [19] for harmonic responsibility under utility harmonic voltage variation was proposed. It has been proved that the utility harmonic voltage can be segmented by hierarchical K-means clustering under the condition of the same utility harmonic impedance. Then, regression methods can be effectively used to calculate the harmonic responsibilities. In the study of utility harmonic voltage fluctuation, the utility harmonic impedance is supposed to be invariant, but the switching of the equipment [22], changes in the reactive power compensation, the state of the distributed generators and the adjustment of the interruptible loads [23] can all result in variations in utility harmonic impedance. Under such an unrealistic assumption, a series of errors may be introduced in the assessment results. Therefore, it is of great significance to evaluate the harmonic responsibility in the presence of utility harmonic impedance changes.

Based on the analysis above, and considering the utility harmonic impedance changes, this paper firstly adopts the wavelet packet transform to detect the change points of the utility harmonic impedance. Then, the harmonic measurement data are segmented. Besides, in order to more accurately evaluate harmonic responsibility, the piecewise bound constrained optimization model and nonlinear optimization method are used to calculate the responsibility of each segment. Finally, the total harmonic responsibility of each harmonic load is obtained based on the data segment length. Section 2 describes the basic principles and conventional method of harmonic responsibility assessment. In Section 3, determination method of the change times of utility harmonic impedance is formulated. Section 4 introduces the piecewise bound constrained optimization method for harmonic responsibility assessment. The process of the novel method for harmonic responsibility assessment, numerical experiments and conclusion are provided in Sections 5–7, respectively.

#### **2. Basic Principle and Conventional Method of Harmonic Responsibility Assessment**

The Norton equivalent circuits can be applied for harmonic modelling of utility and loads [19,24]. Figure 1a shows a typical distribution system with two major harmonic loads, where *h* stands for the harmonic order; *Z<sup>h</sup> <sup>s</sup>* and . *I h <sup>s</sup>* are the equivalent harmonic impedance and injected current at the utility side, respectively, while *Z<sup>h</sup> <sup>k</sup>* and . *I h <sup>k</sup>* (*k* = 1, 2) are the equivalent harmonic impedance and injected current of each nonlinear load; . *I h bk*(*<sup>k</sup>* <sup>=</sup> 1, 2) is the branch harmonic current; . *V h pcc* and . *I h pcc* are the *h*-th harmonic voltage and current at the PCC, respectively.

**Figure 1.** A typical distribution system with two major harmonic loads and its harmonic voltage phasors: (**a**) The Norton equivalent circuit; (**b**) Phasor diagram of the *h*-th harmonic voltages.

*Energies* **2017**, *10*, 936

According to the superposition principle, the *h*-th harmonic voltage at the PCC is:

$$
\dot{\boldsymbol{V}}\_{\rm pcc}^{h} = \dot{\boldsymbol{V}}\_{\rm pcc,1}^{h} + \dot{\boldsymbol{V}}\_{\rm pcc,2}^{h} + \dot{\boldsymbol{V}}\_{\rm pcc,0}^{h} = \boldsymbol{Z}\_{\rm pcc,1}^{h}\dot{\boldsymbol{I}}\_{b1}^{h} + \boldsymbol{Z}\_{\rm pcc,2}^{h}\dot{\boldsymbol{I}}\_{b2}^{h} + \dot{\boldsymbol{V}}\_{\rm pcc,0}^{h} \tag{1}
$$

where dots represent the phasors of the voltages or currents, . *V h pcc*,1 and . *V h pcc*,2 denote the harmonic voltage at harmonic load 1 and 2 at the PCC, respectively; *Z<sup>h</sup> pcc*.1 and *<sup>Z</sup><sup>h</sup> pcc*,2 are the equivalent harmonic impedance but harmonic load 1 or 2, respectively; . *V h pcc*,0 is the harmonic voltage from the utility at the PCC, also known as the utility harmonic voltage. The phasor diagram of the *h*-th harmonic voltages is shown in Figure 1b.

The harmonic responsibility of harmonic load *i* (*i* = 1, 2) at the PCC can be calculated as:

$$\mu\_{\rm pcc,i} = \frac{\left| \dot{V}\_{\rm pcc,i}^h \right|}{\left| \dot{V}\_{\rm pcc}^h \right|} \cos \beta\_i \times 100\% = \frac{\left| Z\_{\rm pcc,i}^h \right| \left| \dot{I}\_{bi}^h \right|}{\left| \dot{V}\_{\rm pcc}^h \right|} \cos \beta\_i \times 100\% \tag{2}$$

where *<sup>β</sup><sup>i</sup>* is the phase angle between . *V h pcc*,*<sup>i</sup>* and . *V h pcc*.

Linear regression is a common assessment method for harmonic responsibilities [12,13], which is based on monitoring the harmonic voltage and current at the PCC.

The normalized *h*-th harmonic voltage and current at the PCC are related by:

$$\left| \dot{V}\_{\rm pcc}^{h} \right| = K \left| \dot{I}\_{\rm pcc}^{h} \right| + B \tag{3}$$

Figure 1 indicates the harmonic voltage at the PCC is:

$$\left| \dot{V}\_{\rm pcc}^{h} \right| = \left| \dot{V}\_{\rm pcc,0}^{h} \right| + \left| Z\_{\rm pcc,1}^{h} \right| \left| \dot{I}\_{b1}^{h} \right| \cos \beta\_1 + \left| Z\_{\rm pcc,2}^{h} \right| \left| \dot{I}\_{b2}^{h} \right| \cos \beta\_2 \tag{4}$$

Let . *V h pcc*,0 = *α*0, *Zh pcc*,1 cos *<sup>β</sup>*<sup>1</sup> <sup>=</sup> *<sup>α</sup>*1, and *Zh pcc*,2 cos *<sup>β</sup>*<sup>2</sup> <sup>=</sup> *<sup>α</sup>*<sup>2</sup> then . *V h pcc* can be expressed as:

$$\left| \dot{V}\_{pcc}^{h} \right| = \kappa\_0 + \kappa\_1 \left| \dot{I}\_{b1}^{h} \right| + \kappa\_2 \left| \dot{I}\_{b2}^{h} \right| \tag{5}$$

It can be seen from Equations (3)–(5) that in the application of linear regression methods, the harmonic data should meet that the change of the utility harmonic voltage cannot influence the change of the harmonic current. Furthermore, if either the harmonic voltage, current or impedance changes, the accuracy of the regression analysis will be affected. Therefore, the variations of utility harmonics are the main error sources when the regression methods are employed.

#### **3. Determination of the Change Time of Utility Harmonic Impedance Using Wavelet Packet Transform**

In the distribution system, the changes of the operation mode, load or reactive compensation can all lead to changes of the utility harmonic impedance. To accurately calculate the harmonic responsibility, harmonic monitoring data must be properly segmented according to the identified utility harmonic impedance. In this article, the roughly estimates of utility harmonic impedance are used to segment the data.

Due to the complexity of the actual distribution system and the existence of transient processes, the actual utility harmonic impedance changes in a gradual manner. Therefore, it is necessary to choose an effective method to adaptively detect the change. In view of the good performance of wavelet

package transform in signal singularity detection, this paper employs the wavelet package transform to detect the change points of the utility harmonic impedance.

In wavelet packet transform, the input signal can be decomposed into low frequency and high frequency components level by level to represent the approximations and details of signal respectively [25]. Figure 2 shows a wavelet packet transform tree with three decomposition levels. The wavelet packet coefficients at each level can be obtained by:

$$\begin{array}{l} D\_{\dot{j}}^{2n}(t) = \sum\_{\omega} G(\omega) D\_{\dot{j}-1}^{n}(2t - \omega) \\ D\_{\dot{j}}^{2n+1}(t) = \sum\_{\omega} H(\omega) D\_{\dot{j}-1}^{n}(2t - \omega) \end{array} \tag{6}$$

where *G* and *H* represent a low-pass filter and a high-pass filter, respectively; *t* is the sampling point; *ω* is the displacement factor; *D<sup>n</sup> <sup>j</sup>*−<sup>1</sup> represents the component at the level *<sup>j</sup>* <sup>−</sup> 1, *<sup>D</sup>*2*<sup>n</sup> <sup>j</sup>* and *<sup>D</sup>*2*n*+<sup>1</sup> *<sup>j</sup>* represent the low frequency and high frequency components at the level *j*, respectively.

**Figure 2.** Wavelet packet decomposition tree with three decomposition levels.

The main idea of identifying the variation of utility harmonic impedance using wavelet packet transform is described in the following paragraphs. Since the boundary of the utility harmonic impedance change is not obvious, this paper transforms the identification of change point into the identification of change time window by adding windows, in order to reduce the identification error. The window length is denoted by *L*. According to Equation (3), if the values of the load harmonic impedances and injected harmonic currents can be considered as constants, the slope of the fitting curve is then a rough estimate of the utility harmonic impedance, and the slopes are approximately equal in this period. If mutation exists in the utility harmonic impedance, the slope of the fitting curve will change sharply compared with the adjacent window.

With regard to small samples, the window length *L* = 3 can be used to carry out the regression analysis. In the harmonic responsibility assessment, the data points in the time window, which correspond to the mutational utility harmonic impedance, are deleted. The sampling data points in the segments on both sides of the deleted time window can be considered as the data points under the same utility harmonic impedance.

For large samples, a long window length, such as *L* = 30, should be used to carry out the regression analysis, and the utility harmonic impedance change time can be directly determined through the wavelet packet decomposition curve.

*Energies* **2017**, *10*, 936

Since high frequency components can reflect the mutational point of the signal, the high frequency band *D*<sup>1</sup> <sup>1</sup>, *<sup>D</sup>*<sup>3</sup> <sup>2</sup> and *<sup>D</sup>*<sup>7</sup> <sup>3</sup> and obtained by wavelet packet transform are used. Set the threshold value *T* = *σ* 2 ln(*M*), where *M* is the sampling number, *σ* is the standard deviation of the high frequency band signal, *σ* = 1 *M M* ∑ *i*=1 (*Swp*(*i*) − *μ*) 2 , *Swp* represents the wavelet packet coefficients of a high frequency band and its mean is *μ*. The value below the threshold *T* is considered to be noise, and the value above *T* that is the mutation of the signal. Set *A*, *B*, and *C* as the sampling point sets of the change time window in the high frequency band *D*<sup>1</sup> <sup>1</sup>, *<sup>D</sup>*<sup>3</sup> <sup>2</sup> and *<sup>D</sup>*<sup>7</sup> <sup>3</sup> respectively. According to the importance of the three high frequency components, in this article, the change time window of the utility harmonic impedance determined by:

$$M = A \cup (B \cap \mathbb{C}) \tag{7}$$

#### **4. The Piecewise Bound Constrained Optimization Model of Harmonic Responsibility Assessment and Its Solution Algorithms**

In order to accurately calculate the single sampling point harmonic responsibility and the total harmonic responsibility of harmonic loads, upon the segmentation of the harmonic monitoring data, the harmonic responsibility is then assessed by the piecewise bound constrained optimization in this paper. According to the law of cosines [26], for the triangle XYZ:

$$z^2 = x^2 + y^2 - 2xy\cos\varphi\tag{8}$$

where *ϕ* represents the angle contained between sides of lengths *x* and *y* and opposite the side of length *z*.

For Figure 1b, the following equations can be obtained for each measurement at time *ti*:

$$\begin{aligned} \left| \dot{V}\_{\rm pcc}^{h}(t\_{i}) \right|^{2} &= \left| \dot{V}\_{\rm pcc,12}^{h}(t\_{i}) \right|^{2} + \left| \dot{V}\_{\rm pcc,0}^{h} \right|^{2} - 2 \left| \dot{V}\_{\rm pcc,12}^{h}(t\_{i}) \right| \left| \dot{V}\_{\rm pcc,0}^{h} \right| \cos \theta\_{2} \\ \left| \dot{V}\_{\rm pcc,12}^{h}(t\_{i}) \right|^{2} &= \left| Z\_{\rm pcc,1}^{h} \right|^{2} \left| \dot{I}\_{b1}(t\_{i}) \right|^{2} + \left| Z\_{\rm pcc,2}^{h} \right|^{2} \left| \dot{I}\_{b2}(t\_{i}) \right|^{2} - 2 \left| Z\_{\rm pcc,1}^{h} \right| \left| \dot{I}\_{b1}(t\_{i}) \right| \left| Z\_{\rm pcc,2}^{h} \right| \left| \dot{I}\_{b2}(t\_{i}) \right| \cos \theta\_{1} \end{aligned} \tag{9}$$

For simplicity, let . *V h pcc*,12(*ti*) <sup>=</sup> *<sup>γ</sup>*0, *Zh pcc*,1 <sup>=</sup> *<sup>γ</sup>*1, *Zh pcc*,2 <sup>=</sup> *<sup>γ</sup>*2, cos *<sup>θ</sup>*<sup>1</sup> <sup>=</sup> *<sup>γ</sup>*3, . *V h pcc*,0 <sup>=</sup> *<sup>γ</sup>*4, and cos *θ*<sup>2</sup> = *γ*5. In order to estimate the independent variables *γ* = [*γ*1, *γ*2, *γ*3, *γ*4, *γ*5], the absolute value of square error can be used as the objective function. The bound constrained optimization model is established as:

$$\begin{aligned} \min f(\gamma\_1, \gamma\_2, \gamma\_3, \gamma\_4, \gamma\_5) &= \sum\_{i=1}^T \left| \left| \dot{V}\_{\text{pcc}}^h(\gamma\_1, \gamma\_2, \gamma\_3, \gamma\_4, \gamma\_5, t\_i) \right|^2 - \left| \dot{V}\_{\text{pcc}}^h(t\_i) \right|^2 \right| \\ &= \sum\_{i=1}^T \left| \left| \dot{V}\_{\text{pcc},12}^h(t\_i) \right|^2 + \left| \dot{V}\_{\text{pcc},0}^h(t\_i) \right|^2 - 2 \left| \dot{V}\_{\text{pcc},12}^h(t\_i) \right| \left| \dot{V}\_{\text{pcc},0}^h(t\_i) \right| \cos \theta\_2 - \left| \dot{V}\_{\text{pcc}}^h(t\_i) \right|^2 \right| \\ &= \sum\_{i=1}^T \left| \gamma\_0^2 + \gamma\_4^2 - 2\gamma\_0 \gamma\_4 \gamma\_5 - \left| \dot{V}\_{\text{pcc}}^h(t\_i) \right|^2 \right| \\ &\text{s.t. } \quad \gamma\_2 > 0. \end{aligned} \tag{10}$$

s.t. *<sup>γ</sup>*<sup>1</sup> > <sup>0</sup> *<sup>γ</sup>*<sup>2</sup> > <sup>0</sup> −1 ≤ *γ*<sup>3</sup> ≤ 1 *<sup>γ</sup>*<sup>4</sup> > <sup>0</sup> −1 ≤ *γ*<sup>5</sup> ≤ 1 *Energies* **2017**, *10*, 936

where *γ*<sup>2</sup> <sup>0</sup> = . *V h pcc*,12(*ti*) 2 = *γ*<sup>2</sup> 1 . *I h <sup>b</sup>*1(*ti*) 2 + *γ*<sup>2</sup> 2 . *I h <sup>b</sup>*2(*ti*) 2 − 2*γ*<sup>1</sup> . *I h <sup>b</sup>*1(*ti*) *γ*2 . *I h <sup>b</sup>*2(*ti*) *γ*3; *T* is the number of sample points; . *V h pcc*(*γ*1, *<sup>γ</sup>*2, *<sup>γ</sup>*3, *<sup>γ</sup>*4, *<sup>γ</sup>*5, *ti*) is the calculated value of harmonic voltage, . *V h pcc*(*ti*), . *I h <sup>b</sup>*1(*ti*) and . *I h <sup>b</sup>*2(*ti*) are the measured values of harmonic voltage and currents respectively.

Once the estimated *γ* = [*γ*1, *γ*2, *γ*3, *γ*4, *γ*5] is obtained, according to Equation (2), the harmonic responsibility from two major harmonic loads, for each sampling point at *ti* can be calculated as:

$$\begin{split} u\_{\rm pcc,1}(t\_i) &= \left( \frac{\left| \dot{\boldsymbol{V}}\_{\rm pcc}^h(t\_i) \right|^2 + \gamma\_0^2 - \gamma\_4^2}{2 \left| \dot{\boldsymbol{V}}\_{\rm pcc}^h(t\_i) \right|^2} \right) \left( \frac{\gamma\_0^2 + \gamma\_1^2 \left| \dot{\boldsymbol{I}}\_{\rm b1}^h(t\_i) \right|^2 - \gamma\_2^2 \left| \dot{\boldsymbol{I}}\_{\rm b2}^h(t\_i) \right|^2}{2 \gamma\_0^2} \right) \\ u\_{\rm pcc,2}(t\_i) &= \left( \frac{\left| \dot{\boldsymbol{V}}\_{\rm pcc}^h(t\_i) \right|^2 + \gamma\_0^2 - \gamma\_4^2}{2 \left| \dot{\boldsymbol{V}}\_{\rm pcc}^h(t\_i) \right|^2} \right) \left( \frac{\gamma\_0^2 + \gamma\_2^2 \left| \dot{\boldsymbol{I}}\_{\rm b2}^h(t\_i) \right|^2 - \gamma\_1^2 \left| \dot{\boldsymbol{I}}\_{\rm b1}^h(t\_i) \right|^2}{2 \gamma\_0^2} \right) \end{split} \tag{11}$$

Assuming that the monitoring data is divided into *N* segments and each segment *Sj*(*j* = 1, 2, ··· , *N*) corresponds to different utility harmonic impedance, the harmonic responsibility at each segment can be determined by:

$$
\mu\_{\rm pcc,i}^{S\_j} = \sum\_{i=1}^{T\_j} \mu\_{\rm pcc,i}(i) \Big/ T\_j \tag{12}
$$

where *Tj*(*j* = 1, 2, ··· , *N*) is the number of data points in the segment *Sj*.

Total harmonic responsibility can be calculated by:

$$
\mu\_{\rm pcc,i} = \sum\_{j=1}^{N} \omega\_j \mu\_{\rm pcc,i}^{S\_j} \tag{13}
$$

$$
\omega\_{\bar{j}} = T\_{\bar{j}} \Big/ \sum\_{j=1}^{N} T\_{\bar{j}} \tag{14}
$$

where *μ Sj pcc*,*<sup>i</sup>* is the harmonic responsibility of segment *j*; *ω<sup>j</sup>* is the weight of each segment.

Numerous methods have been developed to figure out the bound constrained optimization problem. In this article, the interior-point (IP), the sequential quadratic programming (SQP) and the active set (AS) algorithm, which are all regarded as effective tools for solving nonlinear optimization problems, are selected.

A typical constrained programming problem can be expressed as:

$$\begin{array}{ll}\min f(\gamma) \\ \text{s.t.} & h\_i(\gamma) = 0; \\ & g\_i(\gamma) \le 0; \\ & \gamma = (\gamma\_1, \gamma\_2, \dots, \gamma\_n)^T \end{array} \tag{15}$$

The interior-point [27] for constrained optimization is mainly used to solve a variety of approximate optimization problem. For each *η* > 0 the approximate model can be expressed as:

$$\begin{cases} \min\_{\gamma, s} f\_{\eta}(\gamma) - \eta \sum\_{i} \ln(s\_i) \\ \text{s.t.} \quad h(\gamma) = 0 \\ g(\gamma) + s = 0 \end{cases} \tag{16}$$

where *si* denotes the slack variable. As *η* decreases to 0, the minimum of *f<sup>η</sup>* approaches to the minimum of *f*.

The SQP [28] is a kind of approximate Newton's method for solving constrained optimization problems. In each major iteration, the quasi-Newton updating method is firstly used to approach the Hessian of the Lagrangian function. The result is then employed to solve the QP (17) sub-problem:

$$\begin{array}{ll}\min \nabla f(\boldsymbol{\gamma}^{k})^{T}\boldsymbol{q} + \frac{1}{2}\boldsymbol{q}^{T}\boldsymbol{H}\boldsymbol{q} \\ \text{s.t.} \quad h\_{i}(\boldsymbol{\gamma}^{k}) + \nabla h\_{i}(\boldsymbol{\gamma}^{k})^{T}\boldsymbol{q} = \boldsymbol{0};\\ \quad g\_{i}(\boldsymbol{\gamma}^{k}) + \nabla g\_{i}(\boldsymbol{\gamma}^{k})^{T}\boldsymbol{q} \leq \boldsymbol{0};\\ \quad \boldsymbol{\gamma} = \left(\boldsymbol{\gamma}\_{1}, \boldsymbol{\gamma}\_{2}, \dots, \boldsymbol{\gamma}\_{n}\right)^{T} \end{array} \tag{17}$$

where *<sup>H</sup>* ∈ *n*×*<sup>n</sup>* and *<sup>q</sup>* <sup>=</sup> *<sup>γ</sup>k*+<sup>1</sup> <sup>−</sup> *<sup>γ</sup>k*, *<sup>d</sup>* ∈ *n*.

For the constrained optimization problem, the following equation can be derived by Newton's method:

$$\begin{cases} \min \nabla f(\boldsymbol{\gamma})^T \Delta \boldsymbol{\gamma} + \frac{1}{2} \Delta \boldsymbol{\gamma}^T \nabla\_{\boldsymbol{\gamma}\boldsymbol{\gamma}}^2 L(\boldsymbol{\gamma}, \boldsymbol{\lambda}) \Delta \boldsymbol{\gamma} \\ \text{s.t.} \quad h(\boldsymbol{\gamma}) + \nabla h(\boldsymbol{\gamma})^T \Delta \boldsymbol{\gamma} = 0 \\ \text{g}(\boldsymbol{\gamma}) + \nabla \mathbf{g}(\boldsymbol{\gamma})^T \Delta \boldsymbol{\gamma} \le 0 \end{cases} \tag{18}$$

where *<sup>λ</sup>* is the multiplier; *<sup>L</sup>*(*γ*, *<sup>λ</sup>*) denotes the Lagrangian expression for (17); and ∇<sup>2</sup> *γγL*(*γ*, *λ*) represents the Hessian of the Lagrangian.

The active set [29] solves the constrained optimization problem by determining the constraints that impact the results. Equation (15) can be rewritten as:

$$\begin{array}{ll}\min f(\gamma) \\ \text{s.t.} & A\_i(\gamma) = 0; i = 1, \cdots, n\_\ell \\ & A\_i(\gamma) \le 0; i = n\_\ell + 1, \cdots, n \end{array} \tag{19}$$

where *A*(*γ*) is a *n*-dimensional vector containing the evaluated values *γ*.

In the AS algorithm, the solutions of the Karush-Kuhn-Tucker (KKT) equations can be used to calculate the Lagrange multipliers (*Li*, *i* = 1, 2, ..., *n*). For Equation (19), the KKT equations can be expressed as:

$$\begin{aligned} \nabla f(\gamma^\*) + \sum\_{i=1}^n L\_i \nabla A\_i(\gamma^\*) &= 0 \\ L\_i A\_i(\gamma^\*) &= 0; i = 1, \dots, n\_\varepsilon \\ L\_i \ge 0; i = n\_\varepsilon + 1, \dots, n \end{aligned} \tag{20}$$

Equation (20) demonstrates a cancelling of the gradients between the objective function and the active constraints at the solution point. Since the cancelling operation only involves active constraints, the Lagrange multipliers are therefore equal to 0.

#### **5. The Proposed Harmonic Responsibility Assessment Approach**

The working process of the proposed method for harmonic responsibility assessment is illustrated in Figure 3, where *ε<sup>c</sup>* and *ε<sup>t</sup>* represent the calculation error and the termination tolerance. Firstly, the utility harmonic impedance is roughly calculated by least squares linear regression. Second, the change time windows of the utility harmonic impedance are identified by the wavelet packet transform. Then, the harmonic responsibility of each segment is evaluated by the piecewise bound constrained optimization method. Finally, the total responsibilities of harmonic loads can be obtained by the weighted summation, based on the point numbers of segments.

**Figure 3.** The process of the proposed approach.

#### **6. Numerical Experiments**

For the distribution system with two major harmonic loads as shown in Figure 1a, a Norton equivalent circuit model is established in MATLAB [30]. Taking the fifth harmonic as example, Table 1 presents the setting of parameter values. The harmonic impedance is modelled as the resistance *R* and reactance *L* in series. The system parameters and the injected harmonic currents are set and modified on the basis of [24]. In order to simulate practical engineering data, stochastic fluctuations are added to the harmonic data. For harmonic load 1 and 2, the means of the injected harmonic current data are 2.0788 + *j*0.1356 (A) and 3.8849 − *j*0.8549 (A) respectively, while the variances are 0.0018 and 0.0061 respectively. For the utility side, the mean of the injected utility harmonic current is 1.0243 − *j*0.3233 (A). The variances of all the harmonic impedances are 0.001. A total of 1440 harmonic sampling points of harmonic voltage and current data are generated. The change time of utility harmonic impedance are set as 501 and 1001.


**Table 1.** Parameter values of the distribution system Norton equivalent circuit.

For all the measured harmonic data, the least squares are used to carry out linear regression when the value of significance level is 0.05, and the regression coefficient is:

$$\mathbf{a} = \begin{bmatrix} \hat{\alpha}\_0 \\ \hat{\alpha}\_1 \\ \hat{\alpha}\_2 \end{bmatrix} = \begin{bmatrix} 4.4903 \\ -0.1373 \\ 0.7400 \end{bmatrix}$$

where *α*ˆ 0, *α*ˆ 1, *α*ˆ <sup>2</sup> are the estimated values of *α*0, *α*1, *α*<sup>2</sup> in Equation (5), that is, . *V h pcc* <sup>≈</sup> 4.4903 <sup>−</sup> 0.1373 . *I h b*1 + 0.7400 . *I h b*2 .

 The 95% confidence intervals for the coefficient estimations are:

$$\mathbf{C}\_{0.95} = \begin{bmatrix} -5.1372 & 14.1178 \\ -3.3517 & 3.0772 \\ -1.0726 & 2.5527 \end{bmatrix}$$

The *<sup>R</sup>*<sup>2</sup> statistic, the *<sup>F</sup>* statistic and its *<sup>p</sup>* value can be calculated as *<sup>R</sup>*<sup>2</sup> = 4.44781 × <sup>10</sup><sup>−</sup>4, *<sup>F</sup>* = 0.3219 and *p* = 0.7248, respectively. From the above results, the *R*<sup>2</sup> statistic and the *F* statistic are insignificant, and *p* > 0.05. It is indicated that the regression should be rejected, and the harmonic responsibilities cannot be accurately calculated by the linear regression method under the changes of utility harmonic impedance. Thus, identifying the change times of the utility harmonic impedances is considered in this paper. It is solved by the wavelet packet decomposition method.

The wavelet packet decomposition results of the rough estimation of utility harmonic impedance using the Haar wavelet bases function are shown in Figure 4a,b. In order to select the appropriate wavelet basis, the Haar wavelet 'haar (db1)', Daubechies wavelet 'db4', Symlet wavelets 'sym1' and 'sym4', Coiflet wavelet 'coif4', and Demy wavelet 'dmey' [31] are used respectively to perform analysis and compared in this paper. The identification results of the change time window of utility harmonic impedance under different wavelet bases are shown in Table 2. As the sampling window length is 3, the sampling points of utility harmonic impedance changes set preciously (501 and 1001) are all included in the change time windows determined by wavelet packet transform. It can be seen from Table 2, the various wavelet basis functions can all deliver good performances in identifying the change time window, especially for haar (db1) and sym1 wavelet.

According to the change time window of the utility harmonic impedance [167, 168, 333, 334, 335, 336] determined by wavelet packet transform with haar wavelet, the sampling points (499–504) and (997–1008) are deleted. Then, the harmonic data are divided into three segments, that is (1–498), (505–996) and (1009–1440).

**Figure 4.** Wavelet packet decomposition curves: (**a**) Wavelet packet decomposition curves of the utility harmonic impedance rough estimation values; (**b**) The three concerned high frequency components.

**Table 2.** Identification results of the change time windows of utility harmonic impedance under different wavelet bases.


*Energies* **2017**, *10*, 936

On the basis of data segmentation, the piecewise bound constrained optimization methods with three algorithms are used respectively to assess the harmonic responsibility. To accelerate convergence, the least square is adopted to solve the regression coefficients, which are taken as the initial values of the load harmonic impedances *Z*ˆ *h pcc*,1 and *Z*ˆ *h pcc*,2 . Then, the boundary constraints of the load harmonic impedances are set as % 0, 2 *Z*ˆ *h pcc*,1 & and % 0, 2 *Z*ˆ *h pcc*,2 & . The initial values for the cosine of phase angle value are set to be 0. Since . *V h pcc*,0 ≤ . *V h pcc* in general, the initial values and the boundary constraint of . *V h pcc*,0 are set to be 0.5 . *V h pcc* and ' 0, . *V h pcc* ( , which means the initial value of the independent variable is *Z*ˆ *h pcc*,1 , *Z*ˆ *h pcc*,2 , 0, 0.5 . *V h pcc* , 0 , and the boundary constraint values are (0, 0, −1, 0, −1) and 2 *Z*ˆ *h pcc*,1 , 2 *Z*ˆ *h pcc*,2 , 1, . *V h pcc* , 1 . The implementation of IP, SQP and AS are based on the 'fmincon' function in MATLAB. In order to ensure the fairness of algorithm comparison, the parameter settings of the three algorithms in Matlab are modified as follows. The maximum number of iterations is 1000, the maximum number of function evaluations is 5000, the termination tolerance *<sup>ε</sup><sup>t</sup>* is 1 × <sup>10</sup>−10, and the values of other parameters are the default values of the 'fmincon' function [30].

For each segment, the theoretical harmonic responsibilities and calculated values obtained by the three algorithms, as well as the means and variances of the relative error between the calculated value and the theoretical value are presented in Table 3.


**Table 3.** The harmonic responsibilities obtained by the three algorithms and error statistics.

For the two harmonic loads, the harmonic responsibilities for each sample point obtained by the three algorithms are shown in Figure 5.

From the tables and figure above, the calculated values of harmonic responsibility are basically consistent with the theoretical values. For the three algorithms, the mean and the variance of the relative error are all below 0.05 and 4 × <sup>10</sup>−<sup>4</sup> respectively. It is evidenced that the piecewise bound constrained optimization model with the three algorithms can assess the harmonic responsibility of harmonic load accurately. In addition, compared with the AS algorithm, the results of IP and SQP algorithms are closer to the theoretical values.

In order to examine how the fluctuation of the harmonic data can affect the three algorithms, the harmonic responsibilities are evaluated while the variances of the load harmonic impedances are set within the range of 0.005 to 0.1. The calculated values of the harmonic responsibilities obtained by the three algorithms are shown in Table 4. In comparison, the SQP algorithm can provide the most accurate and stable results.

**Figure 5.** The harmonic responsibilities for each sample point of harmonic loads: (**a**) The harmonic responsibilities of load 1; (**b**) The harmonic responsibilities of load 2.


**Table 4.** The harmonic responsibilities under different variances of the load harmonic impedances.

To compare the calculation times of the three optimization algorithms, the statistic results of calculated time including the maximum values, minimum values, mean values and standard deviations of 100 consecutive runs are shown in Table 5. The results show that the AS algorithm is the fastest, while the IP algorithm is the slowest. Since the harmonic responsibility is usually assessed over a period of time, such as 24 h, the computation times of all three algorithms are acceptable.

**Table 5.** The calculated time statistic results of the three optimization algorithms.


In order to further reflect the complexity of the actual distribution system, this article also carries out simulations on the IEEE 13-bus distribution system [19,32] as shown in Figure 6. The introduction of IEEE 13-bus distribution system can be seen in Appendix A.

**Figure 6.** IEEE 13-bus distribution system.

The system parameters are referred to [32] and Table A1. In this work, the parameters of the IEEE 13-bus system are converted into the per unit values. In addition, all loads are modeled as the resistance R and reactance L in series. We take bus 3 as the bus of interest, and set load 8 and 10 as the harmonic load 1 (HL1) and harmonic load 2 (HL2), respectively. To simulate the harmonics at the utility side, the harmonic source (HS) is also injected into bus 3. In this work, the change of the reactive power compensation which can lead to the utility harmonic impedance change is analyzed.

The reactive power compensation of the system is set as 4500 kvar, 5500 kvar, and 6500 kvar. As mentioned above, the variances of the injected harmonic currents are set to be 0.005 and 0.1 so as to evaluate how different data fluctuations influence the harmonic responsibility assessment. The injected harmonic currents of each bus for the two cases are shown in Table 6. The simulations of harmonic responsibility assessment are performed in MATLAB. In the simulation process, the harmonic loads are regarded as known PQ constant loads. The Newton-Raphson method [33] is used to calculate the fundamental power flow, and the injected harmonic currents are calculated according to the typical harmonic current frequency spectrum in [32]. The fifth harmonic is taken as the example for simulation.


**Table 6.** The injected harmonic current for the two cases.

A total of 14,400 sampling points are generated, and the reactive compensation quantity is changed for every 4800 points. The results of harmonic load flow are assumed as the measured harmonic data. In consideration of the data fluctuations in the actual system, the window length of wavelet packet transform is set to *L* = 30. Figure 7 presents the wavelet packet decomposition curves for the harmonic data of the two cases when a Haar wavelet is applied.

(**a**)

**Figure 7.** *Cont.*

**Figure 7.** The wavelet packet decomposition curves for the harmonic data of the two cases: (**a**) The Case 1; (**b**) The Case 2.

Referring to Figure 7, the change time window can be approximatively identified as 160 and 320. As the sampling window length is 30, the sampling time of the utility harmonic impedance changes is approximatively to 4800 and 9600, which is consistent with the settings of change times. Thus, the harmonic data are divided into three segments (1–4800), (4801–9600) and (9601–14,400). Then, the piecewise bound constrained optimization model, the three algorithms and the weighted summation are also utilized to compute the total harmonic responsibility for the two cases. The setting of parameters for the three algorithms, as well as the initial values and the boundary constraints have been described previously. Tables 7 and 8 present the theoretical values and calculated values of the harmonic responsibilities obtained by the three algorithms for Case 1 and Case 2, as well as the corresponding means and variances of the relative error between the calculated value and the theoretical values.


**Table 7.** The harmonic responsibilities and error statistics (Case 1).


**Table 8.** The harmonic responsibilities and error statistics (Case 2).

For the segment 1 of Case 1, the convergence curves of the three algorithms are shown in Figure 8. It can be observed that the minimum objective function values obtained by IP and SQP algorithms are approximately 173, while the minimum objective function value obtained by AS algorithm is around 184. Compared to IP and SQP, the calculation error of AS algorithm is slightly larger due to the fact it is subject to the premature convergence.

**Figure 8.** The convergence curves of the three algorithms.

For the segment 1 of Case 2, the harmonic responsibilities for each sample point of harmonic load 1 obtained by the three algorithms are shown in Figure 9, where Figure 9a shows the results of all the 4800 sampling points, and Figure 9b shows the results of the first 480 sampling points. In order to compare with the conventional regression analysis methods, the harmonic responsibilities obtained by the least square method [12] and the robust least square method [24] are also shown in Figure 9. As shown in Figure 9, the computational accuracy of the proposed method is superior to that of least square method and robust least square method.

**Figure 9.** The harmonic responsibilities for each sample point of harmonic load 1: (**a**) The results of all the 4800 sampling points; (**b**) The results of the first 480 sampling points.

The results above illustrate that the proposed approach can get accurate and stable assessment results as the means and variances of the relative error are small. In addition, the calculated values obtained by the three algorithms in Case 2 are similar and close to the theoretical values, which indicate that the impacts of harmonic data fluctuation are insignificant to the three algorithms. In accordance with the test results, the IP and the SQP algorithm are recommended with the priority.

#### **7. Conclusions**

In existence of the utility harmonic impedance variations, the harmonic responsibility cannot be calculated directly using the linear regression method. Thus, this article proposes a technique for harmonic responsibility assessment by combining wavelet packet transform with piecewise bound constrained optimization approach on the condition of utility harmonic impedance changes. The first contribution lies in the determination of change times of the utility harmonic impedance by the wavelet packet transform, which aims to accurately segment the measured harmonic data according to different utility harmonic impedances. Secondly, the piecewise bound constrained optimization model is established to evaluate the harmonic responsibility of each data segment, which can provide accurate assessment results. Furthermore, the interior point, the sequential quadratic programming and the active set algorithms are utilized to solve this optimization model. Based on the results, the interior point and the sequential quadratic programming can deliver better performance compared with the active set. In the simulation process, the time variation characteristics of the harmonics have been considered. The proposed method has good robustness against the harmonic data fluctuation. Except for the measurement data of harmonic voltage and current, no additional data is required by the proposed method. The future works may focus on the adaptive modeling method for the piecewise bound constrained optimization model, which can conveniently calculate the harmonic responsibility of multiple harmonic loads.

**Acknowledgments:** The authors acknowledge the support by the National Natural Science Foundation for Distinguished Young Scholars of China under Grant 51525702, the National Natural Science Foundation of China under Grant 51407150, Innovative Think-tank Foundation for Young Scientists of China Association for Science and Technology under Grant DXB-ZKQN-2017-042, Open Project of Key Laboratory of electric Power Big Data of Guizhou Province and Guizhou Fengneng Science and Technology Development Co., Ltd.

**Author Contributions:** Tianlei Zang and Zhengyou He conceived and designed the experiments; Tianlei Zang and Yan Wang performed the experiments; Tianlei Zang and Ling Fu analyzed the data; Qingquan Qian contributed analysis tools; Tianlei Zang, Zhengyou He and Zhiyu Peng wrote the paper. All authors have read and approved the final manuscript.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A. The Introduction of IEEE 13-Bus Distribution System**

The IEEE 13-bus system is a medium-sized industrial plant, which is extracted from a typical test system in the IEEE Color Book series. The system has been employed as a benchmark system to develop novel harmonic analysis approaches. The system is fed from a utility supply at 69 kV and the local distribution system operates at 13.8 kV. Because of the balanced nature of the test system, only the data of positive sequence is given. Capacitance of all cables and the short overhead lines are ignored. In addition, frequency dependence of model resistance and transformer magnetizing branch effects is ignored. The main parameters of the IEEE 13-bus distribution system are listed in Table A1.


**Table A1.** The main parameters of IEEE 13-bus distribution system.

#### **References**


© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
