Single-objective application: Microgrid optimal dispatching MATLAB based on Sparrow Search Algorithm SSA

1. Microgrid system operation optimization model

references:

[1] Li Xingxin, Zhang Jing, He Yu, et al. Multi-objective optimal dispatch of microgrid based on improved particle swarm algorithm [J]. Electric Power Science and Engineering, 2021, 37(3):7

2. Introduction to Sparrow Search Algorithm

The Sparrow Search Algorithm (SSA) is a new type of swarm intelligence optimization algorithm proposed in 2020. It is mainly inspired by the foraging behavior and anti-predation behavior of sparrows. SSA is a heuristic optimization algorithm based on simulating the natural food search behavior of sparrows. It optimizes the solution space of the problem by simulating the process of sparrows looking for food in nature, with global search capabilities and high efficiency performance. This algorithm is suitable for solving optimization-related problems, such as combinatorial optimization problems, constrained optimization problems, multi-objective optimization problems, etc. In the process of foraging for sparrows, they are divided into discoverers (explorers) and joiners (followers). Discoverers are responsible for finding food in the population and providing foraging areas and directions for the entire sparrow population, while joiners use Discoverers come to get food. In order to obtain food, sparrows can usually adopt two behavioral strategies: finder and joiner for foraging. Individuals in a population monitor the behavior of other individuals in the population, and attackers in the population compete for food resources with high-intake peers to increase their own predation rate. Additionally, sparrow populations engage in anti-predator behavior when they perceive danger.

Sparrow search algorithm (Matlab code provided)

3. SSA solves microgrid scheduling

(1) Part of the code

close all; 
clear ;  
clc; 
global P_load; %electric load 
global WT;%wind power 
global PV;%photovoltaic 
%% 
TestProblem=1; 
[lb,ub,dim,fobj] = GetFunInfo(TestProblem); 
SearchAgents_no=100; % Number of search agents 
Max_iteration=1000; % Maximum number of iterations 
[Best_score,Xbest,Convergence_curve]=SSA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); 


%% Draw the result graph 
figure(1) 
semilogy(Convergence_curve,'r -','linewidth',2); 
legend('SSA'); 
xlabel('number of iterations') 
ylabel('sum of operating cost and environmental protection cost')

(2) Partial results

4. Complete MATLAB code

Guess you like

Origin blog.csdn.net/weixin_46204734/article/details/132648003