19
Monte Carlo and Stochastic Pathways: Illustrative Examples of Planning in Power Systems at Various Levels Iman Moazzen, Institute for Integrated Energy Systems, University of Victoria [email protected], www.ece.uvic.ca/~imanmoaz ABSTRACT This paper presents the ways that random events can be treated in different stages of energy planning using Monte Carlo experiments and Stochastic approach. These methods are compared in terms of performance and computational complexity. INTRODUCTION The simplest way to deal with random events in an optimization problem is to consider deterministic modeling using single-point estimates. This is usually referred to as “what if” approach. In this case, each uncertain variable within a model is assigned to a single value such as best, worst, or most likely case. Each single-point estimate represents a scenario and results in a particular solution. A more advanced approach is Monte Carlo which has been extensively used in the past. This approach relies on repeated random sampling to obtain numerical results. In contrast to the “what if” approach, Monte Carlo experiments sample from a probability distribution for each variable to produce hundreds or thousands of possible outcomes. In general, the Monte Carlo analysis has a narrower range of solution than the “what if” analysis. This is because the “what if” analysis gives equal weight to all scenarios, while the Monte Carlo method hardly samples in the very low probability regions (rare events). The main drawback of Monte Carlo analysis is lack of flexibility. Monte Carlo experiments are deterministic multi- period optimization which yields unique decisions for all periods. Flexible solutions will always lose in deterministic evaluations and options have no value. Stochastic approach is a sophisticated method which adds flexibility to the system by delaying some of the decisions until after some unknown become known. In fact, the stochastic approach explicitly evaluates the flexibility by providing options. The value of options stems from the right to do something in the future under certain circumstances, but to drop it in others if you wish so.

Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

  • Upload
    others

  • View
    14

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Monte Carlo and Stochastic Pathways:

Illustrative Examples of Planning in Power Systems at Various Levels

Iman Moazzen, Institute for Integrated Energy Systems, University of Victoria

[email protected], www.ece.uvic.ca/~imanmoaz

ABSTRACT

This paper presents the ways that random events can be treated in different stages of energy planning

using Monte Carlo experiments and Stochastic approach. These methods are compared in terms of

performance and computational complexity.

INTRODUCTION

The simplest way to deal with random events in an optimization problem is to consider deterministic

modeling using single-point estimates. This is usually referred to as “what if” approach. In this case, each

uncertain variable within a model is assigned to a single value such as best, worst, or most likely case.

Each single-point estimate represents a scenario and results in a particular solution.

A more advanced approach is Monte Carlo which has been extensively used in the past. This approach

relies on repeated random sampling to obtain numerical results. In contrast to the “what if” approach,

Monte Carlo experiments sample from a probability distribution for each variable to produce hundreds or

thousands of possible outcomes. In general, the Monte Carlo analysis has a narrower range of solution

than the “what if” analysis. This is because the “what if” analysis gives equal weight to all scenarios,

while the Monte Carlo method hardly samples in the very low probability regions (rare events). The main

drawback of Monte Carlo analysis is lack of flexibility. Monte Carlo experiments are deterministic multi-

period optimization which yields unique decisions for all periods. Flexible solutions will always lose in

deterministic evaluations and options have no value.

Stochastic approach is a sophisticated method which adds flexibility to the system by delaying some of the

decisions until after some unknown become known. In fact, the stochastic approach explicitly evaluates the

flexibility by providing options. The value of options stems from the right to do something in the future

under certain circumstances, but to drop it in others if you wish so.

Page 2: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Technically, stochastic programs are much more complicated than the corresponding deterministic

programs. Hence, at least from a practical point of view, there must be very good reasons to turn to the

stochastic models. In this paper, three following examples are provided to illustrate the benefits of the

stochastic approach:

Example 1 is a simple long-term planning problem used to explain the main concept behind the

stochastic approach

Example 2 is a middle-term planning problem to manage hydro storages on a seasonal basis. This

is particularly important in hydro-dominated system such as BC grid.

