# Rapid Prototyping of Multi-Functional Battery Energy Storage System Applications
## 4 Application Development with the EMSOnto Approach
### EMS-Ontology for Modelling BESS Applications  
This section provides an overview of the core elements of the EMS-ontology covering concepts, roles, individuals and axioms. As shown in Figure 3, the implementation of any UC requires the modeling of a controller \(K\), external systems \(A\) and electrical devices defined as components of the process \(G\). The aforementioned elements \((A,K,G)\) are represented by the concept Application. Hence, Application contains sub-classes of type Battery, EMS, Meter, etc. The concept System is created as a root of the EMS-ontology. It gathers Application by the role hasApplication. As a consequence, a System is composed of control applications (e.g., EMS), external systems (e.g., SCADA) and electrical devices (e.g., BESS, PV). On the other hand, the controller \(K\) may implement more than one service \((Service_{1},\ldots,Service_{n})\). To represent those services, the concept HLUC is introduced. For instance, voltage control, Primary Control Reserve (PCR) and self-consumption are abstracted by an HLUC. Furthermore, a categorization of HLUC is carried out by the concepts: Power Quality (PQ), Power Stability (PS), Minimization of Supply Costs (MSC), etc. [4]. Further details of an HLUC are given by a PUC, where the services provided by a HLUC are listed. Moreover, a PUC may contain other services, which in turn are also represented by a PUC. For instance, a PUC(voltage control) requires embedding further services such as a PUC(state estimator) and PUC(PI controller). To achieve that, the role hasPUC is created. It has the concepts PUC, HLUC as domain and PUC as range. Additionally, in case a PUC requires implementing a control scheme, the concepts ControlGoal and Constraint are suggested. ControlGoal represents a control problem \(\lim\limits_{t\rightarrow\infty}(y_{ref}-y)\to 0\) or an optimization problem \(Minimizef(x)\) subject to \(g_{i}(x)\leq 0\), \(h_{j}(x)=0\) constraints. The equality and inequality constraints are represented by the Constraint concept. The introduced concepts and roles are illustrated in Figure 4. To fully understand such representation, it is imperative to comprehend the core elements of an ontology (i.e., role, concepts, etc.) [26]. The formalrepresentation of EMS-ontology is based on DL [27] extended with the concrete-domain concept [42]. A full description of it is given in Appendix A. The implementation of a multi-functional system within the controller requires the exchange of information with the field process and other systems. A model of this data is formally defined by a set of concepts having as the main class the concept External (see Figure 5). External is of type Input or Output. An Input is classified by Feedback and Setpoint. In turn, the concept Output is specified under Control and Status. A mapping of those concepts to the scheme in Figure 3 is stated as follows: Control\((u)\), Setpoint\(\{w_{1},...,w_{n},m\}\), Feedback \((f)\), Status \((s)\). On the other hand, internal variables of \(A,K,G\) are modeled by the Internal concept. Thereby, Internal is structured under State and Param. Param represents variables that do not change dynamically (i.e., parameters). State conceptualizes variables that change over time. For instance, if \(G\) is represented under a Linear Time Invariant (LTI) Single Input Single Output (SISO) system \(x^{{}^{\prime}}=Ax+bu\), then the variable \(x\) is represented by a State and \(b\) by a Param. Values attributed to dynamic and static variables may be binary (i.e., 1 and 0), numeric data (i.e., continuous and discrete) and character. Those are represented by Binary, Numeric, Char concepts. Attributes assigned to them are modeled by the roles hasTimeStamp, hasUnit, hasFormat, etc. (see Figure 6). The role hasTimeStamp is used to reach accuracy in acquired values, enabling the synchronization of an internal time (e.g., time in \(K\)) with an external time (e.g., time in \(G\)). Other attributes of numeric values such as the format, unit and range are also addressed.