Skip to main content

Optimal renewable resources mix for low carbon production energy system in Morocco


The production of electrical energy has always been a subject of debate to fight against climate change and preserve natural resources. Several countries, including Morocco, have proposed ambitious policies to develop renewable energy sources of production in the short and medium term. The major problem of renewable sources production is their intermittent nature. Using storage units, particularly PETS’ and molten salt technologies, will increase the penetration rate of renewable energies. The balance between production and consumption will optimize production, and it represents an important aspect of smart grids. In this article, an electrical energy consumption prediction was developed for the period 2019-2025, and optimization of the renewable energies injected within the grid was made by introducing the algorithm used. The results show that the use of storage units will increase the rate of renewable energies integration to 47.189% of the total installed capacity.


Electrical power is a major factor for the social and economic development of the countries. The consumption of electrical energy will reportedly be doubled in 2040 (IEA, 2018), where comes the need to install new electrical infrastructure.

In Morocco, electricity demand (ED) is experiencing an average increase of 6-7% annually, and the expected electricity consumption in 2030 is 95 TWh. Currently, Morocco consumes 37 TWh for an installed capacity of 9GW. The electricity production field has made it possible to meet 86% of the national ED, and the difference is compensated via the Moroccan Algerian (MA) and Moroccan Spanish (MS) interconnection (

The Moroccan network is mono-directional, radial, and not robust. As more energy enters the market, the transition to a more efficient network with more flexible infrastructures becomes paramount, and the solution is the Smart Grid (SG) (Morad et al. 2013). There is no absolute definition to describe SG, but it can be characterized by its two-way communication, reliability and safety, ability to reduce peak power consumption via Demand Side Management Tool (DSM), ability to provide environmental benefits, locate and repair defects, integrate renewable energies, and manage storage units (Warren 2014) (Wu and Xia 2017). The SG can be summed up by a combination of electrical infrastructure and embedded intelligence associated with the software, automation, transmission, and information processing (Torriti 2012). This intelligence can be deployed at various levels of a network (Galván-López et al. 2015), and this network will be able to integrate data that control the operations that will be assigned to them (Sahbani et al. 2016) (Kuzemko et al. 2017). The basic essential element of SGs is to measure the real needs of consumers to produce the quantity they need. Electricity is very difficult to store. It is, therefore, necessary at all times to balance the network, to ensure that the production is equal to the consumption. If the gap between production and consumption increases too much, the network suffers from frequency deviations and damaging voltages for the network equipment and those of the consumers. The consequences can go as far as the disconnection of certain branches of the network, or even the generalized incident blackout. Where comes the need for DSM and Demand Response (DR). This shifting can effectively reduce the aggregate energy load during peak hours (Alasseri et al. 2017).

In Europe, the consumption of electrical energy is more interesting in winter than in summer, and this is due to the excessive use of heating. The electric variation varies from one country to another. The Belgian electricity sector is liberalized and unbundled. The country is using several business models, as the peak electricity consumption is around 13 GW. The Belgian electricity grid is quite advanced in the market, including decentralized generation, and the government plans to a possible phase-out of the nuclear power plants at the end of their lifetime. DR products are available for ancillary services and strategic reserve. Boogen et al. (2017) have conducted a study on the impact of DSM activities on residential ED in Switzerland. It has been found that the presence of DSM has a significant impact on the consumption of electricity, and their presence reduces the ED by 5%. (Paulus and Borggrefe 2009). Barbato et al. (2015) have proposed a distributed DSM system for SG infrastructure, specially adapted to reduce the demand for residential users using a dynamic pricing strategy. The authors used energy rates as a function of the overall power demand of customers. Mellouk et al. (2018) have used a genetic algorithm method to solve DSM and dynamic economic dispatch problems.

In North America, the specific needs of electric power reveal so many winter peaks that are due to the use of heating means in winter and air conditioning in summer. The American power grid is centralized, fragile, and old, and this makes it rather vulnerable. On August 14, 2003, the American power grid experienced a blackout in California affecting 55 million people and causing $ 6 trillion in losses (Gillingham et al. 2009). US utility grid-initiated DSM program that initially focused on load shifting and their increasing on electric end-use efficiency. Several studies were elaborate to a better implementation of demand-side management programs and modeling their roles to reach a balance between demand and supply in the presence of renewable energies generation considering their stochastic behavior. Alavi et al. (2015) have proposed the point estimate model for modeling wind and solar power uncertainties, and have made a comparison between deterministic and probabilistic management. Zakariazadeh et al. 2014a, 2014b have developed a conceptual model for a DR management system with an optimization tool using a stochastic multiobjective. The objective is to schedule distributed energy resources and aims at minimizing the total operational costs and emissions. Siano (2014) have presented a survey of DR potentials and benefits in SG. Zakariazadeh et al. (2014a, 2014b) have used a stochastic multi-objective economic and environmental operational scheduling method to minimize the total operational costs and emissions and to generate a Pareto-optimal solution for the energy and reserve scheduling problem. Mohamed and Koivo (2010) have used the mesh adaptive direct search algorithm to minimize the cost function of the system. Cicek and Delic (2015) have studied DRM in a smart micro-grid (SMG) with wind power and founded the optimal deficit limiting conventional power production and consumption schedules. Rahimi et al. (2013) have investigated to compensate wind intermittency by introducing various technologies such as pumped hydro storage/ plug-in hybrid electric vehicle (HEV), solar energy, and batteries. Aghajani et al. (2017) have proposed a study of stochastic programming model to optimize the performance of a SMG in a short-term to minimize operating costs, and emissions with RES. The authors' used probabilistic density function to predict climatic data (wind speed, solar irradiation … ), and DR programming with the participation of residential, commercial, and industrial customers.

In Morocco, where air conditioning is very widespread, the seasonal peak takes place in summer. Electricity consumption also varies significantly on the scale of a day: As we can see from the data collected for the ED, there are two-peak consumption per day; Midday peak: this one reflects the launch of the economic and industrial works. Evening peak: begins at around 19h, corresponds to the increase in household consumption and coincides with the end of economic activity.

Network balancing is particularly crucial at the peak. The value of this peak that sizes the electricity network by ensuring the security of the network. The historical holder of most of the means of production is the National Office of Electricity and Water (NOEW). The transmission system operator provides the long-distance transport of large quantities of electricity on high and very high voltage lines. It is responsible for the overall balance of the network, and the instant equilibrium between supply and demand of electricity. The distribution network operator provides the connection and daily distribution of electricity to all consumers. This activity, also considered as monopoly, is under the responsibility of NOEW, and the suppliers are the companies responsible for marketing and billing electricity to consumers. This activity is open to competition in Morocco, and several boards hold the market such as LYDEC, AMENDIS, REDAL, RADEEMA ... At the end of the chain, electricity consumers can be different in nature, from very large industrial consumers to residential customers, though consumers in the tertiary sector.

The main contribution made in this paper is to consolidate a low-carbon energy mix by promoting renewable energies integration into the power grid by:

  • Modeling and predicting monthly ED in Morocco by 2025

  • Propose a flexible and low carbon demand model by promoting the contribution of renewable energies within the power grid by 48% in 2025

The remainder of this paper is organized as follows: section 2 describes the problem and presents the data. In section 3, the regression model was studied and a 2025 ED forecasting scenario was elaborated. The proposed algorithm is analyzed in section 4, and the results are presented in section 5. The last section summarizes the results and draws conclusions.

Problem statement

In this study, a regression model is proposed for long-term energy management in order to promote the contribution of renewable energies resources in a SG. Due to the stochastic behavior of wind and solar energies, their accurate prediction is not possible and is always associated with uncertainties. The predictability of the data is analyzed to evaluate the relevance of keeping the parameters that have a low potential for the predictability. This is intended to determine carefully which criteria have a negative or negligible contribution to prediction accuracy. Therefore, to provide more compliance between planning and reality.The application and integration of ED prediction and generation of RES to SGs will optimize the management of the network. However, it is assumed that the distribution system’s operator, which has the possibility of managing and controlling the grid using distribution management systems, performs planning for generation resources and consumer demands in a SMG and advanced metering infrastructure. The following section is dedicated to data examinations.

Analyzing and modeling monthly electricity demand

  • Analyzing data

Figure 1 presents the evolution of ED in Morocco from 2000 until 2017. First, the figure shows a slight increase during the first seven years. Then a strong increase is observed since 2007. This may be due to several factors, direct and indirect, such as the increase in the exploitation rate of electronic equipment, climate change, and the acceleration of growth dynamics and modernization.

Fig. 1
figure 1

Monthly ED in Morocco (2000-2017)

Figure 2 displays the annual evolution of the demand for electric energy in Morocco during the period 1971-2017. It can be seen that the series reveals a growing trend over the years.

  • Modelling monthly electricity demand

Fig. 2
figure 2

Annual ED in Morocco (1971-2017)

In the literature, several prediction methods are available according to prediction horizons. Every method has its strengths, weaknesses, and changes according to the context and environment of prediction. It is often difficult to identify a prediction method that differs widely from others (Doucouré 2015).

Forecasting techniques are ranging from time series to hybrid models. Reviews research is presented by Bohi and Zimmerman (1984), and by Suganthi and Samuel (2012). In this study, a regression-based model has been used to predict electricity consumption in Morocco in the long-term.

The main objective of multiple regression is to learn more about the relationship between several independent or predictive variables and a dependent or criterion variable. A straight line in a two-dimensional space is defined by the equation (1)

$$ Y=a+b\ast X $$

where Y is the variable described by a constant ‘a’ and slope ‘b’ multiplied by the variable X. Multiple regression is where a dependent variable is described by several parameters, as is shown in equation (2):

$$ Y=a+b\ast {X}_1+c\ast {X}_2+d\ast {X}_3+\dots +n\ast {X}_n $$

Where (b, c, d … , n) are the coefficients of the regression

R2 describe the model fit goodness. If R2 adjusted is close to one, it indicates that the model has managed to explain almost all the dispersion thanks to the independent's variables.

In this paper, a regression-based model has been used introducing gross national product (GNP), population, and 11monthly dummy variables as explanatory variables. The model development was done in excel, and the results are summarized in Table 1.

Table 1 Multiple regression coefficient & probabilities

The P value designates the probability that measures certainty with which it is possible to invalidate the null hypothesis. The more P valued tends to one, the more the null hypothesis is invalidated with more certainty. Table 1 reports that the intercept coefficient with GNP and population are all highly significant with a confidence level of 99%. The coefficient for May is not significant which indicates that ED this month is similar to that of December. All the other dummy variables for the other months are significant, which means that more or less electricity is consumed during the corresponding months than in December.

However, the model still contains a large serial correlation despite its high predictive power. Autocorrelation occurs when the error term observations in regression are correlated. If those values follow a pattern, it means that the model contains autocorrelation. The Durbin-Watson (D-W) is widely used to test the first-order residues independence. The D-W statistic is calculated as follow:

$$ d=\frac{\sum \limits_{i=2}^n\left({e}_i-{e}_{i-1}\right)2}{\sum \limits_{i=1}^n\left({e}_i\right)2} $$

Where ei describe the residuals and n is the number of elements in the sample. D-W statistic value varies between zero and 4. If it is equal 2, it means that the model has no autocorrelation. If‘d’ is less than 2, especially a value less than 1, means that the data is positively autocorrelated. If‘d’ is substantially above 2 means that the data is negatively autocorrelated. The D-W statistic calculated in this model is estimated at 0.79730711, indicating the presence of positive autocorrelation.

In theory, if the residuals are serially correlated, then the estimate of the coefficients may be unstable. In this study, all the independent variables are statistically significant at a 1% error level. However, autocorrelation could be affecting the results, making it appear significant when it is not.

Back in reviews, two approaches can be used to deal with serial autocorrelation. The first method is eliminating the symptoms of autocorrelation by using another estimation method. Otherwise, preventing autocorrelation from occurring in the first place by adding relevant missing independent variables. There are situations in which autocorrelation cannot be eliminated if the omitted independent variable is not available or cannot be found. To reduce autocorrelation, several methods are presented in reviews, such as the AR (1) method used by (Mirasgedis et al. 2006), and Henley and Pierson (1994). Cochrane-Orcutt Method, feasible generalized least squares (FGLS) or estimated generalized least squares (EGLS).

Cochrane-Orcutt regression is an iterative version of the FGLS method for addressing autocorrelation. This approach uses the following steps for estimating rho.

Step 1: Run Ordinary Least Square (OLS) regression on eq (2) and calculate the residualse1, e2en

Step 2: Using these sample residuals ei, find an estimate for ρ using OLS regression on

$$ {\varepsilon}_i=\rho {\varepsilon}_{i-1}+{\delta}_i $$

Step 3: Substitute this estimate for ρ in the generalized difference equation

$$ {y}_i^{\prime }={\beta}_0^{\prime }+{\beta}_1{x}_{i1}^{\prime }+\dots +{\beta}_k{x}_{ik}^{\prime }+{\delta}_i $$

Step 4: Based on step 3, new residuals can be calculated. Go to Step 2.

Continue this iteration until the change in the estimated value of ‘ρ’ is less than some predetermined amount. Note that an iterative approach is used since regression coefficient ‘r’ in step 2 is not necessarily an unbiased estimate of ‘ρ’ although it is known to be a consistent estimate of ‘ρ’.

The use of the Cochrane-Orcutt method has eliminated the first-order autocorrelation. The new statistical value of the Durbin-Watson test is around 2.03, showing that the model has no longer autocorrelation in the error term.

Fig. 3 represents the distribution of the error against time, the new distribution is rather random, and it oscillates around zero.

Fig. 3
figure 3

Error terms distribution

The coefficient of May is not significant, which means that electricity consumed in that month is similar to that of December, or less. All the other coefficients are significant, which indicates that more or less electricity is consumed during these months than in December. The adjusted R² has been updated and has increased slightly from (94.6%) to (96.23%), which designate an improvement of the predictive power of the model.

Both RMSE and MAPE are calculated for the model, and the results are summarized in Table 2.

  1. a)

    Evaluation of the model

