31
Discrete Event Simulation, Smart Grids and Other Topics Dan Gordon

discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Discrete Event Simulation, Smart Grids and Other Topics

Dan Gordon

Page 2: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

My Simulation Journey

• Quantum Mechanics of Bose-Einstein Condensation

• Airline Crew Scheduling

• Biophysics of Ion Channels

• Brownian Dynamics

• Molecular Dynamics

• Smart Grids and Renewables

• SmartGridToolbox - Discrete Event Simulation

• CONSORT : Bruny Island Battery Trial

Page 3: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Time-Stepped Simulations

• Simulate a continuous or regular process

• Calculate the state of the system at discrete time steps

• Time steps need not be all equal: we could use an adaptive step size that decreases when the system is rapidly changing

• Example: simulate the trajectory of a thrown ball

Page 4: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Trajectory of a Thrown Ball

Analytical Solution

Numerical Solution (Simulation using Euler’s Method)

Newton’s Equation of Motion

md2y

dt2= �mg � b

dy

dt<latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit>

y(t) = y0 +mv0b

⇣1� e�

bm t

⌘+

m2g

b2

✓1� e�

bm t � b

mt

<latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit>

v(t+�t) = v(t) +

✓�g � b

mv(t)

◆�t

y(t+�t) = y(t) + v(t)�t

t ! t+�t<latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit>

Page 5: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Trajectory of a Thrown Ball

Page 6: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Molecular Dynamics

Forces BONDS!!V(bond) = Kb(b - b0)**2!!Kb: kcal/mole/A**2!b0: A!!atom type Kb b0!!Carbon DioxideCST OST 937.96 1.1600 ! JES!Heme to Sulfate (PSUL) linkSS FE 250.0 2.3200 !force constant a guess !equilbrium bond length optimized to reproduce !CSD survey values of !2.341pm0.01 (mean, standard error) !adm jr., 7/01C C 600.000 1.3350 ! ALLOW ARO HEM ! Heme vinyl substituent (KK, from propene (JCS))CA CA 305.000 1.3750 ! ALLOW ARO ! benzene, JES 8/25/89CE1 CE1 440.000 1.3400 !

! for butene; from propene, yin/adm jr., 12/95CE1 CE2 500.000 1.3420 !

! for propene, yin/adm jr., 12/95CE1 CT2 365.000 1.5020 !

! for butene; from propene, yin/adm jr., 12/95CE1 CT3 383.000 1.5040 !

! for butene, yin/adm jr., 12/95CE2 CE2 510.000 1.3300 !

! for ethene, yin/adm jr., 12/95

Page 7: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Molecular Dynamics

Page 8: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Brownian Dynamics

Page 9: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Discrete Event Simulations• We have seen some examples of time-stepped simulations. What about cases where the action depends on the irregular

occurrence of events?

• Basic Sequence:

• Work out when next event (event i) occurs

• Perform any necessary calculations at event i

• Event i may trigger other events

• Iterate

• Canonical example: queues

• Arrivals in the queue occur according to a random distribution. Each arrival is an event.

• Random distribution varies according to time of day

• Someone reaching front of queue is another event

• Someone finishing transaction is another event, with its time calculated according to a random distribution of service times

• Calculate statistics of waiting times, etc.

Page 10: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Discrete Event Simulations: BusPlus (Phil Kilby, NICTA)• Proposed system for off-peak public transport

• Seven hubs in Canberra with frequent buses running between hubs

• Taxi-based ride sharing to and from hubs

• Integrated booking for buses and taxis

• Advanced scheduling and routing software for taxis

• Event-based simulator was developed

• Events are:

• Passenger bookings

• Passenger arrives at collection point (bus stop)

• Passenger collections and drop offs

• Taxis / bus departures, arrivals, waypoints

• Simulator employs advanced scheduling software to route the taxis

• Same software intended for the finished product

Page 11: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Discrete Event Simulations: BusPlus (Phil Kilby, NICTA)

Page 12: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Agent-Based Simulation

• Identify agents in a simulation: individual entities that determine their own behaviour

• This is a kind of object-oriented approach to simulation, since the code for each agent is encapsulated within itself

• Agents may interact with other agents, ideally via well-defined (code) interfaces

• Classic example: gaming!

Page 13: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Electricity Grids Past and Present

�13

Pi �X

j

|Vi||Vj |[Gij cos(✓i � ✓j) +Bij sin(✓i � ✓j)] = 0

Qi �X

j

|Vi||Vj |[Gij sin(✓i � ✓j)�Bij cos(✓i � ✓j)] = 0

<latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit>

Page 14: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Electricity Grids Present and Future

• Modern electricity grids are becoming much more complicated

• Distributed generation & storage, grid level renewables & storage, the emergence of electricity markets…

• Developments in computing and communications make a more active, optimal control strategy possible for electricity grids

• This describes the smart grid.

• It is inherently harder to model and simulate�14

Page 15: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox Software

• Combines traditional power flow equations with discrete-event, agent-based simulation

• C++ libraries for flexibility and extensibility

• Build custom applications on top of libraries

