1 Introduction

A microgrid is a collection of electrical loads, communication facilities, control units and generating units that are spread within a small geographical location. The distributed energy resources (DERs) included in the microgrid may be micro turbines, fuel cells, reciprocating engines, or any of a number of alternate power sources (Hatziargyriou et al. 2007). Countries such as the USA, Germany, Greece, Japan have seen the distribution of microgrids and have benefited from them (Barnes 2007). The effective management of a microgrid system in order to supply the required power without facing shortcomings and with a minimized economy is the problem gaining attention (Koutsopoulos and Tassiulas 2012; Khodayar et al. 2012). The Energy Management system makes decisions regarding the best use of the DERs for producing electric power and heat, based upon the heat requirements of the local equipment, the weather conditions, the price of electric power, the cost of fuel and many other considerations.

Extensive literature survey on microgrid energy management has provided insight about the different methodologies employed so far to solve these problems. The demand for electrical power is intensifying at a very fast rate, which, in turn has caused a rapid growth of the real-time market price of electricity. To accommodate these high rising demands, electrical power sectors are growing up significantly. In India most of the electrical energy is derived from fossil fuel based power plants. In this framework, smart grids and microgrids are the key in the near future where a decentralization of energy generation is expected. An advantage of these type of grids is that the balance between energy generation, storage, and consumption can be realized most efficiently. This reduces the need for centralized communication, enables autonomous operations of increasingly smaller sections of the distribution grid and decreases the losses by distant distribution. From the point of view of a microgrid energy management system, economic scheduling of generation devices, storage systems and loads is a crucial problem. Performance of an optimization process is necessary to minimize the operating costs while several operational constraints are taken into account.

The cost of fuel is a major part of the running expenses of various small power stations and this will be enhanced if the efficiency of the plants is to be improved. Hence, the minimization of operating costs has attracted a great deal of attention from the power engineers. Mostly conventional classical based dual decomposition optimization techniques were employed to solve the basic energy management based microgrid problems. However, these approximations resulted in solution of reduced accuracy and hence, huge revenue loss over time. Moreover, in most of the above mentioned algorithms, the numbers of control parameters (which control the performance of the algorithm) are large. Therefore, a time consuming control parameter tuning procedure is required before applying these algorithms to a specific optimization problem

Various loads and the DERs are controlled and maintained by the microgrid energy manager (MGEM). All the DERs and loads have dedicated local controllers that coordinate with the MGEM for the timely operation of resources in a distributed fashion. This disciplined and distributed fashioned functioning of microgrids face the challenge when the uncertainty and stochastic nature of RES come into view. Economic dispatch and unit commitment of a microgrid is done in Stluka et al. (2011) without considering the stochastic nature of RES. Considering the Wei bull distribution for wind speed an ED problem deals with minimization of risk of over-estimation and under-estimation of wind in Hetzer et al. (2008). For a single period, probabilistic study of supply of power is studied with an ED problem involving RES in Liu and Xu (2010). Authors in Guan et al. (2010) considered the stochastic availability nature of demand and PV generation while minimizing the microgrid net cost. Robust scheduling problems with fine incorporated for the uncertainty of supply and demand without considering DSM have been studied in Bertsimas et al. (2013). Some heuristic algorithms are implemented by the authors in Jiang and Low (2011) and Zhao and Zeng (2012) to perform demand side management in RES integrated microgrids. Model predictive control is used for planning problem of a microgrid with DS in Jin and Ghosh (2011). The unreliable and time varying nature of RES is neglected and then distributed algorithm is used to supply a given load including DER in Dom (2011). Considering a microgrid with a single wind farm and no DS, a worst-case transaction based energy management is done in Zhang and Gatsis (2012). Energy management of co-operative microgrids was performed in Lahon and Gupta (2017) to minimize the net operating cost which includes the cost of distributed generation and worst case transaction cost. In Govardhan and Roy (2012) a microgrid with wind turbine, PV array, diesel engine, fuel cell and micro-turbine are studied. The proposed cost functions considered are the cost of the emissions NOx, SO2 and CO2, operating and maintenance cost as well as start-up costs of different sources. The total operating cost of the microgrid is minimized with the help of Ant Bee Colony optimization technique. The isolation niche immune genetic algorithm (INIGA) is used in Liao (2013) to confirm the accuracy and validity of the mathematic model through some actual examples. This method is then compared with some other optimization approaches that are usually applied to solve the energy management and optimization operation problem to show the superiority and usability of the approach mentioned in it. Authors in Shi et al. (2015) designed a distributed energy management strategy (DEMS) based on IEC 61850 bounded by system operational constraints. This DEMS was then implemented on a real microgrid system of China consisting of a photo-voltaic system, wind turbines (WT), diesel generators and battery storage device. Three different optimization techniques viz. genetic algorithm (GA), particle swarm optimization (PSO) and honey bee mating optimization (HBMO) were used by authors in Ahmadnia and Tafehi (2017) to improve the voltage stability margin for seven different scenarios of a microgrid system which consisted of DERs like PV, WT, STATCOM and capacitors. A multi-objective optimization method was presented in Chen et al. (2018) to jointly optimize the planning and operation of a grid-connected microgrid system that included PV, WT and DS. The author used fuzzy satisfaction maximization method for five different scenarios of the microgrid system. A memory based GA (MGA) technique was used in Askarzadeh (2017) to optimize the sharing of power generation among the DERs of a microgrid system to minimize its operating cost. This proposed technique was then compared with GA and two variants of PSO to prove its superiority.