Table 2 MAPE & RMSE calculated for the regression based model

Historical electricity consumption data for the period 01/2000-12/2017 has been used to evaluate the regression-based model. The sample period 01/2000-12/2016 were used in training the model used in equation (3). The results of the computation are summarized in Table 3.

Table 3 Forecasting ED for 2017 for the training set 2000-2016

The model shows a very high predictive power as the overall prediction error is 0.3%. The maximum prediction error is 4%. However, the estimations’ deviation between actual and forecasted monthly ED is 1% or less for 6 out of 12 months. On an annual basis, the model has shown a high predictive power as the forecasted ED is very close to the actual data. Fig. 4 shows forecasted electricity consumption against real electricity consumption for 2017.

  1. b)

    Forecasting electricity demand for the period 2019-2025:

Fig. 4
figure 4

Real electricity consumption against forecasted electricity consumption

After executing the model on the desired period, the results summarized in Table 4 shows the electricity consumption values and their rate of increase. The model rate of increase is compared to what was published by the utility grid in (

Table 4 Forecasted electricity consumption for 2019 and 2025 and the rate of increase compared to 2017

With the 2025 forecasting done, the scaling consists of converting the values obtained into time powers for the 8760 hours of the year, by taking account of the types of the days, the time and seasonal variations. J. Torriti (2017), A.Pimm et al. (2018) and Ma et al. (2017) have used this approach in their studies.

Monthly electricity consumption is modeled as the addition of 4 variables; monthly electricity consumed during working days, holidays, days near holidays and Saturdays. Eq (6) represent the modeled electricity consumption function.

$$ {E}_{mi}={E}_{wd}{n}_{wd}+{E}_h{n}_h+{E}_{nh}{n}_{nh}+{E}_s{n}_s $$

Where Em, is the monthly electricity consumption, and ‘i’ vary from 1 to 12

Ewd: Monthly electricity consumption during working days

nwd: Number of working days during a month

Eh: Monthly electricity consumption during holidays

nh: Number of holidays during a month

Enh: Electricity consumption during days near holidays

nnh: Number of days near holidays during a month

Es: Electricity consumption during Saturdays

ns: Number of Saturdays during a month

Equation (6) can also be written in the following form:

$$ {E}_{mi}={E}_{wd}\ast \left[{n}_{wd}+{r}_h{n}_h+{r}_{nh}{n}_{nh}+{r}_s{n}_s\right] $$

Where, \( {r}_h=\raisebox{1ex}{$\overline{E_h}$}\!\left/ \!\raisebox{-1ex}{$\overline{E_{wd}}$}\right. \) is the rate of holidays

\( {r}_{nh}=\raisebox{1ex}{$\overline{E_{nh}}$}\!\left/ \!\raisebox{-1ex}{$\overline{E_{wd}}$}\right. \) rate days near holidays

\( {r}_s=\raisebox{1ex}{$\overline{E_s}$}\!\left/ \!\raisebox{-1ex}{$\overline{E_{wd}}$}\right. \) rate of Saturdays

After calculating these rates, they will be used to calculate the hourly power of each type of day of the year.

Once the daily energy of the working day is determined, the other values are multiplied by the corresponding ratio of the type of the day.

Therefore, daily ED is summarized in Table 5.

Table 5 Forecasted daily power consumption depending on the type of days

The conversion of energy into power is done by calculating the hourly effect of the day when the consumption is maximum (Table 6). This method was used by Grand et al. (2015) and aimed to extrapolate the hourly load deducing by homothetic from the previous years, and it is calculated as is shown by the equation (7)

Table 6 Daily ratio


$$ {e}_h=\frac{E_i}{\sum \limits_{i=1}^{24}{E}_i} $$

Where, eh is the hourly ratio

Ei hourly energy

\( \sum \limits_{i=1}^{24}{E}_i \) daily consumption

Scaling is the multiplication of these factors by the corresponding daily energy for each category of days.

Hourly energy consumption is summarized in Fig. 5:

  1. c)

    Generation-demand balance in 2025

