**5.2 The object oriented approach**

The Object-Oriented Programming (OOP) is based on to divide a programming task into objects where each one of these objects encapsulates its own data and methods (procedures associated with a class). The most important distinction regarding Procedural Programming (PP) is that this one uses procedures to operate on data structures, whereas the OOP uses procedures and data structures together. In object-oriented modelling, the objects are packages of data and functionalities and the methods can be sent to these objects rather than data only, as in PP. The main disadvantage of OOP compared with the PP is that the last one has a faster execution, which in real-time applications is an essential issue, in past decades, due to restrictions of memory and processing capacity, this arose as a serious problem, but nowadays, with the available computing power, the OOP is a feasible alternative to develop training simulators.

Leva and Maffezzoni (2003) establish some paradigms of the OOP in mathematical modelling; one of the most important is the definition of physical ports as the standard interface to connect a certain component model. In this way, an object is the mathematical model of a power plant component (e.g. valve, pump, etc) and the integration of these objects reflects the physical plant layout. The interactions among the components are satisfied with the flow information of the connectors, which are also related with the physical connections. Figure 13 describes these concepts, each one of the icons represents a physical component and according to this, it has defined their suitable communication ports (small coloured squares). The lines between two icons are equivalents to the actual physical connections. Table 2 shows some connector types.

Although it is not destined to serve as a platform to develop training simulators, Modelica (Modelica, 2011) is representative of this kind of technologies. Modelica is a nonproprietary, object-oriented, equation based language to conveniently model complex physical systems containing, e.g., mechanical, electrical, electronic, hydraulic, thermal, control, electric power or process-oriented subcomponents. Therefore, Modelica is a modelling language rather than a true programming language. The Modelica classes are not compiled in the usual sense, but are translated into objects which are then executed by a simulation engine.

Fossil Fuel Power Plant Simulators for Operator Training 115

topology of the simulated diagram and serves to construct the mathematical solution of the system (Solver). For instance, in a flow-pressure network, the nodes are the points of the network where the process lines are joined or split, if there is not considered accumulation of materials in these nodes, the solution of the continuity equation in steady state for all the nodes

Depending of their complexity, no matter the selected simulation approach, the mathematical models are constituted by: linear algebraic equations, nonlinear algebraic equations, differential equations or a combination of them. Linear equations are resolved with LU decomposition methods, for instance, the solution of the admittance matrix of the electric network. Methods of Newton-Raphson with relaxation techniques are utilized to resolve the algebraic nonlinear equations, for instance, flow-pressure networks where the Jacobian matrix can be calculated with the analytical first-order partial derivatives with respect to the pressures of the nodes. The differential equations can be resolved with implicit or explicit integration methods, according to the simulator solver. Examples of these equations are (8) and (9) or the speed equation of the electric generator. Tolsma and Barton (2002) highlight several numerical algorithms used to solve common problems that arise during process modelling, including

Regarding to general-purpose graphic modelling tools, MATLAB-SIMULINK (Mathworks, 2011) is a remarkable product due to its integrated simulation environment, mathematics libraries and toolboxes (e.g. control, data acquisition and signal processing). Some developments using MATTLAB-SIMULINK are reported by Lu (1999), who presents the simulation of 677 MW coal and gas-fired power plant, with the aim of obtaining a good insight into boiler dynamics and steady state performance. Another development is reported by Alam-Jan et al. (2002). These authors describe a training simulator for operators of a coal-fired power plant, and they claim that their nonlinear models implemented are moderately complex

but reproduces the dynamic behaviour of the actual plant over a wide operation range.

Finally can be pointed that, no matter the selected approach or the computational tools used for the integration of a training simulator, the mathematical models must provide a realistic and consistent response in a wide operation range, this include any transient and steady

Additional issues about mathematical modelling and the application of dynamic simulators

The Distributed Control System (DCS) of a power plant is a group of Programmable Logic Controllers (PLC) where all the control algorithms are executed in an automatic way. A DCS is a very complex system involving many thousands of signals and hundreds of diagrams. The control algorithms are organized in components with specific function or task, for instance: PID controllers, high/low detectors, timers, memories set/reset, etc. This organization is represented by means of a network of these components, which communicate information through connections, (Figure 14). These networks are organized in a hierarchical way, in the bottom levels are the basic elements like AND, OR, NOT gates, in the middle level are the diagrams, and finally in the top level are the modules. In this

yields a system of simultaneous nonlinear algebraic equations.

solution of systems of nonlinear equations and numerical integration.

state of the simulated power plant..

**5.3 Modelling of control systems** 

are discussed by Cameron et al. (2002).