Evolvement of soft computing tools, which are not restricted by the complexity of system models, inspired the research workers to apply them in the field of power system optimization. The versatile properties and attractive performance of genetic algorithm (GA), particle swarm optimization (PSO) and differential evolution (DE) over a wide range of benchmark functions have inspired the many researchers to implement these algorithms for solving energy management issues of microgrids involving optimal costs and load scheduling. Nevertheless, GA, PSO and DE have their own list of disadvantages too. The very basic disadvantage of GA is its unguided mutation. The mutation operator in GA functions like adding a randomly generated number to a parameter of an individual of the population. This is the only reason for the very slow convergence of genetic algorithm. DE suffers from unstable convergence and easily drops down to regional optimum. Likewise, PSO also drops down to regional optimum and has untimely convergence. In addition, multiplicity of population is not enough in PSO. Also, some time is consumed in tuning the control parameters present in all of the aforementioned optimization techniques.

However, there is also a recently developed, simple yet powerful meta-heuristic algorithm called symbiotic organisms search (SOS). In this algorithm the symbiotic interaction tactics that organisms generally use to survive in an ecosystem are simulated. SOS showed better results in various fields of power engineering where optimization is of prime concern. In Das and Bhattacharya (2016), SOS has been implemented in short term hydro thermal scheduling problems and better results were obtained. SOS algorithm has been implemented in Datta et al. (2016) to determine the optimal coordination of directional over current relays. It is worth mentioning that SOS outperformed the various optimization techniques considered for comparative study in this case too. SOS also gave better results than some prior optimization techniques when implemented for real power loss minimization in Balachennaiah and Suryakalavathi (2015).

To avoid the suboptimal solution and to accelerate the convergence speed, the theory of quasi-oppositional based learning (Q-OBL) is integrated with original SOS and used to solve the microgrid energy management based problem. The success of QOSOS algorithm is established by comparing the dynamic performances of concerned microgrid system with those obtained by SOS and some recently published algorithms available in the literature. Furthermore, the robustness and sensitivity are analysed for the concerned microgrid system to judge the efficacy of the proposed QOSOS approach.

2 Mathematical formulation of Microgrid Energy Management System

Let us consider a grid-connected microgrid system comprised of conventional (fossil fuel) generators, RES facilities (wind-farms) supported by DS units supplying power to both elastic and inelastic loads (Fig. 1). The modelling of various DERs for the optimal scheduling of the microgrid system is done in the next sub-sections.

Fig. 1
figure 1

Architecture of a typical microgrid

2.1 Load Demand Model

There are generally two types of loads: inelastic loads and elastic loads. Inelastic loads are the ones which are fixed and their demand should be satisfied at all times. For e.g. hospitals, schools and colleges, government and administrative offices, etc. Elastic loads are those type of loads whose demand may be compromised in case of power shortage and can be scheduled as per time horizon. There are two types of elastic loads:

  1. 1.

    Say, the N number of class-1 dispatchable loads have power consumption \(P_{{D_{n} }}^{t} \in [P_{{D_{n} }}^{\hbox{min} } ,P_{{D_{n} }}^{\hbox{max} } ]\), where \(n \in {\rm N}: = \{ 1, \ldots ,N\}\), and \(t \in \tau\). For this class of elastic loads, the consumption of power varies directly with the utility of the end user. The increasingly concave utility function of the nth dispatchable load, \(U_{{D_{n} }}^{t} (P_{{D_{n} }}^{t} )\)(Chen et al. 2010). The utility of the class-1 type of loads is calculated using the equation

    $$U_{n} (P_{{D_{n} }} ) = c_{n} P_{{D_{n} }}^{2} + d_{n} P_{{D_{n} }}$$
    (1)
  2. 2.

    The Q number of class-2 type of elastic loads denoted by \(q \in Q: = \{ 1,2, \ldots\,Q\}\) with power consuming capability ranging from \(P_{{E_{q} }}^{\hbox{min} }\) to \(P_{{E_{q} }}^{\hbox{max} }\), and permissible energy desired \(E_{q}\) is attained from the start time \(S_{q}\) to termination time \(T_{q}\) (Mohsenian-Rad et al. 2010). Plug-in hybrid electric vehicles (PHEVs) can be considered as a better illustration of this type of load. The time-varying function on which the qth load will operate is a concave function \(U_{{E_{q} }}^{t} (P_{{E_{q} }}^{t} )\) and is calculated with the relation:

    $$U_{{E_{q} }}^{t} (P_{{E_{q} }}^{t} ): = \pi_{q}^{t} P_{{E_{q} }}^{t}$$
    (2)

    with weights \(\{ \pi_{q}^{t} \}\) decreasing in t from slots \(S_{q}\) to \(T_{q}\).

