A Linear Regression Based Resilient Optimal Operation of AC Microgrids

This paper investigates the impact of data integrity attacks (DIAs) on cooperative economic dispatch of distributed generators (DGs) in autonomous AC microgrids. To establish resiliency against such attacks and ensure optimal operation, a linear regression based control update is designed in this paper. To improve the robustness against multiple points of intrusion, the design of the resilient control update involves local measurements. As a result, any maloperation due to DIA is prevented from being propagated to the neighboring nodes. The proposed strategy acts immediately upon detection of data integrity attack to ensure maximization in the economic profit.


I. INTRODUCTION
Due to the flexibility of their application in both gridconnected and islanded modes, microgrids were established as key enablers for the integration of renewable energy sources [1]. To facilitate its operation under transmission delay and information failure, cooperative/distributed controllers with robust performance towards cyber layer imperfections are preferred in recent times [2]. Unlike operating in longer time scales with static demand feedback in the centralized system, cooperative dispatching often allows online actions for every increase in load in real time [3]. As a result, it improves the economic profile of the generators in a given duration.
Considerably less effort has gone into analyzing cyber attacks in cooperative optimization. To name a few, Chow et. al. [4] have designed a reputation-based detection algorithm to detect attacks on the economic dispatch (ED) problem. However, it is not fully cooperative, as the algorithm requires a centralized control center. Since these mechanisms are highly prone to single point of failure, the optimal operation of the system can easily be disrupted [6]. To increase the generation cost, any adversarial false data in the cooperative ED optimization model is categorized as a data integrity attack (DIA) in this paper. Such attacks alter the power flows with respect to the optimal solution [7].
Further, data intrusion from stealth attacks is also possible, as demonstrated in [8]- [12]. Such attacks are capable of increasing the generation cost without causing any obvious indications of power imbalance. To formulate an attackresilient mechanism, a two-hop neighboring information-based verification algorithm to detect and restore the system from DIAs is also reported in [5]. This algorithm is capable of detecting non-optimal and non-feasible solutions simultaneously. Nevertheless, its performance is highly dependent on the information from multiple neighbors, which may be a problem in cases of a compromised link or link failure. Many eventdriven resilient strategies have also been proposed in [14]- [17], which ensure the best resiliency measures in power electronics even using a single trustworthy agent. In fact, the authors in [13] have modeled DIA, which manipulates the power dispatch of each generator to gain monetary benefits without destabilizing the system. Further, they provide a localized eventdriven operation, which provides resilience against several cyber-physical disturbances. However, the design can be a complex approach.
To address these issues, this paper proposes: 1) a simple linear regression based resilient control update against data integrity attacks in cooperative microgrids to ensure optimality, 2) design of the resilient update only considering local measurements to enhance the operational flexibility.

II. SYSTEM AND ATTACK MODEL A. Control of Cooperative AC Microgrids
An autonomous AC microgrid with N inverter based DG sources is shown in Fig. 1. The considered microgrid system consists of three layer: the physical layer, control layer and cyber communication layer. The physical layer comprises of the entire microgrid network N inverters connected to a LCL filter. L k , C f and L g represent per phase inductance and capacitance of the filter circuit and grid-side inductance, respectively. In the system shown in Fig. 1 which comprises of N agents, each communication graph is represented via edges to constitute an adjacency matrix A = [a kj ] ∈ R N ×N , where the communication weights are given by: where E is an edge connecting two nodes with Ψ k and Ψ j being the local and neighboring node measurements, respectively. Otherwise, a kj = 0. N k = {j|(Ψ k , Ψ j ) ∈ E} denotes the set of all neighbors of k th agent. Further, the in-degree matrix Z in = diag{z in } is a diagonal matrix with its elements given by z in = j∈N k a kj . The Laplacian matrix L is defined as L = Z in − A. To improve their performance, neighboring inverters' measurements, which are transmitted to the local inverter and vice-versa, are used in a cooperative secondary controller to regulate their respective bus' average voltageV k and frequency ω k . The control objectives of the cooperative controller can be mathematically represented as: where ω * and V * denote the global reference for frequency and voltage, respectively. Detailed control equations of cooperative secondary controller in AC microgrids can be referred from [2]. To achieve proportionate active power sharing alongwith frequency restoration, the primary layer droop control is modified into: where m k , P k and P ref k denote the active power droop coefficient, measured active power and secondary control active power reference in the k th agent, respectively. The active power control in each DG is augmented with frequency restoration to minimize the generation cost for economic operation. To this end, we consider the general quadratic cost function for each DG to provide the operational cost, given by: where a k , b k and c k are the cost coefficients of the source in k th DG. Following the generation-demand balance equality constraint, the objective of optimal load sharing is to minimize the total cost of all DGs using: where P D , P min k and P max k denotes the total demand in the microgrid, minimum and maximum active power for k th DG respectively. Further, (4) can be solved using its associated Lagrange function as: where λ k and P D k denote the incremental cost and local active power demand respectively. Differentiating (5) with respect to P k using the first-order optimality condition, we can initialize the incremental cost using: To minimize the total generation cost subjecting to the equality constraints, it is required that the incremental cost of each DG be equal [18], which is carried out using a power correction term ΔP k , given by: Using (7), the active power reference for each DG with regulation of the local frequency can be obtained using: Substituting (8) into (2), the active power droop control law operates to restore frequency of each bus to the rated value and participates in the optimal load sharing. Hence using (2)-(8), a unified cooperative control structure for economic dispatch is devised for AC microgrid to achieve: where λ opt and P opt denote the optimal incremental cost and corresponding active power generation from k th DG in the absence of cyber attack. However, any change in cost parameters or displacing of the incremental cost in (6) by an adversary, denoted as a data integrity attack (DIA), will cause the system to operate in an non-optimal state. As a result, such attacks reduce the energy efficiency, which needs to be identified and mitigated immediately.

