[Train Energy Saving Optimization]--Application of Gray Wolf Optimization Algorithm

1. Research background

  • Today's society has an increasing demand for energy resources. How to improve the energy efficiency of trains and reduce energy consumption and environmental pollution has become an important research direction. Train energy-saving optimization is a comprehensive use of mechanical, electrical, control and other disciplines to optimize the energy consumption, operating efficiency and safety of trains by using advanced algorithms and technical means to achieve the goals of reducing energy consumption and reducing environmental pollution.
    The main purpose of train energy-saving optimization is to minimize the energy consumption of the train while ensuring the normal operation of the train, so as to achieve energy-saving effects. Specifically, train energy-saving optimization includes optimizing the train's operation strategy, control system and vehicle design, such as optimizing the train's traction, braking force, speed control, etc., so that the train can maximize the use of kinetic energy and reduce energy while ensuring safety. consumption and environmental pollution.

2. Introduction to Gray Wolf Optimization Algorithm

  • Gray Wolf Optimizer (GWO) is an emerging optimization algorithm inspired by the predatory behavior of wolves. The gray wolf optimization algorithm finds the optimal solution by simulating the interaction behavior among wolves. In train energy-saving optimization, we can apply the gray wolf optimization algorithm to adjust parameters such as train speed to achieve energy-saving purposes.
  • Gray wolves are canids and are considered apex predators, at the top of the biosphere's food chain. Gray wolves mostly like to live in groups, with an average of 5-12 wolves in each group. Of particular interest is the fact that they have a very strict hierarchy of social classes, as shown in Figure 1. The first level of the pyramid is the leader of the population, called α \alphaα . among wolvesα \alphaα is an individual with managerial abilities, mainly responsible for various decisions in the group regarding hunting, time and place to sleep, food distribution, etc. The second level of the pyramid isα \alphaα ’s think tank team is calledβ \betaβ .β \betaβ is mainly responsible for assistingα \alphaα makes decisions. Whenα \alphaWhen there is a vacancy in α ,β \betaβ will succeedα \alphaThe position of α . β \betaβ ’s dominance among the wolves is second only toα \alphaα , which willα \alphaAlpha 's orders are issued to other members, and the execution status of other members is fed back toα \alphaα acts as a bridge. The third level of the pyramid isδ \deltaδ ,δ \deltaδ obeysα \alphaαβ \betaThe decision-making command of β is mainly responsible for investigation, sentry, care and other matters. α \alphawith poor fitnessαβ \betaβ will also reduce toδ \deltaδ . The bottom of the pyramid isω \omegaω is mainly responsible for the balance of relationships within the population.

Figure 1 The hierarchy of gray wolves

  • Additionally, group hunting is another fascinating social behavior of gray wolves. The social hierarchy of gray wolves plays an important role in the group hunting process. The process of predation is determined by α \alphaCompleted under the leadership of α . Gray wolf hunting consists of the following three main parts: 1) Stalking, chasing and approaching the prey; 2) Pursuing, surrounding and harassing the prey until it stops moving; 3) Attacking the prey

Figure 2 The hunting behavior of gray wolves

3. Application of Gray Wolf Optimization Algorithm in Train Energy Saving Optimization

There are usually two operating modes for train operation: time-saving mode and energy-saving mode. The time-saving mode allows the train to complete the operation plan in the shortest time (i.e., operate with maximum traction and maximum braking force). In this mode, the train is required to run close to the speed limit. When the speed is greater than the speed limit value, it maintains a constant speed. When the speed is less than the speed limit, the train is required to run at a constant speed. After the value of traction, that is, the highest technical speed is reached during operation. The energy-saving mode allows the train to select an optimized control plan with the lowest energy consumption, so that the train can complete the operation plan in a relatively energy-saving control method while ensuring safe operation and punctuality of the train. We compare the time-saving mode and the optimized energy-saving mode to prove the optimized energy consumption indicators of the Gray Wolf optimization algorithm.

1. Algorithm solution model

There are two typical ideas for solving multi-objective optimization problems: one is to simplify the solution idea and transform it into solving single-objective optimization problems; the other is to apply the intelligent algorithm of multi-objective optimization based on Pareto theory. Solve.

1.1 Convert multi-objective optimization problems into single-objective problems