2.2 Distributed Storage Model

For stable operation to balance any instantaneous mismatch in active power, efficient DS must be used. Distributed storage enhances the overall performance of microgrid systems in many ways. Firstly, it stabilizes and permits DG units to run at a constant and stable output, despite load fluctuations. Secondly, it provides the ride-through capability when there are dynamic variations of primary energy (such as those of sun, wind, and hydropower sources). It also permits DG to seamlessly operate as a dispatchable unit. Moreover, energy storage can benefit power systems by damping peak surges in electricity demand. In addition to all of these a DS counters momentary power disturbances and provides outage ride-through while backup generators respond. The property of a DS to reserve energy for future demand is of utmost importance.

Let \(B_{j}^{t}\) be the energy stored at the jth battery when the time slot t ends. Suppose the energy which was initially available is \(B_{j}^{0}\) while \(B_{j}^{\hbox{max} }\) indicates maximum energy of the battery, such that \(0 < B_{j}^{t} < B_{j}^{\hbox{max} } ,j \in J: = \{ 1,2 \ldots J\}\). Let \(P_{{B_{j} }}^{t}\) be considered as the exchanged power to or from the jth storage device during time slot \(t\) which causes charging \((P_{{B_{j} }}^{t} \le 0)\) or discharging \((P_{{B_{j} }}^{t} \ge 0)\) of the battery. Energy stored in the battery can be defined as:

$$B_{j}^{t} = B_{j}^{t - 1} + P_{{B_{j} }}^{t}$$
(3)

Constraints of \(P_{{B_{j} }}^{t}\) are:

  1. 1.

    The discharging and charging of the battery obeys the equation:

    $$\begin{aligned} \begin{array}{l} P_{{B_{j} }}^{\hbox{min} } \le P_{{B_{j} }}^{t} \le P_{{B_{j} }}^{\hbox{max} } \hfill \\ - \eta_{j} B_{j}^{t - 1} \le P_{{B_{j} }}^{t} \hfill \\ \end{array} \end{aligned}$$
    (4)

    where \(P_{{B_{j} }}^{\hbox{min} }\) < 0, \(P_{{B_{j} }}^{\hbox{max} }\) > 0, and \(\eta_{j} \in (0,1]\) is the efficiency of the battery j.

  2. 2.

    Final stored energy at any instant of time is also limited so that DS can be used for future scheduling horizons. This limit is represented as \(B_{j}^{T} \ge B_{j}^{\hbox{min} }\).

    The lifetime of the DS can be maximized by employing a storage cost \(H_{j}^{t} (B_{j}^{t} )\) so that the stored energy maintains a specific level of charge (Vytelingum et al. 2011; Alimisis and Hatziargyriou 2013). To validate greater value of power exchange one can even select \(H_{j}^{t} (B_{j}^{t} ) \equiv 0\) altogether.

2.3 Generation Cost of Conventional Generators

Let \(P_{{G_{m} }}\) be the power output of the mth conventional fossil fuelled generator. Then the generator cost function which is quadratic in nature is represented by the equation:

$$C_{m} P_{{G_{m} }} = a_{m} P_{{G_{m} }}^{2} + b_{m} P_{{G_{m} }}$$
(5)

where am and bm are the generator cost coefficients.

Hence the generation cost of the microgrid system is the sum of the generation costs of the conventional fossil-fuelled generators and the storage devices minus the utility of dispatchable loads and can be mathematically formulated as:

$$F_{1} = \sum\limits_{t = 1}^{T} {\left( {\sum\limits_{m = 1}^{M} {C_{m}^{t} (P_{{G_{m} }}^{t} ) - \sum\limits_{n = 1}^{N} {U_{{D_{n} }}^{t} - \sum\limits_{q = 1}^{Q} {U_{{E_{q} }}^{t} (P_{{E_{q} }}^{t} ) + \sum\limits_{j = 1}^{J} {H_{j}^{t} (B_{j}^{t} )} } } } } \right)}$$
(6)

2.4 Worst-case Transaction Cost

Let \(W_{i}^{t}\) be the wind power generated by the ith RES facility (hereafter wind farm) for the time period t. Further, let w comprise \(W_{i}^{t}\), i.e. \(w: = \{ W_{1}^{1} , \,\ldots W_{1}^{T} , \,\ldots W_{I}^{1} ,\, \ldots W_{I}^{T} \}\). The combined power output from the wind farms when postulated for a period t within the time scheduling horizon can be expressed as:

$$\begin{aligned}\begin{array}{l} \underline{{W_{i}^{t} }} \le W_{i}^{t} \le \bar{W}_{i}^{t} \hfill \\ s.t.\;W_{s}^{\hbox{min} } \le \sum\limits_{i = 1}^{I} {W_{i}^{t} \le W_{s}^{\hbox{max} } } \hfill \\\end{array} \end{aligned}$$
(7)

where \(\underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{W}_{i}^{t}\) & \(\bar{W}_{i}^{t}\) stands for the higher and lower limits of \(W_{i}^{t}\) respectively. The total wind energy harvested over the region is bounded by \(W_{s}^{\hbox{min} }\) and \(W_{s}^{\hbox{max} }\) (Zhao and Zeng 2012) and the deterministic lower and upper bounds can be determined via inference schemes based on historical data (Pinson and Kariniotakis 2010).

Since the paper considers a microgrid operating in a grid connected mode, there exists a buying/selling mechanism between the main grid and microgrid. Let \(P_{R}^{t}\) denote the net power delivered to the microgrid at time t from the renewable energy sources and the storage devices when the transaction mechanism is going on. The mathematical expression (\(P_{R}^{t} - \sum\nolimits_{i = 1}^{I} {W_{i}^{t} } + \sum\nolimits_{j = 1}^{J} {P_{{B_{j} }}^{t} }\)) calculates the shortage or surplus of energy. \(\alpha^{t}\) is the cost price of purchasing power in case of deficit and \(\beta^{t}\) is the selling price of the power when the microgrid yields an excess of it.

Worst-case-transaction cost can be mathematically expressed as:

$$F_{2} = \sum\limits_{t = 1}^{T} {\left( {\alpha^{t} \left[P_{R}^{t} - \sum\limits_{i = 1}^{I} {W_{i}^{t} } + \sum\limits_{j = 1}^{J} {P_{{B_{j} }}^{t} } \right]^{ + } - \beta^{t} \left[P_{R}^{t} - \sum\limits_{i = 1}^{I} {W_{i}^{t} } + \sum\limits_{j = 1}^{J} {P_{{B_{j} }}^{t} } \right]^{ - } } \right)}$$
(8)

where {\(P_{R}^{t}\)} collects \(P_{R}^{t}\) for t = 1,2…T and \(\{ {P_{{B_{j} }}^{t} } \}\) collects \(\{ {P_{{B_{j} }}^{t} } \}\) for j = 1,2,…J, t = 1,2,…T.

2.5 Microgrid Energy Management Objective Function

Considering the cost of various DERs and the worst case transaction cost levied by the high penetration and dependability on the RES, the overall microgrid net social cost, which is to be minimized, can be mathematically represented as:

$$\begin{aligned} F = \mathop {\hbox{min} }\limits_{x} F_{1} + \mathop {\hbox{min} }\limits_{x} F_{2} \hfill \\ {\text{also}}\;F = \mathop {\hbox{min} }\limits_{x} \left( {F_{1} + F_{2} } \right) \hfill \\ \end{aligned}$$
(9a)
$$F = \mathop {\hbox{min} }\limits_{x} \left[ {\sum\limits_{t = 1}^{T} {\left( {\sum\limits_{m = 1}^{M} {C_{m}^{t} (P_{{G_{m} }}^{t} ) - \sum\limits_{n = 1}^{N} {U_{{D_{n} }}^{t} - \sum\limits_{q = 1}^{Q} {U_{{E_{q} }}^{t} (P_{{E_{q} }}^{t} ) + \sum\limits_{j = 1}^{J} {H_{j}^{t} (B_{j}^{t} )} } } } } \right)}+ \sum\limits_{t = 1}^{T} {\left( {\alpha^{t} [P_{R}^{t} - \sum\limits_{i = 1}^{I} {W_{i}^{t} } + \sum\limits_{j = 1}^{J} {P_{{B_{j} }}^{t} } ]^{ + } - \beta^{t} [P_{R}^{t} - \sum\limits_{i = 1}^{I} {W_{i}^{t} } + \sum\limits_{j = 1}^{J} {P_{{B_{j} }}^{t} } ]^{ - } } \right)} } \right]$$
(9b)

where x collects all the primal variables \(\{ P_{{G_{m} }}^{t} ,P_{{D_{n} }}^{t} ,P_{{E_{q} }}^{t} ,P_{{B_{j} }}^{t} ,B_{j}^{t} ,P_{R}^{t} ,W_{i}^{t} \}\). Both the generation cost of the microgrid system \(\left( {F_{1} } \right)\) and the worst case transaction cost \(\left( {F_{2} } \right)\) are minimized separately and the overall microgrid net social cost is optimized as a whole using a bio-inspired meta-heuristic optimization technique and its improved variant. The results are then compared in a later section of this paper.

The above objective functions are subject to the constraints which are listed below:

2.5.1 Generation Limits

The conventional generator outputs should lie between its maximum and minimum limits.

$$P_{{G_{m} }}^{\hbox{min} } \le P_{{G_{m} }}^{t} \le P_{{G_{m} }}^{\hbox{max} }$$
(10a)

