You are on page 1of 6

Application of Non-intrusive Polynomial Chaos Theory

to Real Time Simulation
Junjie Tang, Fei Ni, Kanali Togawa, Ferdinanda Ponci, Antonello Monti
Institute for Automation of Complex Power Systems, E.ON Energy Research Center at RWTH Aachen University
Aachen, Germany
E-mail: ([jtang, fni, ktogawa, fponci, amonti]
Abstract— Simulation tools play a critical role in the design and
test of power systems. In particular, real time simulation is now
reliable and constitutes the basis for Hardware in the Loop and
Power hardware in the Loop testing techniques. The application
of real time simulation and related techniques to power systems
is made particularly challenging as it should cover the analysis
of stochastic behaviors. In fact, numerous and volatile
distributed generation (DG), and end users’ dual load-generator
behavior are introducing more uncertainties to the conventional
power systems. Therefore, it is necessary to consider the
uncertainty into the process of real time simulation as well.
Methods that require many repetitions, like Monte Carlo, may
not be applicable, particularly in Hardware in the Loop
experiments with intrinsically long duration, e.g. those involving
thermal systems. As a first step, this paper proposes to address
this issue combining non-intrusive polynomial chaos theory
(NIPCT) with real time simulation. The main goal is to reduce
the number of test scenarios, and correspondingly the run-time.
The implementation of this approach based on Real Time
Digital Simulator (RTDS) and a MATLAB toolbox (NIPC_Tool)
is introduced. The method is then demonstrated on a 5-bus
system and results are compared with the Monte Carlo
Index Terms—Power systems, real time simulation, uncertainty
quantification, Polynomial Chaos Theory (PCT), Monte Carlo



Due to the undergoing changes and increasing complexity
of the future smart grid, identification of the potential risks
and weakness of power systems with simulation tools is
becoming critical. Furthermore, de-risking the technologies
prior deployment is necessary in critical infrastructures. To
this aim, Real Time (RT) simulation combined with Hardware
in the Loop (HiL) and Power Hardware in the Loop (PHiL)
testing is considered a powerful approach, which allows the
testing to be interfaced and extended to a portion of the
physical systems [1], and realizes truly repeatable
experimental conditions. Real time simulators are applied in
various fields, such as statistical protection testing, as a typical
case in the power systems domain. Main benefits of real time
simulation in this application are: 1) ability to reducing risk by
testing the faulty response in a simulated model instead of

using a real device; 2) acceleration of batch simulation and
statistical analysis on the test results [1].
The interest in the analysis of uncertainty in power system
has been recently growing. In fact, there are many sources of
uncertainty in modern power systems, such as electricity price,
weather, variation of load and volatility of the generation.
These uncertainty sources affect planning and operation.
Therefore, it is necessary to take these uncertainties into
consideration, when designing simulation scenarios.
For example, consider the case of statistical load profiles
used in network analysis. For a more reliable model, load
should be modeled as a random variable according to suitable
distributions [2]. The traditional approaches to analyze
uncertain loads are sampling methods, such as Monte Carlo
method (MC), Latin hypercube sampling, and the Markov
Chain Monte Carlo methods (MCMC). Although the sampling
based methods are easy to implement, they may feature slow
convergence and they are time consuming. In contrast,
spectral approximations based non-sampling techniques may
converge quite rapidly, thus largely reduce the time for tests.
This result is particularly important for HiL and PHiL testing
where the device under test possesses naturally slow dynamics
and when scenarios span long periods of time. For example, a
testing platform like the one in [3], is design to conduct
experiments that span one full day, in real time. In this
framework it is not reasonable to repeat the experiment the
number of times that sampling methods would require.
For all the aforementioned reasons, real time simulation
combined with statistical methods, can significantly increase
coverage and statistical confidence, [4]-[6]. Sampling-based
methods are adopted in most of situations. In [7] stochastic
collocation, one of the non-sampling methods, was first
incorporated into the real time simulation of the all-electric
ship. In this paper, real time simulation combined with nonintrusive polynomial chaos methods is proposed to analyze
uncertainty propagation in a 5-Bus test system with uniform
distributed loads.


Polynomial chaos theory, which was first introduced by
Norbert Wiener in [8], is among the methods able to model
and propagate uncertainty in stochastic models. It is one of the