The core idea of ​​converting a multi-objective optimization problem into a single-objective optimization problem is to assemble various sub-objectives in a certain way to form a mathematical expression containing multiple sub-objectives. This solution method usually has different objectives for multiple objectives. Secondly. The following describes several commonly used conversion methods in detail:

Linear weighting method . The linear weighting method is a classic method for solving multi-objective optimization problems. This method assigns multiple optimization objective functions to a fixed weight value wi w_iwi, combine them into a new comprehensive objective function through linear weighting. Although this method simplifies the complex multi-objective problem into a single objective function, due to the differences in the sub-optimization objectives and their evaluation indicators in the multi-objective problem, it is impossible to determine a unified and reasonable standard for the assignment of weight coefficients. Therefore, the assigned weights mostly need to be based on the subjective judgment of the solver, resulting in the method being too subjective and manipulative.

Main function method . Another common method to convert multi-objective optimization problems into single-objective optimization problems is the main objective function method. This method selects a main optimization goal, treats other optimization goals as secondary goals, and converts the expected values ​​of other goals into corresponding constraints to constrain the range of optimization variables. This helps the optimization process move towards the desired solution. Through this method, the solution of multi-objective optimization problems can be simplified, but it is necessary to pay attention to the selection of the main goal and the transformation method of other goals to ensure that the resulting single-objective problem can accurately reflect the solution requirements of the multi-objective optimization problem.

Penalty function method . The penalty function method is a common method for solving optimization problems with constraints. In the penalty function method, one objective function is selected as the main optimization objective, other objective functions are constructed as penalty functions, and they are added to the main objective function as constraints. In this way, a problem with constraints can be transformed into an unconstrained optimization problem. Since train operation optimization control problems usually contain many constraints, the penalty function method can effectively convert the objective function into an unconstrained optimization problem, thereby reducing the uncertainty and complexity caused by subjective weighting, and can be conveniently Solve. Therefore, the penalty function method has broad application prospects in train operation optimization control problems.

1.2 Solve based on Pareto principle

The Pareto principle is a basic principle in the field of multi-objective optimization, also known as the Pareto optimization principle or the Pareto optimal solution principle. The basic idea is: when there are multiple optimization objectives, there is a set of solutions, in which the improvement of any objective function value will lead to the deterioration of the other objective function value, that is, there is no solution that can simultaneously achieve all objectives. The function reaches its optimal value, and only some solutions have "optimal" properties. These solutions are called Pareto optimal solutions.
In multi-objective optimization problems, the Pareto optimal solution has the following two characteristics:
non-inferiority: that is, the Pareto optimal solution is non-inferior among all feasible solutions and cannot be dominated by other solutions.
Diversity: That is, each solution in the Pareto optimal solution set is independent in terms of objective function values, and no group of solutions is better than other solutions in all objective functions.
The solution method based on the Pareto principle is called the Pareto optimal solution solution method. Its main purpose is to find a set of non-inferior solutions. These non-inferior solutions form the Pareto optimal solution set. Through the Pareto optimal solution method, we can obtain some important information in multi-objective optimization problems, such as understanding the trade-offs between objectives, boundary conditions and the diversity of optimal solutions. This has important guiding significance for decision making and problem solving.