2.5.2 Ramp Up/Down Limits

The inequality constraints due to ramp rate limits for unit generation changes are given as:

For increase in generation

$$P_{{G_{m} }}^{t} - P_{{G_{m} }}^{t - 1} \le R_{{m,{\text{up}}}}$$
(10b)

For decrease in generation

$$P_{{G_{m} }}^{t - 1} - P_{{G_{m} }}^{t} \le R_{{m,{\text{down}}}}$$
(10c)

where Rm,up and Rm,down are the up ramp limit and the down ramp limit of the conventional generators respectively.

2.5.3 Spinning Reserve Constraint

The spinning reserve inequality for the conventional generator outputs at any time slot t denoted by SRt is given as:

$$\sum\limits_{m = 1}^{M} {\left( {P_{{G_{m} }}^{\hbox{max} } - P_{{G_{m} }}^{t} } \right)} \ge SR^{t}$$
(10d)

2.5.4 Class-1 Loads Constraint

The power consumption of Class-1 type of elastic loads should lie between their minimum and maximum limits.

$$P_{{D_{n} }}^{\hbox{min} } \le P_{{D_{n} }}^{t} \le P_{{D_{n} }}^{\hbox{max} }$$
(10e)

2.5.5 Class-2 Loads Constraints

The power consumption of Class 2 type of loads should be within their upper and lower limits as assigned. Also, the total energy requirements which are targeted by the running duration of these loads must be equal to Eq. Mathematically,

$$\begin{aligned}\begin{array}{l} P_{{E_{q} }}^{\hbox{min} ,t} \le P_{{E_{q} }}^{t} \le P_{{E_{q} }}^{\hbox{max} ,t} \hfill \\ \sum\limits_{{t = S_{q} }}^{{T_{q} }} {P_{{E_{q} }}^{t} = E_{q} } \hfill \\ P_{{E_{q} }}^{\hbox{min} ,t} = P_{{E_{q} }}^{\hbox{max} ,t} = 0\quad {\text{for}}\;t \notin \left\{ {S_{q} , \ldots T_{q} } \right\} \hfill \\ \end{array}\end{aligned}$$
(10f)

2.5.6 Distributed Storage Constraints

Equation 7(h) and 7(i) bounds the stored energy and the amount of charging (discharging) between their maximum possible limits as

$$0 \le B_{j}^{t} \le B_{j}^{\hbox{max} } ,B_{j}^{T} \ge B_{j}^{\hbox{min} }$$
(10g)
$$P_{{B_{j} }}^{\hbox{min} } \le P_{{B_{j} }}^{t} \le P_{{B_{j} }}^{\hbox{max} }$$
(10h)

A fraction \(\eta_{j}\) of the energy which is stored to be discharged is represented as

$$- \eta_{j} B_{j}^{t - 1} \le P_{{B_{j} }}^{t}$$
(10i)
$$B_{j}^{t} = B_{j}^{t - 1} + P_{{B_{j} }}^{t}$$
(10j)

2.5.7 Constraints for the Auxiliary Variable

The auxiliary variable should lie between the minimum and maximum limits as follows:

$$P_{R}^{\hbox{min} } \le P_{R}^{t} \le P_{R}^{\hbox{max} }$$
(10k)

2.5.8 Power Supply–demand Balance Equation

The sum of the generated powers of all units must be equal to sum of the power demanded by the load.

$$\sum\limits_{m = 1}^{M} {P_{{G_{m} }}^{t} + } P_{R}^{t} = L^{t} + \sum\limits_{n = 1}^{N} {P_{{D_{n} }}^{t} } + \sum\limits_{q = 1}^{Q} {P_{{E_{q} }}^{t} }$$
(10l)

In this present work the above formulated objective functions aims to minimize the overall microgrid net social cost. Different optimization techniques that are used to solve the objective functions are illustrated below in detail.

3 The Symbiotic Organisms Search Algorithm

Symbiotic organisms search is a relatively new powerful and meta-heuristic algorithm applied to optimize many mathematical and engineering problems (Cheng and Prayogo 2014). It works by simulating the symbiotic strategies acquired by the organisms among themselves to survive and be sustained in the ecosystem. The fact that SOS does not require any algorithm specific parameters makes it superior to many other meta-heuristic algorithms. The symbiotic relationships that are found in nature of three types viz. mutualism, commensalism and parasitism. These relationships are further formulated below and the SOS algorithm is developed as below:

3.1 Mutualism Phase

In the mutualism phase of SOS, both the species involved benefit. One common example is the relationship between honey bees and flowers (Fig. 2). The bees collect nectar from flowers and turn it into honey and hence benefit from the flowers. In this process the bees also carry the pollen grains from one flower to another and thus assist in pollination. This phase can be mathematically developed by the following equations:

Fig. 2
figure 2

Honey bee and flower

