Empirical Model for electrical power demand in Mexico

In recent decades, the average global temperature has risen rapidly, due to the modern society activities. Hence, the United Nations has suggested that an increase of 1.5°C above the reference temperature corresponding to the beginning of industrial revolution era must be avoided. One proposal to mitigate this global warming is the migration towards green energy generation systems, however, suitable predictions of electricity demand are required to properly manage the implementation and operation of hybrid energy generation systems with high penetration of renewable energies. In this paper, a simple mathematical model based on sinusoidal functions which consider the normal time periods of the society like daily, weekly, monthly, and annual is proposed for the electricity demand in Mexico. The model parameters were obtained from the historical data from 2017 to 2021, furthermore, the model was used to estimate the electricity demand for the year 2022 as a demonstration of its usefulness, obtaining a mean absolute error of 0.9% in the whole year period. The proposed model is simple and can be used to reproduce and estimate the electricity demand of the national interconnected system.


Introduction
At the present days, one of the main worldwide issues for modern society is the global warming, which means the increment on the average earth temperature considering the reference as the average temperature measured in the 1850-1900 period [1].According with United Nations (UN) the global warming currently implies an increment of about 1.1 °C.However, such increment has been accelerated in the last decades, which implies that the overall temperature could reach the limit of 1.5 °C above the reference value at the beginning of the 2030 decade.This temperature value is considered as not return point, due to the environmental unbalance expected under those conditions [1].Under this scenario, there is a strong necessity to reduce the use of petroleum-based power generation technologies.Hence, the UN has proposed migrating towards sustainable power generation using renewable generation systems [2].Among the different available technologies, the photovoltaic panels and wind power are the most widely used renewable energy systems in the world.However, they are a kind of variable power supplies systems due to their intermittent operation i.e., the photovoltaic power is dependent on the sunlight intensity and operates only during daylight, regarding the wind power systems, they can supply power while the air speed is within the turbine's operating cut in-off range.Additionally, some concerns related with operational problems due to synchronization times with dispatchable generation systems such as hydroelectric or combined cycle power plants can be presented.
Hence, the change toward renewable energy generation technologies implies important issues due to the necessity to guarantee that system will provide power enough to satisfy the full demand at any moment, even when the renewable generation show restricted conditions.Under this scenario, mathematical models are useful tools to analyse the electrical power demand behaviour, as well as feasible short, medium, and long-term forecasting allowing the development of novel strategies to manage the transition to electricity power systems with high energy renewable penetrating.Different methodologies which look for the reproduction of electricity demand have been presented, such as the use of regressions with moving averages over time series like autoregressive integrated moving average (ARIMA) and its variants [3]; the use of neural networks with the aim to fit the time series data [4], or the use of Fourier series to predict residential and commercial loads [5].Additionally, a neural network model using Fourier series was developed to predict monthly demand in Spain [6]; and Fourier series as a regressor for ARIMA models and artificial neural networks (ANN) was used in [7].In this paper, a simple empirical model based on sinusoidal functions is proposed.This model allows to reproduce the demand of the National Interconnected System (NIS) in Mexico, using historical hourly demand data from 2017 to 2021.To analyse the model accuracy, the Mean Absolute Percentage Error (MAPE) was used.

Data analysis
The NIS is formed by seven generation regions distributed along the Mexico´s territory, they are managed by the National Energy Control Centre.The demand data can be found in [8], such data include the losses in the system, therefore they can be considered as net values.Fig. 1 shows the energy demand from January 2017 to December 2021 obtained from [8].As observed the national demand presents a secular increasing trend along the time.Also, an oscillatory behaviour can be distinguished, with period related with a calendar year.Furthermore, it is possible to see a maximum demand at the end of spring or during summer season, and the minimum appears at the beginning of the winter season which corresponds with the last days of the year.Additionally, in Fig. 1 it is possible observe other oscillatory behaviours with shorter periods.Fig. 2 shows the power demand, considering two weeks from May 15 th to May 28 th of 2019 whit the aim to identify the short-time demand behaviour.As can be observed, there are two main components, one with a period of one day and a second with period of a week.It is worth to notice that there is a maximum and minimum of demand every day approximately at 5pm and 5am, respectively.Also, along the week, the maximum demand occurs between Wednesday and Friday and the minimum demand appears on Sundays.
Figure 2. Historical net electricity demand in the NIS from May 15 th at 00 hrs. to May 28 th at 24 hrs. of 2019.The weekly and daily periods can be identified.

