## 2 A New Security ANM Framework
### Steady-State Security Assessment  
The second layer consists of a steady-state security assessment where the critical contingencies from all scenarios obtained from demand and generation forecasting are identified. The critical contingency cases are selected from the contingency cases that cause violations of the operational constraints. The non-critical contingency cases are disregarded since they will not provide any difference in comparison to the conventional optimal power flow calculation. The critical contingency selection is carried out for all scenarios of demand and generation and therefore, identifying the critical case scenarios (i.e, demand and generation operating points binding with the critical contingency) can be done at the same time. The period of critical case scenarios is identified in a priori, in order to take into account effective control actions (i.e., power curtailment of the DGs and/or demand response). The objective of these control actions is to ensure that the system operational state always remains in the normal operation limits. This step is essential for reducing the number of contingency cases to be analysed and to identify the period of demand and generation operating points that affect the secure operation of the system. As a result, the size of the optimisation problem in the computational burden are reduced significantly.  
An iterative procedure is proposed to identify the set of critical contingencies and case scenarios for each time period. The simulation is carried out in a meshed configuration (i.e., all tie switches are closed, in order to account for the worst conditions). Figure 2 shows the iterative procedure being used in this assessment to select the potential critical contingency cases. Let \(K\) be the set of contingencies used in the security analysis (i.e., line outages at the main feeders, including the transformers of  
Figure 1: The flowchart of the introduced ANM (active network management) framework.  
the main distribution substation) and let \(M_{c}\) be the set of critical case scenarios. Let \(\mathbf{P}_{0\{m\}}\) be the optimal operating point at period \(m\in M\). The proposed iterative procedure in Figure 2 can be further explained as follows:  
1. Initialisation of the the critical contingency set and the subset of critical case scenario: \(K_{c}=\emptyset\) and \(M_{c}=\emptyset\);
2. Select a time period of the forecast demand and generation, \(m\in M\), and solve an OPF using base case constraints. The optimal optimal operating point at period \(m\in M\), obtained from the OPF is denoted as \(\mathbf{P}_{0\{m\}}\);
3. Simulate each contingency \(k\in K\) with \(\mathbf{P}_{0\{m\}}\) by running a conventional power flow calculation. If the analysed contingencies do not lead to constraint violations, then \(\mathbf{P}_{0\{m\}}\) is considered a secure optimal solution. Otherwise, the contingency case \(k\) that produces post-contingency violations of the limits is recorded as the subset of critical contingencies (\(K_{c}\)) and the time period of the forecast demand and generation, \(m\) is recorded in the subset of the critical case scenario (\(M_{c}\));
4. The computation is continued for the next period and terminated after all periods \(m\in M\) are executed.