Skip to content

Commit

Permalink
Merge all work for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-harvey committed Jun 9, 2020
1 parent 1da570e commit 671fb13
Show file tree
Hide file tree
Showing 107 changed files with 1,518,417 additions and 451 deletions.
1 change: 1 addition & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source("renv/activate.R")
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
inputs/demand/*.csv
investigations
inputs/mapping/old*
rprogs/dev/*
108 changes: 108 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
**LICENCE TO USE AUTHORITY MODELS**

**Electricity Authority**, a Crown entity established under section 12 of the Electricity Industry Act 2010 (“the
**Authority**”) either owns or is authorised to licence applications, models and tools to support the Authority's
industry and market monitoring functions, including:

(a) Vectorised Scheduling Pricing and Dispatch (vSPD);
(b) Hydro Supply Security test (HSS);
(c) Electricity Market Information tools (EMI tools);
(d) Dynamic Outer Approximation Sampling Algorithm (DOASA); and
(e) except where we have informed you otherwise, any other applications, models and tools made available by the Authority via the Authority's website (www.ea.govt.nz), the EMI website (www.emi.ea.govt.nz), or any other platform authorised by the Authority for such dissemination purposes (e.g. github.com/ElectricityAuthority),

together the **"Models"**.

Your use of the Models is subject to the following terms and conditions (**"Licence"**). By downloading or using a Model
you will be deemed to have agreed to this Licence without reservation or variation.

**1. USE RIGHTS AND LIMITATIONS**

1.1 Unless we inform you otherwise, the following terms and conditions in sub-clauses 1.1(a) to 1.1(c) and clauses 2
to 7 apply to your use of Models other than DOASA:

(a) Subject to sub-clause (c) below, you may use, copy, adapt, modify, distribute, transfer, assign or sublicense the
Models in whole or in part as you see fit for any purpose.

(b) You agree to contact the Authority at [email protected] with any suggestions that you have regarding the Models,
including suggestions for improvements or enhancements. You will not, or attempt to, restrict, impede or impose terms on
the Authority's rights to further develop, adapt or modify in any manner the Models for any purpose.

(c) Many of the Models are developed in GAMS which requires the user to have a GAMS licence in order to operate the
Model. You are responsible for purchasing your own GAMS licences to operate the Models and the Authority shall have no
liability or responsibility arising out of you failing to acquire a licence or for any breach by you of the GAMS licence
terms and conditions.


1.2 The following terms and conditions in sub-clauses 1.2(a) to 1.2(e) and clauses 2 to 7 apply to your use of DOASA:

(a) DOASA is licensed to the Authority by its third party licensor Stochastic Optimization Limited (SOL).

(b) The Authority's Electricity Market Information tool (EMI tools), a Windows-based application developed by the Authority to facilitate use of the Models, provides the user interface for DOASA. You cannot use DOASA without using EMI tools.

(c) DOASA uses CLP, the COIN-OR open source LP code. CLP is distributed under the Eclipse Public Licence (version 0.1).
You are responsible for complying with the Eclipse Public Licence in respect of your commercial use of DOASA and the
Authority will have no liability or responsibility arising out of your breach of the Eclipse Public Licence terms and
conditions.

(d) You may use DOASA for the purposes of solving hydro-thermal scheduling problems and/or developing a policy for
releasing water from reservoirs for electricity generation.

(e) You may not copy, adapt, modify, distribute, transfer, assign or sublicense DOASA.


**2. TERM**

This Licence is perpetual. However, this Licence will terminate if you fail to comply with any term or condition of this
Licence.


**3. EXCLUSION OF WARRANTIES**

(a) You assume sole responsibility for the installation, use and results obtained from the Models.

(b) The Authority does not warrant that the functions contained in the Models will meet your requirements or that the
operation of the Models will be uninterrupted or error free. The entire risk as to the quality and performance of the
Models is with you.

(c) The Authority excludes, to the extent permissible by law, all representations, warranties or guarantees whether
expressed or implied including, without limitation, any warranty or guarantee provided by the Sale of Goods Act 1908.
You agree that you are acquiring the Licence of the Models for business purposes and therefore the Consumer Guarantees
Act 1993 shall not apply to that supply.

(d) In no event will the Authority be liable to you for any damages whatsoever, including lost profits, lost savings, or
direct, indirect, incidental or consequential loss or damage arising out of the use or inability to use the Models,
whether arising in contract, tort (including negligence) or otherwise, even if the Authority has been advised of the
possibility of such damages or for any claim by any other party.

(e) If, notwithstanding the above clause, the Authority is held liable under this Licence or in relation to the Models
the Authority's liability shall be limited to the sum of $1.00.


**4. COPYRIGHT**

(a) You acknowledge that the Models are the subject of copyright. You shall not during or any time during or after the
expiry or termination of the licence engage in or permit any act which infringes that copyright and, without limiting
the generality of the foregoing, you specifically acknowledge that you may not copy or adapt the Models except as
otherwise expressly authorised by this Licence.

(b) You shall indemnify the Authority fully against all liabilities, costs and expenses which the Authority may incur to
a third party as a result of any breach of this Licence where that breach is caused or permitted to be caused by you, or
any of your employees, subcontractors, agents, or other party within your reasonable control.


**5. THIRD PARTY CLAIMS**

You should promptly notify us if anyone makes a claim against you that the Models infringe their rights. If you give us
such notice the Licence shall automatically terminate. This is your only remedy in the event of a claim of infringement.


**6. LAW**

This licence is governed by the laws of New Zealand and the courts of New Zealand shall have non exclusive jurisdiction
in any proceedings relating to it.


**7. QUESTIONS**

If you have any questions concerning this licence you may contact the Authority by writing to the Authority at PO Box
10041, Wellington 6143, New Zealand.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Introduction

This repository includes the code for the Authority's TPM impacts model. An earlier Excel version of the model called '2019 Proposal impacts modelling', was originally originally released as part of the [2019 Issues Paper](https://ea.govt.nz/development/work-programme/pricing-cost-allocation/transmission-pricing-review/consultations/). The original Excel version of the model is available via [EMI](https://www.emi.ea.govt.nz/Wholesale/Datasets/_AdditionalInformation/SupportingInformationAndAnalysis/2019/20190723_TPM_2019_IssuesPaper/), along with the data files and vSPD version used to generate the inputs to the model. This version of the model includes further changes made from the February - March 2020 supplementary consultation. The changes from the original model are discussed in the additional [documentation file](documentation/impact_model_documentation.html).

# Setup

This project uses R 3.6.1. [renv](https://rstudio.github.io/renv/) manages the R dependencies of this project. To install the libraries needed to run this project, run the following from the project:

```{r}
source('renv/activate.R')
renv::restore()
```

The data files used as inputs to the model are included in this repository, hence there is no setup required. These are also available from [EMI](https://www.emi.ea.govt.nz/Wholesale/Datasets/_AdditionalInformation/SupportingInformationAndAnalysis/2019/20190723_TPM_2019_IssuesPaper/).

# Running the impacts model

the `rprogs/main.R` file is used to rerun the impacts model. Sourcing this file will regenerate the results files, found in the results directory. For more information on the options available in the main file and the calculations performed, see the additional [documentation file](documentation/impact_model_documentation.html)
82 changes: 0 additions & 82 deletions calculate_mean_demand.R

This file was deleted.

53 changes: 0 additions & 53 deletions calculate_mean_generation.R

This file was deleted.

27 changes: 0 additions & 27 deletions calculate_revenue.R

This file was deleted.

18 changes: 18 additions & 0 deletions compare/ACOT_impacts_released.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
transpower_customer,ACOT_dollarsperMWh
Aurora Energy,4.480522357
Counties Power,0.787898158
Eastland Network,1.992096542
Electra,5.135833683
Horizon Energy,6.505661199
Network Tasman,2.267490137
Northpower,1.127441839
OtagoNet JV,2.939858854
Powerco,1.335051264
The Lines Company,5.071649834
The Power Company,0.102420704
Top Energy,7.227319565
Unison Networks,2.858855564
Vector,0.110492852
WEL Networks,2.544161946
Wellington Electricity,0.97107598
Westpower,4.887739595
18 changes: 18 additions & 0 deletions compare/adjusted/ACOT_impacts_excel.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
transpower_customer,ACOT_dollarsperMWh
Aurora Energy,4.480522357
Counties Power,0.787898158
Eastland Network,1.992096542
Electra,5.135833683
Horizon Energy,6.295706516
Network Tasman,2.267490137
Northpower,1.127441839
OtagoNet JV,2.939858854
Powerco,1.335051264
The Lines Company,5.071649834
The Power Company,0.102420704
Top Energy,7.227319565
Unison Networks,2.858855564
Vector,0.110492852
WEL Networks,2.544161946
Wellington Electricity,0.97107598
Westpower,4.887739595
Loading

0 comments on commit 671fb13

Please sign in to comment.