Feasibility study of a renewable system (PV/HKT/GB) for hybrid tramway based on fuel cell and super capacitor

The conﬁguration, modelling and control of several possible hybrid systems for the propulsion of the existing tramway in Cuenca-Ecuador are analysed. The system consists of novel renewable sources: Photovoltaic energy, hydrokinetic turbines and a biomass gasiﬁer, which increases the reliability of the system and reduces CO 2 emissions. In addition, a proton exchange fuel cell and a super capacitor thatsupply the necessary power for the tramway, as well as, a hydrogen tank that stores the excess energy. Energy management is done through renewable sources that recharge the super capacitor and the fuel cell at the charging stations along the tramway route. Different renewable hybrid systems have been analysed, which indicates that the most favourable case from a technical, environmental and economic point of view using data analysis and machine learning techniques is S4. Sensitivity analyses allow the study of variables such as CO 2 , net present cost and COE for different demand variations, as well as, for the minimum state of charge in the super capacitor. The results indicate the optimal net present cost is M$ 1.46 and 0.12 $ kWh − 1 in cost of energy, validity of the proposed system in the round trip of the tramway.


INTRODUCTION
One of the energy problems at present is the use of fossil fuels to boost public transport vehicles within cities. The energy conversion of transport to renewable energy seems to be one of the most significant challenges, ref. [1] explains that 100% renewable transport is feasible with adequate energy control. To reduce dependence on fossil fuels, new forms of energy supply are being developed for public transport. For example hydrogen as combined energy storage [2]. Similarly, super capacitors (SC) are widely used as a propulsion system, which are capable of cover the power peaks produced by tramways. SCs need battery backup, typically lithium ion or nickel cadmium [3,4]. An example, is the tramway of Zaragoza-Spain, Urbos 3, this tramway uses the energy from regenerative braking and electrical connections in certain stations to recharge the SCs on board [5]. For the tramway to be completely autonomous, fuel cells (FC) must be used to cover the power deficit of the SC and the batteries, avoiding connections with the electrical grid. Several This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. © 2021 The Authors. IET Renewable Power Generation published by John Wiley & Sons Ltd on behalf of The Institution of Engineering and Technology studies demonstrate the technical feasibility of this configuration through different strategies of predictive control and minimisation of hydrogen consumption [5][6][7][8]. Even, hydrogen consumption can be reduced by up to 4.18% using state machine control, as explained in ref. [9]. The control algorithms proposed to reduce hydrogen consumption significantly reduce the cost of the system compared to a tramway connected to the electrical grid [10].
However, it is feasible to supply the tramway with FC, batteries without SC to reduce the weight of the vehicle. In ref. [11], the viability of using FC without SC is analysed, using an adequate energy control it is possible to supply the tramway with a peak power of 400 kW [12][13][14]. In addition, similar studies have shown the possibility of minimizing hydrogen consumption in a tramway supply with FC, [15][16][17]. The type of tramway route are important factors for system sizing. In tramways with extensive routes and high gradients, a practical solution would consist of charging stations. This is explained by the study [3], which uses combined dual fuzzy logic control, to demonstrate the Electrical grid - performance of a hybrid tramway based on catenary-batteryultra capacitor with field experimental data in China. Another study with real data is ref. [18], which tests a new control strategy for a tramway with FC SC in a real driving cycle, designed and modelled numerically. The authors achieve satisfactory results, the efficiency of the FC was 50% while the state of charge (SOC) of the SC ranges between 35% and 95%. Moreover, the SC and FC systems can solve the problem of power and voltage stability, as they have shown [19,20]. The topology of each site has an important relevance in the sizing optimisation of a hybrid system, the tramways supplied with SC and FC need to be recharged from some alternate source in case the SOC of SC and FC are minimal. The studies reviewed in the literature, focus only on the energy control of the tramway and do not study the type of external source such as the electricity grid or a renewable distributed system, which could be an important factor in cost and longterm efficiency, and a full sensitivity analysis including environmental indices has not been performed either. In the literature, a data analysis with machine learning has not been carried out at different configurations of the system to supply the tramway.