2. Train dynamics model

  • Among various types of train kinematics models, the more common ones include single-particle, multi-particle and mass-band models. As far as the single-particle model is concerned, the train is regarded as a particle, and the length of the car and the coupling force generated by the carriages are not considered. In the study of train traction calculations, this type of model has been used by many scholars because it is not complicated. As far as the multi-particle model is concerned, the multi-particle model treats each carriage of the train as a particle. In the traction calculation, the force relationship of each carriage is considered and the motion parameters of the train are obtained by summing. This type of model needs to take into account the length of the train and the force generated by the train carriage, so it is more consistent with the actual train operation status than the single-mass point model. However, the train route is complex and long, and the use of a multi-particle model may cause a large amount of calculations, and may even lead to no solution when obtaining the train's multi-objective speed curve.

    Single point model
    . The so-called single mass point model treats the entire train as a mass point, which needs to withstand all the forces acting on the train, and does not consider the forces exerted on each other by the carriages.

    Multi-particle model
    . As far as the multi-particle model is concerned, the multi-particle model treats all carriages as mass points. The traction calculation model designed in this way can take into account the impact of the train length and truly reflect the resultant force between all train operations. Such a model is still calculated through force analysis, but at the same time, the pulling force and thrust force generated between the vehicles can be obtained. Then when the train reaches the slope change point or the curvature change point, it can generate Gradient process. Since the multi-particle model needs to consider the specific conditions of all vehicles, the specific calculations of this model are more complicated than the single-particle model.

    Quality belt model
    . The concept of the mass band model is to regard the train as a wooden stick with evenly distributed thickness, and the mass of the train is evenly distributed according to its length. Compared with the single mass point model, the mass band model takes more into account the influence of the length of the train carriage on the traction calculation. When the train enters a ramp or curve, it can accurately use the variable slope points or variable curvature points to calculate the parameters in sections, which reduces the number of factors compared with the single mass point model. calculation error. Compared with the multi-particle model, the mass band model does not consider the force relationship such as thrust or tension between the carriages, which reduces the amount of calculation.
  • The train is subject to traction force FF during operation.F. Braking forceBBB. Basic resistance of trainWWW and line additional resistanceRRThe joint effect of R , assuming that the train mass isMMM , train running timettt , running speedvvv , running distancexxx , according to Newton's second law, the differential equation of train motion can be derived:
    dxdt = vdvdt = F ( v ) − B ( v ) − W ( v ) − R ( x ) M (1) \begin{aligned} \frac {dx}{dt} \quad &=v \\ \frac{dv}{dt} \quad &=\frac{F(v)-B(v)-W(v)-R(x)}{M } \quad \end{aligned}\tag{1}dtdxdtdv=v=MF(v)B(v)W(v)R(x)(1)

3. Establish objective function

  • Before applying the gray wolf optimization algorithm for train energy-saving optimization, we need to establish an objective function. The objective function is a function used to evaluate the energy consumption during train travel.
    min Q = w 1 ∗ ∣ E − E 0 E 0 ∣ + w 2 ∗ ∣ T − T 0 T 0 ∣ \begin{align} min Q =& w_1*\lvert\frac{E-E_0}{E_0}\ rvert+w_2*\lvert\frac{T-T_0}{T_0}\rvert \tag{2}\\ \end{align}min Q=w1E0EE0+w2T0TT0(2)In formula (2), QQQ is the objective function value,w 1 w_1w1 w 2 w_2 w2are the running energy consumption weight and the running time weight respectively, EEE is the actual running energy consumption of the train,E 0 E_0E0is the expected minimum operating energy consumption of the train, which is related to line conditions and train parameters, TTT is the actual running time of the train,T 0 T_0T0Specifies the planned run time for the interval.
  • At the same time, certain constraints need to be met in train energy-saving optimization. There are mainly speed limit constraints, parking accuracy constraints and comfort constraints.

4. Selection of decision variables

