cim to modelica factory - automated equation-based cyber-physical power system modelica model...

19
CIM 2 Modelica Factory Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM Francisco Gomez 1 , Prof. Luigi Vanfretti 1,2 , and Svein H. Olsen 2 [email protected] , [email protected] Electric Power Systems Dept. KTH Stockholm, Sweden [email protected] [email protected] Research and Development Division Statnett SF Oslo, Norway

Upload: luigi-vanfretti

Post on 19-Aug-2014

176 views

Category:

Engineering


10 download

DESCRIPTION

The Common Information Model (CIM) is described using the Unified Modeling Language (UML). UML can also describe data model of cyber-physical power system components and networks. However, there are several difficulties to transform the data model into a strictly defined mathematical model. A strictly defined mathematical model is one for which all-differential algebraic and discrete model equations are explicitly defined [1] (i.e. the equations are written in human readable form). This is known as equation-based modelling [2], and it is utilized in many areas such as the automotive and aerospace industry [3]. The automated generation of an unambiguous equation-based model would allow performing time-domain simulations of cyber-physical power systems [4] and the assessment of textual requirements, which could be defined from the UML model directly [5]. This flexibility would allow adopting model-based systems engineering practices within the power industry, such as those used in process control. For the implementation of models in an equation-based language, the Modelica language [6] is the one of the best choices because it follows the Object Oriented Programming (OOP) notation, with a close relation with UML. Furthermore, the ModelicaML [5], an extended subset of the OMG Unified Modeling Language, enables integrated modelling and simulation of system requirements and design. Combining CIM, ModelicaML and Modelica models of cyber-physical power system components it is possible to automatically generate unambiguous mathematical models that can be used for simulation and requirements verification [7]. This CIM to Modelica Factory talk explores this possibility. One of the main challenges that we face with power systems models defined using the Modelica language is the initialization of the dynamic states (in equilibrium condition) of the components within a model [8, 9]. However, objects and components modelled in CIM standard contain attributes for storing a power flow solution. The purpose of the work described in this presentation is to develop a software tool capable to transform a CIM object model into a Modelica model that can be directly simulated using different Modelica engines. To this aim, we start from the CIM/UML representation of power system components and models, and exploit the ModelicaML profile to achieve a proper code representation of the power system in Modelica code. To confront issues with dynamic initialization, the power flow solution from CIM is linked to the Modelica component models and utilized within the initialization algorithms of the simulation engines. The result is a software tool that allows performing time domain simulations directly from a CIM/UML structure, while maintaining consistency in the resulting mathematical model within different simulation engines.

TRANSCRIPT

Page 1: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

CIM 2 Modelica FactoryAutomated Equation-Based Cyber-Physical Power System Modelica

Model Generation and Time-Domain Simulation from CIM

Francisco Gomez1, Prof. Luigi Vanfretti1,2, and Svein H. Olsen2

[email protected] , [email protected] Power Systems Dept.

KTHStockholm, Sweden

[email protected] [email protected]

Research and Development Division Statnett SF

Oslo, Norway

Page 2: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

• Background & Motivation– Modeling and Simulation– Modelica– CIM for Dynamics

• Modelica – Language Description– MetaModelica– CIM/UML to Modelica

• CIM 2 Modelica– Initial Conditions– Simulations

Overview

Acknowledgments• This work has been funded in part by the EU

funded FP7 iTesla project: http://www.itesla-project.eu/ and Statnett SF, the Norwegian power system operator.

• Work related to the iTesla Modelica power systems library presented here is a result of the collaboration between RTE (France), AIA (Spain) and KTH (Sweden) within the EU funded FP7 iTesla project: http://www.itesla-project.eu/

• Special thanks for ‘special training’ and support from

• Prof. Fritzson and his team at Linköping University• Prof. Berhard Bachmann and Lennart Ochel, FH

Bielefeld

Page 3: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

• Research• Development of software architecture

supporting transformation from CIM, implementing tools for either translating from CIM to Modelica models

• Development of models of cyber-physical power systems components, communication network components, and other components from other domains

• Application• iTESLA: Innovative Tools for Electrical

System Security within Large Areas• CIM provides standard format for power

systems data • Use of data from TSO