$$X_{inew} = X_{i} + rand(0,1)*(X_{best}^{{}} - Mutual\_Vector*BF_{1} )$$
(11)
$$X_{jnew} = X_{j} + rand(0,1)*(X_{best}^{{}} - Mutual\_Vector*BF_{2} )$$
(12)
$$Mutual\_Vector = \frac{{X_{i} + X_{j} }}{2}$$
(13)

where Xi is an organism of the ith member of the ecosystem and Xj is randomly selected from the ecosystem to interact with Xi. rand(0,1) denotes a vector of random numbers. BF1 and BF2 denote the benefit factors and are kept either 1 or 2. Mutual_Vector represents the mutual relation between the organisms Xi and Xj.

3.2 Commensalism Phase

Commensalism is a relationship existing in nature between individuals of two species where one species gathers its food or one benefits from the other without harming or benefitting the latter. The remora fish, for instance, is always attached to the shark and eats the leftover food of a shark without harming or benefitting it. In this way there exists a commensalism relation between the shark and remora fish (Fig. 3). Similar to the mutualism phase, Xj is selected randomly to interact with Xi and a new organism Xinew can be calculated as:

$$X_{inew} = X_{i} + rand( - 1,1)*(X_{best} - X_{j} )$$
(14)

where (Xbest− Xj) portrays the beneficial advantage provided by \(X_{j}\) to help \(X_{i}\) increase its survival advantage in ecosystem to the highest degree Xbest in current organism.

Fig. 3
figure 3

Remora fish and shark

3.3 Parasitism Phase

Parasitism is the name given to the relationship between two organisms in the ecosystem where one is harmed and the other benefits. The organism that benefits is called ‘parasite’ and the one that faces harm is called the ‘host’. Example can be taken of the deer tick (Fig. 4) which attaches to the host to suck its blood and thus benefits. But it also carries some Lyme disease, causing joint damage and kidney problems and also the animal suffers from lack of blood.

Fig. 4
figure 4

Deer tick feeding on the blood of a host

In SOS, Xj is selected randomly to act as the host. Parasite_Vector is an artificial organism created in the search space. If fitness value of Parasite_Vector is better than Xj, it will replace organism Xj. And if the fitness value of Xj is better, it will have immunity and the Parasite_Vector will no longer survive in that ecosystem.

4 Quasi-Oppositional Based Learning

The idea of oppositional based learning (OBL) theory was originally introduced by Tizhoosh (2005). Later, it gained huge acceptability from the researchers in the field of computation intelligence. The basic aim of using OBL in the evolutionary computation is to enhance the solution accuracy and accelerate the convergence rate towards the global solution. It has a high probability to look after the optimization scheme to produce a suboptimal solution. In this process, current population and opposite number are simultaneously generated to produce better candidate solution. The theory of OBL is derived by defining three of its important mathematical attributes:

  1. (a)

    Opposite number: It is the mirror location of the candidate solution from the centre of search space. If X is a randomized initial candidate solution which lies in the interval [a,b], then the opposite number Ox in a d-dimensional space can be mathematically formulated as

    $$O_{{X_{j} }} = a_{j} + b_{j} - X_{j}$$
    (15)

    where \(j = 1,2,3, \ldots d\) and \(X_{j} = X_{1} ,X_{2} ,X_{3} , \ldots\,X_{d}\).

  2. (b)

    Quasi opposite number: the quasi-opposite number finds its position between the centre of search space and the opposite number and is often closer to the global optimum solution than the opposite number. Let ‘C’ be the centre of the search space. Mathematically \(C = \frac{{a_{j} + b_{j} }}{2}\). Then the quasi-opposite number can be obtained by the following pseudo code:

    $$\begin{aligned} \begin{array}{l} {\textit{if}}(O_{x} < C) \hfill \\ QO_{x} = C + (O_{x} - C)*rand; \hfill \\ else \hfill \\ QO_{x} = O_{x} + (C - O_{x} )*rand; \hfill \\ end \hfill \\ \end{array} \end{aligned}$$
    (16)

    where \(QO_{x}\) is the quasi-opposite number and \(rand \in (0,1)\).

  3. (c)

    Jumping rate: This parameter is specifically needed to help the algorithm avoid any sub-optimal solution. The jumping rate also accelerates the algorithm attain a globally optimal solution. The value of jumping rate is normally selected between [0,0.6] and is mathematically defined as

    $$JR = JR_{\hbox{max} } - JR_{\hbox{min} } - (JR_{\hbox{max} } - JR_{\hbox{min} } )*\left(\frac{{fc_{\hbox{max} } - fc}}{{fc_{\hbox{max} } }}\right)$$
    (17)

    where ‘JRmax and ‘JRmin are the maximum and minimum values of jumping rate. ‘fcmax’ is the maximum number of function call and ‘fc’ is the number of function call at the present iteration.