Fig. 5
figure 5

Hourly needs for the period 2025

Production units

Conventional generation sources

A very large part of electricity generation is provided by conventional generation sources, including coal-fired power plants where the fuel is burned in a boiler using the heat generated either by combustion, or in a combustion turbine. In Morocco, the power supplied by coal-fired power plants is 1785 MW (2017). Oil-based production unit’s burn oil in a boiler producing steam that turns a turbine, which drives an alternator and produces electricity. The power supplied by these units is 600 MW (2017). Combined-cycle power plants use natural gas as a fuel in a two-stage production system: the first step is to put the alternator in motion by burning natural gas. Then, in a second cycle, the heat from the first cycle is recovered to the max to generate steam that rotates a second steam turbine to generate additional electricity. The total power of the system is defined in equation (8)

$$ {\boldsymbol{P}}_{\boldsymbol{cc},\boldsymbol{tot}}=\frac{\mathbf{2}}{\mathbf{3}}{\boldsymbol{P}}_{\boldsymbol{cc},\boldsymbol{gt}}+\frac{\mathbf{1}}{\mathbf{3}}{\boldsymbol{P}}_{\boldsymbol{cc},\boldsymbol{st}} $$

The efficiency of the system is around 59%. In Morocco, 1184 MW is installed in a combined cycle for the production of electrical energy. A gas turbine power plant is a heat engine performing the various stages of its thermodynamic cycle in a succession of members traversed by a gaseous fluid in a continuous flow. In Morocco, a gas turbine power plant is functional and develops a power of 315 MW.

