#### Abstract

Electrified guided vehicles typically face routes having a large number of acceleration and braking phases. The braking energy, since the feeding line presents nonreversible electrical feeding substations, can be recovered in the presence of other nearby vehicles. To improve braking energy recovery, one or more storage systems can be positioned along the track. Analysis of effectiveness for the considered solution requires time-domain simulation models, to be created through suitable simulation general-purpose languages or specialised languages/software. In this paper, three different tools for the considered existing tramway were developed, and the main examined characteristics have been compared to each other. Then, analysis of output results was also performed, demonstrating the real cost-effectiveness of introducing one storage device on the considered tramline in operation.

#### 1. Introduction

Electrified guided vehicles such as trams typically face routes with a large number of acceleration and braking phases. In this regard, only a fraction of the initial kinetic energy can be partially recovered [1–4]. In particular, if the feeding line presents nonreversible electrical feeding substations, braking energy can partially get back only in the presence of other nearby vehicles, capable of adsorbing traction energy. To improve the possibility of recovering energy, stationary storage systems along the track can be installed, in order to adsorb the energy during braking, when no other trains are able to receive it.

Analysis of the cost-effectiveness of the proposed solution involves the development of time-domain simulation tools. Obviously, solicitations on the storage system are influenced by timetable of the trams, positioning of substations, etc. Typically, the storage is installed through the interposition of a DC/DC converter, in order to limit current within safety limits, or to avoid battery State-of-Charge drift, to maintain unaltered its capability to adsorb or deliver energy.

In order to make time-domain simulations, it is possible to create models by utilisation of general-purpose programming languages, i.e., FORTRAN or C, or specialised languages or software, i.e., Modelica or Matlab-Simscape, respectively.

As example of modelling and simulation in railway applications, modelling of short-circuit protections or DC electrical railway systems to simulate stray currents and touch voltages, has been already developed in [5, 6].

In this paper, simulation tools aimed at correctly representing the railway system, including the electric power supply, the storage systems, and the vehicles moving along the rails have been widely developed. In particular, three simulation models were developed. The first tool has been realised in FORTRAN. It has been made a long time ago and used in many applications [7, 8]. Several experimental tests, in order to make its validation, were also performed in the past [9].

On the other hand, Dymola [10], a commercial tool based on the open-source Modelica language [11], represents a recent solution having many advantages, in terms of flexibility, simulation efficiency, and man-machine interface, as also demonstrated in several past works on railway systems, by the same authors [12, 13].

In the last years, many other commercial tools were also developed, as Matlab-Simscape [14]. This last one is not based on an open-source environment, but it is a relatively new toolbox of one of the most considered software tools for academic and company uses. Indeed, it is of some interest to compare the different tools as started in [15], also by extending the comparison to the new ones. More precisely, the newest tools were firstly confirmed on results achieved by the first one, in order to ensure the strength of the obtained results. Then, powerful and flexibility of each one have been accurately verified.

Therefore, after mutually validating the three tools under consideration, a technical-economic analysis for a tramway line in operation has been performed. In this way, energy consumption in realistic traffic conditions was taken into account, and energy saving due the installation of a storage device accurately calculated. Finally, payback time of the investment was evaluated, thus demonstrating the cost-effectiveness of the considered solution.

#### 2. The Simulation Tools

As said, in order to evaluate the amount of the braking recoverable energy, it is mandatory to develop a simulation tool capable of correctly simulating the feeding network and the vehicles dynamic. Then, different running phases and frequency of the trains have to be considered. Following modelling criteria were implemented.

##### 2.1. FORTRAN Language Based Model

FORTRAN language is a consolidate code to develop electrical model to represented power network. For DC railway application, calculation code Train-sim, consisting of two computational tools, is presented in [7, 8].

The first one allows calculating all the electromechanical characteristics and performance of trains on a specific railway line. Based on altimetry profile of the track and rolling stock features, it is possible to carry out the train performance due to motion stages. Dynamic and kinematic profiles are obtained. It is possible to set also various traffic scenarios. The tool also calculates the amount of recoverable energy at each braking phase.

The second one makes the DC electrified network load flow calculation. It builds an equivalent electrical network at each step, based on the tram positions along the route. ESSs, vehicles, and parallel points are the electrical nodes of the considered equivalent network.