5 Symbiotic organisms search (SOS) and quasi-oppositional symbiotic organisms search (QOSOS) applied to energy management problem

  • Step 1: Formation of Ecosystem: The parameters considered for microgrid energy management include fuel cost-coefficients of conventional generators, power generation limits, ramp rate limits, power demand of various types of loads and limits of forecasted wind power. Also, the size of ecosystem i.e. the total number of organisms in the ecosystem (eco_size) and maximum iteration (max_iter) is set in this step.

  • Step 2: Let Xi be the trial vector designating the ith organism of the initial ecosystem where Pi consists of generators outputs, class-1 loads, class-2 loads, an auxiliary variable and wind turbine outputs for 8 h intervals. Hence Pi can be represented as Xi = [Pgi11,Pgi12…Pgi18,Pgi21,Pgi22…Pgi28,Pgi31,Pgi32…Pgi38,Di11,Di12….Di18,Di21,Di22….Di28,Di31,Di32….Di38,Di41,Di42….Di48,Di51,Di52….Di58,Di61,Di62….Di68,Ei11,Ei12…Ei18,Ei21,Ei22…Ei28,Ei31,Ei32…Ei38,Ei41,Ei42…Ei48,PtRi1,PtRi2…PtRi8, Wi11,Wi12…Wi18,Wi21,Wi22…Wi28];

  • Now for n number of members of the ecosystem (pop_size) i varies from i = 1, 2, 3….n. Hence the ecosystem matrix can be represented as

  • $$X = \left[ \begin{aligned} X_{1} \hfill \\ X_{2} \hfill \\ X_{3} \hfill \\ \ldots \hfill \\ X_{n} \hfill \\ \end{aligned} \right]$$
  • Step 3: Mutualism phase: Here i is initially set at 1, organism X1 is matched to \(X_{i}\) and organism \(X_{j}\) is formed randomly from the ecosystem. In this case, X2 is selected as \(X_{j}\). Mutual_Vector is calculated using (13). Benefit Factors (1 and 2) are set at 2. Organism \(X_{i}\) and \(X_{j}\) are modified based on their mutual relationship using (11) and (12) and the constraints checking is done. Once it is found that \(X_{i}\) and \(X_{j}\) abide by the constraints, the fitness value is then accounted, if found better than the initial fitness value, we go to next step else we reject modified and keep the initial solution and proceed to next step.

  • Step 4: Commensalism phase: Organism \(X_{j}\)(\(X_{j}\) ≠ \(X_{i}\)) is generated from the ecosystem on a random basis. New candidate solutions X1 are calculated using (14). Constraint checking is done and fitness value is calculated. Like the previous step, if fitness value of the modified organism in this step is better than the previous value then we go to the next step else the modified organism is rejected and the previous solution is kept before proceeding to the next step.

  • Step 5: Parasitism phase: Organism \(X_{j}\) (\(X_{j}\) ≠ \(X_{i}\)) is randomly selected from the ecosystem. Parasite_Vector is formed by mutating \(X_{i}\) in random dimensions using a random number within a given range. Constraint checking is done and fitness value is calculated. If Parasite_Vector is found better than the previously calculated fitness value, then the previous fitness value is replaced with the Parasite vector else the Parasite_Vector is rejected and then we proceed to the next step.

  • Step 6: We proceed to step 2 if the current \(X_{i}\) is not the last member of the ecosystem; otherwise we proceed to next step.

  • Step 7: We stop if one of the termination criteria i.e. the maximum number of iterations is reached; otherwise we return to step 2 and start the next iteration.

Subsequently, the SOS algorithm was modified by incorporating the quasi-oppositional features in it and a modified and novel Quasi-Oppositional Symbiotic Organisms Search (QOSOS) algorithm was developed to minimize the same objective functions of the microgrid energy management problem. Figure 5 below shows the steps followed to minimize the microgrid net social cost using QOSOS.

Fig. 5
figure 5

Flowchart of QOSOS

6 Numerical Results and Analysis

6.1 Description of the Test System

The considered microgrid consists of 3 conventional fossil-fuelled generators, 6 class-1 dispatchable loads, 4 class-2 dispatchable loads, 3 storage units and 2 renewable energy sources (wind farms). The time horizon spans for 8 h corresponding to the interval 4 PM–12 AM. Genetic Algorithm (GA), Particle swarm optimization (PSO) and Differential evolution (DE) were applied in Dey (2015) and have proved themselves better than the classical techniques applied for this work. In this section symbiotic organisms search (SOS) and proposed QOSOS techniques are implemented to evaluate their performance for solving microgrid energy management problems. The proposed algorithm to solve the energy management problem is coded in MATLAB R2013a and executed on a personal computer having 2.53 GHz core i3 processor with 3 GB RAM. The basic system parameters are listed in Table 1. Table 2 contains the various parameters of the conventional fossil fuelled generators. Tables 3 and 4 lists the operating limits and cost coefficients of class-1 and class-2 type of dispatchable loads respectively. The forecasted upper and lower limits of the wind farms, transaction prices for case A and case B and the values of inelastic loads are all listed in Table 5. The forecasted upper and lower limits of the wind farms are gathered from the MISO day-ahead wind forecast data (Zhang et al. 2013) and are rescaled to the order of 1 to 40 kWh, which, according to authors in Wu et al. (2011), is a typical wind power generation for a microgrid. Likewise, the hourly values of the fixed loads Lt which are listed in Table 5, are also collected and re-scaled from the daily report data provided by MISO in Federal Energy Regulatory Commission (2012). The program is run with different population sizes and 100 iterations for 50 trials using SOS. Benefit_Factor value is set at 2 and best result was found at a jumping rate of 0.45 while using QOSOS.