• SgtCore library: utilities and power flow equations

• SgtSim library: discrete event simulation, component library (batteries, solar, tap changers, controllers, optimisation…)

Page 16: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox Discrete Event Simulations

• A simulation consists of components

• E.g. lines, transformers, loads, generators, houses with PV, battery, local controller, voltage regulators with control, central controllers / coordination, weather modelling…

Page 17: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox Discrete Event Simulations

• Each component defines the following member functions (and more):void initializeState() Time validUntil() void updateState(t)

• At the start of the simulation, all components get a chance to initialize themselves via the initializeState() funtion

• Then, validUntil() is called for each component to work out when the components are next scheduled to update

• These updates are sorted by time. If there are several components due to update at the same time, they are sorted according to previously defined dependencies

• These scheduled updates are performed one by one, in order, by calling the updateState(t) function of each component

Page 18: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox Discrete Event Simulations

• During an update, a component may trigger other components to register a contingent update at the current timestep.

• Contingent updates are pushed to the end of all updates at the current timestep

• This careful ordering of scheduled and contingent updates is, roughly, an example of the three phase* method for discrete event simulations

• Updates may be triggered directly from within the updateState(t) function, or may be set up to trigger as a result of other events triggering. This is done through a special event-action mechanism that is a specialisation of the observer pattern of software design.

* Michael Pidd (1998). Computer simulation in management science – fourth edition. Wiley.

Page 19: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox: Tap Changer Example

• Distribution networks sometimes use special transformers called voltage regulators to adjust the network voltage at strategic locations. These are often controlled by special devices known as automatic tap changers, that sense the local voltage and make adjustments to the tap changer to keep the voltage within an allowable range

• Typically, distribution lines have three wires, each carrying its own AC voltage stream. This is an example of three phase power.

• Suppose we have a three-phase voltage regulator, with three sets of taps, each sensing the voltage between two phases (wires) and adjusting the associated tap if the voltage gets too high or low.

Page 20: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox: Tap Changer Example

• When a network load (e.g. the consumption of a house) changes, due to a scheduled update, an “injectionChanged” event is triggered.

• The network is registered to insert a contingent update into the event queue when this occurs. This update will occur after all scheduled updates are finished.

• When the network updates, the voltage at its nodes typically changes. This triggers a “voltageChanged” event.

• The tap changers are registered to insert a contingent update into the event queue when this happens. During the updates, the changers decide whether a tap change is necessary, based on the voltage.

Page 21: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

SmartGridToolbox: Tap Changer Example

• If one of the tap changers changes the transformer tap, the transformer triggers an “admittanceChanged” event.

• The network inserts a contingent update when this occurs. Due to dependency ordering, this update happens only after all pending tap changes have occurred

• After the network updates, the voltages may change, and the tap changers may again need to change their tap settings. So we may need to iterate a few times before things settle down.

Page 22: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

Change tap A admittanceChanged Change tap C admittanceChanged

SmartGridToolbox: Tap Changer Example

Network contingent update voltageChanged

Contingent update A Contingent update B Contingent update C

House1 sched. update loadChanged House2 sched. update loadChanged etc…

Network contingent update voltageChanged

Loads Network Tap Changers Transformer

Page 23: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Bruny Island Battery Trial• ANU led, ARENA funded project to

investigate using residential PV + batteries to help support the network

• ANU, TasNetworks, Reposit Power, UTAS, USYD

• Bruny Island off Hobart is supplied with electricity by 1950s cable from mainland.

• Cable becomes overloaded during holiday periods; TasNetworks needs to run expensive and polluting diesel generator

• We asked the question: can batteries attached to households with PV be used to help support the network during periods of stress?

Page 24: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Bruny Island Battery Trial

Page 25: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Bruny Island Battery Trial• During the trial, 35 PV + battery, each

with a “Reposit box” controller, were subsidised.

• A “Reposit box” is a smart energy management system that charges and discharges battery to minimise costs to household

• How do we recruit and coordinate household batteries to help the network when it’s struggling?

• Preserve agency and privacy of households

• Households should only ever act in their own best interest

• Ensure that network constraints are satisfied at minimal cost

Page 26: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Network Aware Coordination (NAC)

Sgi � Sl

i �P

j Sij = 0Sij = zijViY ⇤

ijV⇤j

|Sij | Suij

<latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit><latexit sha1_base64="(null)">(null)</latexit>

Dealer

PricesIncentives

Dispatch Dispatch

Page 27: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Simulation

Page 28: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Simulation

Page 29: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: SimulationBa

tter

y Lo

ad (k

W)

Die

sel "

Load

" (k

W)

100

50

0

50

100

NAC SimNAC PerfManualIndep

06 09 12 15 18 21

Time (hh)

300

200

100

0

NAC SimNAC PerfManualIndep

Page 30: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT: Simulation

Page 31: discrete event smart grid · 2020-06-08 · Discrete Event Simulations: BusPlus (Phil Kilby, NICTA) • Proposed system for off-peak public transport • Seven hubs in Canberra with

CONSORT Animation