1 Introduction

Micro grid constructions for power generation and distribution have become widespread recently. Micro grids (MG) are small-scaled and restricted power systems which include self-power generation using different resources, distribution to respond the request in the servicing environment and energy storage facilities. Generally, MGs can be run in two different modes; grid-connected and islanded (autonomous) modes. The shifting between the modes is done by regarding need of main grid or MG. On the islanded mode, the MG works autonomously and uses distributed energy resources [1].

The optimal energy management of the MGs has become a recent concern. To construct standalone (islanded mode) MG is the essential aim by determining most fertile locations in terms of distributed resources. However, it is not always possible. Thus, the objective of MG studies moves to minimization of amount of power bought from main grid. This research area is open to be developed by heuristic optimization solutions because of the complex structure of the problems. In the MG problems, both power generation and consumption sides have to be considered.

MGs are seen as the grid system of future because of the decentralized structure [2]. They are also quite open to new technologies because of the small-scale and independent management structure. In this context, this study proposes an unattempted hybrid heuristic approach for optimal management of MGs while considering regional conditions and constraints. For the MGs with distributed resources, minimization of the need to grid connection on hourly basis will be aimed. A new mathematical model and a new hybrid Genetic Algorithm–Simulated Annealing method will be proposed for this type of MGs. It is hoped that the obtained results will give us the most suitable energy management plan with minimum cost in reasonable time.

2 Literature survey

The literature on MGs and distributed generation using heuristic methods is vast. Although these studies have some common grounds, there are differences as well.

Power loss minimization is one of the dynamics which are pioneers of proliferation of MGs. Decentralization of power generation and micro scale generations are quite influential to decrease power losses. The literature provides works studying power losses directly. In one of them, a two-stage stochastic optimal energy and reserve management problem was handled by using a stochastic weight tradeoff particle swarm optimization algorithm in which node voltages, power losses and fuel and emission costs of energy were estimated [3]. Panwar et al. [4] dealt with a multi-objective optimization problem which aims to minimize line loss, operational cost and maximize the value of stored energy simultaneously. The leading complexity by multi-objective construction was solved with a particle swarm optimization algorithm based methodology [4]. Lotfipour and Afrakhte [5] handled reconfiguration of distribution system, a complicated combinatorial optimization problem. For that, a discrete teaching–learning based optimization algorithm was presented which have advantages like high solution speed and requiring no parameters except population size and convergence criterion. The objectives of the established model were power loss minimization and voltage profile improvement [5]. Indragandhi et al. [6] applied an energy management program to minimize both energy cost and power loss probability by considering constraints of generators and storage system of the MG. Multi-objective particle swarm optimization was used to manage all components simultaneously which are wind turbines, photovoltaic (PV) panels, battery and fuel cell [6].

Dispatching, programming and scheduling are other study fields about energy management systems of MGs. Considering flexibility requirement of the system and non-dispatchable intermittent power generation, Marzband et al. [7] proposed an intelligent power scheduling model based on imperialist competition algorithm by minimizing the system operation cost. The results showed that the proposed algorithm gives a set of optimum solutions which fulfill the constraints. Hence, operators had several alternatives to select according to their economic and technical conditions [7]. Mazzola et al. [8] proposed an algorithm which evaluates different energy source combinations. A forecast based energy management system was established by using a heuristic strategy. There, an optimal power schedule with time-steps of 10 min was obtained [8]. Hosseinnezhad et al. [9] presented a mathematical model for day-ahead operational planning of the MG which minimizes both pollutants emission and operating cost. A combination of numerical and evolutionary methods of species-based quantum particle swarm optimization was used to obtain optimal power flow schedule [9]. In the study of Sarshar et al. [10], daily loads were scheduled in a MG which consists of wind turbine, PV panels and micro turbine by minimizing total cost and pollutant emission. Meta-heuristics and decision making methods (wavelet decomposition, artificial neural networks, genetic algorithm and TOPSIS) were used together with the criteria of power balance, power generation capacity and energy storage limits [10]. And also, Roy et al. (2018) scheduled operation of micro-sources with the objective of minimization of generation costs by using the same criteria in their paper. The handled MG has also several components like PV system, wind turbine and micro turbine. They used meta-heuristics of bacterial foraging optimization algorithm and artificial neural networks [11].

