Oct 11, 2013 ... PowerFactory ←→ Matlab / SimPowerSystem. ▫ PowerFactory ←→ 4DIAC (
distributed control system). ▫ 4DIAC ←→ ScadaBR. 9. 10.10.2013.
Modelling and (Co-)simulation of power systems, controls and components for analysing complex energy systems Workshop on Software Tools for Power System Modelling and Analysis University College Dublin – 11th October 2013 Stifter Matthias – AIT, Energy Department, Complex Energy Systems
About Co-Simulation
08.10.2013
3
Co-Simulation Motivation
Multi-domain problems not covered in one tool Electrical power system Communication system Controls / SCADA
Different simulation time steps Different concepts: continuous time and discrete event time systems Use existing highly complex and detailed models Integration of real components Scalability and flexibility
Combine different dedicated simulation tools and domains Analyse different subsystems and their interactions
08.10.2013
4
Co-Simulation Overview
Various types of modelling and simulation: number of modelers
closed simulation
distributed simulation
>1
re-unification of the separately modeled subsystems equations
co-simulation
distributed modelling
=1
„classical“ Simulation
model separation for simulation
closed modelling
=1
>1
number of integrators
Source: M. Geimer, T. Krüger, P. Linsel, Co-Simulation, gekoppelte Simulation oder Simulatorkopplung? Simulation 2006.
08.10.2013
5
Co-Simulation (1)
Coupling on model level
Application 1
Application 2
Model level
Model definition, equations Model code export,
Model level
Integrator level
Model and integrator code export
Integrator level
Source: M. Geimer, T. Krüger, P. Linsel, Co-Simulation, gekoppelte Simulation oder Simulatorkopplung? Simulation 2006.
11.10.2013
6
Co-Simulation (2)
Coupling on integrator level
Application 1
Application 2
Model level
Equation evaluation (e.g. function call)
Model level
Integrator level
Integrator evaluation (distributed simulation)
Integrator level
Source: M. Geimer, T. Krüger, P. Linsel, Co-Simulation, gekoppelte Simulation oder Simulatorkopplung? Simulation 2006.
11.10.2013
7
Simulation challenge: power system and controls System with controller to fulfilll certain functionalities: e.g., voltage control task consists typically of the following parts:
Power system model Component models Controller / SCADA
SCADA system
TCP, UPD, IEC 61850, IEC 60870-5-104
Power Grid Simulation Controller transient/ steady state
Power System Analysis
Com Interface
Com Interface
Com Interface
-
TCP, OPC
TCP, OPC
Component Simulation -
10.10.2013
8
Co-Simulation approach In this simulation coupling, the individual simulators run in real time and parallel, exchanging results and set-points. PowerFactory Matlab / SimPowerSystem PowerFactory 4DIAC (distributed control system) 4DIAC ScadaBR Grid Component Simulation (e.g., Distributed Energy Resources)
Supervisory Control and Monitoring Simulation
Component Simulation
SCADA Emulation
ASN.1 over TCP/IP
Electricity Grid Simulation
10.10.2013
Power System Analysis
ASN.1 over TCP/IP
ASN.1 over TCP/IP
Controller Emulation
(Embedded) Control System Development and Simulation
9
Simulation challenge: dynamic EV charging Need for simulation of : impact of the electric vehicle energy demand energy depends on trip length, temperature, etc. test charging management strategies Continuous charging power is not static System
Hybrid System
Hybrid system: discontinuity taking place at discrete events P
Need for simulation of the EV trip to get the energy needed to recharge
P Charge
a)
t
b)
Recuperation
t
Discharge
Combine the power system simulation with the simulation of the discharging 10.10.2013
10
Simulation challenge: dynamic EV charging household load profiles
taken from measurement campaign
small scale distribution grid
realistic battery model
medium/low voltage network with consumers
stochastic driving patterns
derived from real data charging control algorithm
distributed charging power regulation
20 May 2013
11
Simulation tools
Modelica
PSAT
dedicated multi-domain (physics) simulation language supports event handling acausal simulation (continuous time-based simulation)
Power system analysis toolbox Matlab/Simulink and Octave continuous time-based simulation
4Diac / Forte
GridLAB-D
framework for distributed control systems intended for event based controls in real time open source IDE and Runtime
multi-agent based power system simulation includes various energy-related modules discrete event-based simulation
Main challenge coupling discrete event-based simulation with continuous time-based models. 08.10.2013
12
Co-Simulation Interfaces and Mechanisms
10.10.2013
13
Co-Simulation: synchronous, sequentially
Co-Simulation run sequentially and blocks until the results are available
simulate same time step twice t0
t1
t2
PowerFactory
t3
Data exchange (OPC, TCP/IP)
Co-Simulation (parallel)
step ∆t 1
data exchange
2
simulation time
controller co-sim integration time
power flow send result send ready
Ubus,Pmeas notify IN
receive wait simulate
t0
t1
t2
t3
receive wait
t11
2
data exchange
simulation time
Pset notify OUT
send result send ready
power flow next step
continuous model co-sim integration time
simulate at next time step
10.10.2013
M. Stifter, R. Schwalbe, F. Andrén, and T. Strasser, “Steady-state co-simulation with PowerFactory,” in Modeling and Simulation of Cyber-Physical Energy Systems, Berkeley, California, 2013.
14
Co-Simulation: asynchronous, parallel
Co-Simulation via external DLL PowerFactory stability (rms)
Co-Simulation (sequential) via external DLL (digexdyn.dll)
step ∆t
t0
t1
t2 t3' t3
input simulation time
∆tInt
event DSL integration time
simulate
DSL model (external) emit event
invoke
store state return
result
exec. event next step
M. Stifter, R. Schwalbe, F. Andrén, and T. Strasser, “Steady-state co-simulation with PowerFactory,” in Modeling and Simulation of Cyber-Physical Energy Systems, Berkeley, California, 2013. .
10.10.2013
15
Co-Simulation: real time synchronisation
Dynamic behaviour C-HIL / Regler Filters Synchronisation with system time / scaled time base
t0 1
t1
t2
t3 real-time
∆tlag 2
∆tcommunication delay parallel co-simulation
10.10.2013
16
Functional Mock-Up Interface for Model Exchange
FMI: A standarized API for describing models of DAE-based modeling environments (Modelica, Simulink, etc)
Functional Mock-Up Unit model interface (shared library) model description (XML file)
Executable according to C API low-level approach most fundamental functionalities only tool/platform independent
Gaining popularity among tool vendors CATIA, Simulink, OpenModelica, Dymola, JModelica, SimulationX, etc.
08.10.2013
17
Simulation environment for FMI for Model Exchange
Simulation master algorithm not covered by FMI specification tool independence
Requirements initialization numerical integration event handling orchestration
Well suited for simulation tools focusing on continuous time-based modelling
What about plug-ins for discrete event-driven simulation tools?
08.10.2013
18
The FMI++ library High-level access to FMUs model initialization, get/set variable by name, etc. High-level FMU functionalities integrators, advanced event handling, rollback mechanism, look-ahead predictions, etc. Open-source C++ library tested on Linux and Windows (MinGW/GCC and Visual Studio) available at sourceforge.net synchronous interaction between discrete event-based environment and a continuous equation-based component 08.10.2013
19
Example Application: Controlled Charging
08.10.2013
20
GridLAB-D as co-simulation master
Discrete event-based simulator as co-simulation master GridLAB-D’s core functionalities deployed as master algorithm EV model: agent based behavior over time (individual driving patterns) energy demand due to the trip charging station handling
Traffic Pattern / Electric Vehicles (GridLAB-D) Charge Control
EV
EV
+
-
EV EV +
-
Pset Pcharge
Charging Station Charge Control
EV
+
-
Pset Pcharge
Charging Station
Interface plugin validated tools and continuous models via standardized interface (FMI & FMI++, etc.)
08.10.2013
21
PSAT (Octave)
Power system analysis power flow to determine bus voltages
Network model: medium voltage network with low voltage networks load presenting household and charging station
Interface: Connect to GridLAB-D via Octave API + thin wrapper to access C arrays instead of data types
08.10.2013
22
4Diac / FORTE
Distributed control system IEC 61499 reference model for distributed automation
Model / control Local voltage control (anxilliary service) keep voltage limits
Interface: TCP/IP socket communication (ASN.1 format) suitable for embedded system environments
08.10.2013
23
OpenModelica
multi-domain (physics) simulation language supports event handling acausal simulation (continuous time-based simulation)
Model Industry proofed library for a detailed Li-Ion battery model constant current / constant voltage charger
Interface plug-in continuous time-based models via FMI++
08.10.2013
24
Co-Sim Power System, EVs, Components and Controls Open source based approach of electric vehicle energy management for voltage control Traffic Pattern / Electric Vehicles (GridLAB-D) Charge Control
EV
EV
-
EV EV +
-
FMI
08.10.2013
+
Charging Station
Pset Pcharge
API Interface
Uactual Pcharge
Charge Control
EV
+
-
Pset Pcharge
Charging Station
Uactual, Pcharge
ASN1 (TCP/IP)
FMI
Battery Model
Battery Model
(OpenModelica)
(OpenModelica)
Distributed Control System (4DIAC)
Power System Analysis (PSAT/Octave)
25
Results
Voltage during charging process
Simulation time step varies with time due to updates of control algorithm 08.10.2013
26
Results
Reduced charging power has impact on battery’s SOC
Increased number of updates controller notifies the simulation core more frequently, thus increasing the simulation step resolution. Investigate interesting dynamic effects more precisely.
08.10.2013
27
Co-Sim Power System and Control
Electric Vehicle charge management for voltage control
(GridLAB-D)
simulation control
driving behaviour distributions (departure, duration, length) EV EV electric vehicle schedule battery charger
Pset Pcharge
Pcharge,Pset FMI BatteryModel Model Battery battery model (OpenModelica) (OpenModelica) (OpenModelica)
trip data
ChargingPoint Point Charging charging point group Group Group charging Charging Charging management Management Management charging point
Pcharge,V API distribution grid (PowerFactory)
P. Palensky, E. Widl, A. Elsheikh, and M. Stifter, “Modeling intelligent energy systems: Lessons learned from a flexible-demand EV charging management,” Smart Grids, IEEE Transactions on (accepted), 2013.
10.10.2013
28
Co-Sim Power System, Components and Control System
Detailed battery model based on chemical equations + Energy management Power Flow for every time step control system
SCADA
power system
PV system + inverter
10.10.2013
simulation results
29
Co-Sim Power System with Electrical Energy Storage
Detailed battery model based on chemical equations + Energy management Power Flow for every time step
F. Andrén, M. Stifter, T. Strasser, and D. Burnier de Castro, “Framework for co-ordinated simulation of power networks and components in smart grids using common communication protocols,” in IECON 2011 - 37th
10.10.2013
30
Co-Sim Power System, Communication and Control
Co-Simulation with PowerFactory API: Loose Coupling via Message Bus
M. Ralf, K. Friederich, F. Mario, and S. Matthias, “Loose coupling architecture for co-simulation of heterogeneous components – support of controller prototyping for smart grid applications,” in submitted to IECON 2013 - 39th Annual Conference on IEEE Industrial Electronics Society, Vienna, Austria, 2013.
10.10.2013
31
Electric Vehicle Simulation Environment
10.10.2013
32
EV Simulation Environment Results
Power Grid Simulation power demand
CP & EV Simulation trip data
Mobility Simulation traffic data Scenario & Use-Case 10.10.2013
33
EVSim - Architecture Architecture Transportation Simulation
Charging Point Simulation
Charge Management
Power Power System System
Agents Agents // Events Events EV EV EV EV
+
-
Charging Station
-
Charging Station
Pset SOC
EV
+
Electric Vehicle Simulation EVSim
PDG EV Charge Controller
Uactual
Pcharge
Charging Controller
PowerFactory
Specification for the simulation scenario EV + battery, plug types including efficiency (temperature, losses) locations and charging points distributed generation (location based) 10.10.2013
34
EVSim - Functionality
Configuration simulation time: start / stop / step-size / loop / real-time temperature dependency / performance of the battery Output (csv) SOC, power Interfacing / co-simulation OPC OCPP (Open Charge Point Protocol) Behaviour connection / disconnection handling, authorisation time to plug / unplug charging noise Charging algorithm G2V, V2G, matching with local generation
10.10.2013
35
EVSim – Parameters and Interface Internal variables and parameters Electric Vehicle - battery capacity - battery Type - range ideal - range real - charge Pmax - discharge Pmax - reactive power Qmax,min - charge efficiency - charge temp. perf. - battery performance - time of stay / leave
Pmax, Pmin Pactual Pset Emax SOC, Eactual Ewish status plugtype
Charging Point - group ID - location - plugtype / phases - active power Pact - reactive power Qact - current I1act,I2act,I3act - voltage Ubus - connection Status - time of connection - time of departure
agents
temperature events, profile behavior
Pset Emax SOC, Eactual Ewish Uactual RFID
SLA
SLA
- Total Pactual
Generation - Total Pgeneration
10.10.2013
Pactual
1/3 phase
Charging Group T
Pmax, Pmin
Charge Controller Optimize Echarge=∑[Emax,Ewish] Global or location based contraints: Pactual(t)=[Pmin,Pmax] ∑Pactual = Pgeneration Umin < Uactual < Umax SLA(EV)
Pactual
Pgeneration
36
Validation of charging management
Real and simulated EVs for charging management validation Electric Vehicle Simulation Environment EVSim EV
Charging Station
EV
Charging Station
EV
Charge Controller Renewable Generation Data Exchange Interface (OPC)
Charging Station
DEMS
ECAR DV
Distributed Energy Management
Charging Management
System
Real World
Charging Station
550 500 450 400 350 300 250 200 150 100 50 0
Tolerance range Pact Pset
60 Level Pset ΔP
Power [kW]
40 20 0 -20
11:30
11:00
10:30
10:00
09:30
09:00
08:30
08:00
07:30
07:00
06:30
06:00
11:30
11:00
10:30
10:00
09:30
09:00
08:30
08:00
07:30
07:00
06:30
-40
06:00
Power [kW]
EV
time [hh:mm]
time [hh:mm]
10.10.2013
Tolerance range, Pset and Pact during simulation and deviation
37
Simulation of EVs and power system
Impact of unbalanced charging in low voltage networks
222,66
222,66
221,82
221,82
220,97
220,97
220,13
220,13
219,28
219,28
218,44 0,00
288,
576,
863,
1151,
[-]
1439,
DA61368_60240880: Leiter-Neutral Spannung, Betrag L1 in V DA61368_60240880: Leiter-Neutral Spannung, Betrag L2 in V DA61368_60240880: Leiter-Neutral Spannung, Betrag L3 in V
Voltages a the charging point for symmetrical loaded phases (3 times 3.68kW). Note the voltage rise due to PV generation
10.10.2013
218,44 0,00
288,
576,
863,
1151,
[-]
1439,
DA61368_60240880: Leiter-Neutral Spannung, Betrag L1 in V DA61368_60240880: Leiter-Neutral Spannung, Betrag L2 in V DA61368_60240880: Leiter-Neutral Spannung, Betrag L3 in V
Voltages for unsymmetrical loaded phase (red: 11.04kW). Note the rise in the other phase (green) due to neutral point displacement.
38
Temperature dependency
Region Lungau (Upper Austria) – approx. 6000 EVs
Micro-simulation of region Lungau, generating trip data
10.10.2013
Charging power for opportunity charging on a winter and summer day
39
Simulation of EVs, control and power system
Local supply - demand match in medium voltage networks Two days simulation in summer
Generation from Wind Generation from PV
800
Uncontrolled 11kW Controlled 11kW; SOC-Level: 50%
700
Ppeak [kW]
Charged Energy [kWh]
DER Energy [kWh]
DER Coverage [%]
Charging Mode
empty EVs
uncontrolled 11kW
15
751
9964
8079
54%
controlled 11kW/SOC50
55
366
6832
8079
89%
controlled 11kW/SOC25
66
324
6229
8079
99%
Controlled 11kW; SOC-Level: 25%
Power [kW]
600 500 400 300 200
Two days simulation in winter
100
20:00
16:00
12:00
08:00
04:00
00:00
20:00
16:00
12:00
08:00
04:00
00:00
0
Ppeak [kW]
Charged Energy [kWh]
DER Energy [kWh]
DER Coverage [%]
Charging Mode
empty Evs
uncontrolled 11kW
135
883
12613
3971
26%
controlled 11kW/SOC50
197
552
7267
3971
50%
controlled 11kW/SOC25
218
353
5051
3971
71%
time [hh:mm]
Uncontrolled and controlled charging of 306 EVs with 11 kW during two sumer days. Note: wind is accumulated on top of PV generation 10.10.2013
40
Summary
Multi-agent based simulation tool, time-continuous multi-physics simulation, controls and power system simulation, e.g.: GridLAB-D, OpenModelica, PSAT, 4Diac, PowerFactory Open source software can be used for co-simulation environments
A number of interfaces possibilities exist to couple simulation tools. Model and integrator based coupling can be realised.
Proprietary interfaces are light-weighted but not very general, not usable for other tools, no simulation time step synchronisation Functional Mockup Interface for model exchange + co-simulation.
08.10.2013
41