Control strategy
For this reason, this article analyses the feasibility of a renewable hybrid system composed of solar panels (PV), hydrokitenics turbines (HKT) and a biomass gasifier (GB), which supplies a hybrid tramway with FC and SC on board, using a new proposed control algorithm, The study has been done with real data from a tramway located in Cuenca-Ecuador, currently it tramway are supply with energy from the local electrical grid. A system of SCs and FC covers the tramway power peaks, while the renewable energy system recharges the system through catenaries at certain stations.
Different configurations of renewable hybrid systems are proposed by combining the sources and storage systems mentioned, in order to determine the optimal system. These systems have been analysed using Homer pro software through the proposed energy control.
The main contributions of this paper are the following shown in Table 1 and explain below: • Identify the techno-economic and environmental impact of using a hybrid renewable system to supply energy to a tramway with an SC and FC on board • Compare different scenarios, adding or removing components on the same system in order to be clear about the advantages and disadvantages in each case • Analyse a new energy control that includes the FC system with SC and the renewable hybrid system (PV-HKT-GB) • Study the impact on the net present cost (NPC) by varying the capital cost of each component • Sizing optimisation of the system by varying the SOC of the SC with respect to the NPC, excess energy and unmet load • Analyse the robustness of the system against future load increases • Data analysis and machine learning have been used

TRAMWAY DESCRIPTION
The tramway under study is located in the City of Cuenca-Ecuador, its traction power is supplied through the electrical grid with catenaries at 750 Vdc [21]. The starting power reaches up to 300 kW for 3 s [22], in Figure 1, the calculated power values are shown every minute for 1 h and Figure 2 shown the traction power for 1 day.

RENEWABLE RESOURCES
The renewable sources PV and HKT will operate continuously recharging the SC and hydrogen tank. The annual river velocity obtained from a meteorological station is shown in Figure 3 [23], it is observed that the resource is higher during the months of October and November.    Figure 4, the values have been taken in an interval of h during 1 year. Figure 5 shows the availability of biomass resource for a year distributed in 8 wood furniture factories within the city, the resource is greatest in the months of April and May, and considerably less in October and November [24].

MATHEMATICAL MODELS
The proposed energy scheme is shown in Figure 6. In this section, the mathematical modelling of each component   of the system has been done. The connection between the sources and the tramway is made through a direct current bus.

FIGURE 6
Proposed energy scheme

Fuel cell
In this paper, the proton exchange membrane (PEM) has been used [25], for their high energy density and response to load power peaks. FCs have proven to be feasible for public transportation applications [6-8, 13-16, 26]. The voltage generated by an FC is calculated with Equation (1), E cell of Nernst Voltage and irreversible voltage V irrev [27,28]. (1) . (2) Where: E 0 cell is the standard state reversible voltage, k e is a function of the entropy change and the Faraday constant, T is the FC temperature, R is the ideal gas constant, F is Faraday's constant, p H20 is the partial water pressure, p O2 is the partial pressure of oxygen, p H2 is the partial pressure of hydrogen, V act and V ohm are the activation and concentration voltage drops, which are functions of the current density (relationship between the current FC and its effective area), V ohm is the ohmic voltage drop according to the internal resistance of FC [5,11,17,26].
where q in are the outflow of hydrogen and oxygen [8].
Hydrogen consumption (q con H2 ) for 1 h is calculated by the following Equation (6).
where P FC is the net power output of the FC; E low,H 2 is the low calorific value of hydrogen (33.35 kWh kg −1 ); therm is the thermodynamic efficiency (0.98% a 298 K), U f is the fuel efficiency, FC is the efficiency of the FC [29]. The main characteristics of FC are shown in Table 2.
Restrictions: Certain parameters must be adjusted to ensure optimal performance of a FC [30,31]. In this case, the FC restriction is their operating voltage limits that must be adapted to the tramway system 750 Vdc. V min ≤ V out ≤ V max . Where V min is the minimum operating voltage (−10% of the total voltage 675 V) and V max is the maximum operating voltage (+10% of the total voltage 825 V) [32].

Electrolyser
Renewable sources will store energy in the form of hydrogen through an electrolyser (ELZ) [33]. The ELZ efficiency has increased in recent years reaching the 85% in some cases [34]. The output power of ELZ is given by the Equation (7): where P ELZ is the power consumption of the electrolyser, m H 2 is the mass flow rate of hydrogen produced (kg s −1 ), HH V H 2 is the higher calorific value of hydrogen (MJ kg −1 ) and ELZ is the efficiency of ELZ [35].
Restrictions: In this case, the electrolyser will take power from the system until the volume of the hydrogen tank (kg) reaches the maximum value according to each configuration analysed.

