pyspd Package

pyspd Package

actors Module

class pyspd.actors.Branch(SO, sending_node, receiving_node, capacity=0, risk=False)[source]

Bases: object

Branch

A Branch is a connection point between any two nodes and specifies the capacity between the nodes. A branch may be a risk setting object, if the risk flag is set to True If this is the case then the current implementation of the model requires the sending and receiving node to be in different Reserve Zones.

To initiate a Branch object a minimum of three items must be passed.

Parameters :

SO: SystemOperator :

The System Operator object for the current solution run

sending_node: Node :

The node which is specified as the sending node for the model dispatch

receiving_node: Node :

The receiving node for the model dispatch

capacity: int, float, default 0 :

The capacity of the branch

risk: bool, default False :

Flag to treat the branch as a risk setting object.

class pyspd.actors.Company(name)[source]

Bases: object

Company

A container around a number of Stations and Interruptible Load which can be used to determine the aggregate position for a particular company. This is useful when determining profits and losses from a particular solution ot the model and should speed up the iteration process.

class pyspd.actors.InterruptibleLoad(name, SO, Node, Company)[source]

Bases: object

InterruptibleLoad

Container for an Interruptible Load participant within the market. This participant acts as a non-generator source of reserve for supporting a higher level of risk in the market.

Currently set up by passing a unique name to the object.

Parameters :

name: str :

The unique name to be applied to the Interruptible Load object

SO: SystemOperator :

The System Operator object

Node: Node :

The location of the source of interruptible load

Company: Company :

Who controls the Interruptible Load object, used when determining profits or losses

Methods

add_reserve_offer(price, offer)[source]

Add a Reserve Offer to the object consisting of a price and offer

Parameters :

price: int, float :

The price of the offer

offer: int, float :

The quantity of the offer

class pyspd.actors.Node(name, SO, RZ, demand=0)[source]

Bases: object

Node

A nodal location within the current system. Is part of a reserve zone and acts as a location for demand, generation and reserve. Has a number of automatic methods which are called whenever a new object is created at the node in question to handle the book keeping operations.

Parameters :

name: str :

A unique name for the Node

SO: SystemOperator :

The system opeartor object

RZ: ReserveZone :

What reserve zone the node is a part of

demand: int, float, default 0 :

The nodal demand at the node

class pyspd.actors.ReserveZone(name, SO)[source]

Bases: object

ReserveZone

A Reserve Zone is a collection of nodes which have a separate “risk” which must be secured against by dispatching reserve from the nodes within the zone. Reserve procured from other zones cannot currently be utilised to secure a risk in a separate zone

Parameters :

name: str :

Unique name for the Reserve Zone

SO: SystemOperator :

The System Operator object for the dispatch

class pyspd.actors.Station(name, SO, Node, Company, capacity=0)[source]

Bases: object

Station

A generation station for use in the SPD model. Is a container around the core functionality that can be called automatically by the operator to provide its offers. Ideally is a self contained agent that communicates with the SystemOperator

Parameters :

name: str :

Unique name for the Generation Station

SO: SystemOperator :

Operator object for the situation

Node: Node :

Location of the generation station

Company: Company :

Owner of the generation station for determining total revenue etc

capacity: int, float, default 0 :

Total generation capacity of the station

Methods

add_energy_offer(price, offer)[source]

Adds an Energy Offer to the station

Parameters :

price: int, float :

The price of the Energy Offer

offer: int, float :

Offer component of the Energy Offer

add_reserve_offer(price, offer, proportion)[source]

Adds a Reserve Offer to the Station

Parameters :

price: int, float :

The price of the Reserve Offer

offer: int, float :

Offer component of the Reserve Offer

proportion: float :

Proportion component of the Reserve Offer

class pyspd.actors.SystemOperator[source]

Bases: object

System Operator

This is a container which contains all of the information about the System. This includes demand data, nodes, stations etc. It must be created first when developing a simulation.

Once it has been created it is passed to the creation of any other object upon which it will automatically update itself.

Once the simulation has been fully defined it is passed to the SPDmodel instance which draws all of the necessary variables and values. These are taken and a Linear Program created which is solved.

Methods

create_iterator(actor=None, variable='reserve_price', varrange=<Mock object at 0x134cf10>)[source]

Create a range of duplicate scenarios which are all solved at once to assess the benefits of a particular strategy over a particular run.

This is a user exposed function and must be called whenever a run is being created.

Parameters :

actor: Node, Station, InterruptibleLoad :

An object which is to be modified when solving the linear program

variable: str :

The name of the variable to be modified, e.g. ‘reserve_price’

varrange: iterable :

An iterable of ints or floats which consist of the new values for the variable in each instance

analysis Module

model Module

Overall Model for the linear program.

class pyspd.model.SPDModel(ISO)[source]

Bases: object

SPDModel

Container for setting up, solving, and organising the results of a Simulation. Contains three primary API methods. Creation of the Linear Program, solving the LP and parsing the results.

Methods

create_lp()[source]

Publically exposed API Creates the Linear program including applying the objective function and adding all of the necessary constraints. This exists as a wrapper around a number of hidden functions.

parse_result()[source]

Publically exposed API Parse the Results of the solved Linear Program. Must be called after solving it.

solve_lp()[source]

Solve the Linear Program including the time taken to solve it

write_lp(fName=None)[source]

Write the Linear Program to a file

Table Of Contents

This Page