Introduction to Monte Carlo Simulations Ebrahim Shayesteh Agenda
Total Page:16
File Type:pdf, Size:1020Kb
F19: Introduction to Monte Carlo simulations Ebrahim Shayesteh Agenda . Introduction and repetition . Monte Carlo methods: Background, Introduction, Motivation . Example 1: Buffon’s needle . Simple Sampling . Example 2: Travel time from A to B . Accuracy: Variance reduction techniques . VRT 1: Complementary random numbers . Example 3: DC OPF problem 2 Repetition: fault models . Note: "Non-repairable systems” . A summary of functions to describe the stochastic variable T (when a failure occurs): . Cumulative distribution function: F t PT t . survivor Rt P T t 1 F t function: . Probability f (t) F t R t density function: f t F t . Failure rate: zt Rt 1 F t 3 Repetition: repairable systems . Repairable systems: ”alternating renewal process” X(t) 1 0 t T 1 D 1 T 2 D 2 T 3 D 3 T 4 . Mean Time To Failure (MTTF) . Mean Down Time (MDT) . Mean Time To Repair (MTTR), sometimes, but not always the same as MDT . Mean Time Between Failure (MTBF = MTTF + MDT) 4 Repetition: repairable systems . The “availability” for a unit is defined as the probability that the unit is operational at a given time t 1 . Note: – if the unit cannot be repaired A(t)=R(t) – if the unit can be repaired, the availability will depend both on the lifetime distribution and the repair time. 5 Repetition: repairable systems . The share of when the unit has been working thus becomes: n 1 n T T i n i i 1 i 1 n n 11n n TDi i Ti D i i 11i n i 11n i . It results when ∞ in: ET MTTF Aav ET ED MTTF MDT 6 Repetition: repairable systems . The failure frequency (referred to as either ω or f) during the total time interval i is provided by: 1 f MTTF MDT . Note the difference between failure rate (λ = 1/MTTF)and failure frequency (f=1/MTBF). For short down time compared to the operation time (i.e. MDT << MTTF), this difference is negligible: λ≈f. o This assumption is often applicable and used within reliability analyses of power distribution! 7 System of components . A technical system can be described as consisting of a number of functional blocks that are interconnected to perform a number of required functions – where components are modeled as blocks. There are two fundamental system categories: 1. Serial systems (often in power distribution contexts referred to as radial system/lines/feeders) 2. Parallel systems • Often, a system can be seen as a composition of several subsystems of these two fundamental types 8 Methods: approximate equations . Approximate equations for a serial system (MDT << MTTF is assumed): • Failure rate, Unit, e.g: [failures/year]: n s i • Unavailability, i1 Unit, e.g: [hours/year]: n U s iri • Average repair time, i1 Unit, e.g: [hours]: U s rs s 9 Methods: approximate equations . Approximate equations for a parallel system (MDT << MTTF is assumed): • Failure rate, 12 (r1 r2 ) Unit, e.g: [failures/year]: p 12 (r1 r2 ) 1 1r1 2r2 • Unavailability, r r Unit, e.g: [hours/year]: 1 2 rp • Average repair time, r1 r2 Unit, e.g: [hours]: U p prp 12r1r2 10 System indices Additional reliability measures - System indices . Previously calculated measures for system reliability λs,Us and rs specifies expected values, or mean, of a probability distribution. These measures however not describe the impact of a fault which can mean significant differences for different load points: • For example a load point with one customer and a load of load 10 kW and another with 100 customers and load of 500 MW. In order to take into account more aspects, system indices are calculated. 11 System indices Customer-oriented reliability indices . System average interruption frequency index SAIFI [failures/year, customer] ∑ λ ∑ . Customer average interruption frequency index CAIFI [Failure/year, customer] ∑ λ ∑⊂ λi is the failure rate of load point i (LPi) and Ni is equal to number of customers in LPi 12 System indices Customer-oriented reliability indices . System average interruption duration index SAIDI [hours/year, customer]: ∑ ∑ . Customer average interruption duration index CAIDI [hours/failure]: ∑ ∑ λ Ui is the outage time of load point i (LPi) and Ni is equal to number of customers in Lpi 13 System indices . Average service availability index (ASAI) [probability between 0 and 1] or [%]: ∑ 8760 ∑ ∑ 8760 where 8760 is number of hours/year . Also Average service unavailability index (ASUI) are used: ASUI = 1-ASAI 14 System indices Energy-oriented reliability indices . Energy not supplied index (ENS) [kWh/year] . Average energy not supplied index (AENS) [kWh/year, customer] ∑ ∑ ∑ . Ui is the outage time of load point i (LPi), Ni is equal to number of customers in Lpi and La(i) is average average load of Lpi : 15 Agenda . Introduction and repetition . Monte Carlo methods: Background, Introduction, Motivation . Example 1: Buffon’s needle . Simple Sampling . Example 2: Travel time from A to B . Accuracy: Variance reduction techniques . VRT 1: Complementary random numbers . Example 3: DC OPF problem 16 Monte Carlo methods: background . A class of methods used to solve mathematical problems by studying random samples. It is, in another word, an experimental approach to solve a problem. Theoretical basis of Monte Carlo is the Law of Large Numbers: • The average of several independent stochastic variables with the same expected value m is close to m, when the number of stochastic variables is large enough. • The result is that: ∑ → → ∞ ∑ → → ∞ 17 Monte Carlo methods: background . The second most important (i.e., useful) theoretical result for Monte Carlo is the Central Limit Theorem. CLT: The sum of a sufficiently large number of independent identically distributed random variables becomes normally distributed as N increases. This is useful for us because we can draw useful conclusions from the results from a large number of samples (e.g., 68.7% within one standard deviation, etc.). 18 Monte Carlo methods: simulation . The word “simulation” in Monte Carlo Simulation is derived from Latin simulare, which means “to make like”. Thus, a simulation is an attempt to imitate natural or technical systems. Different simulation methods: • Physical simulation: Study a copy of the original system which is usually smaller and less expensive than the real system. • Computer simulation: Study a mathematical model of the original system. • Interactive simulation: Study a system (either physical or a computer simulation) and its human operators. 19 Monte Carlo methods: simulation Y X g(Y) . Inputs: • The inputs are random variables with known probability distributions. • For convenience, we collect all input variables in a vector, Y. 20 Monte Carlo methods: simulation Y X g(Y) . Model: • The model is represented by the mathematical function, g(Y). • The random behavior of the system is captured by the inputs, i.e., the model is deterministic! Hence, if x1 = g(y1), x2 = g(y2) and y1 = y2 then x1 = x2. 21 Monte Carlo methods: simulation Y X g(Y) . Outputs: • The outputs are random variables with unknown probability distributions. • For convenience, we collect all output variables in a vector, X. The objective of the simulation is to study the probability distribution of X!. 22 Monte Carlo methods: simulation example Y X g(Y) . Inputs: • The status of all primary lines, all lateral lines, and the amount of power consumption and number of customers at each load points. Model: • The structure of the distribution system given the above inputs. Outputs: • The reliability measures, e.g., the value of system indices. 23 Monte Carlo methods: motivation . Assume that we want to calculate the expectation value, E[X], of the system X = g(Y). According to the definition of expectation value we get the following expression: . What reasons are there to solve this problem using Monte Carlo methods rather than analytical methods? 24 Monte Carlo methods: motivation . Complexity: The model g(y) may not be an explicit function. • Example: The outputs, x, are given by the solution to an optimization problem, where the inputs y appear as parameters, i.e., . Problem size: The model may have too many inputs or outputs. • Example: 10 inputs ⇒ integrate over 10 dimensions! 25 Monte Carlo methods: motivation Analytic model or simulation method? . The analytic models are usually valid under certain restrictive assumptions such as independence of the inputs, limited status number, etc. MC method can be used for large problems with multiple status. Physical visibility of a complex system is higher in the simulation method. The analytical methods are more accurate than simulations as long as no simplifying assumption is considered. Otherwise, it cannot be compared. In the case of future development in the system, simulation methods are more appropriate since future developments may be more tractable. For small systems, the analytic methods are faster while enough random scenarios need to be simulated in MC method which takes longer time. 26 Monte Carlo methods: motivation Analytic model or simulation method? . Advantages of each method: Analitical Monte-Carlo Exact results if there are limited The analyses are very flexible assumptions The outputs are fast once the The model extention is easy model is obtained Computer is not necessarily It can easily be understood needed 27 Agenda . Introduction and repetition . Monte Carlo methods: Background, Introduction, Motivation . Example 1: Buffon’s needle . Simple Sampling . Example 2: Travel time from A to B . Accuracy: Variance reduction techniques . VRT 1: Complementary random numbers . Example 3: DC OPF problem 28 Example 1: Buffon’s needle . The position of the needle can be described using two parameters: • a = least distance from the needle center to one of the parallel lines (0 ≤ a ≤ d/2). • ϑ = least angle between the needle direction and the parallel lines (0 ≤ϑ≤π/2). The needle will cross a line if its projection on a line perpendicular to the parallel lines is larger than the distance to the closest line, i.e.