The calculation code due to the model reported below permits the calculation of the electrical parameter of the network considering also the energy recovered during braking phase. The models are as follows:(i)Electrical substation (ESS). Figure 1 highlights the equivalent circuit to represent the voltage-current characteristic of a typical electrical substation. When the substation is not connected (zone 2), the node A is settled with* P* = 0. During supply or regeneration mode,* V* =* V*_{0} condition (zone 1 no-load output voltage) or* V* = (zone 3 network recovery voltage) is imposed at the node through resistance* R*_{3} or* R*_{1} to simulate different voltage drop, as shown in zone 3 and zone 1.(ii)Trams in traction. The vehicles are represented as a constant power load. However, if the current exceeds the maximum allowed value during operation, the constraint* I*= (constant-current operation) is imposed during the iterative calculation of the nonlinear equations, until the voltage at pantograph decreases. Standard EN 50388 [16] imposed* V*=0.8, so the model reproduces the* V-P* characteristic in agreement with this value.(iii)Trams in braking. Braking energy recovering depends on the receptivity of the system. If the system allows it, the traction line can accept all the power generated during braking phase, according to the solution of the system equations. If the voltage increases up to , the recoverable energy transferred to the catenary is lower. Then, the distance among the recoverable energy, and the energy effectively recovered gives an idea of the energy dissipated on braking rheostat. In this regard, a mixed rheostat-regenerative braking (shown as dash-dotted line in Figure 2) can be simulated. Figure 2 shows how the model works due to this braking technique: in particular, the current dissipated on the braking rheostat increases, and consequently the current entered into the traction line decreases up to being zeroed, when the voltage is reached. Typically,* V*’ is in the range 0.9÷0.95 . However, a good strategy to avoid the voltage decrease, just explained, is following the solid line reported in Figure 2, where* V*’=.

Finally, simple laws implemented for traction (1) and braking (2), according to the above points (see Figure 2), are as follows.

For each electrical substation, the software calculated electrical parameters about power, current, etc. including the amount of recoverable energy during braking and the voltage along the line.

The procedure for determining the matrix coefficients of the admittance constituting the traction line refers to electrical networks in permanent sinusoidal regime and, therefore, to complex admittance and impedance. The software, dealing with DC networks, considers all the magnitudes to be real, the admittance as conductance, and the impedance as resistance.

Regarding numerical solving methods, Newton-Raphson or Gauss-Seidel method is typically applied. Some variants of Newton-Raphson method particularly suitable for small- and medium-size networks can be also considered, in order to improve conditions of convergence and to reduce number of iterations [17].

##### 2.2. Modelica and Matlab-Simscape Based Model

As said, the simulation tool realised in Dymola is based on Modelica language [11]. It is a single simulator, performing the same functionalities of the two previous ones, written in FORTRAN, to the advantage of accuracy and flexibility, as will be analysed later. As anticipated, Modelica language is cyber-physical and allows simulating complex systems, i.e., having mechanical, electrical, thermal, control subsystems. Following the proposed approach, the ESSs were simulated through lumped components linked in a graphical way, as visible in Figure 3. As this study shows, only the DC component is of interest to evaluate effects of harmonics; each substation has been modelled through its well-known DC equivalent. Naturally, the system is time-variant. In fact, the contact-line configuration varies with time, since the train position varies. In fact, resistor values change depending on the train position, according to the following expressions:where* R*_{1} is the left side line resistance,* R*_{2} is the right side line resistance, and* δ* is the ratio of the distance between the train position (

*x*) and ESS2 position (

*P*

_{2}), and the distance between ESS1 and ESS2 substations (

*L*

_{12}).

In addition, the electrical feeding substations in operation are subjected to variation, when a train moves from a section to another, along the track. This difficulty can be easily addressed in Modelica, considering the possibility of changing the system equations after some events happen [12, 13].

Finally, modelling of trains requires modelling of the electric drive, resistance forces, and the driver’s behaviour. Electric drive is modelled as a system able to produce the tractive force as required by the driver, within the allowed force and power limits, generating some power losses expressed as a function of the mechanical speed and the required force. Then, each train must avoid feeding power to the catenary when this would cause the line voltage to become too large, and a controller of the DC power must be implemented. A much more sophisticated control strategy has been used, having feedback on the instantaneous pantograph voltage and modulating the braking power conveyed along the catenary, in order to avoid reaching instantaneously the upper allowed limit. Resistance to movement has been modelled using the formula including aerodynamic drag and rolling resistance:where* R* is the global resistance force acting against the vehicle movement, *α* is the angle between the track and the horizontal plane, m is the vehicle mass, is the rolling resistance coefficient,* A* and* B* are empirical positive numbers taking into account the lateral and front aerodynamic resistance, and* V* is the train speed. About the driver, it can be represented simply by a proportional controller, in which the reference tractive force is proportional to the error between the actual and the reference speed.

Further details regarding different submodel and control logic, in particular the blending strategy depicted in Figure 2, are widely described also in [15].

