1、11、 秦九韶算法 2、二分法 3、拉格朗日插值 4、埃特金算法 5、复化梯形法6、复化辛甫生算法 7、二阶龙格库塔方法 8、四阶龙格库塔方法 9、改进的欧拉方法 10、迭代法 11、埃特金加速方法:12、牛顿迭代法 13、追赶法 14、雅克比迭代 15、蛋白质设计:17 高斯消去法:1、 秦九韶算法P11.3 利用秦九韶算法求多项式 ,在 x=3 时的值。程序:#include#includevoid main()float a100,v,x;int n,i,k;scanf(“%d%f“,for(i=0;i#includefloat fun(float);void main()float a
2、,b,c,x,y,y1;scanf(“%f%f%f“,y1=fun(a);dox=(a+b)/2;y=fun(x);if(y*y10)a=x;elseb=x;while(b-a)=c);printf(“%f,%fn“,x,y);float fun(float m)float n;n=m*m*m-m-1;return(n);运行结果:33、拉格朗日插值程序:#includemain()float a,b,t,x100,y100;int n,i,j,k;scanf(“%f%d“,for(i=0;i#includemain()4float a,b,c,x100,y100;int i,j,n,k;sc
3、anf(“%d%f“,for(i=0;i#includedouble fun(double);void main()double a,b,h,s,x,y;int n,k;scanf(“%lf%lf%d“,h=(b-a)/n;s=0;x=a;y=fun(x);for(k=1;k#includedouble fun(double);void main()double a,b,h,s,x,y;int n,k;scanf(“%lf%lf%d“,h=(b-a)/n;s=0;6x=a;y=fun(x);for(k=1;k#include7float fun(float,float);void main()
4、float h,x0,y0,x1,y1,k1,k2;int n,N;scanf(“%f%f%f%d“,n=1;for(n=1;n#includefloat fun(float,float);void main()float h,x0,y0,x1,y1,k1,k2,k3,k4;int n,N;scanf(“%f%f%f%d“,n=1;for(n=1;n#includefloat fun(float,float);void main()float x0,y0,h,x1,y1,yp,yc;int n,N;scanf(“%f%f%f%d“,for(n=1;n#includefloat fun(floa
5、t);void main()float x0,x1,c;int k,N;scanf(“%f%f%d“,for(k=1;k#includefloat fun(float);void main()float x0,x1,x2,c;int k,N;scanf(“%f%f%d“,for(k=1;k#includefloat fun(float);float ff(float);void main()float x0,x1,c;int k,N;scanf(“%f%f%d“,for(k=1;k#includevoid main()float a100,b100,c100,d100,t;int i,n;sc
6、anf(“%d“,14for(i=2;i=1;i-)di=di-ci*di+1;printf(“%fn“,di);运行结果:14、雅克比迭代程序:#include#include#define N 50 15#define M 4void main()double xM,yM,aMM,bM,dM,c,t;double ff(double ,int);int k,i,j,n;n=M-1;scanf(“%lf“, for(i=0;i17#include #include void main()printf(“横坐标 纵坐标 竖坐标n“); FILE *fp;char c100,x30007,y30
7、007,z30007;float a3000,b3000,d3000,r3000;int i,k=0,j,n=0,m,p;float X3000,Y3000,Z3000,s1=0,s2=0,s3=0,av_x,av_y,av_z;fp=fopen(“1a1c.pdb“,“r“);for(i=0;i=10000;i+)fgets(c,81,fp);if(c0=Aj6;j+)xkj=c32+j; printf(“%c“,xkj);printf(“ “);for(j=0;j6;j+) ykj=c40+j; printf(“%c“,ykj);printf(“ “);for(j=0;j6;j+) zkj
8、=c48+j;printf(“%c“,zkj);18printf(“ “);Xk=atof(xk);s1+=Xk;Yk=atof(yk);s2+=Yk;Zk=atof(zk);s3+=Zk;printf(“n“);k+;if(c77=C) n+;av_x=s1/k;av_y=s2/k;av_z=s3/k;printf(“共有:%dn“,k+1);printf(“av_x=%f,av_y=%f,av_z=%fn“,av_x,av_y,av_z);printf(“C 原子个数为:%dn“,n);printf(“平移原点后的坐标:n“);for(m=0;mk;m+)am=Xm-av_x;printf
9、(“%f “,am); bm=Ym-av_y;printf(“%f “,bm);dm=Zm-av_z;printf(“%f “,dm);rm=sqrt(am*am+bm*bm+dm*dm);printf(“%f “,rm);printf(“n“);1917 高斯消去法:#include “stdio.h“#include“math.h“main()double a33=1,1,1,0,4,-1,2,-2,1,b3=6,5,1,x10=0;int i,j,k,n=3;for(k=0;kn-1;k+) for(i=k+1;in;i+) for(j=k+1;jn;j+) aij=aij-akj*aik/akk;bi=bi-bk*aik/akk;xn-1=bn-1/an-1n-1;for(i=2;i=n;i+) k=n-i; for(j=k+1;jn;j+) xk+=akj*xj;xk=(bk-xk)/akk;for(k=0;kn;k+)printf(“x%d=%f“,k,xk);