B. Attack Modeling
Two types of DIAs have been considered in this paper. These attacks are given by: where u a λi is an exogenous attack input in i th DG and ζ is a binary variable which is equal to 1 in the presence of DIA, or 0 otherwise. Moreover, λ c i denotes a constant valued attack element, which does not update in an iterative manner.
In (10), the attack can be injected by changing the cost parameters using: where Δa k and Δb k denote positive attack coefficients, when added to the cost function in (3) increase the overall generation cost. Hence, using (11), the consensus algorithm maloperates during the update process, which converges to an arbitrary value. Due to this maloperation, the control objectives in (9) are altered to: where λ * and P * denote the optimal setpoints for incremental cost and active power under the presence of DIA, respectively. It should be noted that there lies a considerable steady-state difference between λ opt and λ * , which has been theoretically verified in [2]. Hence, λ * denotes the sub-optimal point of economic operation for DGs in AC microgrids.
To provide a basic understanding, a case study is done in a microgrid with N = 4 agents (the system and control parameters can be found in Appendix) in Fig. 2 to study the impact of change in cost parameters on the performance of AC microgrids. The cost parameters of each DG are provided in Table I. It can be seen that the system response is almost similar under both cases until DIA 1 is injected into DG I at t = 1 sec. As soon as DIA 1 is injected, the dotted lines show the deviation from the actual output as the incremental cost go up by a steady-state deviation of 0.6 $/kW. Furthermore, this value will keep increasing as the power dispatch from each generator change with the increase in load. To counteract against these attacks, we propose a linear regression technique which can effectively diminish the impact of the modeled attacks by an artificial routing of the economic model parameters and ensure resilient optimal operation.

III. PROPOSED RESILIENT MECHANISM
Considering x(i) = P k (i) as input and y =λ k (i) as the output, which is supposed to be predicted. A pair (x(i), y(i)) is called a training example for i th instant. Each training set comprises of m pairs. To describe the supervised learning  problem more formally, our goal is, given a training set, to learn a hypothesis function h so that h(x) is a good predictor for the corresponding value of y. When the output variable that we're trying to predict is continuous, we call the learning problem a regression problem. To perform supervised learning, we must decide how we're going to represent the hypotheses h. As an initial choice, we approximate y as a linear function of x: In (14), θ is a weight, which parameterizes the space of linear functions mapping from x to y. One of the reasonable objective is to bring h(x) close to y. To formalize this, we define a cost function that maps the relationship between h(x(i)) and y(i), given by: In (15), J is minimized without resorting to an iterative algorithm. In fact, it is minimized explicitly by taking its derivatives with respect to θ and setting them to zero.
Substituting (14) in (15), we get: Thus, using the fact that for a vector z, we have that Hence, the cost function can be obtained using: Finally to minimize J, let's find its derivative with respect to θ. It is worth notifying that the derivative of J with respect to θ is denoted as Δ θ J(θ).
The following properties of the trace operator tr(•) are given below. Here, A and B are square matrices, and a is a real number:

