PSCAD-MATLAB Coupled Simulation Method for Power Flow Optimization using Continuous Reactive Power Controllable Device

With the integration of distributed generation (DG), micro-grids and are becoming attractive. Power flow studies are very important in the planning or expansion of power systems. The paper proposed a novel method that incorporates MATLAB and PSCAD to study the optimal control of the reactive control algorithm to reduce the power loss in the transmission lines. The proposed strategy is easy to implement and effective in solving the dynamic power flow problems. The results can apply to control the continuous reactive power controllable device and show that the power loss can be greatly reduced.


Introduction
The trend to implement different software to solve the same engineering problem is growing. Since there are limited features for each software, it is of great benefit to combine them to give full play the advantage of different software and improve working efficiency. In the electric power industry, PSCAD/EMTDC is very popular to simulate electromagnetic transient phenomena [1] . However, the control system design feature is considerably outdated. It is hard to implement complicated control strategies in a pure PSCAD/EMTDC simulation. Take into consideration that many power flow optimization algorithms have been already proposed using MATLAB. A coupled simulation method using both PSCAD and MATLAB is proposed [2] [3] . The novel method can fully use the specialty of PSCAD in power system analysis, as well as the advanced mathematics and control system design feature of MATLAB. Using the method, the already existing power flow optimization algorithms can easily be implemented in the electromagnetic transient simulation to validate the dynamic power flow control strategies in the real power grid [4] .
The coupled simulation of PSCAD/EMTDC with MATLAB has great advantages. PSCAD/EMTDC is optimized and specialized for power network simulations. The solve speed in PSCAD is much faster than that in MATLAB [5] . Furthermore, the graphical user interface in PSCAD is also customized for power industry applications and appears more familiar to engineerers.

Interface from PSCAD/EMTDC to MATLAB
PSCAD/EMTDC covers power system parameters from xml format file to Fortran language. The fortran based solution engine consists of two main parts: 1) The system dynamics: includes the master dynamics subroutine (DSDYN), the output definition subroutine (DSOUT), and the initialization subroutine (BEGIN); 2) There exists an additional step called the electric network solution between the DSDYN and DSOUT to deal with electric circuits calculation.
As illustrated by Fig. 1, The PSCAD/EMTDC control system is usually located in DSDYN section. If the simulation reaches the finish time, the solution ends. Otherwise, it iterates by a specified fixed interval Δt. So before the PSCAD start its control system process, add a Fortran subroutine which interfaces with the algorithm realized in MATLAB and then pass the value calculated from MATLAB to PSCAD. As both the MATLAB and PSCAD/EMTDC concurrently working on the same solution, the data communication delay between the Fortran subroutine and MATLAB can be neglected.

Power flow optimization algorithm
The target of the power flow optimization is to make the power transmission loss minimal. The optimization function that calculates the total loss of the grid can be described as below.
Where S L is the branch without the transformers; L ij g is the conductance between branch i and j; T ik g is the conductance of the transformer that normalized to high winding. e i is the real part of node i voltage; f i is the imaginary part of node i voltage; In order to guarantee the power quality, voltage amplitude of each load node must be maintained at rated voltage attachments, at the same time, the generator's active power and reactive power output by certain restrictions. The constrain conditions are to depend on specific power grid parameters.These restrictions will constitute the power grid operation constraints, and adjust the power pattern in bus voltages and transformer tap positions and reactive power output. ( cos sin ) 0 ( cos sin ) 0 The inequality constraints are limited by total active power SG, reactive power Solve, voltage deviation(for volage above 35kV, ΔV i <10%). Usually, the reactive power constrain is consider as several fixed value which can not control continuously. Based on the magnetically controlled reactor technology, the power grid can precisely control the reactive power. If the algorithm can effectively regulate the grid power flow and reduce the power loss, the study can greatly improve the flexibility of the AVC system.
The algorithm is realized in MATLAB. The algorithm chart is shown in Fig.2. The power loss calculation derives from PSCAD network solution results. The nodes' voltage, current, reactive/active power and power loss results are then passed to MATLAB routine. MATLAB processes the information got from PSCAD and computes the optimal reactive compensate power of each reactive power controllable device, also the tap changer value. That is to say, MATLAB acts as a virtual AVC control system, and PSCAD act as the power system with SCADA.

Simulation example
To validate the proposed method, the simulation is applied to IEEE 9 Test System. The base Voltage/MVA is 230kV/100MVA. The simulation parameters of the IEEE 9 node test system are list in Table.1 to Table.3.
To couple simulation with MATLAB, a build-in subroutine called MLAB_INT must be used. Also, input variables from PSCAD simulation results in each time step should be transferred to STORF and/or  After each all of the MLAB_INT routine, it will output an updated array includes Q c and control signals. The updated array must also store in STORF or STORI. For more complicated cases, The The total reactive compensate constrain value is 20Mvar. The compensation points locate on buses 5, 6 and 8. The optimal results are shown in Table.4. The results show that the optimal reactive power control can effectively reduce the line loss by 12.7%, from 4.7042MW to 4.1054MW. The algorithm can also apply to power systems with dynamically changed loads.

Conclusion
This paper proposed a PSCAD MATLAB co-simulation method to optimize control for line loss reduction of the power grid. A good agreement of the results indicates the efficiency of the proposed optimal algorithm. The proposed method provides great simulation power to the electric power research. It can be a useful tool for planning and operation of the electric power industry.