Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

QBUS6820 Prescriptive Analytics: From  Data  to  Decision

Assignment 3

Semester 1, 2023

Out: 6th May 2023

Due: 26th May 2023 at 11:59pm

This assignment consists of six problems, some involving multiple parts. Some parts require a written response and others involve coding. The parts that require a written response are described in this document, while the coding questions (indicated by    ) are described in the associated Jupyter Notebook (.ipynb   file).

You should submit a PDF to GradeScope for the written parts and match  the  page  number  with the  questions  that  you  answered.  You can find detailed instructions on how to use GradeScope on Canvas. If you fail to match the page to the corresponding question, the marker will not be able to view your response and thus you will be awarded 0 marks for the question.

You should answer the coding questions by modifying the Jupyter Notebook appropriately, and submit it through Canvas.

When a problem asks you to formulate  a model, you need to provide your mathematical formulation with clear justification of decision variables, constraints and objective. If you decide to label any of the data with algebraic symbols, you must clearly define these (e.g., let aij be the amount of material i required by product j).

All the problems  can be  done using  only the material  from this  class,  and we will  deduct points  from solutions  that  refer  to  outside  material.

Written parts must be typed. This means no handwriting and no screen shots are permitted, except for illustrative graphics to supplement answers. If you are using Microsoft Word, use the equation editor for mathematical equations/formulas. We recommend using IATEX or a similar system for typesetting your

answer.

You must  fill  and  sign the  academic honesty  declaration  on the next page  and  submit it through GradeScope.

Question:

1

2

3

4

5

6

Total

Points:

15

15

15

15

15

15

90

 Academic  integrity  declaration

Collaboration    policy.   You are only allowed to verbally discuss high-level ideas with classmates. All detailed model workings and coding should be done individually . You may consult any resources you like on how to use Python and Gurobi(e.g., syntax). However, for the conceptual model building parts you are not permitted to consult resources (e.g., internet forums, websites) except for provided lecture and tutorial content.

Academic  honesty  declaration.   I declare that the submitted work is my solely my own, except for high-level ideas that I have discussed with the following people:

I declare that I have not consulted any material besides lecture and tutorial content provided through Canvas.

I understand that my work may be submitted to similarity detection software and a copy of the work may be retained for future similarity checking.

Name:

Signed:

Date:

You power company owns a generator that runs on liquefied natural gas (LNG) fuel that it uses to generate power and sell it to the electricity market (hopefully for a profit). The units of electricity consumption are measured in megawatt hours (MWh), and the units that the generator produces are measured in megawatts (MW). The generator running at 50MW produces 50MWh if run for an hour. It produces 25MWh if run at that level for 30 minutes. The LNG fuel costs are relatively stable and the  cost per MWh of generation is $90. Therefore running the generator at 50MW for 30 minutes will cost  25×$90. Also, it is just MWh that determines the cost, so running the generator at 25MW for one hour will produce 25MWh, and also cost 25×$90.

When electricity prices (from the market) are high, it makes economic sense to turn the generator on and sell the power to the market. For example, if current electricity prices are $107.25, then selling 25MWh earns 25×$107.35 in revenue, while costing 25×$90, thus earning profit of 25×$(107.25-90). When electricity prices are low, using the generator may incur a loss.

Assume for the purposes of modelling (even though this is not realistic) that the power generated is constant over a 30 minute period, and then jumps to its new value for the next 30 minutes. Similarly, prices will remain constant in each 30 minute period, and jumps to a new value at the end of the period.  Furthermore, the generator will only operate between the times of 3pm - 12am each day, so there are 18 periods of 30 minute length.(Therefore, the generator is "off"from 12am - 3pm each day.)

The operation of the generator is subject to "ramp rate" constraints. The capacity of the generator is 180MW, but the power supplied can increase by at most 50MW in any 30 minute period. For example, if the generator is off for the period 3-3:30pm, then it cannot reach full capacity until the period 5-5:30pm. Moreover the generator cannot be shut down too quickly, so that the power supplied can be reduced by at most 80MW in any half hour period. Finally, the generator has a minimum load of 25MW, i.e., if the generator is turned on, it must produce at least 25MW to prevent unnecessary wear and tear.

In  addition to ramp rate  constraints, there  is  also  a  fixed  cost  of $50  every time the  generator transitions from idle to running, or running to idle. For example, if the generator is off from 4-4:30pm, it runs at 25MW from 4:30-5:30pm, and then is off again from 5:30-6pm, then, in addition to operating costs described above, a cost of $50 is paid to turn on the generator at 4:30pm as well as a cost of $50 to turn it off at 5:30pm.

1.(15 points)  Let n be the number  of periods  in  a  day(for  our problem n  =  18).  Let pi,...,pn be given electricity market prices during each period. Formulate a linear program that optimizes the  generator output levels given the prices. Use variables x1,...,Xn to denote the output level (in MW)  of the generator in each period.

2.(15 points) In practice, prices are unknown to us. However, we can use historical data to produce likely scenarios for the prices, then optimize the generator output levels given prices.

We now have K scenarios, and each scenario k ∈[K] has a set of prices pk,1,...,Pk,n for each period. Formulate a model that optimizes generator output levels given the scenarios, by maximizing the average profit across all scenarios.

Hint: Your model should give a single set of levels.

3.(15 points)Formulate a model that optimizes generator output levels given the scenarios, by maxi- mizing the conditional value-at-risk across all scenarios at level a.