Example 3 is a short-term scheduling problem to find the best economic dispatch for thermal

units when the portion of renewable intermittent energy (wind) is high in the grid. This scenario

is similar to Energy Transformation Scenario for Alberta grid.

EXAMPLE 1

Let’s assume building a wind generator consists of two stages:

Development - resource assessment, buy the land and get the permit (time-consuming)

Construction- Install the wind turbine (fast)

If the wind generator is available in the future, it can produce one unit of electricity which can be sold

at a price 𝑝 in the market. 𝑝 Is unknown at the present and “Development” must take place before 𝑝

becomes known as it is time-consuming. However, it is possible to delay “Construction” as it can be done

fast until after 𝑝 becomes known, but at a 10% penalty. The cost structure is given in the Table 1.

Table 1. Cost Assumption for Example 1

Development Present Construction Delayed Construction

Cost ($) 200 600 660

Page 3: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

The optimization problem to maximize the profit can be formulated as follows:

Maximize [ 𝑝 ∗ (𝑦1 + 𝑦2) − (200 ∗ 𝑥 + 600 ∗ 𝑦1 + 660 ∗ 𝑦2) ]

Subject to:

Condition 1: 𝑦1 + 𝑦2 < 2

Condition 2: 𝑥 − (𝑦1 + 𝑦2) > 0

Condition 3: 𝑥, 𝑦1, 𝑦2 are binary variables (zero or one)

𝑥, 𝑦1 and 𝑦2 are the binary decisions for doing/not doing “Development”, “Present Construction” and

“Delayed Construction”, respectively. Condition 1 means 𝑦1 and 𝑦2 cannot be one at the same time (it is

meaningless to install turbine twice). Condition 2 means 𝑥 must be one if 𝑦1 or 𝑦2 is one (it is

meaningless to do construction if the development stage is not considered). It is clear that the problem can

have one of these four solutions:

Solution 1

(do nothing)

Solution 2

(development)

Solution 3

(development and present

construction)

Solution 4

(development and delayed

construction)

Page 4: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Now, assume for simplicity that 𝑝 can take on only two values, namely 200 and 1200, each with a

probability of 0.5.

To solve the problem using Monte Carlo approach, we need to:

Choose a random number for 𝑝 according to its probability distribution

Fix 𝑝 and solve the optimization problem

Repeat the process many times

It is easy to show that when the price is 200 the optimal decision is “Solution 1” and when the price is

1200 the optimal decision is “Solution 3”. Hence, if we repeat the 10000 times, the histogram of the

solutions is similar to Fig.1.

Figure 1. Monte Carlo results for Example 1

Note that in this setting it is never optimal to use delayed construction (Solution 4). The reason is that

each scenario analysis is performed under certainty (𝑝 is fixed), and hence, there is no reason to pay the

extra 10% for being allowed to delay the decision. Also, it is clear that it is never optimal to just do

development (Solution 2).

S1 is the optimal solution when the price is 200 and S3 is the optimal solution when the price is 1200.

But are these the solutions with the best expected performance? Let’s answer this question by simply

listing all possible solutions, and calculate their expected profit in Table 2.

Page 5: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Table 2. Expected profit for four possible solutions in Example 1

Investment Income if 𝒑= 200 Income if 𝒑= 1200 Expected Profit

Solution 1 0 0 0 0

Solution 2 -200 0 0 -200

Solution 3 -800 0.5(200) 0.5(1200) -100

Solution 4 -200 0.5(1200-660) 70

As we see from Table.2, the optimal solution is to do development, then wait to see what the price

turns out to be. If the price turns out to be low, do nothing, if it turns out to be high, do construction. The

solution that truly maximizes the expected value of the objective function will be called the stochastic

solution. Solution 4 is the optimal solution as it has options in it.

In Monte Carlo approach, options have no value, and hence, never show up in a solution. The value of

a stochastic solution lies in the explicit evaluation of flexibility. Flexible solutions will always lose in

deterministic evaluations. What is it that gives an option a value? Its value stems from the right to do