Renewable energy sources generation

Renewable sources of production, particularly solar and wind have great potential. The installed capacity of the wind power plant will reach 2000 MW in 2020, spread over several sites. With a very strong solar field, Moroccan kingdom can produce a power of 20 GW just by solar, ( but this capacity is not exploited yet. However, 2 GW of solar is planned to be operational by 2020 divided into concentrating thermal power plants and photovoltaic power plants.

Hydroelectric generation

A hydroelectric power plant is the process of producing electricity by using water as the driving force to turn the turbines that drive generators to produce electrical power. These stations can also be used for energy storage as a pumped energy transfer station. The total installed capacity of these units in Morocco should be around 1400 MW around 2020.

Generation-consumption balance

Electricity consumption is highly unsteady, and this variability is sensitive during a season with peaks of consumption, more or less strong, this variation can also be on the scale of the day. In Morocco, generally warm country, widely equipped in air conditioner, the peak in electrical consumption is in summer.

Network balancing is crucial at the peak. Consumption peak value sizes the network to ensure electricity energy quality and complementary production capacities. Moroccan production units currently in operation are summarized in Fig. 6.

Fig. 6
figure 6

Percentage of different production sector in Morocco (2017)

The forecasted ED is denoted as (Fi, i=1 … .m). The devices that produce electricity are divided into three groups. Basic production units, decentralized production units, and peak production units. They are classified according to their priority. High, medium, low. When the demand is low, the manager would use the base source (coal = low), the more the demand increases, the more the manager would have to resort to another source of production, notably RES and gas-based production (Table 7).

Table 7 Production units’ priorities

Basic production units are scheduled to be operational in full-time. These units require a very high investment cost, but the operating cost is relatively low. In Morocco, as shown in Fig. 6, a preponderance of the production sources are based on coal and oil, 50% of the total installed capacity. During an electrical peak, utility grid manager uses auxiliary sources to meet ED. Those capacities have a fast startup and a high operating cost which explains the high cost during peak hours.

Production group maintenance is a periodic action programmed to detect latent anomalies in equipment and guarantee their proper functioning. Maintenance can reduce the probability of failure and increase equipment life. In this study, the maintenance schedule is supposed to be known.

The proposed algorithm is based on the promotion of renewable sources integration. The base capacities will be coal power plants operating with the minimum technical requirements. Coal plants are chosen because of their stability, reliability, and low production costs, where RES will be connected to be injected to meet required consumption in mid-peak time. The gas-based production units are characterizing by their fast start and flexibility, denoted as high because its request arrival time is in peak hour.

The objective of shifting electricity consumption can be various. The objective of electricity suppliers is to avoid the appearance of high peak load demand. In consumers’ point of view, the objective is to minimize electricity bill, and offer a better electricity quality.

In order to provide optimal schemes to regulate controllable devices to meet some desired properties, the demand load is forecasted based on the previous usage. The period of estimation is a forecasted window. It can be one day, a week, or even longer. In that case, the algorithm can run beforehand to generate a scheme for organizing the production units. In this paper, the algorithm is designed for one day ahead of planned load shifting, and it can be easily extended to the other sizes of forecasted windows.

Utility grid manager objective is to balance ED and production, to smooth the load curve by eliminating electrical peaks, and regress the energy bill. The approach used in this paper is to predict daily consumption by 2025, transform energy into hourly power, and optimize the use of conventional power sources. The algorithm is based on the use of coal-based sources of production with their technical minimum to ensure the base, and adding production units when needed by promoting RES injection.

$$ \left\{\begin{array}{c}{P}_n=a\ast {P}_{jlec}+b\ast {P}_{abm}+c\ast {P}_{eet}+d\ast {P}_{ctm}+e\ast {P}_{ctj}+f\ast {P}_{cts}+g\ast {P}_{ctk}+h\ast {P}_{hyd}+i\ast {P}_{wt}+\\ {}j\ast {P}_{solar}+k\ast {P}_{IMS; IMA}\kern14.75em \\ {}\mathit{\operatorname{maximize}}\ {F}_{d,\mathit{\min}}-{P}_{wt}-{P}_{solar}\ge {P}_{n,\mathit{\min}}\kern6.5em \\ {}\ f:=h+i+j\le 0.48\kern18.25em \end{array}\right. $$

Eq (9) describes the distribution of national production according to different sources of production. ‘a, b, c ... k’ are the coefficients that describe each source of production.

Eq (9) is the equation to be maximized; with ‘i’ the coefficient of wind turbines production and ‘j’ is the coefficient of solar energy production. The objective is to integrate renewable energies into the power grid, without exceeding 48% of the total production due to technical standard.

Implementation of the proposed algorithm

In this paper, an algorithm was implemented by programming language C to address the optimization problem in the power grid by shifting RES to start working at the appropriate time.

The flowchart of the proposed algorithm is presented in the illustration below Fig. 7. The initialization step initializes the parameters, time, type of day, the forecasted electricity consumption, coal production, RES production, gas production, Spain-Morocco interconnection, Algeria-Morocco interconnection. In each iteration, the priority change according to the required demand and the utility grid react according to the available sources of production.

Fig. 7
figure 7

The flowchart of the proposed algorithm

The program starts with the initialization of the inputs: the day Ti, month Mi, forecasted consumption Fd, available production units Ai, their degree of importance Ii, and their downtime Ci.

With day and month acknowledged, the forecasted electricity consumption would be determined, consequently, the production units’ status: low, medium, and high, as needed. After the determination of production units’ status, the connected units will be chosen according to the need for consumption. If all the objectives were realized, the program would shut down showing the results. Otherwise, an incremental loop is created to continue the calculation. When the production meets the demand, the program will stop, print results, and shows the percentage of renewable energies integration within the power grid.

Fig. 8 shows that the use of RES production varies according to the hours of the years. The graph represents a monotonous hourly load, classified from the greatest to the smallest value. Based on equation (9), the max of production to be connected is 40% in 2019, 48% in 2025 (

Fig. 8
figure 8

Hourly monotonous electric load for 2025

Figure 9 represents the load monotone expected in 2025 in hourly volume, represented in the descending curve. The bottom of the graph represents basic generation power plants that operate in technical minimum during the same period.

Fig. 9
figure 9

Monotonous electric load for the period 2025 with basic generation power plants

After the execution of the program, the calculation of the small integrable value by renewable energies over the whole period was calculated, Pres, min=1248.793 MW.

This value represents a penetration rate of 17.54502 % of the total installed capacity, distributed on wind farms and solar fields. The integrable capacity of renewable energies can be increased by adding storage capacity, PETS’ to store the energy produced by wind turbines, and molten salt technology to store solar energy. The capacity of the storage units in Morocco in 2025 will reach 2110 MW, 1110 MW of PETS’, 1000 MW of molten salts (

RES are intermittent, so their storage is mandatory for better utilization of these resources. The integrable RES capacity is 3358,793 MW, which corresponds to a maximum penetration rate of 47,189%. The capacity of the electrical system to absorb the surplus of RES generation is increased. As a result, demand increases and the maximum power that can be produced by RES power plants increase, and the penetration rate is improved.


In order to define relevant scenarios, several factors are relative and which must be taken into account. The total character of the energy system will impose the elected choice. The world price of the energy that depends directly on the estimated balance offers and demand on a world level. The second character refers to the relations foreign of Morocco and the evolution of its integration in various regional contexts. This variable is particularly determining for the future of the Moroccan energy system that suffers from a notorious insufficiency of primary resources in this sector. The process of decarbonizing of the electrical supply network bases the fall of price by putting in exploitation new technologies of production of electrical energy leading in the long term to a surplus of offer and capacity installed.

The electricity production field in Morocco is mainly based on centralized production based on coal, while the production based on renewable energies does not exceed 13%, Fig. 10.

Fig. 10
figure 10

Injected power by sources

After the implementation of the program, the share of renewable energies has increased. By regressing the share of decentralized generation sources and putting them in technical minimum, the production of renewable energy injected into the network has reached 17,545 %. Storage units represent an effective way to increase the percentage share of renewable energies. The aim of these units is to store the excess of production from REPP, and use it when needed. By adding the generation stored in these units, the share of renewable energies has increased to 47.18963%.

By using thermal sources of production with their nominal values, production would exceed demand in 42.796% of the time, and only 1.554% of the time when thermal production would be in line with consumption, Fig. 11. The renewable energy threshold was calculated for the remaining 55.650% of the sample, and the calculated value vary between 0.36% and 31.7%.

Fig. 11
figure 11

Monotonous electric charge for 2025

The program used will help to manage the production units better, to promote renewable energy integration, and to reduce greenhouse gas emissions. First, reduce the nominal power of the thermal power plants, and use them with their technical minimums, Fig. 12. The insufficiency, in this case, will be compensated by means of renewable energies. The integrable capacity calculated is 17.545% over the entire period. By adding the storage units, which totalize 2110 MW, Table 8, the integrable threshold will increase to 47.189%.

Table 8 Storage units available by 2025
Fig. 12
figure 12

Forecasted load monotone with basic power plants working with minimum technic power

Fig. 13
figure 13

Installed power distribution without optimization

Fig. 14
figure 14

Installed power distribution after optimization

The program has therefore helped to increase the renewable energy threshold in 2025 from 31.733% out of 4875 hours, Fig. 13, to 47.189% out of 8760 hours, Fig. 14. This value corresponds to a significant decrease in conventional sources, and the decrease of the energetic mix cost, since the cost of the kWh produced from renewable energies is cheaper than the one produced by TPP.


Summarizing what was done, the regression-based model was used to predict electricity demand in Morocco for 2025. The method has shown a high predictive capacity with a significant adjusted R², 96.23%. The forecasted energy was scaled by converting the values obtained into time powers, for the 8760 hours of the year, based on the type of days, the time and seasonal variations. An algorithm based on the promotion of renewable sources integration was elaborated. After the integration of basic power plant, the program has to promote directly the integration of renewable energies within the power grid and indirectly via storage units. The calculated integrable threshold is 17.545%. With storage capacities added, the new integrable power by renewable energies will border 3358.793 MW, with a percentage of integration of 47,189%. A value that converges with the policy of the country who have proposed 42% of the installed capacity power of RES by 2020, and 52% by 2030. Among the perspectives that can be identified on the purpose of this work would be to develop more complex modeling of the intermittency, and the balance of the electrical network by integrating the hourly climatic and meteorological data to calculate the electric power generated by the natural flow. Thus, our study will allow developing more deeply the economic and environmental consequences.

Availability of data and materials

The datasets generated and analyzed during the current study are not publicly available due confidentiality issues, but are available from the corresponding author on reasonable request.


\( \overline{E} \) :

Mean Electricity power

E m, i :

Monthly Electricity consumed in ‘i’ hour


Ain Beni Mathar power plant


Basic Power Plant


Combined cycle


Thermal Power plant Jerada


Thermal Power plan Kenitra


Thermal Power plant Mohamedia


Thermal Power plant Safi


Demand Response


Demand Side Management


Durbin Watson


Electricity Demand


Electric Energy Tahadart


Gas Power Plant


Gas turbine




Giga Watt-hour




Hybrid Electric Vehicle


Jorf Lasfer Electricity Company


Morocco-Algeria Interconnection


Mean Absolute Percentage Error


Morocco-Spain Interconnection


Near holidays


National Office of Electricity and Water


Pumped Energy Transfer Station

R2 :

Coefficient of determination


Renewable Energy Power Plant


Renewable Energy Sources


Root Mean Square Error




Smart Grid


Smart Micro Grid


Steam Turbine


Thermal Power Point


Tera Watt-hour


Working days


Wind Turbines


  • Aghajani GR, Shayanfar HA, Shayeghi H (2017) Demand side management in a smart micro-grid in the presence of renewable generation and demand response. Energy 126:622–637

    Article  Google Scholar 

  • Alasseri R, Tripathi A, Rao TJ, Sreekanth KJ (2017) A review of implementation strategies for demand-side management (DSM) in Kuwait through incentive-based demand response programs. Renewable and Sustainable Energy Reviews 77:617–635

    Article  Google Scholar 

  • Alavi SA, Ahmadian A, Aliakbar-Golkar M (2015) Optimal probabilistic energy management in a typical micro-grid based-on robust optimization and point estimate method. Energy Conversion and Management 95:314–325

    Article  Google Scholar 

  • Barbato A, Capone A, Chen L, Martignon F, Paris S (2015) A distributed demand-side management framework for the smart grid. Computer Communications 57:13–24

    Article  Google Scholar 

  • Bohi DR, Zimmerman MB (1984) An update on econometric studies of energy demand behavior. Annual Rev Energy 9(1):105–154

    Article  Google Scholar 

  • Boogen N, Datta S, Filippini M (2017) Demand-side management by electric utilities in Switzerland: Analyzing its impact on residential electricity demand. Energy Economics 64:402–414

    Article  Google Scholar 

  • Cicek N, Delic H (2015) Demand response management for smart grids with wind power. IEEE Transactions on Sustainable Energy 6(2):625–634

    Article  Google Scholar 

  • Doucouré B (2015) Proposition, intégration dans un système de gestion de réseau intelligent et validation expérimentale d'une méthode de prédiction pour un système d'énergies renouvelables (Doctoral dissertation, Université du Québec à Trois-Rivières)

    Google Scholar 

  • Galván-López E, Curran T, McDermott J, Carroll P (2015) Design of an autonomous intelligent demand-side management system using stochastic optimization evolutionary algorithms. Neurocomputing 170:270–285

    Article  Google Scholar 

  • Gillingham K, Newell RG, Palmer K (2009) Energy efficiency economics and policy. Annu Rev Resour Econ 1(1):597–620

    Article  Google Scholar 

  • Grand D, Le Brun E, Vidil R (2015) Intermittence des énergies renouvelables et mix électrique

  • Henley A, Peirson J (1994) Electricity load and temperature : Issues in dynamic specification. Energy Economics. 16. 235–243.

  • INTERNATIONAL ENERGY OUTLOOK 2018 (September 22th, 2018)

  • Kuzemko C, Mitchell C, Lockwood M, Hoggett R (2017) Policies, politics and demand side innovations: The untold story of Germany’s energy transition. Energy Res Soc Sci 28:58–67

    Article  Google Scholar 

  • Ma Z, Song J, Zhang J (2017) Energy consumption prediction of air-conditioning systems in buildings by selecting similar days based on combined weights. Energy Buildings 151:157–166

    Article  Google Scholar 

  • Mellouk L, Boulmalf M, Aaroud A, Zine-Dine K, Benhaddou D (2018) Genetic Algorithm to Solve Demand Side Management and Economic Dispatch Problem. Procedia Computer Sci 130:611–618

    Article  Google Scholar 

  • Mirasgedis S, Sarafidis Y, Georgopoulou E, Lalas DP, Moschovits M, Karagiannis F, Papakonstantinou D (2006) Models for mid-term electricity demand forecasting incorporating weather influences. Energy, 31(2-3), 208–227.

  • Mohamed FA, Koivo HN (2010) System modelling and online optimal management of microgrid using mesh adaptive direct search. Int J Electrical Power Energy Systems 32(5):398–407

    Article  Google Scholar 

  • Morad M, Abdellah EB, Ahmed EK (2013, October). Smart grids in Morocco: Dream or reality? In Industrial Engineering and Systems Management (IESM), Proceedings of 2013 International Conference on (pp. 1-8). IEEE.

  • Paulus M, Borggrefe F (2009, September). Economic potential of demand-side management in an industrialized country–the case of Germany. In 10th IAEE European conference.

  • Pimm AJ, Cockerill TT, Taylor PG (2018) The potential for peak shaving on low voltage distribution networks using electricity storage. J Energy Storage 16:231–242

    Article  Google Scholar 

  • Rahimi E, Rabiee A, Aghaei J, Muttaqi KM, Nezhad AE (2013) On the management of wind power intermittency. Renewable and Sustainable Energy Reviews 28:643–653

    Article  Google Scholar 

  • Sahbani S, Mahmoudi H, Hasnaoui A, Kchikach M (2016) Development prospect of smart grid in Morocco. Procedia Computer Sci 83:1313–1320

    Article  Google Scholar 

  • Siano P (2014) Demand response and smart grids—A survey. Renewable Sustainable Energy Rev 30:461–478

    Article  Google Scholar 

  • Suganthi L, Samuel AA (2012) Energy models for demand forecasting—A review. Renewable Sustainable Energy Rev 16(2):1223–1240

    Article  Google Scholar 

  • Torriti J (2012) Demand Side Management for the European Supergrid: Occupancy variances of European single-person households. Energy Policy 44:199–206

    Article  Google Scholar 

  • Torriti J (2017) Understanding the timing of energy demand through time use data: Time of the day dependence of social practices. Energy Res Soc Sci 25:37–47

    Article  Google Scholar 

  • Warren P (2014) A review of demand-side management policy in the UK. Renewable Sustainable Energy Rev 29:941–951

    Article  Google Scholar 

  • Wu Z, Xia X (2017) A Portfolio Approach of Demand Side Management. IFAC-Papers Online 50(1):171–176

    Article  MathSciNet  Google Scholar 

  • Zakariazadeh A, Jadid S, Siano P (2014a) Economic-environmental energy and reserve scheduling of smart distribution systems: A multiobjective mathematical programming approach. Energy Conversion Manag 78:151–164

    Article  Google Scholar 

  • Zakariazadeh A, Jadid S, Siano P (2014b) Stochastic multi-objective operational planning of smart distribution systems considering demand response programs. Electric Power Systems Res 111:156–168

    Article  Google Scholar 

Download references


The authors would like to thank the National Office of Electricity and Water (ONEE/BE) for providing data which give the authors the opportunity to pursue research in this area.


Not applicable

Author information

Authors and Affiliations



SE provided the data used in the study. OB analyzed and interpreted electricity demand data, programmed the algorithm, and was a major contributor in writing the manuscript. DS revised the program with OB. DS and FF have revised the work. All authors read and approved the final manuscript, and agreed both to be personally accountable for the author's own contributions and to ensure that questions related to the accuracy or integrity of any part of the work, even ones in which the author was not personally involved, are appropriately investigated, resolved, and the resolution documented in the literature.

Corresponding author

Correspondence to Omar Benzohra.

Ethics declarations

Ethics approval and consent to participate

Not applicable

Consent for publication

Not applicable

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Benzohra, O., Ech-Charqaouy, S.S., Fraija, F. et al. Optimal renewable resources mix for low carbon production energy system in Morocco. Energy Inform 3, 3 (2020).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI:


  • Renewable energy
  • forecasting
  • electricity demand
  • demand-side management
  • low carbon system
  • optimization