tr(A)
• tr(AB)=tr(BA) Furthermore, the derivative output using the trace operator is given by: Combining (20) and (21), we get: Using (22) to get the derivative of (18), we get: It is worth notifying that the trace of a real number is just the real number, given by tr(A) = tr(A) T . Considering this postulate, (24) can be re-written as: Comparing equation (22) and (25), we conclude: To minimize J, we set its derivative to zero in order to obtain: Finally, the parameter θ that minimizes J(θ) can be given by: With parameterization achieved to a certain degree using the offline historic data from λ k and P k , the estimated cost coefficientsâ k andb k are fed into the linear regression model, as shown in Fig. 3, to formalize the presence of any identification error. Finally, if an error is identified, the next update is immediately switched using: Hence, the cooperative update of incremental cost is updated to ensure resiliency under these conditions. A detailed schematic of the control diagram is provided in Fig. 3.

IV. SIMULATION RESULTS
The proposed localized event based attack-resilient control strategy is tested on an AC microgrid, as shown in Fig. 4, with N = 4 DGs of equal capacity of 10 kVA. The nominal frequency of the network is 60 Hz. All the system parameters can be found in Appendix. The cost parameter of each DG can be referred from Table I. A case study on the considered system is carried out in Fig.  5(a), with DIA 1 in (5) injected by the adversary at t = 0.5 s. Observations in Fig. 5(a) confirm that the incremental cost of each DG start converging to a feasible solution. Further, another attack is conducted at t = 1 s, where λ c 1 = 6.5. It can be seen that as soon as λ 1 settles to 6.5, the remaining DGs track the set-point as a reference using the consensus theory. However as per the explained theory, it can be seen in Fig.  5(b) that λ 1 immediately reverts back to the normal operating conditions obeying the consensus theory using the proposed resilient mechanism. In Fig. 6, another case study is carried out where a ramp attack element (using the DIA 1 model in (10)) is injected into the generation cost model of DG I. It can be seen that when Δa k = −0.005t is injected at t = 0.5 sec, the incremental cost of each DG remain converged to the pre-attack value. Particularly, the linear regression technique substitutes the attacked signal with the estimated signal upon determination of the error as shown in Fig. 5. Fig. 7. Estimation by the proposed resilient mechanism under normal operating conditions. Further in Fig. 7, it can be seen that the estimated signal follows the calculated incremental cost of DG II under normal and dynamic conditions. This allows the proposed mechanism to operate not only like a switching state (Refer to (29)) but it can always be used as a resilient controller to prevent maloperation due to cyber attacks. Another case study is carried out in Fig. 8 where DIA 1 is conducted simultaneously at t = 1 sec. It can be seen in Fig. 8(a) that when the cost coefficient b k of each DG (Refer to Table I) is doubled, the incremental cost increases almost by 1 $/kW, which disregards the optimal operation. Consequently for any consecutive change in load, the incremental cost always follows a non-optimal trajectory from here on. However in the presence of the proposed controller, it can be seen in Fig. 8(b) that the regression technique immediately replaces all the attacked λ k locally withλ k . As soon as it is replaced, the pre-attack set-point is retained to ensure optimal operation. This highlights the robustness of using a localized resilient strategy in handling simultaneous attacks, which can be the worse case scenario.

V. CONCLUSION
This paper presents a linear regression based resilient controller to defend cooperative AC microgrids from data integrity attacks (DIAs). As these attacks cause an increase in the generation cost, the attack elements need to be removed immediately from the control system to prevent divergent nonoptimal solutions. In this paper, we have considered two DIAs namely DIA 1 and DIA 2 , which supports and blocks the consensus iterative theory, respectively. Hence, the proposed scheme provides a faster elimination of the attacked signal by understanding the intrinsic signal properties more closely and providing an accurate estimation even under attacked conditions. Moreover, it allows to deal with the correctness of measurements in each DG locally without infringing neighbor DG's cost parameters. Due to its intrinsic localized resilient feature, this strategy can be leveraged under worse-case disturbances, such as simultaneous DIA attacks on every DG in the microgrids. Due to the decentralization, it restricts further cyber interactions to ensure the optimal operation of AC microgrids.

APPENDIX
It is worth notifying that the control parameters are consistent for each DG, unless stated otherwise.