something in the future under certain circumstances, but to drop it in others if you wish so.

In Monte Carlo method, after the fact, it will always be such that one of the scenario solutions turns

out to be the best choice. The problem is that it is not the same scenario solution that is optimal in all

cases. In fact, most of them are very bad in all but the situation where they are best. The stochastic

solution, on the other hand, is normally never optimal after the fact. But, at the same time, it is also hardly

ever really bad. In our example, with the given probability distribution, the decision of doing nothing

(which has an expected value of zero) and the decision of doing development and present construction

(with an expected value of -100) both have a probability of 50% of being optimal after 𝑝 has become

known. The stochastic solution, with an expected value of 70, on the other hand, has zero probability of

being optimal in hindsight.

If you base your decisions on stochastic models, you will normally never do things really well.

Therefore, people who prefer to evaluate after the fact can always claim that you made a bad decision. If

you base your decisions on scenario solutions, there is a certain chance that you will do really well (or

really bad).

Page 6: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

EXAMPLE 2

Given a hydro storage with the maximum capacity of 100 GWh1 and a thermal unit with infinite

capacity, the goal is to come up with a strategic-water-release plan to minimize thermal generation across

the summer. The hydro and thermal generation costs are assumed to be 0 and $1/GWh respectively. The

initial storage is 50 GWh and because of some environmental constraints the end storage must be at least

50 GWh. The natural inflow is a random event but based on the historical records we know the

probability distribution for each month as summarized in Table 3. The load is 100 GWh and constant

across all three months.

The problem can be formulated as follows (this is referred to as “Standard Formulation”):

Standard Formulation

Minimize 𝑦1 + 𝑦2 + 𝑦3

Subject to:

−𝑥1 ≤ 50 − 𝑟1

𝑥1 ≤ 50 + 𝑟1

−𝑥1 − 𝑥2 ≤ 50 − 𝑟1 − 𝑟2

𝑥1 + 𝑥2 ≤ 50 + 𝑟1 + 𝑟2

−𝑥1 − 𝑥2 − 𝑥3 ≤ 50 – 𝑟1 − 𝑟2 − 𝑟3

𝑥1 + 𝑥2 + 𝑥3 ≤ 𝑟1 + 𝑟2 + 𝑟3

Meaning:

The water level must be between zero and

100 GWh (maximum capacity) for all the months.

The last inequality is seasonal recovery constraint

−𝑥1 − 𝑦1 ≤ −100

−𝑥2 − 𝑦2 ≤ −100

−𝑥3 − 𝑦3 ≤ −100

Meaning:

Load must be met for all the months.

𝑥1, 𝑥2, 𝑥3, 𝑦1, 𝑦2, 𝑦3 ≥ 0

𝑥1, 𝑥2, 𝑥3 are hydro generation for the first, second and third month respectively.

𝑦1, 𝑦2, 𝑦3 are thermal generation for the first, second and third month respectively.

1 The reservoir capacity is often defined in terms of water volume (𝑚3) but for simplicity energy unit is used.

Page 7: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Table 3. Natural Inflow Pattern

Pattern

Name

Month Distribution

Type

Mean

(GWh)

Standard Deviation

(GWh)

𝑟1 June Normal 50 12

𝑟2 July Uniform 50 14.5

𝑟3 August Normal 50 9

Monte Carlo Approach

1- Generate a random number for 𝑟1 , 𝑟2 , 𝑟3 according to their probability distributions

2- Fixed 𝑟1 , 𝑟2 , 𝑟3 and solve the above optimization problem

3- Repeat it many times

4- Pick one of the solutions based on the cost and risk you want to accept (e.g. risk of flood,

overstraining water or not satisfying the load)

NOTE: This solution is a SINGLE solution for all the months, i.e. we decide for all the months NOW.

It is important to note that for each iteration the feasible area is changing as new values are assigned to

𝑟1 , 𝑟2 , 𝑟3. In Fig.2, feasible areas are shown as 𝑟1 and 𝑟2 change2. It can be concluded that a solution

