• 【智能优化算法-正弦余弦算法】基于正弦余弦算法求解高维优化问题附matlab代码


    1 内容介绍

    SCA 算法是基于正弦余弦数学模型而提出一种新型优化算法一般来说智能优化算法初 始点往往随机选取一系列个体虽然无法保证一 次迭代就能找最优解但如果足够个 体和迭代次数并利用目标函数进行反复评价SCA 算法大大增加获得最优解概率

    2 仿真代码

    %  Sine Cosine Algorithm (SCA)  
    %                                                                                                     
    %  Main paper:                                                                                        
    %  S. Mirjalili, SCA: A Sine Cosine Algorithm for solving optimization problems
    %  Knowledge-Based Systems, DOI: http://dx.doi.org/10.1016/j.knosys.2015.12.022
    %_______________________________________________________________________________________________
    % You can simply define your cost function in a seperate file and load its handle to fobj 
    % The initial parameters that you need are:
    %__________________________________________
    % fobj = @YourCostFunction
    % dim = number of your variables
    % Max_iteration = maximum number of iterations
    % SearchAgents_no = number of search agents
    % lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
    % ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
    % If all the variables have equal lower bound you can just
    % define lb and ub as two single numbers

    % To run SCA: [Best_score,Best_pos,cg_curve]=SCA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj)
    %______________________________________________________________________________________________

    clear all 
    clc

    SearchAgents_no=30; % Number of search agents

    Function_name='F1'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)

    Max_iteration=1000; % Maximum numbef of iterations

    % Load details of the selected benchmark function
    [lb,ub,dim,fobj]=Get_Functions_details(Function_name);

    [Best_score,Best_pos,cg_curve]=SCA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);

    figure('Position',[284   214   660   290])
    %Draw search space
    subplot(1,2,1);
    func_plot(Function_name);
    title('Test function')
    xlabel('x_1');
    ylabel('x_2');
    zlabel([Function_name,'( x_1 , x_2 )'])
    grid off

    %Draw objective space
    subplot(1,2,2);
    semilogy(cg_curve,'Color','b')
    title('Convergence curve')
    xlabel('Iteration');
    ylabel('Best flame (score) obtained so far');

    axis tight
    grid off
    box on
    legend('SCA')

    display(['The best solution obtained by SCA is : ', num2str(Best_pos)]);
    display(['The best optimal value of the objective funciton found by SCA is : ', num2str(Best_score)]);

            

    ​​​​​​​3 运行结果

    4 参考文献

    [1]陈聪, 马良, 刘勇. 函数优化的量子正弦余弦算法[J]. 计算机应用研究, 2017, 34(11):5.

    [2]崔东文. 正弦余弦算法-投影寻踪水污染物总量分配模型[J]. 水资源保护, 2016, 32(6):8.

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

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

  • 相关阅读:
    CentOS下MySQL安装配置
    Linux 将文件中部分内容替换大小写
    什么是产品架构图?如何绘制产品架构图?
    Codeforces Round 900 (Div. 3)
    【每日一题】Day 38 选择题
    使用 C++20 实现异步网络访问
    闪烁霓虹灯文字动画
    C++ Reference: Standard C++ Library reference: C Library: cuchar: mbrtoc16
    【mysql】只使用数据库DB如何实现--预定系统(古法)电影院座位预定
    springboot 线程池参数解释
  • 原文地址:https://blog.csdn.net/matlab_dingdang/article/details/126107608