– Description of data equipment, power systems topology and measurements for model validation

Motivation

Page 4: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Modelica

• Modelica is an OOP for declarative equation based mathematical language

• Non-proprietary language, suitable for standardization and exchange of models

• Modelica tools, commercial and free of charge

• Electric power steering and controller model

[1] Andreas Deuring, Johannes Gerl, Harald Wilhelm“Multi-Domain Vehicle Dynamics Simulation in Dymola”,Modelica Conference, Dresden, 2011

• Thermodinamic Network of the ICE model

[2] L. Morawietz, S. Risse, H. Zellbeck, H. Reuss, T. Christ “Modeling an automotive power train and electrical power supply for HiL applications using Modelica”,Modelica Conference, Hamburg, 2005TU Dresden, University of Stuttgart, BMW Group, Germany.

Background

Page 5: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Common Information Model

• Conceived for information exchange: power systems topology, equipment, measurements

• Using UML representation to design a structured data model: Semantic transformation from real world to a model

• Standardization of the model diagrams for cyber-physical components

• Generators• Turbine Governors• Capacitors• Protections• Measurements

• IEC61970 provides standard data model for power systems components

Background

class SynchronousMachineDynamics

Wires::SynchronousMachine

+ aVRToManualLag :Seconds [0..1]+ aVRToManualLead :Seconds [0..1]+ baseQ :ReactivePower [0..1]+ condenserP :ActivePower [0..1]+ coolantCondition :Float [0..1]+ coolantType :CoolantType [0..1]+ earthing :Boolean [0..1]+ earthingStarPointR :Resistance [0..1]+ earthingStarPointX :Reactance [0..1]+ ikk :CurrentFlow [0..1]+ manualToAVR :Seconds [0..1]+ maxQ :ReactivePower [0..1]+ maxU :Voltage [0..1]+ minQ :ReactivePower [0..1]+ minU :Voltage [0..1]+ mu :Float [0..1]+ operatingMode :SynchronousMachineOperatingMode [0..1]+ qPercent :PerCent [0..1]+ r :Resistance [0..1]+ r0 :Resistance [0..1]+ r2 :Resistance [0..1]+ referencePriority :Integer [0..1]+ satDirectSubtransX :PU [0..1]+ satDirectSyncX :PU [0..1]+ satDirectTransX :PU [0..1]+ shortCircuitRotorType :ShortCircuitRotorKind [0..1]+ type :SynchronousMachineKind [0..1]+ voltageRegulationRange :PerCent [0..1]+ x0 :Reactance [0..1]+ x2 :Reactance [0..1]

Page 6: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

CIM for Dynamics• Dynamic models used in the

industry today use application specific data format and are embedded within the solver (integration routine)

• No information on how the model is implemented (i.e. actual equations used)

• Dynamic models can be represented in CIM, and exchanged among utilities

• Need to extend CIM to support dynamics models

• CIM should also support the exchange not only of parameters

Background

doc SynchronousGeneratorMechanicalEquation

Page 7: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Extension for CIM Dynamics• Automatic model

transformation from CIM to a well defined (equation based) language

• Information exchange, parameters and equations with CIM and Modelica

The benefit / role of CIM:Modelling of the network are done separate from the analyticExisting Steady-State Solver Engine (SSSE) can be used to initialize the transient study

Background

model gensal…

parameter Real wbase = 2 * pi * 50 "system base speed";parameter Complex Epqp = fpp + a * It;parameter Real delta0 = arg(Epqp);

parameter Real Pm0 = p0 + (id0 * id0 + iq0 * iq0) * Ra;Real delta "rotor angle";Real w "machine speed deviation, p.u.";…

initial equation   delta = delta0;  w = 0;

equation …   der(w) = ((Pm0 - D * w) / (w + 1) - Te) / (2 * H);  der(delta) = wbase * w;end gensal;

Page 8: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

• Background & Motivation– Modeling and Simulation– Modelica– CIM for Dynamics

• Modelica – Language Description– MetaModelica– CIM/UML to Modelica

• CIM 2 Modelica– Initial Conditions– Simulations

Overview

Page 9: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Modeling Language

• Modeling language based on equations, allow specification of mathematical models

• Multi-Domain modeling