Energy storage is also an important element of MGs. The battery energy storages are mostly seen as a key factor to handle intermittent and unpredictable nature of renewable sources. There are numerous studies in the literature focused on battery storage needs. Almada et al. [2] used a PV generator, a fuel cell and a battery bank together in a MG. The researchers presented a centralized energy management system which prevents power cut during shifts between grid-connected and islanded modes [2]. Chen et al. [12] proposed an optimization model which regards economic factors for MG energy management. Optimal investment amounts were determined for power generators and battery devices. In the results of sensitivity analysis of battery capacity, it was seen that optimal battery size is determined according to demand and supply of MG system; and greater battery storage capacity always requires more investment [12]. Liu et al. [13] optimized capacity of energy storages which are Li-ion battery and lead acid battery by using particle swarm optimization. The criteria were determined as life cycle costs and pollution emissions [13]. Sharma et al. [14] minimized total operation costs under uncertainties by using point estimate method, Swine influenza model based optimization with quarantine and whale optimization algorithm together. The handled MG has generators like wind turbines, PV panels and micro turbine, and storage components like battery and fuel cell [14]. Forecasting studies are also seen in this literature. Mavrigiannaki et al. [15] did 24 h load forecasting to predict the day ahead excess production by using artificial neural networks method in a MG. The handled MG composes of hydro-power plant, rooftop solar panel installations, ground water heat pumps, solar tracker and electrical and thermal storage systems [15].

Real time energy management was done for MGs. Elsied et al. [1] used binary particle swarm optimization algorithm to meet load demand of 24-h operation with minimum utility cost. This helps to achieve an optimal power allocation between distributed energy resources [1]. In another study, authors use a novel heuristic strategy for a commercial buildings MG system which contains electric vehicles and PV units. The strategy was composed of feasible charging region, dynamical event triggering and real-time power allocation. The important advantages of proposed approach were that the statistical data about solar resource or consumer demand were not needed, and applying the method was at quite low cost [16]. Shi et al. [17] compared results of two meta-heuristics for the energy management system of a distributed generation MG, i.e. elitism genetic algorithm and particle swarm optimization. It was concluded that the performance of elitism genetic algorithm was a bit better than other one [17]. Marzband et al. [18] applied multi-period artificial bee colony algorithm to minimize real-time operation costs of another MG. In that real-time energy management approach, power balance, generation and operating time capacities of power sources and main grid constraints were regarded [18].

Tah and Das [19] studied with a hybrid MG, which composes of wind-turbine generator, fuel-cell, aqua-electrolyzer and diesel engine generator as a slack generator. The MG evaluated in three modes, i.e. isolated, interconnected and grid-connected modes. The aim of the paper was to improve voltage profile and decrease the active power loss [19]. Azaza and Wallin [20] also dealt with another MG composes of PV panels, wind turbines, diesel generator and battery. In that study, particle swarm optimization was used with the objectives of optimization of operational costs, system reliability and environmental impact. Only capacities of power generators were considered as criteria [20]. Abdul-Salam and Phimister [21] proposed a mixed integer nonlinear programming model. The model was used in Monte Carlo simulation for electricity planning. Due to the simulation procedure, the relative performance of a common heuristic algorithm was tested and it was shown that the heuristic algorithm is generally cost effective in such studies [21]. Alavi et al. [22] used both the point estimate method and robust optimization technique for optimal energy management of a MG. The methods were applied under uncertainties arise from the solar and wind resources and load demand. In the result, operation costs of the MG system reduced dramatically [22]. Bai et al. [23] dealt with a MG system which contains a PV generator and a solid oxide fuel cell. Several control systems were developed for system operation, and the artificial bee colony algorithm was adapted to the control systems. This way, the distributed generation units in the MG could be managed easily in both grid-connected and islanded modes [23].