In parallel with object-oriented interface, the user can directly insert physical or control equations. These last are written exactly as in textbooks. Starting from individual subsystems description, Modelica-based tool automatically performs many operations: first, the identification of a set of differential algebraic equations (DAEs) representing the system under study and, then, after some additional operations to simplify the set of equations [15], the conversion in a C or C++ language compilation, to make the final simulation executable. This task of automatic creation of simulation executable requires just a few seconds. So, changing the system to create a new executable (for instance, to have more trains or a different number of ESSs) will require just a repetition of this automatic process. Once the executable has been created, it can run several times, while changing some parameters from a run to another [15].

Last simulator is realised in Matlab-Simscape [14] and entirely developed starting from the tool realised in Modelica: in this regard, the model architecture and equations of the submodels are the same already implemented in Modelica. Thus, lumped components have been simply rebuilt using Matlab-Simscape libraries, always according to Figure 3, and considering for their control part the well-known Matlab-Simulink control libraries.

##### 2.3. Comparisons

The three tools were tested by analysing their flexibility, simulation efficiency, and man-machine interface.

*Flexibility*. This aspect was identified in terms of capability to model new case studies. The Modelica-based tool is able to rapidly modify the existing models through its object-oriented interface, simply by changing or connecting new elements. Indeed, it is possible to increase or reduce the number of the trains running, the number and positioning of the electrical feeding substations, the eventual storage systems located along the track, the auxiliary adsorption, etc. Indeed, expandability of the model is easily guaranteed, also by the fact that the Modelica-based tool is a unique simulator, unlike those realised in FORTRAN. Additionally, creation of the simulation executable requires just few seconds. Thus, changing the system simply requires the rapid repletion of this process. These characteristics may be retrieved also in Matlab-Simscape, although the graphical interface is less clear and intuitive, as only partially object-oriented, due to the need for additional Matlab-Simulink control blocks. On the other hand, the FORTRAN language based model is completely different, requiring to be fully recompiled at every small change [18].

*Simulation Efficiency*. This was evaluated by speed and memory requirements. It must be said that the FORTRAN numerical solver may be optimised for the considered case study. Instead, Modelica and Matlab-Simscape utilise standard numerical solvers not specifically optimised on the single case study. The comparison was executed having one system characterised by a single electrical feeding substation and two trams on the track. As already described in [15], at equal number of samples and time length simulation, the Modelica-based tool engaged 11.5 s requiring 6 MB of memory. This is nearly the same for Matlab-Simscape, which employs about 20 s to perform a simulation of 1000 s, with memory occupation of 11 MB. In order to consider a proper time for complete simulation for FORTRAN calculation code, it is needed to consider the time duration to move between the two tools. In the case of the considered simulation (i.e., 1000 s), it engaged about 9.8 s and 20 MB of memory requirements.

*Man-Machine Interface*. The tool developed in Modelica allows the possibility of making changes in different ways. First, equations can be easily changed by text interface. On the other hand, model structure and related parameters may be changed by graphical interface [13]. This is nearly the same as utilisation of the Matlab-Simscape tool. Regarding the FORTRAN based model, Visual-Basic language is used to manage input and output data in Train-sim software; the support of the user friendly macros implemented permits modifying parameters in the software, although much more slowly than the others.

In conclusion, the Modelica-based and Matlab-Simscape tools require high memory requirements but also guarantee much more flexibility. The FORTRAN based tool, developed many years ago, is very useful because it is able to produce benchmark results, to be used as main reference. On the other hand, the other two tools allow fast creation of models, whose simulation results need to be carefully verified.

#### 3. Case Study

##### 3.1. Validation

The tools have been tested having as reference case study an existing tramway, in Rome. The path length is about 5.7 km, as noticeable from Figure 4, having one single electrical feeding substation: two trains are on rails, one for each track. The main input model parameters are listed in Table 1.

The simulation results were evaluated in terms of energy and power flows of the considered tramway. In the first examined condition, the trams make use of on-board resistors to dissipate all the braking energy. In the second scenario, they send braking energy on the catenary, until the voltage does not reach the maximum admitted value fixed at 800 V. Finally, trams send braking energy as before, but with one storage system installed about halfway along the tramway.

First, simulations were performed without considering braking energy recovery. As said, model parameters were slightly updated, in order to match the results provided by the new tools with the oldest one. Figure 5 shows the plot results of one train, driving on a portion of the considered route. In this case, the tram is not able to send its braking energy along the catenary. As observable, plot results are equivalent among the three tools, respectively, developed in Modelica, Matlab-Simscape, and FORTRAN.

Then, simulations have considered the possibility of recovering the braking energy. In this case, parameters acting on control voltage at pantograph have been tuned, to perform modulation of the inlet power, without overcoming voltage limits. Figure 6 shows plot results of one train under a portion of the considered profile.