Hydrogen tank
Different sizes of hydrogen tank have been proposed. The power required by the compressor is calculated using the Equation (8) [36]. The FC will use the stored hydrogen to generate electricity for the tramway [34].
(8) where is the polytrophic coefficient, R is the ideal gas constant, T incomp is the compressor inlet temperature, Comp is the efficiency of the compressor, P 1 y P 2 are the input and output pressures respectively yṁ H 2 is the mass flow of hydrogen. Therefore, the pressure in the hydrogen tank is expressed as follows where V tank is the volume of the hydrogen tank and tank is the tank efficiency Restrictions: If the volume of the hydrogen tank is greater than 50%, the FC can provide output power. This restriction is adopted to ensure that the hydrogen tank has enough time to be recharged from renewable sources, or the excess energy of the GB.

Supercapacitor
The energy stored in the SC is expressed as: where E SC is the energy stored in the SC, C is the capacitance and V is the output voltage. For this study, the SC of 3000 F available in Homer has been chosen. Each unit with 2.7 V, 3.7 W output power. Arranged in strings of 278 units, it is possible to reach a voltage of 750 Vdc required by the load.
Restrictions: Like FC, a voltage constraint has been imposed, where: V min is the minimum operating voltage (−10% of the total voltage 675 V) and V max is the maximum operating voltage (+10% of the total voltage 825 V) [32]. V min ≤ V ≤ V max . Furthermore, under real conditions the SOC min is 5% since the SC needs an initial charge residue, the SOC max is 95% to store the remaining 5% as residual charge for the next charge-discharge procedure [37].

Biomass gasifier
In this paper, the gasifier (GB) must transform the furniture waste produced by the factories as a form of biomass, into electrical energy. Under partial combustion, the gas has a composition of H2 (20%), CO (20%), CH4 (1-2%) and inert gases. The gases produced by the pyrolysis of biomass, the reformed tar and the coal gasification processes contain fuel that is used as fuel for the gas engine or MT to generate electricity. Gasifier performance η g i s given by Equation (11) [38][39][40][41][42].
where Q g is the volumetric gas flow (Nm 3 h −1 ), LHV b is the lower heating value of biomass (kJ kg −1 ),ṁ b is the biomass consumption rate (kg h −1 ) and LHV g is the lower heating value of gas (MJ Nm −3 ). The estimated power generated is calculated with the following Equation (12) [43].
where HHV g is the high heating value of gas generated, η MT is the efficiency of the MT, about 30% and is given by Equation (13) [44]: where P bg is the electrical power generated by the system, η gen is the efficiency of the generator, about 95%. Electrical efficiency is given by Equation (14) [44]: The electrical performance of the gasifier-MT system is given by Equation (15) [45]: where P aux is the power required by the equipment and P in is the input power. The annual electricity production of a GB E bg can be calculated as, here P bg is the power of the biomass gasification system and CUF is the utilisation factor. Restrictions: GBs need a lower power limit to operate, because the characteristics of biomass, in this case the lower power limit is 10% of the nominal power of GB [46].

Hydrokinetic turbine
The characteristics of the HKT depend of their power curve and the river speed. In this study, 5 kW of nominal power turbine are used, the authors [47,48] have demonstrated the feasibility of using hydrokinetic turbines (HKT) in off-grid systems. The power of the hydrokinetic turbine P HKT is given by Equation (17) [48].
Where the energy is given by: where ρw is the water density in kg m −3 , C p,H, the performance coefficient of HKT, η HKT is the combined efficiency of the HKT generator, A the HKT area in m 2 , water flow rate v (m s −1 ) and time t in seconds.
Turbines installed in open channels must consider distances from the river bed. Considering the average flow speed (u), normal distance above the bed taken from reference (y), the speed where the flow is diverted vertically towards the bottom of the river (u a ) and the exponent of the power law 1 m , therefore, the power law is expressed by the Equation (19) [49].
Restrictions: The power curve of the HKT of 5 kW nominal power indicates that: The turbine starts its operation with a power of 0.1 kW at a river speed of 1 m s −1 , and a nominal power of 5 kW at a river speed of 2.8 m s −1 [50].

CC/CA converter
The converter is used to connect the DC bus to the AC current, using Equation (20) the power of the load side is determined.
where P 0 (t) is the output power of the inverter, P i (t) is the input power of the inverter and η inv is the converter performance, in this case 96%. The input power of the converter P inv will be given by the PV, FC and battery power [47].

