推广 热搜: page  使用  音视频  个数  选择  搜索引擎  企业  百度  可以  父亲 

【PID优化】基于花朵授粉算法PID控制器优化设计含Matlab源码

   日期:2024-12-16     作者:x5bnw    caijiyuan   评论:0    移动:http://ww.kub2b.com/mobile/news/4509.html
核心提示:PID参数优化对PID控制性能起着决定性作用,针对PID参数寻优问题,提出运用一种花授粉算法(FPA).该算法启发于自然界中花粉的传播授

PID参数优化对PID控制性能起着决定性作用,针对PID参数寻优问题,提出运用一种花授粉算法(FPA).该算法启发于自然界中花粉的传播授粉过程,以三个PID参数组成每个花粉单元的位置坐标,根据一定的全局授粉与局部授粉规则更新花粉单元的位置,使其向最优解迭代.仿真结果表明,与粒子群算法和人群搜索算法相比,花授粉算法优化参数使系统具备更短的响应时间,更高的系统控制精度以及更好的鲁棒性,为PID控制系统的参数整定提供了参考.

function [aa,fminf,Ntime ] = fpa(n,p,N_iter,d )

%UNTITLED3 此处显示有关此函数的摘要

%   此处显示详细说明

Lb=-600*ones(1,d);

Ub=600*ones(1,d);

 Sol=zeros(n,d);

  Fitness=zeros(1,n);

for i=1:n,

  Sol(i,:)=Lb+(Ub-Lb)*rand;

  Fitness(i)=Fun(Sol(i,:));

end

% Find the current best

[fmin,I]=min(Fitness);

best=Sol(I,:);

S=Sol;

 Ntime=1;

  Ntime= Ntime-1;

for t=1:N_iter,

        % Loop over all bats/solutions

        for i=1:n,

          % Pollens are carried by insects and thus can move in

          % large scale, large distance.

          % This L should replace by Levy flights  

          % Formula: x_i^{t+1}=x_i^t+ L (x_i^t-gbest)

          if rand<p,

          %% L=rand;

          L=Levy(d);

          

          dS=L.*(Sol(i,:)-best);

          S(i,:)=Sol(i,:)+dS;

          

          % Check if the simple limits/bounds are OK

          S(i,:)=simplebounds(S(i,:),Lb,Ub);

          

          % If not, then local pollenation of neighbor flowers 

          else

              epsilon=rand;

              % Find random flowers in the neighbourhood

              JK=randperm(n);

             

【PID优化】基于花朵授粉算法PID控制器优化设计含Matlab源码

%               end

              % As they are random, the first two entries also random

              % If the flower are the same or similar species, then

              % they can be pollenated, otherwise, no action.

              % Formula: x_i^{t+1}+epsilon*(x_j^t-x_k^t)

%            

               S(i,:)=S(i,:)+epsilon*(Sol(JK(1))-Sol(JK(2)));

%               

              % Check if the simple limits/bounds are OK

              S(i,:)=simplebounds(S(i,:),Lb,Ub);

          end

          

          % evaluate new solutions

           Fnew=Fun(S(i,:));

          % If fitness improves (better solutions found), update then

            if (Fnew<=Fitness(i)),

                Sol(i,:)=S(i,:);

                Fitness(i)=Fnew;

           end

           

          % Update the current global best

          if Fnew<=fmin,

                best=S(i,:)   ;

                fmin=Fnew   ;

          end

         

               Ntime=Ntime+1;

         

             aa( Ntime)=fmin; 

        end

        % Display results every 100 iterations

%          if round(t/10)==t/10,

%           best

%            fmin

%        fmin

%   

%        best

%          end

        end

        fminf=fmin;

end

[1]贺圣彦, 曹中清, 余胜威. 基于花授粉算法的PID参数优化[J]. 计算机工程与应用, 2016, 52(17):4.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

本文地址:http://ww.kub2b.com/news/4509.html     企库往 http://ww.kub2b.com/ ,  查看更多

特别提示:本信息由相关用户自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。

 
 
更多>同类最新文章
0相关评论

文章列表
相关文章
最新动态
推荐图文
最新文章
点击排行
网站首页  |  关于我们  |  联系方式  |  使用协议  |  版权隐私  |  网站地图  |  排名推广  |  广告服务  |  积分换礼  |  网站留言  |  RSS订阅  |  违规举报  |  鄂ICP备2020018471号