with a typical time step of 50 μs.1. Polynomial Chaos expansion of random variables The Polynomial Chaos is an orthogonal basis of 2 L (:. collocation points in this paper. f) Continuous Discrete Poisson Binomial Hypergeometric Charlier Krawtchouk Hahn {0. the infinite expansion (1) is truncated at certain order K. P) . More details about the definition of collocation points and weights are discussed in [11]. X n . from input data processing to post-simulation elaboration. (n  K )! n! K ! (7) SIMULATION AND ANALYSIS PLATFORM A. RTDS is selected as the main simulation tool in this paper. NIPC_Tool is composed of two parts: the pre- . General introduction about RTDS Real Time Digital Simulator (RTDS®) [12] is capable of solving the electromagnetic simulations in real time. namely. LINKAGES BETWEEN POLYNOMIAL CHAOS AND PROBABILITY DISTRIBUTIONS Distribution Polynomials Support Gaussian Uniform Exponential Hermite Legendre Laguerre (f. It has the ability to approximate any random process with finite second-order moments. and then import them in MATLAB® [13] for post processing analysis.1. wk are Gaussian quadrature points and weights. In particular. [n ) <i ([1 ) …  … <i ([n ) 1 n (5) The truncated expansion of Y is given by: Y ([1 .. Uncertainty analysis toolbox--NIPC_Tool NIPC_Tool [14]. such as our uncertainty quantification with NIPC_Tool. orthogonal characteristic of {<i } 2 m ¦ X ([ X ([ )<i ([ ) f ([ )d[ : ³ III.. The coefficients ai can be calculated by using the ¢ <i ([ )< j ([ )² ³ : <i ([ )< j ([ ) f ([ )d[ ¢ <i ([ )²G ij with the Kronecker delta G ij ai 1 X ([ )<i ([ ) f ([ )d[ ¢ <i2 ([ )² ³: (3) Several common linkages between polynomial chaos and probability distributions are listed as follows [9].2.which are tensor products of the one-dimensional polynomials )i ([1 . so its polynomial chaos expansion will involve the polynomials {) i } . [ i 0 i i 1 n ) (6) where Q is the number of the truncated summations of the target variable. two different families of methods have been proposed to estimate the coefficients of a set of orthogonal polynomials. In polynomial chaos theory.. The non-intrusive methods regard the deterministic system as a black box to propagate uncertainty.. will be inserted into the original system by substituting polynomial chaos expansion for X ([ ) . A. via C code programmed by the users. Quadrature points with corresponding weights Since quadrature rule is the most basic concept of numerical integration. users do not need to deal with the polynomial chaos representation of the target variables directly. the quadrature based method is the most intuitive approach to implement non-intrusive polynomial chaos. real time simulation of power systems is implemented by a combination of custom software and hardware. At the same time. an uncertainty quantification GUI in MATLAB.. C. f) B.most frequently used non-sampling techniques and currently is of great interest [9][10]. As a result. Q (2) k 1 in which [ k . Coefficients of the target variables Assume that the target variable Y depends on n independent random inputs X 1 .1] [0. [ n ) Q 1 ¦ y ) ([ . while the intrusive approaches require modifications of the original deterministic model. F .N} {0. Through the RTDS user interface (RSCAD). {<i } is a set of polynomial basis orthogonal with respect to the probability density function of the input uncertainty X ([ ) . X 2 . Therefore. TABLE I. because the whole process is hidden. In practice. it is possible to store the simulation results. The corresponding k Gaussian quadrature points are the roots of the k-th order polynomial <k ([ ) . In this platform. Hence any random variable X ([ )  L2 (:. The integrals in (3) can be computed using Gaussian quadrature rules as: k )<i ([ k ) wk (4) Then the combination of quadrature points.1. P) can be expressed as follows X ([ ) f ¦ a < ([ ) i 0 i (1) i where [ represents randomness.N} [-1. possibly run time. RSCAD offers the options of the scripting function for batches of operations of simulator. so it is extensively used in power systems.. The simulator is regarded as a black-box by the NIPC_Tool.….…. B.. the non-intrusive methods offer the interesting option of easy implementation on top of standard simulation solvers. yi is the coefficient for each ) i [11]. F .} {0. has been developed in house. With this feature an external tool (in our case again the NIPC_Tool) can control the set up and the evolution of the simulation scenarios according to preprogrammed parameter variations. and {ai } is a set of the projection of X ([ ) on {<i } .

processing section and the post-processing section. 88) (46. Furthermore. the number of collocation points is expected to be much fewer than the number of MC samples. In the following step. RTDS can be regarded as the specific black-box. when the number of sources of uncertainty is moderate. all the combinations of collocation points are generated and saved into a file through the pre-processing GUI. Once each complete set of scenario simulations is performed. Test example To verify the operation of the proposed methodology. 61) Varying range 20% 5% Peak and valley loads are main concerns in the practical operation of power systems. commercial and domestic respectively. three loads are regarded as the uncertainty sources. 2 and 3 are industrial. TEST SETTING AND RESULTS A. as schematically shown in Figure 1. Initially. For simplicity. PL3. 79) (136. are mapped to the random values generated by the MC sampling and by the NIPC_Tool respectively. The output variables of interest are: voltage magnitude of each bus—V1. a 5-Bus power system is modeled in RTDS: detailed settings can be found in [15]. 52) (175. In assumption. IV. which includes calculating its PC coefficients and yielding the random samples into the PC representation of the target variables. Both MC method and NIPCT are adopted to perform real time simulation under uncertainty in RTDS in this paper. with different values of mean load and variations for each load. Methodology for RTDS simulation with PCT As discussed above. 23) (105. V4 and V5. 2 and 3—PL1. After the two steps above. In the preprocessing section. the stochastic loads. C. The post-processing GUI analyzes the statistical properties of the simulation results. As the second part of the tool. approximation order of each dimension and the number of quadrature points set by the users. The MC method is applied to create a term of comparison. and the active power output of the two generators—PG1 and PG2. In Section IV the comparison between these two approaches is carried out through numerical tests. the load types at Bus1. PL2. In principle. MVar) (158. Similarly. Test scenario—single time point TABLE II. and they are expected to occur at time 20:00 and 03:00 respectively. thus the change in the portion of active power and reactive power are identical for each load. V3. assumed to follow independent uniform distributions. Figure 2. Then. As two test cases. Then. there are three stochastic inputs: active power consumption of load 1. NIPC_Tool has been successfully integrated with SimulationX. the probability density function (PDF) of each target variable is obtained. B. Details . Referring to the methodology proposed in this paper. In both test cases. these collocation points are regarded as the test scenarios to run a deterministic simulation multiple times. according to the number and the distribution type of random variables. 68) (253. Topology of 5-Bus test network In this paper. that is. V2. the simulations are carried out in RTDS. their daily load profiles with 24 points for an hour can be found from [16] and corresponding variation range for each time point is attached in TABLE IV in the appendix. the three loads are assumed to follow different uniform distributions. as shown in Figure 2. while the two generators adapt to these load changes and maintain the whole network in stable operation by adjusting their power outputs. Therefore. users can obtain the PDF of a variable of interest at any point in time and represent it through histogram. as many as the number of the collocation points. For example. INFORMATION ABOUT LOAD VARIATION IN TWO TEST CASES Information Test cases Figure 1. it post-processes the simulation results by sampling each target variable. which can be used to formulate the bounds of the corresponding uniform distribution. the power factor of each load is assumed to be constant. the collocation points can be generated by the pre-processing section. the simulation results of target variables are recorded from each simulation and stored on a PC. it has been done in this work with the NIPC_Tool and RTDS. the main contribution of this paper is the application of NIPCT in real time simulation to enable stochastic analysis in HiL and PHiL. Structure of NIPC_Tool combined with RTDS simulation In [14]. based on the selected “collocation points”. all random variables are transparently transformed to be represented in terms of Legendre polynomials. Case 1 Case 2 Bus number of Loads Bus 1 Bus 2 Bus 3 Bus 1 Bus 2 Bus 3 Time point 20:00 03:00 Mean Load (MW. In this system. they are used to demonstrate the features of NIPCT through the comparison with results of MC method.

004 Figure 6.004 0 200 0. For each load. Frequency histogram of voltage magnitude of Bus 1 in case 1 provided by NIPCT (top.005 0.012 220 230 |V1| [kV] 0.025 0. Frequency histogram of active power output of generator 2 in case 1 provided by NIPCT (top. blue) and MC method (below.015 0. when comparing MC sampling or NIPCT. The parameters of the uniform distribution are the same.008 0. PL3) from NIPC_Tool as shown in Figure 4. blue) and MC method (below.005 0 220 Figure 5. while the collocation points are much fewer than the MC samples. PL2.012 Density 0. The distribution of each load that these two methods yield. separately. Similar conclusions can be drawn from the results in Figure 6. 0. As shown in Figure 5.005 0 220 240 260 280 300 PG2 [MW] 320 340 360 240 260 280 300 PG2 [MW] 320 340 360 0. while 125 groups of RTDS simulation results correspond to these 125 collocation points—combinations of (PL1. considering the balance of time burden and simulation accuracy. while the 5 quadrature points are applied to generate the collocation points through NIPCT. the shapes of frequency histograms generated by the two methods are very close to each other.015 Density about the uncertainty information for the two test cases can be found in TABLE II.005 0. Differences lie in some details. for example.002 0 100 150 200 250 PL [MW] 300 350 Figure 4.014 210 0.01 0. Moreover.01 0.014 Load1 Load2 Load3 0. the mean load of each bus is calculated by multiplying the base load as indicated in Figure 2 by the corresponding load level as defined in the load profile [16].002 0 100 150 200 250 PL [MW] 300 350 Density 0. the computation time with NIPCT is only 1% of the time cost in the MC tests.015 0. the density for active power output values obtained by NIPCT is not strictly equal to the ones from MC sampling.006 0.02 Figure 3. green) 0.01 240 250 210 220 230 |V1| [kV] 240 250 0. Thus. Frequency histogram of active power of each load in case 1 provided by MC method 0. there are 10000 groups of simulation results for statistical analysis.025 0.01 0.006 0 200 0. according to the individual 10000 groups of (PL1. Thus. respectively in terms of frequency histograms for active power output of generator 2 and voltage magnitude of Bus 1.0. Frequency histogram of active power of each load in case 1 provided by NIPCT Simulation results based on MC method and NIPCT with 5 quadrature points are shown in Figure 5 and Figure 6. PL2. . are consistent with each other respectively. However. 10000 samples are adopted through MC methods.015 Density Load1 Load2 Load3 0.02 0. the inputs of RTDS simulation are provided by the two methods mentioned above.008 Density 0. the above results are likely to be acceptable for most applications.01 0. PL3) generated by MC simulation as shown in Figure 3. for each time point. e. 0.02 Density In the following tests. green) 0. Considering the time of each RTDS simulation is identical.02 0.g. the case 1 (20:00) as defined in TABLE II. we can obtain the bound of each uniform distribution by adding and subtracting the mean load and the variation individually.01 0.

we can conclude that. green) 0. NIPC_Tool settings may make the representation not sensitive enough to deal with such small variation. Frequency histogram of voltage magnitude of Bus 2. 256] 0 246 269 Figure 9. Compared with case 1.05 0. it can be observed that the intervals of voltage variation for Bus 1.03 0.02 0. thus the voltage variation at time 03:00 is not as large as the one at time 20:00. especially with respect to the active power as shown in Figure 8. variation horizons of the loads in test case 2 are much smaller than test case 1.06 Density 170 180 190 PG2 [MW] 0 160 200 0.02 Number of buses Mean of V Range of V Mean of V Range of V 0. unlike with the results in case 1.01 248 250 252 |V2| [kV] 254 256 258 0. Therefore.03 0.04 0.04 0. Bu3.01 0 240 0. which means the load variation. This demonstrates that the voltage is more stable at generation buses. Bus4 and Bus 5 are 40. However. 10. difference arises at the different load levels corresponding to various time points. location of the bus in the grid and its feature (load or generator or zero injection bus). 252] 255 [252. we observe some differences in test case 2 which is also defined in TABLE II. 10. 269] Bus 2 252 [247. 257] Bus 5 252 [248.03 0. 254] 253 [251. results from the two cases obtained by NIPCT with 5 quadrature points are listed and compared.02 Density Density 0.05 Density 0.05 0. Regardless.04 Density 0.02 0.01 0 262 263 264 265 266 V1 [kV] 267 268 269 0 262 263 264 265 266 |V1| [kV] 267 268 0. COMPARISON BETWEEN TWO CASES IN VOLTAGE 0. In addition. the effectiveness of NIPCT is verified by the results too.05 0. 257] 257 [254.01 Bus 1 221 [201. 257] Bus 4 253 [249. Therefore. 6 and 6 kV respectively.06 0. Frequency histogram of voltage magnitude of Bus 1 in case 2 provided by NIPCT (left. Bus 3.03 0.03 0. although the operations for the two test cases are identical.04 248 250 252 |V5| [kV] 254 256 258 Figure 7.03 Cases 0. especially for . It is clear that for the bus voltages. there is a high possibility for some bus to violate the lower threshold of voltage magnitude required by the grid code. combined with real time simulation is very critical for the heavily loaded systems. This observation has not been proven theoretically. 260] Bus 3 248 [242. Bus2. Meanwhile.02 0. the larger variation is due to the loads that vary in a wider bound in case 1.05 0. 241] 266 [262.06 0. blue) and MC method (right.03 0. blue) and MC method (right.04 242 244 246 248 |V3| [kV] 250 252 254 Density 0 246 0. Thus.01 0.02 0. Comparing these five frequency histograms.01 Density Density 0.04 TABLE III. 0. heavier load always leads to larger voltage variation Together with the wider variation of voltage. Therefore. Figure 7 shows the results obtained by NIPCT with 5 quadrature points. the variation increases with the distance from the power sources.01 0 248 170 180 190 PG2 [MW] 200 Figure 8.05 250 252 254 |V4| [kv] 256 258 0. it implies that uncertainty analysis. Bus 4 and Bus 5 in case 1 provided by NIPCT Together with the top subfigure of Figure 6. green) 0.02 0. the voltage magnitudes are also affected by the load variation.01 0. the shapes of the frequency histogram provided by the two methods become inconsistent with each other. the ability to withstand the impact from uncertainty sources highly depends on the Case 1 Case 2 In TABLE III.Besides power outputs of generators. while for the voltage at each load bus. but it offers an interesting direction for the future work.02 0 160 0. Frequency histogram of active power output of generator 2 in case 2 provided by NIPCT (left. in Figure 8 or Figure 9. 255] 254 [252.03 0.

23:00 and 24:00 from 09:00 to 10:00. the heaviest load condition occurs at 20:00.242-272. 60. L. Paquin. Miyasaka. Monti. Ponci. pp. Molitor. N. which happens only in light load condition with reactive power compensation devices equipped at the load buses. Conversely. the advantage of NIPCT in terms of [12] [13] [14] [15] [16] A. 2005. K. LeMaitre. as the stochastic analysis is more relevant for heavy load cases.. Schäfer. Tang.4 [10] 14:00 15:00 16:00 0. A. computational burden is great. P. 30-35. Ohkawa. O. Besides. 2008. Therefore. Phys.N.GCMS '11. the load uncertainty can be described by the basic load level and amplitude of variation. G. N. Mech. A." in IEEE Energy Conversion Congress and Exposition (ECCE’09). Snider. Paquin. Comp. 11-13 Jun.. Li. New York: Wiley.. B. Ohkawa. K. vol. F.6 12:00 13:00 0. RTDS Technologies. Oct. F. thus corresponding actions can be taken in advance. Eng. Cambridge. Yamasaki. Benigni. 1989.-M. 2009. 1. Inc. Anders. Wiener. J. T. T. The main challenges are how to apply this method for complex systems with many stochastic variables. 2012. These steps are in the direction of enabling stochastic HiL and PHiL. pp. Miyasaka. J. Instead. PDFs of voltage magnitude of Bus 1 with 24 time points provided by NIPCT Figure 10 focuses on the PDFs of voltage magnitude of Bus 1 with 24 time points obtained from NIPC_Tool.2 0 280 [11] 17:00 18:00 19:00 260 240 20:00 21:00 220 200 180 1 5 Voltage [kV] 9 13 17 22:00 21 24 23:00 24:00 Time [h] Figure 10.Venne. the system operator can be aware of different challenges at different time points. 2012. the two single time points in Section B are only two of the 24 time points in this test scenario. Inc. Test scenario—24 time points As known. With this new methodology. T. LOAD VARIATION FOR DIFFERENT TIME POINTS Time points from 01:00 to 08:00. pp. Komoda.Available: http://monaco. "Realtime stochastic qualitative simulation of large scale air conditioning systems. Mihara. Togawa. 1995. 1161-1172.strath." Master thesis. K. Yumoto. Moreover. 1938. pp." 2012 IEEE Complexity in Engineering (COMPENG). "Real-time simulation for fault detection and diagnosis using stochastic qualitative reasoning. Benigni. vol.. A. Liu. “The Homogeneous Chaos. pp. C. we can obtain acceptable results with faster speed in real time simulation under uncertainty. pp. Bélanger. 897-936. REFERENCES [1] [2] [3] [4] [5] [6] 01:00 02:00 [7] 03:00 04:00 05:00 1 [8] 06:00 07:00 08:00 0. J. C. J. due to the smaller load variation. could be interesting for future work.902-907 Joshua Adam Taylor. United Kingdom Generic Distribution Network (UKGDS).eee. MathWorks. J.. To achieve this goal. and Why of Real-Time Simulation. Where. 1 –5. pp. ISIE'95. MATLAB User’s Guide. It clearly demonstrates that in the midnight (from 01:00 to 08:00. Monti. Pirolli. the load variations follow the same distribution type with different parameters at different time points. Reliability Engineering & System Safety (2009) pp. [Online]. the limitations emphasized for the results of test case 2 are not practically a problem. In fact.those operating on edge of their stability limits. 2011 M. and J. Monti. no. J. and how to improve the accuracy of this method when the stochastic variation is Arimoto. RTDS Manual Set. 1995. T. J. Function “ksdensity” offered by MATLAB is utilized to fit the PDF according to the data provided by the post-processing section of NIPC_Tool. and S. N.. in case 2. Komoda. Helmedag. and W. "Uncertainty Analysis of Power Systems Using Collocation." IEEE Complexity in Engineering (COMPENG). N. it is abnormal that the voltage magnitude of each load bus is larger than the voltage at generation buses. "A MATLAB Graphical User Interface for Nonintrusive Polynomial Chaos Theory. APPENDIX TABLE IV. C. the voltage variation is smaller and gathered in a narrower range. in the condition of moderate number of stochastic variables. "An advanced real-time simulation laboratory for future grid studies: Current state and future development. which forms the slender PDF. USA. Liu. in this test scenario. Only NIPCT with 5 quadrature points is applied to this test scenario." IEEE International Symposium on Industrial Electronics. the total number of times for running RTDS simulation is still 125. which is time dependent. Thus. A. J. F. A. which leads to the flattest PDF. Through this figure. “Fast Numerical Methods for Stochastic Computations: A Review. S. 18:00 and 19:00 20:00 and 22:00 Variation 5% 10% 15% 20% . 3194 – 3202. Tests of the real time simulations based on MC method and NIPCT have been presented to validate NIPCT. from 14:00 to 17:00 from 11:00 to 13:00. 2001. San-José. Xiu. MIT.2-4. Crestaux.” IEEE International Instrumentation and Measurement Technology Conference (I2MTC). Summer Simulation MultiConference. "Advantages and Challenges of Non-intrusive Polynomial Chaos Theory". 2011.” Amer.. J. vol.5 no. Probability Concepts in Electric Power Systems. Sulis.8 [9] Density 09:00 10:00 11:00 0. “Polynomial chaos expansion for sensitivity analysis”. In other words. and 24:00). Math. W.” in Planet RT. Li. V. Benigni.2. Martinez. Belanger. Muscas. C. CA. . “Effects of PMU’s uncertainty on voltage stability assessment in power systems. 2010." 8th IEEE International Conference on Emerging Technologies and Factory Automation. A. CONCLUSIONS Application of NIPCT in real time simulation has been proposed in this paper.391-398. “The What.” Comm. Dept. NIPCT is used to obtain the PDF of various outputs at different time instants. "Monte-Carlo Study on a Large-Scale Power System Model in Real-Time using eMEGAsim. Togawa. each RTDS simulation sustains for 24 s with load change once per 1 s to represent the 24 sharp clocks in a daily load profile. D. vol.