Photovoltaic generator
The performance of a solar module varies according to the radiation, temperature and angle of each photovoltaic panel. The output power of P PV is calculated using the Equation (21), where Y PV (kW) is the nominal capacity of the photovoltaic generator, f PV (%) is the reduction factor, I T (kW m −2 ) is the solar energy from the incident radiation in the photovoltaic module, I S (kW m −2 ) is the solar radiation incident under standard test conditions, α P is the temperature coefficient. T C is the cell temperature PV and T s is the temperature of the PV cell under standard operating conditions [47,48,[51][52][53][54]]. The PV system must provide all the available power according to solar radiation without any restrictions. Table 2 shows the main technical and economic characteristics of the hybrid system components.
In this study, different configurations have been proposed adding or removing elements to study the impact on the techno-economic and environmental results. Table 3 shows the configuration of each proposed renewable hybrid system (HRES), in all systems, the SC must supply the power peaks produced by the tramway.

ENERGY MANAGEMENT
The energy control proposed in this article is made up of several states, considering different conditions that could arise in a real system. In this case, the energy management for a system composed of renewable sources, hydrogen, FC and SC (configuration S4 in Table 3) has been explained, for the other configurations proposed in Table 3 it will be enough to adapt the conditions by removing each component. The algorithm shown in Figure 7 is explained below.
(i) Start. If the energy of the GB+HKT+PV sources is sufficient to supply the demand (P GB + P HKT + P PV ) ≥ P load , and if SOC sc ≥ SOC scmin . The remaining energy is supplied to the HYDT through the ELZ, as shown in Equation (22). .
(ii) If the energy of the GB+HKT+PV sources is sufficient to supply the demand (P GB + P HKT + P PV ) ≥ P load , and if SOC sc < SOC scmin .  . (23) b. If the volume of the hydrogen tank is less than 50%, it will be recharged by renewable sources.
(iii) If the energy of the GB+HKT+PV sources is not sufficient to supply the demand (P GB + P HKT + P PV ) < P load , and if SOC sc ≥ SOC scmin . a. If the volume of the hydrogen tank is less than 50%, the load will be supplied by GB+HKT+PV +SC.
b. If the volume of the hydrogen tank load is greater than 50%, the load will be supplied by GB+HKT+PV+SC+FC.
(iv) If the energy of the GB+HKT+PV sources is not sufficient to supply the demand (P GB + P HKT + P PV ) < P load , and if SOC sc < SOC scmin . a. If the volume of the hydrogen tank is less than 50%, the load will be supplied by GB+HKT+PV.
b. If the volume of the hydrogen tank is greater than 50%, the load will be supplied by GB+HKT+PV+FC.

Sizing optimisation
In Table 4, the result of the proposed HRES is presented, the savings in S8 configuration is evident (1.29 M$ and 0.107 $ kWh −1 ), as it consists only of a GB and SCs. However, in this configuration, the GB must provide more energy and therefore CO 2 emissions are increased (332 kg y −1 ). If the GB is replaced by PV + HKT, (S2 configuration) the SC capacity increases with respect to the S8 (267,000 units) because the randomness of renewable sources, this result produces higher excess energy (46%) and unmet load (1.75%), so the cost also increases considerably (7.98 M$ and 0.668 $ kW −1 ), but CO 2 emissions are avoided.
The capacity of the SC is an important factor for the extra weight on the tramway. The SC capacity could be reduced if a GB is added to the S2 configuration, in this case the energy sources are PV+HKT+GB with SC on board the tramway (S3 configuration). The cost reduces considerably (1.36 M$ and 0.112 $ kWh −1 ) as does the capacity of the SC (1072 units), but CO 2 emissions increase to 158 kg year −1 , the energy excess is 26.2% and the unmet load is 0.05%.
In order to reduce excess energy and unmet load without increasing CO 2 emissions, it has been proposed to replace the renewable sources PV+HKT with a hydrogen system (FC+HYDT+ELZ). The new system consists of a hydrogen system, SC and a GB (S7 configuration), the cost does not vary considerably with respect to S3 (1.39 M $ and 0.115 $ kWh −1 ). However, it is possible to reduce the energy excess and the unmet load completely, but CO 2 emissions have increased (330 kg year −1 ), and the capacity of SC is now (2064 units).
Then, it has been proposed to add renewable sources to the S7 configuration, first the PV source is added (configuration S5), the results show that the cost has increased to (1.41 M$ and 0.116 $ kWh −1 ), the capacity SC has been reduced to 912 units, and CO 2 emissions are now lower (158 kg year −1 ). However, there has been an increase in excess energy of 12.9% and unmet load of 0.06%.
If in configuration S5 the PV source is replaced by HKT (configuration S6), the results are similar, the cost increases to 1.47 M $ and 0.121 $ kWh −1 , the capacity of the SC remains at 912 units, CO 2 emissions are it increases up to 295 kg year −1 , but there is no excess energy and the unmet load is 0.227%.
According to the analyses, an important index to consider is the CO 2 emissions, which is produced by the GB, it has been found in the S2 configuration that by eliminating the GB from the system, the SC capacity and the excess energy increase considerably. However, having a hydrogen system and renewable sources the results could vary, the S1 configuration has PV+HKT as energy sources, a hydrogen system and SCs. The results of this configuration show that the capacity of SC increases, to supply the energy of GB the renewable sources and the hydrogen system must also increase their capacity with respect to the other configurations as shown in Table 4. Therefore, the cost in S1 increases to 3.06 M$ and $ 0.256 kWh −1 . There is a significant saving in CO 2 emissions (−131 kg year −1 ), the excess energy is still high (30.1%), as well as, the unmet load (0.942%).
Finally, the S4 configuration is analysed considering renewable sources, GB, SC and the hydrogen system. The results show that the cost is reduced compared to the previous configuration (1.46 M$ and 0.12 $ kWh −1 ), the capacity of the SC now it is lower (1264 units), CO 2 emissions are 220 kg year −1 . The excess energy has been considerably reduced to 0.463% and the unmet load of 0.015%.