During the operation of the train, the driver's control simply means adjusting the control conditions at the corresponding position. Typical train control strategies mainly include time-saving control strategies, energy-saving control strategies and hybrid control strategies. According to different operating requirements of trains, different control strategies should be adopted. No matter which control strategy is adopted, the train uses the maximum traction force for traction acceleration during the startup acceleration stage. After reaching the speed limit, an appropriate control strategy is adopted according to the operation requirements in the intermediate stage. If the control mode conversion sequence during train operation and the corresponding operating mode conversion point position are known, the train operation curve can be uniquely determined.
The working condition transformation sequence can be described by the following formula:
P = ( p 0 , p 1 , p 2 , . . . , pi , . . . , pm ) \begin{align} P =& (p_0,p_1,p_2,.. .,p_i,...,p_m) \tag{3}\\ \end{align}P=(p0,p1,p2,...,pi,...,pm)(3)In formula (3), PPP is the working mode conversion sequence consisting of traction, cruising, coasting and braking conditions, which needs to satisfy the working mode conversion constraints.
The energy-saving control of trains based on the working condition sequence list can be described as: given the control working condition sequence during the train operation in advance, the solution to the energy-saving optimization problem is expressed as finding the positions of these conversion points, that is, solving the equation (4)XXX
X = ( x 0 , x 1 , x 2 , . . . , x i , . . . , x m ) \begin{align} X=& (x_0,x_1,x_2,...,x_i,...,x_m) \tag{4}\\ \end{align} X=(x0,x1,x2,...,xi,...,xm)(4)In formula (4), xi x_ixiis the working condition switching point position, and satisfies 0 = x 0 < x 1 < x 2 . . . < xi < . . . < xm < S 0=x_0<x_1<x_2...<x_i<...<x_m <S0=x0<x1<x2...<xi<...<xm<S S S S is the end point of the interval.
When the train is actually running, the number of working mode conversions is uncertain, and several working mode conversion sequences can be adopted for control. In order to improve the diversity of solutions to energy-saving control optimization problems, multiple control working condition sequences can be given in advance and the energy-saving effects under each working condition sequence can be compared. Assume that the control optimization problem now has two reasonable working condition conversion sequences:
Working condition sequence one: P 1 = ( p 0 , p 1 , p 2 , p 3 , p 4 , p 5 , p 6 , p 7 ) = ( Towing, cruising, coasting, pulling, cruising, coasting, braking) P_1=(p_0,p_1,p_2,p_3,p_4,p_5,p_6,p_7)=(traction, cruising, coasting, traction, cruising, coasting, braking )P1=(p0,p1,p2,p3,p4,p5,p6,p7)=( traction ,cruise ,lazy ,traction ,cruise ,lazy ,Braking ) working condition sequence two:P 2 = ( p 0 , p 1 , p 2 , p 3 , p 4 , p 5 , p 6 , p 7 ) = (traction, coasting, traction, coasting, traction, coasting, Braking) P_2=(p_0,p_1,p_2,p_3,p_4,p_5,p_6,p_7)=(traction, coasting, traction, coasting, traction, coasting, braking)P2=(p0,p1,p2,p3,p4,p5,p6,p7)=( traction ,lazy ,traction ,lazy ,traction ,lazy ,Braking ) Therefore, during simulation experiments, it is necessary to solve their corresponding working condition conversion points separately, and compare the two to obtain the optimal solution to the energy-saving control optimization problem. In actual application, the working condition sequence can be pre-determined based on specific line conditions and operating experience.

4. Simulation parameter settings

An actual line is used as a simulation line, and an HXD1 electric locomotive pulling 50 C80 freight cars is used as the simulation object. The basic attributes of freight trains are shown in Table 1.
Table 1 Basic parameters of freight trains

parameter value
train formation 1 locomotive + 50 trucks
Locomotive quality 200 ( t ) 200(t) 200(t)
Locomotive length 35.22 ( m ) 35.22(m) 35.22(m)
Locomotive unit basic resistance 1.2 + 0.0065 v + 0.000279 v 2 ( N / t ) 1.2+0.0065v+0.000279v^2(N/t) 1.2+0.0065v+0.000279v2(N/t)
Truck quality 80 ( t ) 80(t) 80(t)
Locomotive length 12 ( m ) 12(m) 12(m)
Truck unit basic resistance 0.92 + 0.0048 v + 0.000125 v 2 ( N / t ) 0.92+0.0048v+0.000125v^2(N/t) 0.92+0.0048v+0.000125v2(N/t)

5. Part of the source program Matlab code

  • Traction characteristic curve of HXD1 electric locomotive
function f= TractionForce(vel)
%  根据牵引曲线计算列车牵引力大小
%  输入速度单位为m/s
f=0;
u=vel*3.6; %单位换算
    if u<5
        f=760;
    elseif u<65
        f=779-3.8*u;
    elseif u<100
        f=34560/u;
    end
end
  • Braking characteristic curve of HXD1 electric locomotive
function f= BrakingForce(vel)
%  根据制动曲线计算列车制动力大小
%  输入速度单位为m/s
f=0;
u=vel*3.6; %单位换算
    if u<3
        f=153.3*u ;
    elseif u<=75
        f=461;
    elseif u<=100
        f=34560/u;
    end
end
  • The total resistance experienced by the train when running
function f = TotalResistance(vel,pos)
% 计算列车运行时所受到的总阻力
global RampArray;
global CurveArray;
global TrainLength;
global LocomotiveWeight TruckWeight TrainWeight;