Proposed mathematical model
As indicated above, the NIS electrical demand exhibits an oscillating behaviour with at least three different periods, which corresponds with the normal society activities: i) yearly, ii) weakly and iii) daily.An extra oscillation with monthly period, as well as a secular linear trend will be included.Hence, the mathematical model can be built using simple sinusoidal functions, with the aim to properly reproduce the energy demand shown in Fig. 1.
The model is developed considering a first sinusoidal function with a daily period as follows: Where coefficient b1 is estimated as the half of the difference between the average of daily maximums and the average of daily minimums registered from January 1 st of 2017 to December 31 st of 2021, and ωd corresponds to the angular frequency related with a period of 24 hrs.i.e., one day (ωd = 2π/24 rad/h).
A second sinusoidal function with a weekly period is considered as: where coefficient b2 is estimated as the half of the difference between the average of weekly maximums and the average of weekly minimums registered from first week of 2017 to last week of 2021, and ωw corresponds to the angular frequency related with weekly period (ωw = 2π/168 rad/h).
A third sinusoidal function with a monthly period can be defined as: where coefficient b3 is a fitting parameter, ωm corresponds to the angular frequency with a monthly period (ωm = 2π/730 rad/h), and  is an angle phase.
Also, a sinusoidal function corresponding with a yearly period can be added as: Where coefficient b4 is estimated as the half of the difference between the average of yearly maximums and the average of yearly minimums from 2017 to 2021, and ωy corresponds to the angular frequency of a yearly period (ωy = 2π/8760 rad/h).
The secular increasing trend is included using a linear function as: where b5 and m5 are fitting parameters, which can be roughly estimated as the y-axis intercept and the slope of the linear regression of the whole demand from January 1 st of 2017 to December 31 st of 2021.
Finally, the energy demand of the NIS (ED) is defined as: The final values of the fitting parameter b3, b5 and m5 were obtained from the comparison between the model and the historical demand.Table I summarizes the values used for the model parameters.

Results and discussion
Fig. 3 shows the comparison between modelled and historical NIS data.As can be seen, the annual behaviour is properly reproduced, however a significant mismatch is found mainly in spring season.Fig. 4 shows the same comparison in the time range from May 15 th to May 28 th of 2019, as shown, the model exhibits a good fitting with historical demand data in the daily period, but some deviations appear at the maximum and minimum values.Also, the weekly period is properly reproduced with maximum values around Wednesday and the minimum consumption shown on Sundays.
To validate the energy demand calculated by the model, the MAPE was calculated using the following equation using the historical data from January 1 st of 2017 to December 31 st of 2021.
where NISi is the historical energy demand data and EDi is the energy calculated data from (6).
For this analysis, the data were treated on hourly, daily, weekly and annual range times, Table 2 summarizes the calculated values of MAPE.As observed, the error decreases as the time range is increased and the values obtained are in the same order of magnitude that others models [3,6].Therefore, these results suggest that the model allows to forecast the medium-and long-term power demand in Mexico.In order to show the usefulness of the model, the estimation of the 2022 demand was performed and compared with reported data, also the corresponding MAPE was determined, the comparison and errors are sown, respectively, in Fig. 5 and Table III.The best fitting is shown along the summer season, and in winter season has more significant differences, mainly in December and January.The MAPE shows a relatively hourly error of about 4.7%, and the error of the annual demand was of about 0.9 %.Those results, based on the error values obtained, show that the model allows to estimate the demand within a good certainty range.Yearly 0.9

Conclusions
A simple analytical model for the electrical demand in Mexico has been developed.The model is based on sinusoidal functions, which considers the normal society activity periods, and three fitting parameters.The model has been fitted using the historical demand data from January 2017 to December 2021 and it has been used to estimate the energy demand along 2022 to demonstrate the forecasting feasibility of the model.Additionally, main absolute error was determined with the aim to analyse the model performance and confidence.The estimated errors showed values around 5.7 % for the hourly period, which was reduced until 2.5 for the yearly range.Also, the errors for the 2022 prediction were reduced to 4.7 % and 0.9 % for the hourly and yearly ranges.Therefore, the presented model can be used for forecasting, in a very simple way, the energy demand in Mexico with a good confidence degree.

Figure 1 .
Figure 1.Historical net electricity demand in the NIS, from 2017 to 2021.The annual period and the secular trend of the data are shown.The grey scale spans present the seasons: Winter, Spring, Summer and Autumn.

Figure 3 .
Figure 3.Comparison between NIS and modelled demand (ED), from 2017 to 2021.The grey scale spans present the seasons: Winter, Spring, Summer and Autumn.

Figure 4 .
Figure 4. Comparison between NIS and modelled demand (ED), for the period from May 15 th at 00 hrs to May 28 th at 00 hrs. of 2019.

Table 1 .
Summary of the model parameters.

Table 2 .
Error estimation using the historical demand data from January 1 st of 2017 to December 31 st of 2021.

Table 3 .
Error estimation for the year 2022.