APP下载

基于细菌觅食算法求数值积分

2019-09-02郭德龙周锦程

科技视界 2019年10期

郭德龙 周锦程

【摘 要】在求解积分问题时,常常是运用微积分的基本定理得到其被积函数的原函数,之后采用牛顿-莱布尼茨公式完成求解。然而,很多被积函数的原函数时常不可以利用初等函数来表示,即便可以表示出,但计算也相当复杂。因此,本文提出利用细菌觅食算法再结合梯形求积公式的思想来求解数值积分,即将被积函数的积分区间进行随机分割选取分割点,然后将分割点进行优化求和得到最优解。最后数值仿真实验结果表明,求解精度较高、有较快的收敛速度。

【关键词】细菌觅食;数值积分;适应度;梯形公式

中图分类号: TM615 文献标识码: A文章编号: 2095-2457(2019)10-0112-003

DOI:10.19694/j.cnki.issn2095-2457.2019.10.047

Numerical Integration Based on Bacterial Foraging Algorithm.

GUO De-long1,2 ZHOU Jin-cheng1,2

(1.School of Mathematics and Statistics Qiannan Normal University for Nationalities,

Duyun Guizhou 558000,China)

(2.Key Laboratory of Complex Systems and Intelligent Computing,School of Mathematics and Statistics,

Duyun Guizhou 558000,China)

【Abstract】In solving the problem of integral,the original function of the integrand is often obtained by using the basic theorem of calculus,and then the Newton Leibniz formula is used to solve the problem.However,many primitive functions of integrable functions are often not expressed by elementary functions.Even though they can be expressed, computation is quite complicated.Therefore,this paper proposes to use the thought of the bacterial foraging algorithm and the trapezoid quadrature formula to solve the numerical integration,and then the integral interval of the integrand is randomly divided into the segmentation points,and then the optimal solution is obtained by optimizing the segmentation points. Finally, the numerical simulation results show that the algorithm has high accuracy and fast convergence speed.

【Key words】Bacterial foraging;Numerical integration;Fitness;Trapezoid formula

0 引言

在許多工作中经常会遇到数值积分问题,对于积分I=f(x)dx找到其被积函数f(x)的原函数F(x),再运用牛顿-莱布尼茨公式进行求解。但是许多积分原函数都不能用初等函数表达出来,例如(x=0),e;有些被积函数的原函数即使能用初等函数表达出来,在计算时也十分困难[1],例如f(x)=。求解积分的方式另外有牛顿-科特斯公式、辛普森公式、龙贝格求解公式、复合求解公式等[1]。在求解时,以上公式均有一个共用的不足,就是收敛速度慢,精度不高。因此,本文运用细菌觅食算法对这类问题进行求解,细菌觅食算法是等人在2002年给出的一种模拟优化计算方法——细菌觅食算法(),还被称作细菌觅食优化算法(,BFOA)[2]。该算法结合梯形公式的思想,通过Matlab编程在积分区间上随机选取分割点,作为被积函数计算的初始群体,然后利用细菌觅食算法将选取的分割点进行优化并求和得到最优解,该方法在计算过程上将传统公式的缺陷和不足进行了改进,并且能得到较高的结果。……

登录APP查看全文