Dufo-Lopez et al. [24] proposed a new stochastic-heuristic methodology for power supply of off-grid hybrid systems. The handled power system in the study was a PV-wind-diesel hybrid system with battery storage. The using heuristic method was genetic algorithm of which fitness function has expressed net present cost [24]. Han et al. [25] used all of the particle swarm optimization, artificial fish swarm, genetic algorithm, artificial bee colony algorithm and interior point algorithm to maximize lifecycle net profit under power balance and storage system constraints. The MG has only PV generators and also energy storage system [25]. In the study of Aghajani et al. [26], PV system, wind energy system and batteries were managed for the purpose of optimal operation of a grid-connected MG. Multi-objective particle swarm optimization was used by considering the constraints of operational costs, pollution emissions and power balance [26]. As a last example, Wanitschke et al. [27] used multi-objective evolutionary algorithm for an islanded MG. The components of MG were PV system, wind turbine, combined heat and power system, lithium ion and lead acid batteries. They aimed to model hourly power flow between the MG components by minimizing operational costs [27].

In the context of the presented literature review, the optimal energy management of a MG with distributed renewable generation units will be dealt in this paper. As we have seen in the literature, decentralized power generation and using distributed resources are power generation structure of the future like MGs. To conclude, new tendency of the power sector is localization and moving away centrality in both energy generation techniques and grid structures. Furthermore, a new plant which will be established in any sector must be self-contained. Hence, it will be a real contribution to propose an algorithm for evaluation of MGs in terms of self-sufficiency.

In the light of aforementioned arguments, the main aim of our study is minimizing the need of grid connection in MGs. This study presents a hybrid heuristic GA-SA method. The algorithm can be used for evaluating several distributed generation MG systems whether it can be a standalone MG or not; and if there is a need for grid connection, the algorithm shows how one can minimize total load taken from grid. The results will answer two things: firstly, is the grid-connected mode necessary for the handled MG; and secondly, if establishing the MG is a contribution or not. This will eventually help avoid wrong investment decisions.

3 Problem statement

Optimal energy management of a MG with distributed resources is the aim of this paper. The mathematical model and the hybrid heuristic method can both be used for evaluation and optimal management of any MG with distributed resources. Demand Side Management (DSM) approach will be the main approach. DSM is to manage electricity demand without affecting consumers’ activities adversely. It schedules the power consumption by considering shiftable and non-shiftable consumption of consumers. For instance, a CNC (Computer Numerical Control) machine can be operated at different hours in line with the production schedules. However, lighting equipment or power consumption of cafeteria is non-shiftable. Energy management in MG will be done by considering consumers’ welfare according to DSM principles.

The problem is optimal energy management of a MG which has its own renewable resources and generators, and has connection with main grid. The consumers in the MG are industrial consumers like factories. The hourly power consumptions of the consumers in MG primarily must be met by distributed resources of MG. When the total power output of distributed generators is not enough, the grid connection is stepped in, and power is bought from the main grid with a determined price. Similarly, when the total power output of the MG is over, power surplus is sold to the main grid. With this bidirectional power flow, the main grid connection becomes more useful. The aim is to schedule the loads of consumers in MG to minimize amount of power taken from main grid. As mentioned, the load scheduling will be done by DSM principles. Another important point is that the power outputs of distributed generators can be seen as exogenous. For instance, for the power output of a wind turbine, wind speed is the main variable which is exogenous. The only endogenous variables are radius of propeller, turbine height etc. which are adjusted during the construction of generator.

Every consumer in the MG has several power consumers like machines, lighting equipment etc. All the power consumers of consumers are called as devices. The load scheduling will be done on the basis of devices. Before the mathematical model, the assumptions of the problem can be ordered as follows:

  • Setup times of the devices are ignored.

  • Devices can work in an interrupted order. The need is to meet daily totally working hours.

  • The processes of the devices are independent.

The given assumptions mean that only non-shiftable devices must be considered during the scheduling in terms of DSM principles. Shiftable devices must provide only daily total working hours.

3.1 Mathematical model

