计算方法2.doc

上传人:李医生 文档编号:7210228 上传时间:2020-11-06 格式:DOC 页数:6 大小:31KB
返回 下载 相关 举报
计算方法2.doc_第1页
第1页 / 共6页
计算方法2.doc_第2页
第2页 / 共6页
计算方法2.doc_第3页
第3页 / 共6页
计算方法2.doc_第4页
第4页 / 共6页
计算方法2.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《计算方法2.doc》由会员分享,可在线阅读,更多相关《计算方法2.doc(6页珍藏版)》请在三一文库上搜索。

1、一用y1.c1.please input zen guang ju zhen a45:2 2 1 -3 8 -2 1 -1 -3 1 8 -1 3 8 -1 10 44 3 810.000000 4.000000 4.000000 3.000000 8.0000000.000000 1.800000 -0.200000 -2.400000 2.600000-0.000000 -0.000000 -0.666667 -0.000000 -1.333334-0.000000 0.000000 -0.000000 -2.000000 4.000000x3=-2.000000x2=2.000001 x

2、1=-1.000000 x0=1.0000002. please input zen guang ju zhen a67:17.031 -0.651 -2.991 1.007 -1.006 0 0.23-1 34.211 -1 -2.1 6.3 -1.7 -22.322 0 0.5 13 -0.5 1 -1.5 54 4.501 3.11 -3.907 -61.705 12.17 8.999 240.236 0.101 -0.812 -0.017 -0.91 4.918 0.1 29.304 1 2 3 4.5 521.803 -117.81817.031000 -0.651000 -2.99

3、1000 1.007000 -1.006000 0.000000 0.230000-0.000000 34.172775 -1.175621 -2.040872 6.240932 -1.700000 -22.3084960.000000 0.000000 13.017201 -0.470139 0.908686 -1.475126 54.3264080.000000 0.000000 -0.000000 -61.883606 12.046144 8.821898 254.8531650.000000 -0.000000 0.000000 0.000000 5.371222 22.939346

4、-110.7740330.000000 0.000000 0.000000 -0.000000 0.000000 -20.946045 125.670898x5=-5.999744x4=5.000009 x3=-4.000276 x2=3.000023 x1=-2.000128 x0=0.9957883. please input zen guang ju zhen a89:17 1 4 3 -1 2 3 -7 71 2 10 -1 7 -2 1 1 -4 43 -1 1 -8 2 -5 2 -1 1 -11 2 4 1 -11 1 3 4 -1-37 1 3 1 7 -15 1 -2 4 -

5、61 -2 1 7-1 2 12 -1 8 52 3 4 5 1 2 8 -19 2 -73 5 1 1 1 -1 1 -7 10 2117.000000 1.000000 4.000000 3.000000 -1.000000 2.000000 3.000000 -7.000000 71.000000-0.000000 9.882353 -1.470588 6.647059 -1.882353 0.764706 0.647059 -3.176471 34.6470600.000000 -0.000000 -7.607142 1.464286 -4.857143 2.035714 -0.892

6、857 0.928571 -10.535714-0.000000 0.000000 -0.000000 -13.751174 1.150235 2.760563 3.262911 1.206573 -60.497650-0.000000 0.000000 0.000000 -0.000000 -14.724024 1.995675 -1.305565 5.949357 -99.4879840.000000 -0.000000 -0.000000 0.000000 -0.000000 13.830669 -1.353640 7.352926 64.294250-0.000000 -0.00000

7、0 0.000000 0.000000 -0.000000 0.000000 -19.780596 0.381110 -137.480103-0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000000 11.766468 57.449459x7=4.882473x6=7.044321 x5=2.742403 x4=8.476737 x3=7.758939 x2=-2.030829 x1=0.495473 x0=4.1992534. please input zen guang ju zhen a56:1 1 1 1 1 1

8、1 2 3 4 5 0 1 3 6 10 15 0 1 4 10 20 35 0 1 5 15 35 70 01.000000 1.000000 1.000000 1.000000 1.000000 1.0000000.000000 4.000000 14.000000 34.000000 69.000000 -1.0000000.000000 0.000000 -2.000000 -8.000000 -20.500000 -0.5000000.000000 0.000000 0.000000 -0.500000 -2.375000 0.1250000.000000 0.000000 0.00

9、0000 0.000000 -0.250000 -0.250000x4=1.000000x3=-5.000000 x2=10.000000 x1=-10.000000 x0=5.000000二用y2.c1.test4 -1 0 0 0 100 -1 4 -1 0 0 0 0 -1 4 -1 0 0 0 0 -1 4 -1 0 0 0 0 -1 4 200the result of LU fen jie is:4.000000 -1.000000 0.000000 0.000000 0.000000 100.000000-0.250000 3.750000 -1.000000 0.000000

10、0.000000 25.0000000.000000 -0.266667 3.733333 -1.000000 0.000000 6.6666670.000000 0.000000 -0.267857 3.732143 -1.000000 1.7857140.000000 0.000000 0.000000 -0.267943 3.732057 200.478470x04=53.717949x03=14.871795x02=5.769231x01=8.205129x00=27.051283Press any key to continue2.test-2 1 0 0 0 0 0 0 0 0 -

11、0.5 1 -2 1 0 0 0 0 0 0 0 -1.5 0 1 -2 1 0 0 0 0 0 0 -1.5 0 0 1 -2 1 0 0 0 0 0 -1.5 0 0 0 1 -2 1 0 0 0 0 -1.5 0 0 0 0 1 -2 1 0 0 0 -1.50 0 0 0 0 1 -2 1 0 0 -1.5 0 0 0 0 0 0 1 -2 1 0 -1.5 0 0 0 0 0 0 0 1 -2 1 -1.5 00 0 0 0 0 0 0 1 -2 -0.5the result of LU fen jie is:-2.000000 1.000000 0.000000 0.000000