As noted, different blending strategies according to Figure 2 have been implemented. Naturally, these differences have an impact on the total energy absorbed from the network. The blending strategy having V’=0.9÷0.95 (see Figure 2), implemented in FORTRAN, results in a reduction of the energy recovered through the pantograph, respectively, of 13% and 2% with respect to the dynamical strategy, used in Modelica and Matlab-Simscape, that allows the full powertrain power to be recovered up to (i.e.,* V*’=). Then, in terms of total energy adsorption from the ESS, increment is of 3% and 0.6%, respectively.

Naturally, braking energy recovery can be enhanced through energy storage systems installed along the route. In this way, one storage system has been introduced, with the main aim of validating the tools under test, also in the new considered system configuration. The lithium battery is positioned about halfway along the tramway (i.e., about 3.8 km from the terminal), whose characteristics are in Table 2.

Relation among the nominal energy and nominal capacity is given by

where is the number of cells in series, is the nominal energy, is the nominal cell voltage, and is the nominal capacity. Number of cells and nominal capacity were selected in order to exactly reproduce through the newest tools the battery SOC (State-of-Charge) and the power profile, with respect to the FORTRAN based one. Results are shown in Figure 7.

Installation of one storage system can significantly reduce the energy delivered by the electrical feeding substations (ESSs). The considered simplified case study with two trains obviously cannot correctly evaluate the cost-effectiveness of the considered solution. Thus, the full analysis will be described in the next section, following the same approach already considered by the authors in [12, 13].

##### 3.2. Energy Saving Evaluation

Energy saving evaluation has been performed by considering an experimental measurement campaign carried on by the authors. Results are summarized in Table 3, where the daily energy delivered from the electrical substation (ESS) has been measured during one typical school working day and one typical holiday day. Starting from that, evaluation of the annual electrical energy demand has been performed simply by considering the number of working days and holidays over the year, given by the tramline operator.

Therefore, the Modelica-based tool presented before has been used to exactly reproduce the energy consumption shown in Table 3. To do that, different numbers of operating trams along the day have been considered from timetable, respectively, 24 during peak hours, typically concentrated in the middle part of the day, and 12 in low load hours, mainly in the early morning and in the late evening. Real number of trams in operation may be slightly different. However, the daily distribution has been chosen to exactly reproduce the measured consumption.

After simulating exactly the same level of the measured energy demand, i.e., obtaining the daily consumption shown in Table 3, simulations have been repeated by including the storage system described in Table 2. The delivered energy by the ESS was then compared with the previous one, calculated in absence of the storage system. The reduction in annual energy consumption was about 15.2%, moving from 5386 MWh up to 4570 MWh.

The cost-effectiveness of the proposed solution has been investigated by considering the initial cash outlay due the introduction of the storage system, with respect to the annual return of the investment due to the above-mentioned electrical energy saving. The initial cash outlay due to the storage system and its balance of plant has been calculated by considering a value of 500 €/kWh including cells, BMS, and battery packaging. As discussed in detail in [19], the presence of a DC/DC converter may be required. For this, a fixed cost of 60 k€ in analogue way to the experience presented in [19] has been used. Finally, the current industrial user price of energy in Italy was evaluated considering an average value of 150 €/MWh. In terms of maintenance costs, for the reasons already explained in [19], the storage has been considered able to cover the whole life of the plant.

Main objective of the analysis was related to the evaluation of the net present value (NPV) and of the payback time (PBT) for a whole life of ten years and an interest rate of 4%. Results are shown in Table 4.

The results show that installation of a stationary storage system may guarantee a payback time within just two year. These numbers are so favourable not to be affected by any possible storage substitution, during the plant life. Indeed, the cost-effectiveness of the proposed solution has been clearly demonstrated.

#### 4. Conclusions

This paper has demonstrated how innovative languages and software allow rapid creation of numerical models, having electrical, mechanical, and control parts to be simulated.

The Modelica-based model was realised through the commercial Dymola tool. However, it could run inside any other Modelica-compliant tool. They proved to be fast, with relatively small memory occupation. Nearly the same can be said about Matlab-Simscape, although characterised by less flexibility, due to the fact that it is not inspired by an open-source language platform. The quality has been verified by comparing results with those obtained using a well validated FORTRAN based simulator.

With reference to an existing case study, the cost-effectiveness due to the utilisation of stationary storage system to enhance braking energy recovery has been clearly demonstrated, since on a high-traffic tramway with high number of stops, payback time has been reached within only two years. Naturally, it is of great importance, in order to correctly achieve energy saving for the considered application, to preliminary calibrate the considered tool on actual electrical energy consumption, experimentally measured.

As future direction of this work, it is also possible to consider the extension of the considered methodology to other tramlines in operation, in order to investigate the potential cost-effectiveness of similar, or different, energy saving solutions.

#### Data Availability

The data used to support the findings of this study are included within the article.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.