In the mathematical model, i is the index of the devices and t is the time index (1, 2, …, 24). The decision variable of the model is \( y_{i,t} \) which shows whether the device i works at time t or not. It is a binary variable; it takes 1 and 0 values respectively. Other variables and parameters are explained in Table 1. The general model of the problem is given below:

$$ Min z = \varvec{C}_{\varvec{d}} .\varvec{X}_{\varvec{d}}^{\varvec{T}} + c_{g} .\mathop \sum \limits_{t = 1}^{24} x_{gt}^{ + } - p_{g} .\mathop \sum \limits_{t = 1}^{24} x_{gt}^{ - } $$
(1)
$$ \begin{aligned} & Subject\,to, \\ & \quad^\circ l_{i,t} = y_{i,t} . p_{i }\quad \forall i, t \\ \end{aligned} $$
(2)
$$ ^\circ\,\mathop \sum \limits_{t = 1}^{24} y_{i,t} = \tau_{i} \forall i $$
(3)
$$ ^\circ\,For \,non - shiftable\, devices, y_{i,t} = 1\,according \,to\, t $$
(4)
$$ ^\circ\,x_{dt} + x_{gt}^{ + } - x_{gt}^{ - } = \mathop \sum \limits_{i} l_{i,t} \forall t $$
(5)
$$ ^\circ\,y_{i,t} \in \left\{ {0, 1} \right\} $$
(6)
Table 1 Variables and parameters of the general model

Here, Eq. (1) is cost minimization objective. Its first term means total cost of power generation with distributed generators. Second term shows the cost of power which is bought from main grid. Third term is the revenue of power which is sold to main grid. Equation (2) gives the relation between aforementioned variables and parameters. Equation (3) explains the parameter \( \tau_{i} \) mathematically. Equation (4) stipulates the specific working times for non-shiftable devices. Equation (5) equalizes the hourly total power usage of devices with hourly power input of the MG considering the power output to main grid. Equation (6) is a mathematical model system constraint which defines the decision variable \( y_{i,t} \).

As we have seen in Table 1 and the model, the \( l_{i,t} \), \( x_{gt}^{ + } \) and \( x_{gt}^{ - } \) are variations of decision variable. The others are parameters. The proposed mathematical model is a daily model. It runs for every day separately.

3.2 Distributed generators

The distributed generators of the MG differ from region to region. For each model application, accessible renewable resources are evaluated according to properties of region of MG. Technical qualifications of the generators also differ according to conditions.

After these stages which are about construction, calculation of power output of the generators is done by generation functions. For most of the installed renewable generators, the power output is exogenous. The obtained natural power resources cannot be used by cutting down on. For instance, the power output of a PV panel is calculated by a generation formula in which the solar radiation is a multiplier. Here, we do not have a chance to use one part of the solar radiation. Hence, sometimes power output may be more than enough subject to power demand and natural resources data. In such circumstances, power surplus can be sold to main grid.

For several applications of this study, generation functions of the most used renewable generators will be given. One of the most used renewable sources is wind energy. As known, wind energy is generated by the wind turbines. The wind energy depends on wind speed, area of propeller and air density. Also, there must be an efficiency coefficient which is assumed as 0, 4. Additionally, another coefficient must be added to formula which is for power loss due to yowing of the mechanism. It is assumed as 0, 8. The wind power generation function is given in Eq. (7). In the equation, \( P_{wind}^{N} \) is nominal value of the generator; \( V {\text{is wind speed with unit of m}}/{\text{s}} \); \( v_{ci} , v_{co} \) and \( v_{r} \) are cut-in, cut-off and rated speed values of the turbine, respectively. These values are assumed as 2 m/s, 25 m/s, 10 m/s, respectively [28].

