资源简介
自适应积分算法,适用于对函数的积分。对在不同区间变化趋势不同的函数进行积分。算法收敛迅速。占用的程序空间很小。对数组的操作采用了堆栈的思想。C语言实现,易于在DSP,ARM,单片机上移植
代码片段和文件信息
#include
#include
#include
int i;
int N;
float A ;
float B;
float FD;
float FE;
float S1;
float S2;
float v1;
float v2;
float v3;
float v4;
float v5;
float v6;
float v7;
int v8;
float v9;
float APP;
float TOL;
float why;
float tol[11]={00000000000};
float a[11]={00000000000};
float h[11]={00000000000};
float FA[11]={00000000000};
float FC[11]={00000000000};
float FB[11]={00000000000};
float S[11]={00000000000};
int L[11]={00000000000};
int j;
int k;
float x[17]={11.11.251.31.51.61.751.922.12.252.42.52.62.752.83};
float y[17]={-0.5480.3230.98870.9870.3772-0.03-0.53626-0.85-0.958-0.998-0.965-0.8558-0.758-0.65-0.476-0.418-0.192};
float Q[17][17]={{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}{00000000000000000}};
/************************************************************************用Neville插值法求函数sin(10/x)输出的值,并计算最终要积分的函数[100/(x*x)]*sin(10/x)的函数值******************************/
float functionout(float xin)
{
float z;
float result;
float mid;
float mid2;
for(j=0;j<17;j++)
{
Q[j][0]=y[j];
}
for(j=1;j<=16;j++)
{
for(k=1;k<=j;k++)
{
Q[j][k]=(xin-x[j-k])*Q[j][
评论
共有 条评论