way, the DCS is constituted by a collection of modules.

Fig. 13. Object oriented approach


Table 2. Connector types.

Tavira-Mondragón et al. (2010c) describe an OOP development with the aim of modelling and developing simulators of power plants. Based on the previously discussed concepts of components, ports and connectors; these authors present a specially designed editor to fulfil the requirements of these kind of applications. This editor was designed using the design pattern Model-View-Controller (MVC). In this context, the Model component is the instantiation of each generic component including their connectors, and the result of putting together the required components is the construction of the mathematical model to simulate. The View is the graphical representation of the Model, i.e. each one of the elements of the Model is represented by a graphic icon. The Controller component is responsible of maintaining consistency between the View and Model; therefore, any change to the Vista (user interaction) will be reflected in the Model and vice versa. The result of the editing process is a simulation diagram. During the edition of a complete diagram, the generic elements are linked by mean of a set of connectors in various domains. These connectors specify the information flow among different elements of the diagram. The simulation of a diagram consists in calling in an orderly way the diagrams. During the simulation sequence, and for each one of the diagrams, it is built a data structure, which represents a directed graph, this graph has the

**Connector Information** 

Actuator Valve position Mechanical Motion Mechanical torque

Thermal Temperature

Tavira-Mondragón et al. (2010c) describe an OOP development with the aim of modelling and developing simulators of power plants. Based on the previously discussed concepts of components, ports and connectors; these authors present a specially designed editor to fulfil the requirements of these kind of applications. This editor was designed using the design pattern Model-View-Controller (MVC). In this context, the Model component is the instantiation of each generic component including their connectors, and the result of putting together the required components is the construction of the mathematical model to simulate. The View is the graphical representation of the Model, i.e. each one of the elements of the Model is represented by a graphic icon. The Controller component is responsible of maintaining consistency between the View and Model; therefore, any change to the Vista (user interaction) will be reflected in the Model and vice versa. The result of the editing process is a simulation diagram. During the edition of a complete diagram, the generic elements are linked by mean of a set of connectors in various domains. These connectors specify the information flow among different elements of the diagram. The simulation of a diagram consists in calling in an orderly way the diagrams. During the simulation sequence, and for each one of the diagrams, it is built a data structure, which represents a directed graph, this graph has the

Electric Voltage

 Pressure Total Flow rate Liquid fraction Density Enthalpy Composition

Angular speed

Heat rate

Current

Fig. 13. Object oriented approach

Table 2. Connector types.

Hydraulic

topology of the simulated diagram and serves to construct the mathematical solution of the system (Solver). For instance, in a flow-pressure network, the nodes are the points of the network where the process lines are joined or split, if there is not considered accumulation of materials in these nodes, the solution of the continuity equation in steady state for all the nodes yields a system of simultaneous nonlinear algebraic equations.

Depending of their complexity, no matter the selected simulation approach, the mathematical models are constituted by: linear algebraic equations, nonlinear algebraic equations, differential equations or a combination of them. Linear equations are resolved with LU decomposition methods, for instance, the solution of the admittance matrix of the electric network. Methods of Newton-Raphson with relaxation techniques are utilized to resolve the algebraic nonlinear equations, for instance, flow-pressure networks where the Jacobian matrix can be calculated with the analytical first-order partial derivatives with respect to the pressures of the nodes. The differential equations can be resolved with implicit or explicit integration methods, according to the simulator solver. Examples of these equations are (8) and (9) or the speed equation of the electric generator. Tolsma and Barton (2002) highlight several numerical algorithms used to solve common problems that arise during process modelling, including solution of systems of nonlinear equations and numerical integration.

Regarding to general-purpose graphic modelling tools, MATLAB-SIMULINK (Mathworks, 2011) is a remarkable product due to its integrated simulation environment, mathematics libraries and toolboxes (e.g. control, data acquisition and signal processing). Some developments using MATTLAB-SIMULINK are reported by Lu (1999), who presents the simulation of 677 MW coal and gas-fired power plant, with the aim of obtaining a good insight into boiler dynamics and steady state performance. Another development is reported by Alam-Jan et al. (2002). These authors describe a training simulator for operators of a coal-fired power plant, and they claim that their nonlinear models implemented are moderately complex but reproduces the dynamic behaviour of the actual plant over a wide operation range.

Finally can be pointed that, no matter the selected approach or the computational tools used for the integration of a training simulator, the mathematical models must provide a realistic and consistent response in a wide operation range, this include any transient and steady state of the simulated power plant..

Additional issues about mathematical modelling and the application of dynamic simulators are discussed by Cameron et al. (2002).
