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 11 th 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 SCADA system Component models Controller / Power Grid Simulation TCP, UPD, IEC 61850, IEC 60870-5-104 SCADA Controller Com Interface Power System Analysis transient/ steady state Com Interface TCP, OPC Com Interface - 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) Component Simulation SCADA Emulation Supervisory Control and Monitoring Simulation ASN.1 over TCP/IP ASN.1 over TCP/IP Electricity Grid Simulation Power System Analysis ASN.1 over TCP/IP Controller Emulation (Embedded) Control System Development and Simulation 10.10.2013 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 charging power is not static Continuous System Hybrid System Hybrid system: discontinuity taking place at discrete events P P Need for simulation of the EV trip to get the energy needed to recharge a) b) t Charge Discharge Recuperation t 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 medium/low voltage network with consumers realistic battery model charging control algorithm distributed charging power regulation stochastic driving patterns derived from real data 20 May 2013 11
Simulation tools Modelica dedicated multi-domain (physics) simulation language supports event handling acausal simulation (continuous time-based simulation) PSAT Power system analysis toolbox Matlab/Simulink and Octave continuous time-based simulation 4Diac / Forte framework for distributed control systems intended for event based controls in real time open source IDE and Runtime GridLAB-D 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 t 0 t 1 t 2 t 3 PowerFactory step t Data exchange (OPC, TCP/IP) Co-Simulation (parallel) 1 2 data exchange simulation time controller co-sim integration time t 0 t 1 t 2 1 2 t 1- simulate at next time step t 3 data exchange simulation time continuous model co-sim integration time power flow send result send ready receive wait power flow next step U bus,p meas notify IN P set notify OUT receive wait simulate send result send ready 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 14
Co-Simulation: asynchronous, parallel Co-Simulation via external DLL PowerFactory stability (rms) Co-Simulation (sequential) via external DLL (digexdyn.dll) step t t 0 t 1 t 2 t 3' t 3 input invoke t Int event simulation time DSL integration time DSL model (external) emit event return simulate store state 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 t 0 t 1 t 2 t 3 1 t lag 2 t communication delay real-time 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 EV Traffic Pattern / Electric Vehicles (GridLAB-D) EV EV + - EV EV + - + - P set P charge P set P charge Charge Control Charging Station Charge Control Charging Station Interface 08.10.2013 plugin validated tools and continuous models via standardized interface (FMI & FMI++, etc.) 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 EV Traffic Pattern / Electric Vehicles (GridLAB-D) EV EV + - EV EV + - + - P set P charge P set P charge Charge Control Charging Station Charge Control Charging Station API Interface U actual P charge U actual, P charge FMI FMI ASN1 (TCP/IP) Battery Model (OpenModelica) Battery Model (OpenModelica) Distributed Control System (4DIAC) Power System Analysis (PSAT/Octave) 08.10.2013 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 P set P charge trip data Charging Point charging Charging Point Group Group point group charging management Charging Management charging point P charge,p set FMI Battery Battery Model Model battery model (OpenModelica) P charge,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 SCADA power system control 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 10.10.2013 Scenario & Use-Case 33
EVSim - Architecture Architecture Transportation Simulation Charging Point Simulation Charge Management Power System Agents / Events EV EV EV EV + - Charging Station P set SOC EV + - Charging Station EV Charge Controller P charge P DG U actual Electric Vehicle Simulation EVSim 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 P max, P min Charging Point P max, P min Charge Controller - battery capacity - battery Type - range ideal - range real - charge P max - discharge P max - reactive power Q max,min - charge efficiency - charge temp. perf. - battery performance - time of stay / leave P actual P set E max SOC, E actual E wish status plugtype 1/3 phase - group ID - location - plugtype / phases - active power P act - reactive power Q act - current I1 act,i2 act,i3 act - voltage U bus - connection Status - time of connection - time of departure P actual P set E max SOC, E actual E wish U actual RFID Optimize E charge = [E max,e wish ] Global or location based contraints: P actual (t)=[p min,p max ] P actual = P generation U min < U actual < U max SLA(EV) SLA SLA T temperature profile agents events, behavior Charging Group - Total P actual P actual Generation - Total P generation P generation 10.10.2013 36
06:00 06:30 07:00 07:30 08:00 08:30 09:00 09:30 10:00 10:30 11:00 11:30 06:00 06:30 07:00 07:30 08:00 08:30 09:00 09:30 10:00 10:30 11:00 11:30 Power [kw] Power [kw] Validation of charging management Real and simulated EVs for charging management validation Electric Vehicle Simulation Environment EVSim Charging EV Station EV EV Charging Station Charging Station Data Exchange Interface (OPC) ECAR DV Charging Management Charge Controller Renewable Generation DEMS Distributed Energy Management System Real World EV Charging Station 550 500 450 400 350 300 250 200 150 100 50 0 Tolerance range Pact Pset 60 40 20 0-20 -40 time [hh:mm] Level Pset ΔP 10.10.2013 time [hh:mm] Tolerance range, P set and P act 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, [-] 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 1439, 218,44 0,00 288, 576, 863, 1151, [-] 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 1439, Voltages a the charging point for symmetrical loaded phases (3 times 3.68kW). Note the voltage rise due to PV generation Voltages for unsymmetrical loaded phase (red: 11.04kW). Note the rise in the other phase (green) due to neutral point displacement. 10.10.2013 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
00:00 04:00 08:00 12:00 16:00 20:00 00:00 04:00 08:00 12:00 16:00 20:00 Power [kw] Simulation of EVs, control and power system Local supply - demand match in medium voltage networks 800 700 600 500 400 Generation from Wind Generation from PV Uncontrolled 11kW Controlled 11kW; SOC-Level: 50% Controlled 11kW; SOC-Level: 25% Two days simulation in summer Charging Mode uncontrolled 11kW controlled 11kW/SOC50 empty EVs P- peak [kw] Charged Energy [kwh] DER Energy [kwh] DER Coverage [%] 15 751 9964 8079 54% 55 366 6832 8079 89% 300 200 controlled 11kW/SOC25 66 324 6229 8079 99% 100 Two days simulation in winter 0 Charging Mode empty Evs P- peak [kw] Charged Energy [kwh] DER Energy [kwh] DER Coverage [%] 10.10.2013 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 uncontrolled 11kW controlled 11kW/SOC50 controlled 11kW/SOC25 135 883 12613 3971 26% 197 552 7267 3971 50% 218 353 5051 3971 71% 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