12、0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.500000-0.500000 -1.500000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.7500000.000000 -0.666667 -1.333333 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -2.6666670.000000 0.000000 -0.750000 -1.2500

13、00 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -3.5000000.000000 0.000000 0.000000 -0.800000 -1.200000 1.000000 0.000000 0.000000 0.000000 0.000000 -4.3000000.000000 0.000000 0.000000 0.000000 -0.833333 -1.166667 1.000000 0.000000 0.000000 0.000000 -5.0833330.000000 0.000000 0.000000 0.000

14、000 0.000000 -0.857143 -1.142857 1.000000 0.000000 0.000000 -5.8571430.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.875000 -1.125000 1.000000 0.000000 -6.6250000.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.888889 -1.111111 1.000000 -7.3888880.000000 0.000000 0.000000 0.

15、000000 0.000000 0.000000 0.000000 0.000000 -0.900000 -1.100000 -7.149999x09=6.499999x08=12.499998x07=16.999998x06=19.999998x05=21.499996x04=21.499996x03=19.999996x02=16.999998x01=12.499999x00=6.500000Press any key to continue三1用y6.c. please input zone a,b1,2the integral value of sin(x)/x in zone 1.0

16、00000,2.000000 is I=0.659330Press any key to continue2. 所用程序为自编程序,编写内容如下:/*romberg method*/#include #include #define n 1float f(float x);float tt(int m,float t1,float t2);main()float t2020;int i,m,k;float p,a,b;printf(nplease input zone a,b);scanf(%f,%f,&a,&b);p=f(a);for(i=1;in;i+) p=p+2*f(a+i*(b-a)

17、/n);p=p+f(b);t00=(b-a)*p/(2*n);p=0;k=1;m=1;dofor(i=0;ipow(2,k-1);i+) p=p+f(a+(b-a)/(n*pow(2,k)+i*2*(b-a)/(n*pow(2,k);t0k=0.5*t0k-1+(b-a)*p/(pow(2,k)*n);p=0;for(i=1;i=20) printf(m20,stop acclerate,I=%f,tm-10);while(tm-21-tm-20)1e-6);printf(nthe integral value of 1/exp(x*x) in zone %f,%f is I=%f,a,b,t

18、m-10);getch();float f(float x)float y;if(x1e-10) y=1;elsey=1/exp(x*x);return y;float tt(int m,float t1,float t2)float tm;tm=(pow(4,m)*t2-t1)/(pow(4,m)-1);return tm;float f1(float x)float y;y=1/exp(x);return y;结果为please input zone a,b0,1the integral value of 1/exp(x*x) in zone 0.000000,1.000000 is I=

19、0.746834Pressany key to continue四用y4.c1. please input matrix a:2 0.5 0 0 0 0 0.5 2 0.5 0 0 0 0 0.5 2 0.6 0 0 0 0 0.6 2 0.7 0 0 0 0 0.7 2 0.8 00 0 0 0.8 20.8000000.6000000.5000000.3500000.3500000.3500000.3500000.2288370.2288370.2288370.2288370.0899190.0899190.0899190.0899190.0446550.0446550.0446550.0

20、446550.0073380.0073380.0073380.0073380.000594 the eigenvalue of matrix a r0=1.269217 the eigenvector of matrix a x0 is:(0.412822 -0.603366 0.468595 -0.067930 -0.331658 0.362401 ) the eigenvalue of matrix a r1=2.730783 the eigenvector of matrix a x1 is:(0.412847 0.603308 0.468706 0.067760 -0.331469 -

21、0.362530 ) the eigenvalue of matrix a r2=1.720198 the eigenvector of matrix a x2 is:(-0.568513 0.318142 0.390484 -0.447216 -0.155932 0.445851 ) the eigenvalue of matrix a r3=2.279802 the eigenvector of matrix a x3 is:(-0.568513 -0.318142 0.390484 0.447216 -0.155932 -0.445851 ) the eigenvalue of matr

22、ix a r4=0.826260 the eigenvector of matrix a x4 is:(0.079687 -0.186560 0.357543 -0.543513 0.604825 -0.412054 ) the eigenvalue of matrix a r5=3.173740 the eigenvector of matrix a x5 is:(0.079815 0.186372 0.357689 0.543492 0.604722 0.412167 )2please input matrix a:-2 1 0 0 0 1 -2 1 0 0 0 1 -2 1 0 0 0

23、1 -2 1 0 0 0 1 -21.0000001.0000000.7071070.6279630.4578050.4440370.4764100.3748860.3658700.2549410.2508020.1635390.1556290.0967430.0904810.0240100.0214430.0091050.0021700.0020800.0016920.0010440.000643 the eigenvalue of matrix a r0=-3.000000 the eigenvector of matrix a x0 is:(0.499999 -0.500000 0.00

24、0001 0.500000 -0.500001 ) the eigenvalue of matrix a r1=-1.000000 the eigenvector of matrix a x1 is:(0.499997 0.499987 -0.000010 -0.500013 -0.500003 ) the eigenvalue of matrix a r2=-3.732051 the eigenvector of matrix a x2 is:(0.288784 -0.500003 0.577239 -0.499997 0.288789 ) the eigenvalue of matrix a r3=-0.267949 the eigenvector of matrix a x3 is:(0.288685 0.500010 0.577350 0.499990 0.288665 ) the eigenvalue of matrix a r4=-2.000000 the eigenvector of matrix a x4 is:(0.577294 0.000095 -0.577462 0.000098 0.577295 )

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1