Hint: the conditional value-at-risk defined in lectures assumes that high-valued outcomes are"bad"  (i.e., losses) and that we want to minimize the risk of obtaining a high outcome. However, when high outcomes are good (i.e., profits), this needs to be modified. In this case, the "risky" values are

low values. How should the definition of CVaR be modified?

4.(15   points)      Please refer to the Jupyter Notebook for this question.

5.(15 points)We now consider a different framework.  Suppose you set the generator levels for the first four periods from 3-5pm. Let m be the number of periods you set (in this case m = 4) with  generator levels x₁,...,Xm. Then, on observing the prices pi,...,Pm, you will choose the levels for the  remaining  n-m  periods  m+1,m+2,...,n.  In  order  to  model  this  sensibly,  we  need  to  limit the choice for the remaining n-m periods. You are allowed to choose from one of three alternative schedules for these periods. Denote these by

X1,m+1,.  · ,X1,n

x2,m+1,.. · ,x2,n

Z3,m+1,. · ,Z3,n ·

In question 6, you will come up with a rule to decide which schedule you will use, after observing p₁,...,Pm.  However,  for  now  assume  that  you  have  already  set  the  rule.  Each  scenario  k ∈[K]  can be put into one of three groups:

Ki:={k ∈[K]:schedule   1   is   chosen   after   observing   pk,1,...,Pk,m} K₂:={k ∈[K]:schedule   2   is   chosen   after   observing   pk,1,...,Pk,m}

K3:={k ∈[K]:schedule   3   is   chosen   after   observing  pk,1,...,Pk,m}.

Given  this  rule,  and  these  groups  of  scenarios,  formulate  a  model  to  optimize  the  initial  levels C1,...,Xm  as well  as the three  schedules.

6.(15  points)  One  potential  rule  is  as   follows.  Given  prices  pi,..,Pm,  let  p=  m(1) Zie[m]pi   be   the

average. Then choose two thresholds Ti < T₂ . The rule decides which schedule to use based on the

thresholds:

Carefully describe a rule that you think would work well. You do not need to implement the rule. In describing your rule, you need to define two components:

·  how  you  obtain  the  levels  x1,. …,Tm  as  well  as  schedules  xj,m+1,.  .,xj,n  for j  {1,2,3};and

● how you pick the schedule.

There  is no  one  correct  answer, though  in practice  certain rules will work better than  others. You can be as creative as you like. Marks will be given based on how well you describe your rule (rigour) as well as how convincingly you justify why the rule will work well. Clear written communication is essential  here.

Hint:  If you  are  short  on  ideas,  one  possibility  is  to  use  the  training  data  to  develop  your  rule. E.g., you could cluster data to find three groups within your training data, then compare new prices against  these  groups.

Hint: Another consideration is how you would obtain the a's. One possibility is to use the optimiza- tion model in question 5, but you don't have to. You are free to modify it, or even take a completely different approach if you wish.

 Bonus    Activity

You have the potential to  earn bonus marks  for the unit through participation  in this  activity.  This is optional, and is not part of Assignment 3. If you choose to not participate, your unit grade will not be negatively affected. There is only potential to boost your grade.

Activity.      Implement your rule from question 6. You may earn bonus marks for the unit based on the

performance of your rule.       Please refer to the Jupyter Notebook for this question.

·  Let  s₁,s₂,S₃  be  your  scores  for  the  three  assignments,  expressed  as  a  percentage.  You  have  the potential to  earn bonus points up to

p=0.2×(100-min{s1,s2,s3})%

of the total unit grade. In other words, you could turn your lowest assignment score into  100%.

The performance of your rule will be assessed using test scenarios. You will not be given access to this data. All you know about the test scenarios is that they are generated from the same source as your training scenarios. After the submission is closed, we will release code used to generate training and test scenarios for you to verify your scores.

·  Suppose there  are L test  scenarios,  and  for each  scenario  C ∈[L] let qe,1,...,qe,n denote the prices for  each  period.  The  ideal  profit  πt  will  be  computed  for  this  scenario,  which  is  computed  by  optimizing  the profit using  the  full  information  model  (given  full  knowledge  of the prices)  from

question 1 .

·Your  performance  will  be  computed  as  follows.  You  first  implement  x₁,...,Cm  on  the  first  m periods  and  examine  qe,1,...,9e,m.  Based  on  these  prices,  suppose  that  schedule  j ∈ {1,2,3}  is chosen  according to your rule, with  levels xj,m+1,...,xj,n. Your profit  is then  computed based  on

prices  qe,1,...,9e,n. Denote this profit by  Te.

 The relative performance  for test  scenario  l is  computed  as

re=max{0,πe}/πc ∈[0,1].

The  average  relative  performance  r  across  all  test  scenarios  will  be  your  performance  score.  A higher performance score is better, and the maximum performance score is  1.

● We will assign your bonus score b as follows:

b=η×r×p,

where η is a scaling parameter to be chosen to ensure proper scaling of bonuses.

You may submit three score checks on  12/5,19/5 and 24/5 and we will release results the day after. These will not contribute to your score, but you may use them to gauge how well your rule is performing. The bonus mark submission will close on 26/5 at  11:59pm. If you submit more than once, we will take your  best-performing  submission.

As this activity is not formally part of Assignment 3, bonus marks will not be awarded for submis- sions after 26/5, even if you have a  simple extension/special consideration approval for the assignment. However, you may  submit the bonus mark portion before  submitting the  assignment.