%%
% tailStock=pos-TrainLength;
% bodyStock=pos-TRAINWGH/2;
% L=TrainLength;
u=vel*3.6;
%%
w0=1.2+0.0065*u+0.000279*u*u;  %机车
w1=0.92+0.0048*u+0.000125*u*u;  %C80货车
f1=w0*LocomotiveWeight*9.8/1000; %机车基本阻力
f2=w1*TruckWeight*9.8/1000;%货车基本阻力
f=0;
RampResistance=0;
CurveResistance=0;
n = size(RampArray, 2);
m = size(CurveArray, 2);
i=1;
j=1;
%%  列车坡道附加阻力计算公式,采用单质点模型
while (i<n)
    if((pos>=RampArray(1,i)) && (pos<RampArray(1,i+1)))
        wi = RampArray(2, i);
        RampResistance =wi*TrainWeight*9.8/1000;
        break;
    end
    i = i + 1;
end
%%   列车曲线附加阻力计算公式
while (j<m) 
       if pos>=CurveArray(1,j) && pos<CurveArray(1,j+1)
           if 0==CurveArray(2,j)
              wr=0;
              CurveResistance =wr*TrainWeight*9.8/1000;
              break;
           else 
             wr=600/CurveArray(2,j);
             CurveResistance =wr*TrainWeight*9.8/1000;
             break;
           end
       end
        j = j + 1;
 end
%%  列车所受的总阻力
f=f1+f2+RampResistance+CurveResistance;
end
  • Fitness function design
function  fitness = CalculateFitness(Energy,Time)
%  计算适应度函数
%  定义全局变量
global Tmin;  
% global Emax;
global Emin;
%%  适应度计算应该归一化
%  设置线性权重,包括能耗权重w1和时间权重w2
w1=0.5;
w2=0.5;
%% 分目标适应度值
f1=(abs(Energy-Emin))/Emin;
f2=(abs(Time-Tmin))/Tmin;
%% 适应度函数
fitness=w1*f1+w2*f2;
end
  • The main function of the gray wolf optimization algorithm
function [bestFitnessPos,bestFitness,newPop,IterCurve]=GWO_main(option)
%灰狼化算法的主函数
global switchNumber;
global popSize iterNumber;
global upLimit lowLimit;

%灰狼优化算法参数
popSize=option.PopulationSize;   %种群数量
iterNumber=option.MaxGenerations; %迭代次数
%%   产生初始种群
Population= InitializePopulation(popSize,switchNumber);  %生成种群

%%   计算适应度值
for  i=1:popSize
    [~,Energy,Time,~]=ModelConstraint(Population(i,:),2);
    fitness(i)=CalculateFitness(Energy,Time);
end

%%  对适应度排序,找到Alpha,Beta,Delta狼
%寻找适应度最小的位置
[SortFitness,indexSort] = sort(fitness);
%记录适应度值和位置
Alpha_pos = Population(indexSort(1),:);
Alpha_score = SortFitness(1);
Beta_pos = Population(indexSort(2),:);
Beta_score = SortFitness(2);
Delta_pos = Population(indexSort(3),:);
Delta_score = SortFitness(3);
gBest = Alpha_pos;
gBestFitness = Alpha_score;

