# Optimal Operation of CCHP Smart Distribution Grid with Integration of Renewable Energy
## 5 Solution of the Proposed Combined-Objective Function  
The proposed EMS is formulated as a combined-objective UCIMIQP. This combined-objective optimization function is converted to a single function that can be solved directly in one step [37,38]. General algebraic modelling system (Gams) software is employed to formulate and model the proposed optimization problem. Gams is a highly mathematical modelling system for modelling and solving optimization problems. Cplex Solver is utilized to solve the proposed CCHP optimization problem. CPLEX is an efficient solver, which is based on the branch and bound algorithm. One of the significant merits of this algorithm is that when the solution is obtained it is the global optimum [39]. The flowchart shown in Figure 1 depicts the process that has been followed to formulate and solve theproposed optimization problem. Firstly, each component of the CCHP is formulated based on its economic operation function. Additionally, the constraints relevant to the operation are modelled and formulated as aforementioned in the previous section. Further, the combined objective function is formulated to minimize the operation and emission cost as in Equation (33). This objective function is modelled as UCIMIQP. Finally, the entire problem is solved, and the results are obtained. There are many algorithms and methods in the open literature to solve the variety of optimization problems of the CCHP systems. The mature and famous methods are as follows: deterministic methods (liner programming (LP), non-linear programming (NL), mixed integer linear programming (MILP), mixed integer quadratic programming (MIQP), and dynamic programming (DP)), heuristic and metaheuristic methods (genetic algorithm (GA), particle swarm optimization (PSO), simulated annealing (SA), grey wolf optimizer (GWO), and multi-objective evolutionary algorithms (MOEAs)), artificial intelligence (AI) and machine learning (neural networks (NNs), fuzzy logic (FL), and reinforcement learning (RL)), and hybrid methods, which combine multiple techniques to combine their strength (MILP with metaheuristics, deterministic with stochastic methods, and metaheuristics with AI). The details of these methods, in aspects of formulation and suitability of each one to solve a specific optimization problem efficiently better than others with relevant algorithms, and comparisons between these methods are presented in the references [40; 41; 42; 43; 44; 45; 46; 47; 48; 49]. Real-time  
Figure 1: Flowchart of the formulation of and solution to the proposed optimization problem. and model predictive control energy management systems of the microgrids are addressed in [39; 50]. Selecting the suitable solution method to formulate and solve the optimization problem depends on the types of the objective function, constraints and variables of the problem, the dimension of the problem, and where each optimization problem is different from others based on these criteria. In addition, the global optimal solution is a considerable factor in the formulation and solution of the optimization problem of CCHP systems, where the local optimum solution may be not an economic solution and affects the fidelity of the proposed approach [48]. Similarly, the solution time is an important factor in the solution of the optimization problem, particularly in the case of online optimization. Clearly, choosing the solution methods is a vital decision in the formulation and solution of the optimization problem. In this paper, the branch and bound algorithm is employed to solve the proposed UCIMIQP because when the solution is obtained that means the solution is the guaranteed global optimum and the solution time is not computationally intensive. In addition, the algorithm is integrated with an efficient solver [49]. This simplifies the formulation and solution of the problem.