from one of the Monte Carlo simulations might not even be in the feasible area of another simulations.

Stochastic Approach

The idea behind stochastic approach is to delay some of the decisions until after some unknown

becomes known. For instance, in the above example, we don’t need to decide on the exact hydro and

thermal generation for July NOW. We can wait and observe the natural inflow in June and then decide.

When a decision must be made NOW, it will be referred to as a first-stage decision. This decision is

UNIQUE. In the above example, the hydro and thermal generation for June are first-stage decisions.

When a decision can be delayed until after some unknown becomes known, it will be referred as a

second-stage decision. This decision in NOT UNIQUE and can have different values based on the

observation in the past. In the above example, the hydro and thermal generation for July and August are

second-stage decisions.

2 The feasible area is a six-dimensional area and cannot be shown. For simplicity, the first four inequality constrains

are just considered.

Page 8: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

(a)

(b)

(c)

(d)

Figure 2. feasible area of the standard optimization problem

(a) 𝑟1 = 30 , 𝑟2 = 30 , (b) 𝑟1 = 30 , 𝑟2 = 60, (c) 𝑟1 = 60 , 𝑟2 = 30, (d) 𝑟1 = 60 , 𝑟2 = 60

Page 9: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

The objective in the stochastic approach is to minimize the cost of first-stage and expected value of the

second stage decisions. Hence, the standard case can be reformulated as follows (𝐸{} stands for expected

value):

Minimize 𝑦1 + 𝐸{ 𝑦2(𝑟1) + 𝑦3(𝑟1, 𝑟2)}

Subject to:

−𝑥1 ≤ 50 − 𝑟1

𝑥1 ≤ 50 + 𝑟1

−𝑥1 − 𝑥2(𝑟1) ≤ 50 − 𝑟1 − 𝑟2

𝑥1 + 𝑥2(𝑟1) ≤ 50 + 𝑟1 + 𝑟2

−𝑥1 − 𝑥2(𝑟1) − 𝑥3(𝑟1, 𝑟2) ≤ 50 – 𝑟1 − 𝑟2 − 𝑟3

𝑥1 + 𝑥2(𝑟1) + 𝑥3(𝑟1, 𝑟2) ≤ 𝑟1 + 𝑟2 + 𝑟3

−𝑥1 − 𝑦1 ≤ −100

−𝑥2(𝑟1) − 𝑦2(𝑟1) ≤ −100

−𝑥3(𝑟1, 𝑟2) ≤ − 𝑦3(𝑟1, 𝑟2) ≤ −100

𝑥1, 𝑥2, 𝑥3, 𝑦1, 𝑦2, 𝑦3 ≥ 0

It is clear that 𝑥2 and 𝑦2 are the functions of observations for the natural inflow in June (𝑟1), and 𝑥3

and 𝑦3 are the functions of the observations for the natural inflow in June and July (𝑟1, 𝑟2), i.e. they can

have DIFFERENT values based on the observations.

Due to the expected value, 𝐸{}, in the objective function, the above optimization problem is not linear

and can present numerical difficulties even for small idealized problem. To avoid this, we shall try to

approximate the probability distribution by discrete ones. An example is shown in Fig.3 where

𝑟1 is approximated using 17 discrete bins. Obviously, this approximation can result in considerable

discretization errors if the number of bins is too small.

Page 10: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Figure 3. Discrete approximation of the probability distribution

Each random pattern (𝑟1, 𝑟2, 𝑟3) is discretized into “𝑏" bins. For example, 𝑟1(𝑖) and 𝑝1(𝑖) are the value

and probability of the 𝑖𝑡ℎ bin respectively. Thanks to discretization, the above problem can be expressed

as (this is referred to as “Stochastic Formulation”):

Stochastic Formulation

Minimize 𝑦1 + ∑ 𝑝1(𝑖)𝑏𝑖=1 ∗ 𝑦2(𝑟1(𝑖)) + ∑ ∑ 𝑝1(𝑖) ∗ 𝑝2(𝑗)𝑏