FIGURE 8
Data analysis of renewable hybrid system parameters as a function of Tramway (kW)-WEKA To optimise the system from a technical, economic and environmental point of view, there must be a balance between cost, SC capacity, excess energy, unmet load and CO 2 emissions. Although some configurations present excellent economic indices, the CO 2 emissions are very high or the capacity of the SC is not practical on board the tramway, in the same way to guarantee the reliability of the system the stability must have acceptable indices of excess energy and unmet load. In summary, after analysing the eight configurations, it has been identified that by using a greater number of energy sources and energy storage systems (S4 configuration) there is a balance in the results, so the S4 configuration could be a promising result and deserves to be analysed further in this article.

Data analysis and machine learning systems
Applying Data Analysis and Machine Learning techniques, using WEKA (Waikato Environment for Knowledge Analysis) software [57], some important characteristics could be observed in the input variables of the proposed algorithm that are detailed below in Figure 8. For the traction power of the tramway, a mean value of 88,081 kW has been found with a standard deviation of 89,122 and with the limits of −4.97 kW and 297.86 kW as minimum and maximum required values.
In relation to Table 3, it is observed in Figure 8(a), the PV power reaches maximum values with respect to the demand, and the HKT compensates the PV power, Figure 8(b). For the configurations S1, S2 the discharge value of the SCs is progressive, Figure 8(c).
The output power of FC contributes to the system if the SC does not have enough load to supply the tramway, Figure 8(d).
Considering the contribution of the electrolyser, the recharge of the hydrogen tank is observed from the excess energy, Figure 8(e). In the configuration with HYDT, its minimum distribution can also be observed according to the necessary compensation of the tramway, Figure 8(f) and the contribution of GB, Figure 8(g).
In this way, the optimal distributed combination of HRES elements could be defined, as indicated in configuration S4.

Result of energy control
The energy control of the renewable system must ensure that the system has enough energy to cover the power peaks of the tramway. In Figure 9, the result of the algorithm proposed in Figure 7 is presented. It is observed that the response of GB and SC is as fast as the power peaks of the tram, while the renewable sources have a constant behaviour, in case if the GB is not available, the FC supplies the power together with SC. Finally, the hydrogen discharge rate is promising.