Table 1 Basic parameters of the microgrid system
Table 2 Conventional fossil-fuelled generators parameters
Table 3 Class 1 Dispatchable loads parameters
Table 4 Class-2 Dispatchable load parameters
Table 5 Boundary limits of the wind farms, fixed loads and real time transaction prices for both the cases

6.2 Comparative Study

  1. 1.

    Solution Quality: The minimized generation cost, worst transaction cost and microgrid net social cost for case A with the classical techniques used in literature, GA, PSO, DE, SOS and QOSOS algorithms are displayed in Table 6. It can be seen that proposed QOSOS gives the best and minimized solutions with $10.1022 for net generation cost, $7.9652 for worst transaction cost and $22.0051 for net microgrid cost. Similarly, for case B it can be seen from Table 7 that QOSOS yielded better solutions with $13.6527 for microgrid generation cost, $80.9699 for worst transaction cost and $135.9970 for microgrid net social cost respectively. From these results it is quite clear that proposed QOSOS algorithm gave better and least operation cost of the considered microgrid system compared to other algorithms. The optimal microgrid power schedules of both the cases are shown in Figs. 3 and 4. The stair steps include conventional power generation CG, and total elastic demands for classes 1 and 2 respectively. Quantity WORSTCASE denotes the total worst case wind energy at the respective time slot which is obtained with optimal \(P_{R}^{t}\). A common observation from Figs. 3 and 4 is that the total conventional power generation varies with the same trend across t as the fixed load demand FIXEDLOADS, while the class-1 elastic load exhibits the opposite trend. Because the conventional generation and the power drawn from the main grid are limited, the optimal scheduling by solving (P2) dispatches less power for CLASS1 when FIXEDLOADS is large (from 6 P.M. to 10 P.M.), and vice versa. This behaviour indeed reflects the load shifting ability of the proposed design for the microgrid energy management. Furthermore, by comparing the two cases in Figs. 6 and 7 it is interesting to note that the difference between \(P_{R}^{t}\) and WORSTCASE is the shortage power needed to purchase (if positive) or the surplus power to be sold (if negative).

    Table 6 Costs (in $) obtained for minimum value of objective functions (Case A)
    Table 7 Costs (in $) obtained for minimum value of objective functions (Case B)
    Fig. 6
    figure 6

    Optimal power schedule by QOSOS (Case A)

    Fig. 7
    figure 7

    Optimal power schedule by QOSOS (Case B)

  2. 2.

    Computational Efficiency: Table 8 highlights the low computational time and iteration counts taken by QOSOS to converge to the best solutions. It can be seen for case A, QOSOS takes 0.2150 iter/s and 0.2000 iter/s for case B. Also Figs. 5 and 6 show the convergence characteristics implying the fast convergence criteria of SOS and QOSOS than the rest of the soft computing techniques applied. It means that the time taken by QOSOS algorithm is much less and hence has significantly better computational efficiency to solve energy management problem. Also, Table 7 reflects the number of hits to optimum solution is far more with QOSOS than the other algorithms thus proving its robustness better than GA, PSO, DE and SOS used.

    Table 8 Solution quality analysis of various optimization techniques used for minimizing microgrid net social cost

7 Conclusion

Access to reliable source of electricity is a basic need for every individual. Implementation of microgrids can be considered as the most promising solution for rural or small area electrification. Moreover, providing a suitable means of power exchange between the microgrid and utility grid can be beneficial in terms of both objectives. An optimal strategy for supplying the required energy in an autonomous grid connected microgrid is developed in this paper by means of wind farms, distributed storage and conventional generators only. Based on the financial and operational perspective, the optimization problem was formulated and a new and modified algorithm QOSOS was presented to solve the optimization problem. The effectiveness of the proposed strategy in finding the optimum design was portrayed by the simulation results. The results also showed the proposed system is capable to meet electricity demand of microgrid. In addition, the paper focussed on minimizing the worst case transaction cost which arose due to the stochastic nature of RES. Finally, the accuracy and robustness of QOSOS compared with other conventional algorithms were shown. Since this paper mainly concentrated on cost minimization of the hybrid energy system, involvement of other RES and their reliability check can be a subject of future research (Figs. 7, 8, 9).

Fig. 8
figure 8

Convergence characteristics of net microgrid cost during Case A

Fig. 9
figure 9

Convergence characteristics of overall microgrid cost during Case B