𝑗=1𝑏𝑖=1 ∗ 𝑦3(𝑟1(𝑖), 𝑟2(𝑖))

Subject to:

−𝑥1 ≤ 50 − 𝑟1(𝑖) ∀𝑖

𝑥1 ≤ 50 + 𝑟1(𝑖) ∀𝑖

−𝑥1 − 𝑥2(𝑟1(𝑖)) ≤ 50 − 𝑟1(𝑖) − 𝑟2(𝑗) ∀𝑖, 𝑗

𝑥1 + 𝑥2(𝑟1(𝑖)) ≤ 50 + 𝑟1(𝑖) + 𝑟2(𝑗) ∀𝑖, 𝑗

−𝑥1 − 𝑥2(𝑟1(𝑖)) − 𝑥3(𝑟1(𝑖), 𝑟2(𝑗)) ≤ 50 – 𝑟1(𝑖) − 𝑟2(j) − 𝑟3(𝑘) ∀𝑖, 𝑗, 𝑘

𝑥1 + 𝑥2(𝑟1(𝑖)) + 𝑥3(𝑟1(𝑖), 𝑟2(𝑗)) ≤ 𝑟1(𝑖) + 𝑟2(j) + 𝑟3(𝑘) ∀𝑖, 𝑗, 𝑘

−𝑥1 − 𝑦1 ≤ −100

−𝑥2(𝑟1(𝑖)) − 𝑦2(𝑟1(𝑖)) ≤ −100 ∀𝑖

−𝑥3(𝑟1(𝑖), 𝑟2(𝑗)) ≤ − 𝑦3(𝑟1(𝑖), 𝑟2(𝑗)) ≤ −100 ∀𝑖, 𝑗

𝑥1, 𝑥2, 𝑥3, 𝑦1, 𝑦2, 𝑦3 ≥ 0

Page 11: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Note that each condition must be valid for any realization of the random patterns. This means that the

feasible area is UNIQUE and considers all possible cases. Consequently, the solution (if there is one) is

always feasible. To illustrate that, the feasible area is shown is Fig.4 for the case that 𝑟1 and 𝑟2 can get

either 30 or 60 (similar to Fig.2).

Figure 4. Feasible area of the stochastic optimization problem, 𝑟1 and 𝑟2 can get either 30 or 60

Comparison

In this section, the results from Monte Carlo simulations and the stochastic approach are compared.

a) Monte Carlo

The standard case was repeated for 10000 iterations and the associated cost was calculated. The

probability of occurrence versus thermal generation cost is plotted in Fig.5 (a). In the Monte Carlo

method, after the fact, it will always be such that one of the scenario solutions turns out to be the best

choice. The problem is that it is not the same scenario solution that is optimal in all cases. In fact, most of

them are very bad (even infeasible) in all but the situation where they are best. To illustrate that, the

reliability is defined as the probability of each scenario solution to be feasible in other scenarios. The

solution is considered infeasible if at least one of the constraints is violated. Note that the reliability

provides no indication of the size of possible constraint violations and corresponding penalty costs.

Nevertheless, there are many real life decision situations where reliability is considered to be the most

important issue as it is not always possible to quantify a penalty function. The reliability versus thermal

generation cost is plotted in Fig.5 (b).

Page 12: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

(a)

(b)

Figure 5. (a) Probability of occurrence versus cost, (b) reliability versus cost

Note that none of the decisions is completely safe and maximum reliability is about 0.65! The question

is which decision is the best. It depends, if we want to accept minimum risk, the safest solution is

𝑥1 = 54, 𝑥2 = 36.5, 𝑥3 = 34.5, 𝑦1 = 46, 𝑦2 = 63.5 and 𝑦3 = 65.5 with the thermal generation cost of

$175 and reliability of 0.65. If we want to accept more risk in the hope for less thermal generation cost,

one good solution is 𝑥1 = 52.5, 𝑥2 = 55.5, 𝑥3 = 56, 𝑦1 = 47.5, 𝑦2 = 44.5 and 𝑦3 = 44 with the cost