$$ P_{wind} = \left\{ {\begin{array}{*{20}l} {0,} \hfill & {V \le v_{ci} \, {\rm or}\, V \ge v_{co} } \hfill \\ {P_{wind}^{N} .\frac{{V^{3} - v_{ci}^{3} }}{{v_{r}^{3} - v_{ci}^{3} }}.0,4 . 0,8,} \hfill & {v_{ci} < V \le v_{r} } \hfill \\ {P_{wind}^{N} .0,4 . 0,8,} \hfill & {v_{r} < V \le v_{co} } \hfill \\ \end{array} } \right. $$
(7)

The other renewable source is solar energy. Output of PV systems depends on solar radiation mainly. Also, area of PV panel and efficiency coefficients are other factors. In the case study, two-axis tracking PV panel is preferred. The PV power generation function is given in Eq. (8). Here, I is solar radiation with unit of kWh/m2; A is area of PV panel with unit of m2; and other coefficients are several necessary efficiency coefficients for the handled case [29].

The first coefficient (0, 129) is calculated with respect to temperature. The second one (0, 9) is equanimity coefficient which is composed from inverter efficiency (0, 95) and voltage drop (0, 95). The third one (0, 8) is yearly average cloudiness rate for the Marmara Region. Using two-axis tracking PV panel removes the necessity of considering solar altitude angle as a coefficient. Because, incidence angle of solar radiation is always 90° due to moving structure of the panel [29].

$$ P_{solar} = I . A . 0,129 . 0,9 . 0,8 $$
(8)

Hydro power is also one of the most used renewable resources. For hydro power output, head and flow rate are most important factors. The hydro power generation function is given in Eq. (9). In this equation, h is flow height in meters; f is mass flow rate with unit of kg/s; g is gravity which is equal to 9.81 m/s2; and \( \mu \) is efficiency coefficient which is equal to 0.7 [30].

$$ P_{hydro} = h . f. g . \mu $$
(9)

The last renewable resource which will be mentioned here is geothermal energy. The geothermal power generation function is used as Eq. (10). Here, f is mass flow rate of the geofluid with unit of kg/s; \( h_{g} \) and \( h_{o} \) are enthalpy of the geofluid at geothermal resource temperature and ambient temperature with unit of J/kg; \( T_{o} \) is ambient temperature with unit of K; \( s_{g} \) and \( s_{o} \) are the entropy of the geofluid at geothermal resource temperature and ambient temperature with unit of J/kg.K; and \( \mu \) is efficiency coefficient of the geothermal plant [31].

$$ P_{geo} = f.\left( {h_{g} - h_{o} - T_{o} \left( {s_{g} - s_{o} } \right)} \right). \mu $$
(10)

4 Proposed solution: hybrid genetic algorithm—simulated annealing

This study uses a method that combines Genetic Algorithm (GA) and Simulated Annealing (SA) heuristic methods for the solution of optimal energy management problem. As mentioned, the proposed mathematical model and method can be used for optimal energy management of any grid-connected MG with distributed generation. In the methodology, GA is the main solver algorithm for the problem. However, GA has many parameters which dramatically affect the solution. SA is used for parameter optimization of GA. Hence, the optimality of final solution becomes more relied. Additionally, GA is a population based metaheuristic and SA is a single solution based search metaheuristic algorithm. When using metaheuristic methods, diversification and intensification should be balanced. So, using a population based algorithm and a search algorithm together is more convenient for a quality optimization process.

In the GA stage, the fitness function has been determined as a part of objective function. The objective function in Eq. (1) is equal to total power cost of the MG in a day. However, cost coefficients and power outputs of distributed generators in it are exogenous. So, only part which depends on decision variables is \( \sum\nolimits_{t = 1}^{24} {x_{gt} } \) part. This part will be fitness function of the GA to minimize.

As mentioned, the decision variable of the proposed model is \( y_{i,t} \) which is a binary variable and shows whether the device \( i \) works at time \( t \) or not. The chromosomes of the GA composes of \( y_{i,t} \)’s. According to maximum value of the \( i \) index, number of genes in a chromosome is determined. As an example, for \( i = 1, 2, \ldots , 5 \), the number of genes will be \( 5 . 24 = 120 \) and the structure of a chromosome will be like that:

$$ \underline{{y_{1,1} }} \underline{{y_{2,1} }} \underline{{y_{3,1} }} \underline{{y_{4,1} }} \underline{{y_{5,1} }} \underline{{y_{1,2} }} \ldots \ldots \ldots \underline{{y_{5,24} }} $$

At the selection step, the Roulette Circle method is used. Then, the multipoint crossover is applied at the crossover stage. The number of crossover points can be determined according to dimension of chromosomes. Crossover and mutation probabilities of the algorithm will be determined by SA optimization. Finally, stopping criterion of the GA is determined as number of iterations which must be equal to number of genes, like in a study which compares two meta-heuristics for distributed generation planning [17].

For parameter optimization of the GA, the SA method will be used. The parameters are probability of crossover and probability of mutation to optimize. These parameters take continuous values between 0 and 1. Hence, the selected method SA is suitable for optimization of these continuous variables. Accordingly, the solution of the SA will be a two-dimensional vector which contains crossover probability and mutation probability, respectively.

SA has also parameters which are delta (neighborhood ratio), temperature, end temperature and cooling rate. These parameters will take different values in different runs of the algorithm by a process of trial and error. The stopping criterion of the SA is the end temperature parameter.

The proposed hybrid GA-SA method will be programmed in MATLAB R2013a. The proposed mathematical model has constraints which cannot be ignored. These constraints also must be integrated to the GA. Constraints in the Eq. (2) can be seen as definition of \( l_{i,t} \). So, these are used as definitions in objective function etc. Constraints in the Eq. (4) and (6) are used during the stage of population creating. Finally, constraints in the Eq. (3) and (5) are added to fitness function with λ multipliers with the idea of Lagrange multipliers method.

5 Case study

In the application stage of the proposed model, a MG in Gebze—a town of Kocaeli, Turkey—will be dealt. The MG contains three factories as consumers, grid connection and wind and solar resources. All of the factories work 7/24; and all have several devices which are machines and other power consumers like digital camera systems etc. The devices in the factories and daily total working hour needs and hourly power expenses of the devices are given in Table 2. In the table, the abbreviation “NS” signifies the non-shiftable devices. Three factories in the MG have 20 devices totally.

Table 2 Data about the devices of the factories

5.1 Parameters

After the data about power demand, the parameters of the power generation must be determined. There will be two distributed generators in the MG which are wind turbine and PV panel in terms of natural conditions of the region. Power generation functions of these resources have been given in Eqs. (7) and (8), respectively. For the wind turbine, only endogenous parameter is radius of the propeller. It is determined as 3 meters for our study. For PV panel, only area of panel must be determined. It is taken as 20 m2 for our study. Also, hourly wind speed and solar radiation data of Gebze for year of 2017 have been provided from researchers who work about renewable energy technologies. So, the \( \varvec{X}_{\varvec{d}} \) vector in the model which contains daily total generation amounts of the distributed generators and \( x_{dt} \) values which are hourly total power output of the all distributed generators can be calculated by the generation functions.

The other essential parameters for the model are cost and price values. Cost of the power which bought from the main grid (cg) and price of the power which sold to the main grid (pg) is assumed same and equal to 0.260173 TL/kWh for Turkey for every quarter of year 2017 [32]. Cost of generation of renewable energy is much smaller than conventional energy. The values can differ according to region or technology. However, in our study, the cost values are determined as 0.04 TL/kWh and 0.06 TL/kWh for wind and solar, respectively [33]. Other parameters of the model \( \uptau_{\text{i}} \) and pi have already given in Table 2.

In the light of the given information, mathematical model of the case study can be established. According to mathematical model, the gene number of a chromosome of the GA will be 20. 24 = 480. Thus, the number of iterations in the GA also will be 480 as stopping criterion. Considering to dimension of chromosomes, the number of crossover points is determined as 5. So, the population size of the algorithm must be divisible to 6 because of the using crossover technique which given in Fig. 1. It is determined as 60.

Fig. 1
figure 1

The 5-point crossover technique

The crossover and mutation probabilities of the GA will be optimized by SA. SA contains also several parameters. The delta is determined as 0.05; and the end temperature is taken as 0. The temperature and cooling rate parameters will be used as different values, and then the results of all of them will be given. To sum up, all parameters of the proposed hybrid algorithm are given in Table 3.

Table 3 Parameters of hybrid GA-SA method

5.2 Results

The proposed hybrid GA-SA method has been programmed on MATLAB R2013a for the case study. The hybrid algorithm has been run for 4 cases which are days from different seasons of 2017; i.e. January 1st, April 1st, July 1st and October 1st. The detailed results of the runs are given in Tables 4, 5, 6 and 7. Every line of the tables has been tried repeatedly; especially GA algorithm has been run many times with same parameters to ensure the constraints of the model. Then, best solutions have been saved to lines. The best solution of each case is also marked as bold.

Table 4 Results for January 1st 2017
Table 5 Results for April 1st 2017
Table 6 Results for July 1st 2017
Table 7 Results for October 1st 2017

At the case of January 1st, the obtained minimum fitness value from the experiments is selected the best result of the case. It must not be forgotten that the solution value of GA is the daily total power taken from main grid with unit of kWh. If it is a negative value, it means that the power amount sold to main grid is bigger than the power amount bought from main grid. Regarding the results, the renewable resources are exceedingly sufficient for the load demand. When the real objective value of the model is calculated by using renewable costs and main grid prices, the value of 7460.75 TL is obtained. As an example, the calculation is given in Eq. (11).

$$ \left[ {0.04\quad 0.06} \right].\left[ {308843\quad 10864} \right]^{T} + 0.260173 . \left( { - 21312} \right) = 7460.75 TL $$
(11)

At the case of April 1st, the obtained minimum fitness value from the experiments is selected the best result of the case. Of course, success of every case must be evaluated in itself; since the wind speed and solar radiation data are peculiar to date. When the real objective value of the model is calculated, the value of 5213.05 TL is obtained.

At the case of July 1st, the obtained minimum fitness value is the best result. When the real objective value of the model is calculated, the value of 4038.60 TL is obtained.

At the case of October 1st, the obtained minimum fitness value is the best result, too. When the real objective value of the model is calculated, the value of 3407.21 TL is obtained.

The final cost values of the cases are quite high, because of the abundance of wind and solar resources. The power outputs of these generators cannot cut down on. Power surplus is sold to main grid, but it cannot be used in the case of power inadequacy; so, the total costs increase. However, using storage technologies is an alternative which absolutely should be applied on such an occasion.

The proposed hybrid Genetic Algorithm–Simulated Annealing achieves near optimum result in a very short time. Regarding the elapsed times of similar studies, it can be said that the proposed method reduces the cost of calculation by reducing the time [34].

6 Conclusion and recommendations

Optimal energy management of a MG with distributed resources has been targeted in this study. Energy management has been done by hourly power scheduling considering both consumption rules and generation output. It is shown in Sect. 5.2 whether the handled MG can be standalone or not using the proposed hybrid algorithm.

The handled problem contains both power generation and consumption constraints; so it has a complex structure. To deal with this complex problem, a versatile mathematical model must be established. Also, the mathematical model needs to be integrated with a hybrid heuristic algorithm; only such an improved heuristic approach can be sufficient to solve this kind of model. The objective of the established mathematical model is the minimization of the need to grid connection on hourly basis. Then, a hybrid Genetic Algorithm–Simulated Annealing method has been proposed to solve the model. Main workload of the model has been in GA part; and the parameters of the GA which are quite important factors have been optimized with SA. The structure of the proposed algorithm is suitable for scrutinizing the deficient points of the cases. It can be controlled that stepping in time of power resources; and the user can interfere to that with minor changes on the model.

The problem has been applied with data of Gebze city. Four different dates have been covered as case studies. According to the results, suggestions have been put forward. The suggestions can be seen as motivations for further studies; i.e. a similar study with energy storage technology can be run. Furthermore, it has appeared that establishing a standalone MG is not easy in spite of the power surplus in most of the day. Only storage technologies may make it possible with an improved mathematical approach. On the other hand, it is recommended to compare the results of this hybrid meta-heuristic application with other meta-heuristic applications in the field.