• Visual Acausal Hierarchical Component Modeling• Physical structure• No specification of data flow

direction

load

EM DC

G

R L

Electrical

Mechanics

model DCMotorModelica.Electrical.Analog.Basic.Resistor r1(R =

10);Modelica.Electrical.Analog.Basic.Inductor i1;Modelica.Electrical.Analog.Basic.EMF emf1;Modelica.Mechanics.Rotational.Inertia load;Modelica.Electrical.Analog.Basic.Ground g;Modelica.Electrical.Analog.Sources.ConstantVoltage

v;equation

connect(DC.p,R.n);connect(R.p,L.n);connect(L.p,EM.n);connect(EM.p,DC.n);connect(DC.n,G.p);connect(EM.flange_b,load.flange_a);

end DCMotor;

Modelica

Page 10: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Modeling Language

• Typed Declarative Equation-based Textual Language

• Object-Oriented Language with class concept• Reuse of classes • Reuse of components• Scalable and Modular models

•Decoupling the model from the solver

model GENROUparameter Complex It=conj(S/VT) “Some comments

here“;   parameter Complex Is = It + VT/Zs;   parameter Complex fpp = Zs*Is;   parameter Real ang_P=arg(fpp);   parameter Real ang_I=arg(It);   parameter Real ang_PI=ang_P-ang_I;   parameter Real psi = 'abs'(fpp);equation

der(Epq) = (1/Tpd0)*(Efd0 -XadIfd);  der(Epd) = (1/Tpq0)*(-1)*(XaqIlq);

…anglev =atan2(p.vi, p.vr);Vt = sqrt(p.vr^2 + p.vi^2);

   anglei =atan2(p.ii, p.ir);    I = sqrt(p.ii^2 + p.ir^2);

…end GENROU;

Variable declaration

DAE Equations

Modelica

Page 11: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Power Systems Library in Modelica

• The FP7 iTESLA project develops a high level library for modeling power grid components

• Generators,• Governors,• Controls,• Branches,• Loads,• Buses,• Events

• The library makes available standardized power systems models usually available in power system tools only accessible through proprietary (and expensive) licenses

Modelica

Page 12: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

CIM / UML to Modelica

• Modelica provides data definition and compilers for equation based modeling

• ModelicaML is a tool to create UML definition for Modelica models

• Design of classes, components and models using a data model representation:• Definition of start values for

components and definition of mathematical equations

• Code generation creates classes and models with relation between classes

Modelica

Page 13: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

CIM / UML to Modelica

• Semantic transformation for automatic simulation directly from CIM definition

Modelica

Page 14: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

• Background & Motivation– Modeling and Simulation– Modelica– CIM for Dynamics

• Modelica – Language Description– MetaModelica– CIM/UML to Modelica

• CIM 2 Modelica– Initial Conditions– Simulations

Overview

Page 15: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Process flow design

• Automatic generation of Modelica code from CIM/UML definition

• Manual design of CIM/UML definition and Mapping

• Loading CIM/XML and Mapping

• Semantic transformation into Modelica code:– Set initial values from load flow solution– Set connection between classes

CIM 2 Modelica

Page 16: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

CIM 2 Modelica Mapping

•Relation between CIM classes and Power system library classes

•CIM Attributes and values -> Modelica Variables and starting values

•CIM relations between classes -> Modelica connection between components

or•CIM relations between classes -> Use of Modelica classes as objects

CIM 2 Modelica

Page 17: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Modelica Simulation Engine (architecture)

Page 18: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Simulation Engine

• Open-source software for cyber-physical system simulation

• Plug-in different compilers and solvers

• Enhancement to CIM:• Integration with PMU

measurements or simulation -> Harmonization with HDFS is an alternative

• Include the Modelica library code as part of the CIM standard

CIM 2 Modelica

Prop

ertie

s

Resu

ltsHDF5

JMOMC

PYTHON

JAVA

Dymola

Page 19: CIM to Modelica Factory - Automated Equation-Based Cyber-Physical Power System Modelica Model Generation and Time-Domain Simulation from CIM

Thank you! Questions?

[email protected] , [email protected] Power Systems Dept.

KTHStockholm, Sweden

[email protected] [email protected]

Research and Development Division Statnett SF

Oslo, Norway