of $136 and reliability of 0.31. Note that this thermal generation cost has the highest probability of

occurrence in Fig 5(a) (circled in the figure).

To provide a trade-off between thermal generation cost and risk, one possible approach is to multiply

the reliability with probability of occurrence for each solution. In fact, probability of occurrence acts as a

weighting system. The result is plotted in Fig. 6. A good decision which provides a trade-off between cost

and risk is the top point in Fig.6 (circled in the figure) where the decisions are 𝑥1 = 44, 𝑥2 = 39,

𝑥3 = 47.5, 𝑦1 = 56, 𝑦2 = 61 and 𝑦3 = 52.5 with the cost of $169.5.

Page 13: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Figure 6. Reliability multiplied by probability of occurrence versus cost

a) Stochastic Approach

The first-stage decisions (unique) are the hydro and thermal generation for June (𝑥1 and 𝑦1). These

values are 𝑥1 = 43.5 and 𝑦1 = 56.5. For discretization process, 21 bins were considered, i.e. each

random pattern is approximated using 21 values. 𝑥2 and 𝑦2 are function of natural inflow in June (𝑟1).

There are 21 different realizations of 𝑟1, each of which is corresponding to a different decision for 𝑥2

and 𝑦2 as shown in Fig.7 (a). Also, 𝑥3 and 𝑦3 are function of natural inflow in June and July (𝑟1, 𝑟2).

There are 21*21 different realizations, each of which is corresponding to a different decision for 𝑥3 and

𝑦3 as shown in Fig.7 (b).

(a)

(b)

Figure 7. Different policies for hydro and thermal generation according to the observations of natural inflow

(a) Decisions for July, (b) Decisions for August

Page 14: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

The stochastic solution is NEVER infeasible as all the scenarios are considered in the “Stochastic

Formulation”. Total expected cost for the first-stage and second-stage decisions is $174. This cost is very

close to the safest solution in Monte Carlo approach, but it is worth noting that the second-stage decisions

in stochastic solution are not unique and based on our observation of natural inflow in the past month(s)

there are different options to choose from. In Monte Carlo approach, options have no value, and hence,

never show up in a solution. In fact, deterministic solutions will underestimate the true costs and the risk

of spilling water, and deterministic models will not see any value in waiting with releasing water in order

to learn more about future natural inflow.

EXAMPLE 3

Four-Hour-Ahead Unit Commitment

The goal is to find the best economic dispatch strategy for the next four hours. Generation pool

consists of many coal IPPs with total capacity of 80 MW, one 40-MW gas unit and a wind farm. The

power purchase agreement with IPPs must be finalized now, i.e. the commitment decisions for the coal

generators in the next four hours must be taken now and cannot be delayed. The gas generator can

provide power on short notice but it cannot ramp up/down more than half of its capacity each hour. Wind

output for each hour is a random event with the probability distribution described in Table 4. If there is a

shortage, power can be imported at a high price. The load is 100 MW and constant across the four hours.

The cost assumptions, summarized in Table 5, are time variant.

Table 4. Wind Pattern

Pattern

Name

Hour Distribution

Type

Mean

Standard

Deviation

𝑤1 1 Normal 45 12

𝑤2 2 Normal 25 9

𝑤3 3 Normal 35 9

𝑤4 4 Normal 55 12

Table 5. Generation Cost for Example 3

Type Capacity $/MW

First Hour

$/MW

Second Hour

$/MW

Third Hour

$/MW

Four Hour

Coal 80 1 2 3 4

Gas 40 5 6 7 8

Import Infinite 9 10 11 12

Wind 80 0 0 0 0

Page 15: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

The problem can be formulated as follows:

Standard Formulation

Minimize (𝑐1 + 2𝑐2 + 3𝑐3 + 4𝑐4) + (5𝑔1 + 6𝑔2 + 7𝑔3 + 8𝑔4) + (9𝑖1 + 10𝑖2 + 11𝑖3 + 12𝑖4)

Subject to:

