• 混沌引力搜索算法(CGSA)解决三个机械工程设计问题(Matlab代码实现)


     👨‍🎓个人主页:研学社的博客 

    💥💥💞💞欢迎来到本博客❤️❤️💥💥

    🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

    ⛳️座右铭:行百里者,半于九十。

    📋📋📋本文目录如下:🎁🎁🎁

    目录

    💥1 概述

    📚2 运行结果

    🎉3 参考文献

    🌈4 Matlab代码实现


    💥1 概述

    文献来源:

    本文旨在研究混沌引力搜索算法( CGSA )在求解焊接梁设计( WBD )、压缩弹簧设计( CSD )和压力容器设计( PVD )等机械工程设计框架中的性能。


    本研究将十个混沌映射与引力常数相结合,以增加引力搜索算法( GSA )的开发能力。此外,CGSA还用于保持引力常数的自适应能力。此外,混沌映射被用于克服标准GSA的早熟收敛和陷入局部极小的问题。

    📚2 运行结果

     

     

    部分代码:

    function [Fbest,Lbest,BestChart]=GSA(Benchmark_Function_ID,N,Max_Iteration,ElitistCheck,min_flag,Rpower)

    %V:   Velocity.
    %a:   Acceleration.
    %M:   Mass.  Ma=Mp=Mi=M;
    %dim: Dimension of the test function.
    %N:   Number of agents.
    %X:   Position of agents. dim-by-N matrix.
    %R:   Distance between agents in search space.
    %[low-up]: Allowable range for search space.
    %Rnorm:  Norm in eq.8.
    %Rpower: Power of R in eq.7.
     
     Rnorm=2; 
     
    %get allowable range and dimension of the test function.
     [down,up,dim]=benchmark_functions_details(Benchmark_Function_ID);

    %random initialization for agents.
    X=initialization(dim,N,up,down); 

    %create the best so far chart and average fitnesses chart.
    BestChart=[];

    V=zeros(dim,N);

    for iteration=1:Max_Iteration
    %     iteration
        
        %Checking allowable range. 
        X=space_bound(X,up,down); 

        %Evaluation of agents. 
        fitness=evaluateF(X,Benchmark_Function_ID); 
        
        if min_flag==1
        [best, best_X]=min(fitness); %minimization.
        else
        [best best_X]=max(fitness); %maximization.
        end        
        
        if iteration==1
           Fbest=best;Lbest=X(:,best_X);
        end
        if min_flag==1
          if best        Fbest=best;Lbest=X(:,best_X);
          end
        else 
          if best>Fbest  %maximization
           Fbest=best;Lbest=X(:,best_X);
          end
        end
          
    BestChart=[BestChart Fbest];

    %Calculation of M. eq.14-20
    [M]=massCalculation(fitness,min_flag); 

    %Calculation of Gravitational constant. eq.13.
    G=Gconstant(iteration,Max_Iteration); 

    %Calculation of accelaration in gravitational field. eq.7-10,21.
    a=Gfield(M,X,G,Rnorm,Rpower,ElitistCheck,iteration,Max_Iteration);

    %Agent movement. eq.11-12
    [X,V]=move(X,a,V);

    end %iteration

    🎉3 参考文献

    部分理论来源于网络,如有侵权请联系删除。

     

     

    🌈4 Matlab代码实现

  • 相关阅读:
    弘辽科技:100块的直通车,怎么开?电商运营新手篇
    如何在不同平台上搭建Flutter开发环境
    java计算机毕业设计酒店管理系统设计与实现源码+mysql数据库+系统+lw文档+部署
    Android 12修改usb tp触摸唤醒
    快速排序(Quick Sort)
    1.1信息系统与信息化-1.2信息系统开发方法
    C# .NET CORE .NET6 RSA 公钥加密 私钥解密
    Django(二、静态文件的配置、链接数据库MySQL)
    【微服务】API治理发展历史与未来趋势
    详解欧拉计划第395题:毕达哥拉斯树
  • 原文地址:https://blog.csdn.net/weixin_46039719/article/details/127954478