%%   开始迭代
for iter=1:iterNumber
    
    %%   把种群赋给旧种群
    oldPopulation=Population;
    a=2-iter*((2)/iterNumber);
    %%  对个体进行评估
    for i=1:popSize
        for j=1:switchNumber
            %% 根据Alpha狼更新位置
            r1=rand(); % [0,1]随机数
            r2=rand(); % [0,1]随机数
            A1=2*a*r1-a; % 计算A1
            C1=2*r2; % 计算C1
            D_alpha=abs(C1*Alpha_pos(j)-Population(i,j)); % 计算距离Alpha的距离
            X1=Alpha_pos(j)-A1*D_alpha; %位置更新
            %% 根据Beta狼更新位置
            r1=rand();%[0,1]随机数
            r2=rand();%[0,1]随机数
            A2=2*a*r1-a;% 计算A2
            C2=2*r2; % 计算C2
            D_beta=abs(C2*Beta_pos(j)-Population(i,j));  % 计算距离Beta的距离
            X2=Beta_pos(j)-A2*D_beta; %位置更新
            %% 根据Delta狼更新位置
            r1=rand();%[0,1]随机数
            r2=rand();%[0,1]随机数
            A3=2*a*r1-a; % 计算A3
            C3=2*r2; % 计算C3
            D_delta=abs(C3*Delta_pos(j)-Population(i,j)); % 计算距离Delta的距离
            X3=Delta_pos(j)-A3*D_delta; %位置更新
            %更新位置
            Population(i,j)=(X1+X2+X3)/3;
        end
        %%  边界检查
        Population(i,:) = BoundaryCheck(Population(i,:),upLimit,lowLimit,switchNumber);
    end
    
    
    %%  判断个体是否符合约束条件
    for i=1:popSize
        [flag,Energy,Time,~]=ModelConstraint(Population(i,:),2);
        if flag~= 0
            Population(i,:)=lowLimit + (upLimit -lowLimit).*rand(1,switchNumber);
            %再次测试
            [flag,Energy,Time,~]=ModelConstraint(Population(i,:),2);
            while flag~= 0
                Population(i,:)=lowLimit + (upLimit -lowLimit).*rand(1,switchNumber);
                [flag,Energy,Time,~]=ModelConstraint(Population(i,:),2);
            end
        end
        fitness(i)=CalculateFitness(Energy,Time);
    end
    
    %%  合并新旧种群,取种群数量大小
    newPopulation = [oldPopulation; Population];
    % 计算适应度值
    newfitness = zeros(size(newPopulation, 1), 1);
    for i = 1:size(newPopulation, 1)
        [~,Energy,Time,~] = ModelConstraint(newPopulation(i,:), 2);
        newfitness(i) = CalculateFitness(Energy, Time);
    end
    % 排序并选择前setNum个个体
    [~, sortIndex] = sort(newfitness, 'ascend');
    newPopulation = newPopulation(sortIndex(1:popSize), :);
    % 更新种群和适应度值
    Population = newPopulation;
    fitness = newfitness(sortIndex(1:popSize));
    %%  更新适应度值
    for i=1:size(Population,1)
        % 更新 Alpha, Beta,  Delta狼
        if  fitness(i)<Alpha_score
            Alpha_score= fitness(i); % 更新alpha狼
            Alpha_pos=Population(i,:);
        end
        if  fitness(i)>Alpha_score &&  fitness(i)<Beta_score
            Beta_score= fitness(i); % 更新beta狼
            Beta_pos=Population(i,:);
        end
        if  fitness(i)>Alpha_score &&  fitness(i)>Beta_score &&  fitness(i)<Delta_score
            Delta_score= fitness(i); %更新delta狼
            Delta_pos=Population(i,:);
        end
    end
    %%
    gBest = Alpha_pos;
    gBestFitness = Alpha_score;
    IterCurve(iter) = gBestFitness;
    %%  显示迭代次数
    disp(['第',num2str(iter),'次迭代']);   
end
bestFitnessPos=gBest;
bestFitness=gBestFitness;
newPop=Population;
end

6. Simulation diagram of some experimental results

  • Speed-distance curve in time-saving mode

Figure 3 Speed-distance curve in time-saving mode

  • Optimized train speed-distance curve

Figure 4 Optimized speed-distance curve

  • Optimized working sequence

Figure 5 Optimized working condition sequence

7. Some references

[1] Mirjalili, Seyedali, Seyed Mohammad Mirjalili, and Andrew Lewis. “Grey wolf optimizer.” Advances in engineering software 69 (2014): 46-61. [2] Yang Yanqiang, Liu Haidong, Ma Cunrui, Xu Liang. Train energy
saving Research on optimization of operating target speed control [J]. Transportation System Engineering and Information, 2019, 19(01): 138-144.
[3] Zhang Huiru, Jia Limin, Wang Li. High-speed railway train energy-saving driving curve based on Pareto multi-objective optimization Set generation [J]. Journal of Railways, 2021, 43(03):85-91.
[4] Chu Xintong. Research on energy-saving operation optimization of urban rail multi-trains based on ant colony algorithm [D]. Southwest Jiaotong University, 2021. [
5 ] Yang Jie. Energy-saving operation optimization and intelligent control method of freight trains [D]. Beijing Jiaotong University, 2017.
[6] Lin Xuan. Research on energy-saving optimized control strategies of freight electric locomotives [D]. Southwest Jiaotong University, 2018.

Guess you like

Origin blog.csdn.net/qidian630/article/details/130262628