|𝑔2 − 𝑔1| ≤ 20

|𝑔3 − 𝑔2| ≤ 20

|𝑔4 − 𝑔3| ≤ 20

Meaning:

The gas generator can only ramp

up/down 20 MW between each step

𝑐1 + 𝑔1 + 𝑤1 + 𝑖1 ≥ 100

𝑐2 + 𝑔2 + 𝑤2 + 𝑖2 ≥ 100

𝑐3 + 𝑔3 + 𝑤3 + 𝑖3 ≥ 100

𝑐4 + 𝑔4 + 𝑤4 + 𝑖4 ≥ 100

Meaning:

Load must be met for all the hours.

𝑐1, 𝑐2, 𝑐3, 𝑐4 ≤ 80

𝑔1, 𝑔2, 𝑔3, 𝑔4 ≤ 40

Meaning:

Maximum Generation

𝑐1, 𝑐2, 𝑐3, 𝑐4, 𝑔1, 𝑔2, 𝑔3, 𝑔4, 𝑖1, 𝑖2, 𝑖3, 𝑖4≥ 0

𝑐, 𝑔, 𝑤, 𝑖 represent coal, gas, wind generation and import portion respectively. The index indicates the

hour, e.g. 𝑐3 means coal generation in the third hour.

Monte Carlo Approach

1- Generate a random number for 𝑤1 , 𝑤2 , 𝑤3, 𝑤4 according to their probability distributions

2- Fixed 𝑤1 , 𝑤2 , 𝑤3, 𝑤4 and solve the above optimization problem

3- Repeat it many times

4- Pick one of the solutions based on the cost and risk you want to accept.

Because of having random events in the inequality constraints, it is easily seen that the variation of the

feasible area between different simulations may be substantial, depending on the actual realizations of the

random data. This implies that an optimum solution for one simulation might not be even feasible in other

simulations. A first possibility to deal with this issue would consist in looking for a “safe” generation

plan: one that will be feasible for all possible realizations of wind. A plan like this is called a fat solution

and reflects total risk aversion of the decision maker. Not surprisingly, fat solutions are usually rather

expensive. Another possibility is to use stochastic approach.

Page 16: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Stochastic Approach

Coal generations are the first-stage decisions (unique) and must be taken now. Gas generation and

import portion are the second-stage decisions (not unique) and can be delayed until after wind

observations. The approach to replace the above optimization problem with a stochastic one is similar to

the method discussed in the “Example 2”.

Comparison

The results for Monte Carlo approach (several iterations) are shown in Fig.8. The left figure shows the

generation cost and its corresponding probability of occurrence. The right figure shows reliability versus

generation cost. Reliability is defined as the probability of each scenario solution to be feasible in other

scenarios. The solution is considered infeasible if at least one of the constraints is violated.

A risky-but-cost-effective decision can be the top point in Fig.8 (a) (circled in the figure). However

the risk of infeasibility for this decision is high as shown in Fig.8 (b). The coal commitment decisions for

this particular solution are 𝑐1 = 55 , 𝑐2 = 75, 𝑐3 = 65 , 𝑐4 = 45 MW with the total generation cost of

$580. The rest of generation decisions (gas and import) are zero. Note the generation cost is $580 if and

only if the actual wind observations are matched to the one used in this simulation! Any deviation must

be compensated by other resources (gas or import) to satisfy the load. This would impose extra cost to the

system. In fact, $580 is the minimum generation cost. A safe-but-expensive decision (fat solution) is

corresponding to the top point in Fig.8 (b) (circled in the figure) where 𝑐1 = 80 , 𝑐2 = 80, 𝑐3 = 80 , 𝑐4 =

72, 𝑔1 = 2, 𝑔2 = 15 , 𝑔3 = 5 MW with the total generation cost of $900! The rest of generation

decisions are zero.

To provide a trade-off between cost and risk, one possible approach is to multiply the reliability with

probability of occurrence for each solution. In fact, probability of occurrence acts as a weighting system.