Sensitivity analysis of S4 configuration
Sensitivity analysis allows a more in-depth study of a system, by varying certain parameters it is possible to identify new technoeconomic and environmental behaviours. In this paper, sensitivity analyses have been performed varying the capital cost of the components with respect to the NPC. In addition, the SOC has been varied with respect to the NPC, excess energy and CO 2 emissions. Finally, the impact of increasing the electric load scaled average with respect to the NPC, the fuel consumed and the energy excess has been analysed. The results are discussed below. Capital costs vary frequently, so the NPC of a project depends on it. Figure 10 presents the result of the capital cost sensitivity analysis with respect to the NPC. The variation in the cost of capital of a gasifier influences the NPC of the project because their high cost of operation and maintenance and its high nominal power (216 kWe). If the capital cost of the GB triples, the project NPC increases almost half a million dollars. HKTs under the same conditions would increase the NPC by approximately $ 300,000 and the SC about $ 100.00. The hydrogen system (electrolyser, FC and hydrogen tank) have less sensitivity to changes in their capital cost.
On the other hand, the sensitivity analysis of the SOC min in the SC with respect to the NPC and the total COE shown in Figure 11, has shown that it is possible to discharge the SC up to a SOC min of 20% without changing the total system cost. However, by increasing the SOC min above 20%, the NPC and COE also increase considerably since, having lower stored energy, the installed power of the sources must be increased to ensure the reliability of the electrical system.
Similarly, CO 2 emissions are also increased if the SOC min of the SC is greater than 20%, in Figure 12 this variation is indicated, the maximum point is 30% since for larger values the emissions decrease, depending on the type of electrical source used. It is important to mention that the real limits of the SOC in a SC are 5% to 95%.
By increasing the SOC min from 0 to 20% in the SC, the excess energy and the unmet load increase by 0.6% and 1.5%,

FIGURE 14
Sensitivity analysis increased load with respect to net present cost and COE respectively, for higher values of SOC min these indexes are reduced, but they still remain above the initial value. This is shown in Figure 13. If electricity demand increases, renewable sources and the energy storage system will provide more energy, according to Figure 14, if the load is increased from 2,113 kWh day −1 to 3000 kWh day −1 , $ 400,000 must be added to the total cost of the project. However, the COE would be reduced by 1.6 $ kWh −1 . Similarly, for the same load increase interval, CO 2 emissions and fuel consumption would be increased by 1200 kg y −1 and 600 kg y −1 respectively. These values are indicated in Figure 15. The configuration (S4) would represent an increase of 0.8% in unmet load, and 0.2% in excess energy (887 kWh day −1 ), as shown in Figure 16.
When the energy from renewable sources PV+HKT is sufficient to recharge the SC, they are used to recharge the hydrogen tank as shown in Figure 17, for a year it has been recharged twice to its maximum capacity. Figure 18 shows the SOC of the SC for a day, it is clear that during night hours the SOC remains at the maximum (100%), at the beginning of the day the SC will be unloaded covering the tramway load peaks, in addition of FC+GB.

CONCLUSION
• This article evaluates a new configuration and energy management system for the Cuenca (Ecuador) tramway, based on various configurations of hybrid PV/HKT/GB/SC/FC systems. The proposed control decides which energy source should supply the tramway power at each moment, the SC and FC cover the highest and fastest load peaks; and renewable sources keep the energy storage system recharged (SC and HYDT). • In the different simulations of the hybrid system, it is possible to analyse the costs, the CO 2 emissions and the percentage of unmet load, for a new hybrid PV/HKT/GB/SC/FC system (S4 configuration), which allows to improve the reliability in comparison with other systems studied (S1, S2, S3, S5, S6, S7 and S8). The GB allows a quick response to the system when the SC cannot supply the necessary power. • The analysis on SOC min of the SC, if there is an increase in SOC min , both the NPC and the COE increase considerably, with less energy stored, the installed power of the sources must be increased to ensure the reliability of the electrical system. There are more CO 2 emissions if the SOC min is greater than 20%, reaching the maximum value of 30%, the CO 2 emissions are inversely proportional to the SOC min . For a SOC min between 0 and 20% the excess energy and the unmet load increase by 0.6% and 1.5%, respectively, for higher values of SOC min these indices are reduced. The increase in demand is directly proportional to the CO 2 emissions and the NPC, but the COE is inversely proportional, with higher demand the cost per kWh is lower. • The capital cost of each component affects the NPC of the project, the GB has shown greater sensitivity to this variation and the HYDT the least. • Of the possible solutions, there are options with NPC and COE values below the S4 configuration, but they have higher CO 2 emissions and a higher percentage of both excess energy and unmet load. • For these reasons, the S4 system is considered the most suitable for the tramway application, since the system is perfectly capable of supplying the system throughout the entire route, although it presents 0.8% unmet load. • The data analysis with machine learning using the WEKA software indicates that for the power of the tramway an average value of 88.081 kW has been found with a standard deviation of 89.122 and with the limits of −4.97 kW and 297.86 kW, as minimum values and maximum required. After analysis, it has been confirmed that the optimal configuration is S4. In addition, the results have shown that by having more energy sources, it is possible that they are complementary, avoiding excess energy and unmet load.