The result is plotted in Fig.9. A good decision which provides a trade-off between cost and risk is the top

point in Fig.9 (circled in the figure) where the coal commitment decisions are 𝑐1 = 62 , 𝑐2 = 80, 𝑐3 =

70 , 𝑐4 = 52 MW. The rest of generation decisions are zero. The minimum generation cost for this

decision is $638.

In the stochastic approach, the first-stage decisions (unique) are the coal generation for all the hours.

For the discretization process of probability distributions, 9 bins were considered, i.e. each random pattern

is approximated using 9 values. There are 94 = 6561 possible scenarios in total. The coal commitment

decisions are 𝑐1 = 62, 𝑐2 = 80, 𝑐3 = 65 𝑐4 = 45. The other generation decisions (gas and import) are

Page 17: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

not unique and depend on the wind observations. The total expected generation cost is $674. The

generation cost and the probability of occurrence for all 6561 scenarios is shown in Fig.10. Note the coal

generations are the same in all scenarios. However, the expected cost is higher than the decisions that we

took using Monte Carlo approach (except the fat solution), it is worth noting that this solution is always

feasible.

(a)

(b)

Figure 8. (a) Probability of occurrence versus cost, (b) reliability versus cost

Figure 9. Reliability multiplied by probability of occurrence versus cost

Page 18: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

Figure 10. The generation cost and the probability of occurrence for all 6561 scenarios

(the coal commitment decisions are the same in all scenarios)

COUMPUTATON

Depending on the number of realizations of random events, the stochastic optimization problem may

become very large in scale. For the Example 2 discussed in this paper, there are 6 variables and 15

inequalities constraints in the standard formulation, but in the stochastic formulation there are

2∗(1 + 𝑏𝑖𝑛 + 𝑏𝑖𝑛2) variables and (2∗ 𝑏𝑖𝑛 + 1) ∗(1 + 𝑏𝑖𝑛 + 𝑏𝑖𝑛2) constraints! As an example, number of

constraints versus number of bins is plotted in Fig.11. In the Monte Carlo simulations, a small-sized

problem is solved several times for different values of random patterns, but in the stochastic approach a

large-sized problem is solved just once.

Figure 11. Number of constraints versus bins in stochastic formulation of Example 2

Page 19: Monte Carlo and Stochastic Pathways: Illustrative Examples ...imanmoaz/publications_files/Report_Stochastic.pdf · deterministic evaluations and options have no value. Stochastic

CONCLUSION

This paper provides some insights into the basics of stochastic optimization. Using three planning

examples in power systems, we demonstrated why it is important, often crucial to turn to stochastic

programming when working with decisions affected by uncertainty. A Monte Carlo simulation is a

deterministic multi-period optimization which yields decisions for all periods, but the stochastic approach

delays some of the decisions until after some unknown become known and yields policies or strategies to

deal with random events. The stochastic approach explicitly evaluates the flexibility by providing options.

Depending on the number of realizations of random events, the stochastic optimization problem may

become very large in scale.

REFERENCES

[1] Glyn A. Holton, “Perspectives: Defining Risk”, Financial Analysts Journal, Vol. 60, No. 6, pp. 19-25, 2004.

[2] Peter Kall and Stein W. Wallace, “Stochastic Programming”, Second Edition, Wiley, 1994.

[3] Stein W. Wallace, Stein-Erik Fleten, “Stochastic Programming Models in Energy”, Handbooks in Operations

Research and Management Science, Elsevier, Vol. 10, pp. 637-677, 2003.

[4] Pernille Seljom, Asgeir Tomasgard, “Short-term uncertainty in long-term energy system models — A case study

of wind power in Denmark”, Energy Economics, Vol. 49, pp. 157-167, 2015.

[5] Anders Gjelsvik, Birger Mo, and Arne Haugstad, “Long- and Medium-term Operations Planning and Stochastic

Modelling in Hydro-dominated Power Systems Based on Stochastic Dual Dynamic Programming”, Handbook of

Power Systems I, Springer, pp. 33-55, 2010.