数值分析上机题Matlab(东南大学)1

合集下载

数值分析上机作业(MATLAB)

数值分析上机作业(MATLAB)
代矩阵。根据迭代矩阵的不同算法,可分为雅各比迭代方法和高斯-赛德尔方法。 (a)雅各比算法
将系数矩阵 A 分解为:A=L+U+D
Ax=b
⇔ (D + L +U)x = b ⇔ Dx = −(L + U )x + b ⇔ x = −D −1(L + U )x + D −1b x(k +1) = −D −1 (L + U ) x(k ) + D −1b
输入 A,b 和初始向量 x
迭代矩阵 BJ , BG

ρ(B) < 1?
按雅各比方法进行迭代

|| x (k+1) − x(k) ||< ε ?
按高斯-塞德尔法进行迭代

|| x(k+1) − x (k ) ||< ε ?
输出迭代结果
图 1 雅各布和高斯-赛德尔算法程序流程图
1.2 问题求解
按图 1 所示的程序流程,用 MATLAB 编写程序代码,具体见附录 1。解上述三个问题 如下
16
-0.72723528355328
0.80813484897616
0.25249261987171
17
-0.72729617968010
0.80805513082418
0.25253982509100
18
-0.72726173942623
0.80809395746552
0.25251408253388
0.80756312717373
8
-0.72715363032573
0.80789064377799
9
-0.72718652854079

东南大学数值分析上机作业汇总

东南大学数值分析上机作业汇总

东南大学数值分析上机作业汇总-标准化文件发布号:(9456-EUATWK-MWUB-WUNN-INNUL-DDQTY-KII数值分析上机报告院系:学号:姓名:目录作业1、舍入误差与有效数 (1)1、函数文件cxdd.m (1)2、函数文件cddx.m (1)3、两种方法有效位数对比 (1)4、心得 (2)作业2、Newton迭代法 (2)1、通用程序函数文件 (3)2、局部收敛性 (4)(1)最大δ值文件 (4)(2)验证局部收敛性 (4)3、心得 (6)作业3、列主元素Gauss消去法 (7)1、列主元Gauss消去法的通用程序 (7)2、解题中线性方程组 (7)3、心得 (9)作业4、三次样条插值函数 (10)1、第一型三次样条插值函数通用程序: (10)2、数据输入及计算结果 (12)作业1、舍入误差与有效数设∑=-=Nj N j S 2211,其精确值为⎪⎭⎫ ⎝⎛---1112321N N . (1)编制按从小到大的顺序11131121222-⋅⋅⋅+-+-=N S N ,计算N S 的通用程序;(2)编制按从大到小的顺序()12111111222-⋅⋅⋅+--+-=N N S N ,计算N S 的通用程序;(3)按两种顺序分别计算642101010,,S S S ,并指出有效位数; (4)通过本上机你明白了什么? 程序:1、函数文件cxdd.mfunction S=cxdd(N) S=0; i=2.0;while (i<=N) S=S+1.0/(i*i-1); i=i+1;endscript 运行结果(省略>>):S=cxdd(80) S=0.7375772、函数文件cddx.mfunction S=cddx (N) S=0; for i=N:-1:2 S=S+1/(i*i-1); endscript 运行结果(省略>>): S=cddx(80) S=0.7375773、两种方法有效位数对比精确值函数:function S=jqz(N)S=0.5*(1.5-1.0/N-1.0/(N+1));script运行结果(省略>>)4、心得本题重点体现了数值计算中“大数吃小数”的问题,由于计算机计算的截断特点,从大到小的计算会导致小数的有效数被忽略掉。

数值分析报告上机题课后作业全部-东南大学

数值分析报告上机题课后作业全部-东南大学

实用标准文案文档大全上机作业题报告2015.1.9 USER1.Chapter 11.1题目设S N =∑1j 2−1N j=2,其精确值为)11123(21+--N N 。

(1)编制按从大到小的顺序11131121222-+⋯⋯+-+-=N S N ,计算S N 的通用程序。

(2)编制按从小到大的顺序1211)1(111222-+⋯⋯+--+-=N N S N ,计算S N 的通用程序。

(3)按两种顺序分别计算64210,10,10S S S ,并指出有效位数。

(编制程序时用单精度) (4)通过本次上机题,你明白了什么?1.2程序1.3运行结果1.4结果分析按从大到小的顺序,有效位数分别为:6,4,3。

按从小到大的顺序,有效位数分别为:5,6,6。

可以看出,不同的算法造成的误差限是不同的,好的算法可以让结果更加精确。

当采用从大到小的顺序累加的算法时,误差限随着N 的增大而增大,可见在累加的过程中,误差在放大,造成结果的误差较大。

因此,采取从小到大的顺序累加得到的结果更加精确。

2.Chapter 22.1题目(1)给定初值0x 及容许误差ε,编制牛顿法解方程f(x)=0的通用程序。

(2)给定方程03)(3=-=x xx f ,易知其有三个根3,0,3321=*=*-=*x x x○1由牛顿方法的局部收敛性可知存在,0>δ当),(0δδ+-∈x 时,Newton 迭代序列收敛于根x2*。

试确定尽可能大的δ。

○2试取若干初始值,观察当),1(),1,(),,(),,1(),1,(0+∞+-----∞∈δδδδx 时Newton 序列的收敛性以及收敛于哪一个根。

(3)通过本上机题,你明白了什么?2.2程序2.3运行结果(1)寻找最大的δ值。

算法为:将初值x0在从0开始不断累加搜索精度eps,带入Newton迭代公式,直到求得的根不再收敛于0为止,此时的x0值即为最大的sigma值。

运行Find.m,得到在不同的搜索精度下的最大sigma值。

东南大学数值分析上机题答案

东南大学数值分析上机题答案

东南⼤学数值分析上机题答案数值分析上机题第⼀章17.(上机题)舍⼊误差与有效数设∑=-=Nj N j S 2211,其精确值为)111-23(21+-N N 。

(1)编制按从⼤到⼩的顺序1-1···1-311-21222N S N +++=,计算N S 的通⽤程序;(2)编制按从⼩到⼤的顺序121···1)1(111222-++--+-=N N S N ,计算NS 的通⽤程序;(3)按两种顺序分别计算210S ,410S ,610S ,并指出有效位数(编制程序时⽤单精度);(4)通过本上机题,你明⽩了什么?解:程序:(1)从⼤到⼩的顺序计算1-1···1-311-21222N S N +++=:function sn1=fromlarge(n) %从⼤到⼩计算sn1format long ; sn1=single(0); for m=2:1:nsn1=sn1+1/(m^2-1); end end(2)从⼩到⼤计算121···1)1(111222-++--+-=N N S N function sn2=fromsmall(n) %从⼩到⼤计算sn2format long ; sn2=single(0); for m=n:-1:2sn2=sn2+1/(m^2-1); end end(3)总的编程程序为: function p203()clear allformat long;n=input('please enter a number as the n:') sn=1/2*(3/2-1/n-1/(n+1));%精确值为sn fprintf('精确值为%f\n',sn);sn1=fromlarge(n);fprintf('从⼤到⼩计算的值为%f\n',sn1);sn2=fromsmall(n);fprintf('从⼩到⼤计算的值为%f\n',sn2);function sn1=fromlarge(n) %从⼤到⼩计算sn1 format long;sn1=single(0);for m=2:1:nsn1=sn1+1/(m^2-1);endendfunction sn2=fromsmall(n) %从⼩到⼤计算sn2 format long;sn2=single(0);for m=n:-1:2sn2=sn2+1/(m^2-1);endendend运⾏结果:从⽽可以得到N值真值顺序值有效位数2 100.740050 从⼤到⼩0.740049 5从⼩到⼤0.740050 64 100.749900 从⼤到⼩0.749852 3从⼩到⼤0.749900 66 100.749999 从⼤到⼩0.749852 3从⼩到⼤0.749999 6(4)感想:通过本上机题,我明⽩了,从⼩到⼤计算数值的精确位数⽐较⾼⽽且与真值较为接近,⽽从⼤到⼩计算数值的精确位数⽐较低。

基于MATLAB的数值分析编程上机作业1

基于MATLAB的数值分析编程上机作业1
%输出:H。H是Householder初等变换阵,H*x=y,使得y的第k+1项到最后项全为零;
%引用函数:
% holder2;示例[p,u]=holder2(x);
%使用举例:
% H=holderk(x,k)
%Define variables:
% x-输入的n维向量;
% n-n维向量x的维数;
% p-Householder初等变换阵的系数ρ;
H(k:n,k:n)=eye(n-k+1)-p\u*u';%计算H(k:n,k:n)=I-p\u*u';
3、计算实例:
>> x=[2,0,2,1]'
x =
2
0
2
1
>> H=holderk(x,3)
H =
1.0000 0 0 0
0 1.0000 0 0
0 0 -0.8944 -0.4472
0 0 -0.4472 0.8944
%HOLDERK给定向量x≠0,数k,计算初等反射阵Hk,使HkX=Y,其中Y的第k+1项到最后项全为零;
%程序功能:函数holderk给定向量x≠0,数k,计算初等反射阵Hk,使HkX=Y,%程序功能:函数holder2给定向量x≠0,计算Householder初等变换阵的p,u;
%输入:n维向量x,数k;
>> H*x
ans =
2.0000
0
-2.2361
0
二、用Householder变换法求矩阵A的正交分解A=QR。
1、基本原理:
任一实列满秩的m×n矩阵A,可以分解成两个矩阵的乘积,即A=QR,其中Q是具有法正交列向量的m×n矩阵,R是非奇异的n阶上三角阵。

东南大学出版社第二版《数值分析》上机作业答案(前三章)

东南大学出版社第二版《数值分析》上机作业答案(前三章)

for (i=k+1;i<N;i++) // { lik=a[i][k]/a[k][k]; //实施消去过程,得到上三角系数增广矩阵 for (j=k;j<M;j++) // { a[i][j]=a[i][j]‐lik*a[k][j]; // } } } cout<<"经列主元高斯消去法得到的数组为:"<<endl; // for (b=0;b<N;b++) // { cout<<endl; //输出经过列主元消去法处理过的系数增广矩阵 for (c=0;c<M;c++) { cout<<setw(7)<<a[b][c]; // } } cout<<endl; double x[N]; // double s; int f,g; x[N‐1]=a[N‐1][M‐1]/a[N‐1][N‐1]; // for (f=N‐2;f>=0;f‐‐) // { s=0; for (g=f+1;g<N;g++) //由上三角形的系数增广矩阵求出方程组的解 { s=s+a[f][g]*x[g]; // } x[f]=(a[f][N]‐s)/a[f][f]; // } cout<<"方程组的解为:"<<endl; for (b=0;b<N;b++) //输出方程组的解 {
1
当 n=10000 时,s3=0.7499 Press any key to continue (分析 S1 的 6 位数字中,有效位数为 4 位; S2 的所有数字都是有效数字。 ) 当 n=1000000 时,s1=‐14.2546 当 n=1000000 时,s2=‐14.2551 当 n=1000000 时,s3=0.749999 Press any key to continue (分析: S1 的 6 位数字中,没有有效数字; S2 的 6 位数字中,没有有效数字。 ) 由运行结果可知,当精度比较低时,按从大数开始累加到小数的计算结果的精度低于按从小数 累加到大数的计算结果的精度。 至于当 n=1000000 时,S1 和 S2 得出了负数结果,可能是由于循环次数过多,导致数据溢出, 从而得出错误结果。 习题 2 20.程序如下: //给定误差限为:0.5e‐6 //经过试算得当 delta 最大取道 0.7745966 时,迭代得到的根都收敛于 0 #include <iostream.h> #include <math.h> void main () { double x,u; int count=0; u=10.0; cout<<"请输入 x 的初值"<<endl; cin>>x; for (count=0;abs(u)>5;count++) { x=x‐(x*x*x‐3*x)/(3*(x*x‐1)); u=10000000*x; if(count>5000) { cout<<"迭代结果不收敛于 0!"<<endl; break; } } cout<<"x="<<x<<endl<<endl;

东南大学Matlab作业1

东南大学Matlab作业1

Matlab Worksheet 1Part A1.Get into Matlab: Use the diary command to record your activity in to a file: diarymydiary01.doc before you start your work. (And diary off to switch off your diary when you finish your work.)At the Command Window assign a v alue x=10, then use the Up Key ↑ to repeat the expression, editing it to show the effect of using a semicolon after the 10, namely x=10;Answers:>> x=10x =10>> x=10;2.Confirm whether the following names of variables are acceptable:a)Velocity Yes Nob)Velocity1 Yes Noc) Velocity.1 Yes Nod)Velocity_1 Yes Noe)Velocity-01 Yes Nof)velocityONE Yes Nog) 1velocity Yes NoAnswers: (1)legal variable names : a) Velocityb) Velocity1d) Velocity_1f) velocityONE(2) illegal variable names: c) Velocity.1e) Velocity-01g) 1velocity3. Assign two scalar variables x and y values x=1.5, y=2.3, then construct Matlab expressions for the following: a) yx y x z +=35 b) ()3/27y x z = c) ()y e x x z 25106/111log -⋅⎥⎦⎤⎢⎣⎡+-= d) )2cos()2sin(x e y x z x ππ+-=Answers:the result of the Command Window is:>> x=1.5;y=2.3 ;z1=5*x^3*y/(x+y)z2=(x^7*y^0.5)^(2/3)z3=(x^(1/6)/(log10(x^5-1))+1)*exp(-2*y)z4=sin(2*pi*x-y)+exp(x).*cos(2*pi*x)z1 =10.2138z2 =8.7566z3 =0.0232z4 =-3.73604. Assign two variables with complex values u=2+3j and v=4+10j and then construct expression for:a) vu b) j uv 2+ c) j u 2 d) u j ve π2- Answers:the result of the Command Window is:>> u=2+3j;v=4+10j;z1=u/vz2=u*v+2jz3=u/2jz4=v*exp(-j*2*pi*u)z1 =0.3276 - 0.0690iz2 =-22.0000 +34.0000iz3 =1.5000 - 1.0000iz4 =6.1421e+08 + 1.5355e+09ie the colon operator : to assign numerical values between 0 and 1 to vector arrayvariable a in steps of 0.1.Answer:the result of the Command Window is:>> V=0:0.1:1V =Columns 1 through 100 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.80000.9000Column 111.0000e linspace function to assign 20 values to vector variable y between 20 and 30.Answer:the result of the Command Window is:>> V=linspace(20,30,20)V =Columns 1 through 1020.0000 20.5263 21.0526 21.5789 22.1053 22.6316 23.1579 23.684224.2105 24.7368Columns 11 through 2025.2632 25.7895 26.3158 26.8421 27.3684 27.8947 28.4211 28.947429.4737 30.00007.Assign 20 values to a variable h increasing logarithmically between 10 and 1000.Next, use the colon operator to assign the first 10 elements of h to a variable p.Answers:>> v=logspace(1,3,20)v =1.0e+03 *Columns 1 through 100.0100 0.0127 0.0162 0.0207 0.0264 0.0336 0.0428 0.05460.0695 0.0886Columns 11 through 200.1129 0.1438 0.1833 0.2336 0.2976 0.3793 0.4833 0.61580.7848 1.0000>> p=v(1:10)p =10.0000 12.7427 16.2378 20.6914 26.3665 33.5982 42.8133 54.5559 69.5193 88.58678.Create 6 element row vector z with values 1.0 1.2 1.6 -1.7 1.8 1.9, then constructan expression for the sum of the 2nd 4th and 6th elements of z.Answers:>> z=[1.0 1.2 1.6 -1.7 1.8 1.9]x=z(2)+z(4)+z(6)z =1.0000 1.2000 1.6000 -1.7000 1.8000 1.9000x =1.4000e the colon operator to create a vector array x between 10 and -10in steps of -1,and second, an array vector y between 20 and -20 in steps -2 .a)Add x and y, b) subtract 10x from 5y.Answers:>> x=10:-1:-10y=20:-2:-20x =Columns 1 through 1710 9 8 7 6 5 4 3 2 1 0 -1 -2 -3 -4 -5 -6Columns 18 through 21-7 -8 -9 -10y =Columns 1 through 1720 18 16 14 12 10 8 6 4 2 0 -2 -4 -6 -8 -10 -12 Columns 18 through 21-14 -16 -18 -20>> x+yans =Columns 1 through 1730 27 24 21 18 15 12 9 6 3 0 -3 -6 -9 -12 -15 -18 Columns 18 through 21-21 -24 -27 -30>> 5*y-10*xans =Columns 1 through 170 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Columns 18 through 210 0 0 0e the size,length, who and whos commands to establish the size and length of xand y from Question 9, and use transpose operator ’ to convert vector x fromQuestion 9.Answers:>> size(x)length(x)ans =1 21ans =21>> whoYour variables are:ans x y>> whosName Size Bytes Class Attributesans 1x1 8 doublex 1x21 168 doubley 1x21 168 double>> z=x'z =10987654321-1-2-3-4-5-6-7-8-9-1011.Show that i f w=[ 2i 3i 3+i] the .’ operator creates the transpose. What effect does theoperator ’ applied to w have on its own?Answer:>> w=[ 2i 3i 3+i]w =0 + 2.0000i 0 + 3.0000i 3.0000 + 1.0000i>> x=w'x =0 - 2.0000i0 - 3.0000i3.0000 - 1.0000i>> y=w.'y =0 + 2.0000i0 + 3.0000i3.0000 + 1.0000ie the ones function to create a 4 by 6 array of 1’s. Considering just the shape ofthe resulting array, what do the expression ones(3), ones(5) and ones(7) all have in common?Answer:>> v=ones(4,6)v =1 1 1 1 1 11 1 1 1 1 11 1 1 1 1 11 1 1 1 1 1>> ones(3)ans =1 1 11 1 11 1 1>> ones(5)ans =1 1 1 1 11 1 1 1 11 1 1 1 11 1 1 1 11 1 1 1 1Ones(n)是n阶全为1的方阵13.Create using the rand function a 5 by 4 random matrix and assign it to matrix arrayvariable A and observe carefully what A(:,3) A(1:2) and A(3,[2 4]) mean.Answer:>> A=rand(5,4)A =0.8147 0.0975 0.1576 0.14190.9058 0.2785 0.9706 0.42180.1270 0.5469 0.9572 0.91570.9134 0.9575 0.4854 0.79220.6324 0.9649 0.8003 0.9595>> A(:,3)ans =0.15760.97060.95720.48540.8003>> A(1:2)ans =0.8147 0.9058>> A(3,[2 4])ans =0.5469 0.9157ing array subscripts, create an expression for the sum of the element in the topright-hand-corner of A and the bottom left-hand-corner of A. Also assign the 2nd column of A to a column vector b, and assign the 3rd row of A to a row vector d.Answer:>> A=rand(5,4)A =0.7513 0.9593 0.8407 0.35000.2551 0.5472 0.2543 0.19660.5060 0.1386 0.8143 0.25110.6991 0.1493 0.2435 0.61600.8909 0.2575 0.9293 0.4733>> x=A(1,4)+A(4,1)x =1.0491>> b=A(:,2)b =0.95930.54720.13860.14930.2575>> d=A(3,:)d =0.5060 0.1386 0.8143 0.2511>>diary off to switch off your diary now.15. Using the colon operator, assign a row vector array t, values between 0 and 10 in steps of 0.01. Use the ; operator to prevent displaying the information. Obtain the term-by-term values of functions:a) t e z 05.0-= b) )sin(05.0t e z t π-= c) )2cos()sin(05.0t t e z t ππ-=Answers:(1)home_work_1_A_15.mt=0:0.01:10;z1=exp(-0.05*t)z2=z1.*sin(pi*t)z3=z2.*cos(2*pi*t)(2)result>> home_work_1_A_15z1 =Columns 1 through 101.0000 0.9995 0.9990 0.9985 0.9980 0.9975 0.9970 0.9965 0.9960 0.9955Columns 11 through 200.9950 0.9945 0.9940 0.9935 0.9930 0.9925 0.9920 0.9915 0.9910 0.9905Columns 21 through 300.9900 0.9896 0.9891 0.9886 0.9881 0.9876 0.9871 0.9866 0.9861 0.9856Columns 31 through 400.9851 0.9846 0.9841 0.9836 0.9831 0.9827 0.9822 0.9817 0.9812 0.9807Columns 41 through 500.9802 0.9797 0.9792 0.9787 0.9782 0.9778 0.9773 0.9768 0.9763 0.9758Columns 51 through 600.9753 0.9748 0.9743 0.9738 0.9734 0.9729 0.9724 0.9719 0.9714 0.9709Columns 61 through 700.9704 0.9700 0.9695 0.9690 0.9685 0.9680 0.9675 0.9671 0.9666 0.9661Columns 71 through 800.9656 0.9651 0.9646 0.9642 0.9637 0.9632 0.9627 0.9622 0.9618 0.9613Columns 81 through 900.9608 0.9603 0.9598 0.9593 0.9589 0.9584 0.9579 0.9574 0.9570 0.9565Columns 91 through 1000.9560 0.9555 0.9550 0.9546 0.9541 0.9536 0.9531 0.9527 0.9522 0.9517Columns 101 through 1100.9512 0.9508 0.9503 0.9498 0.9493 0.9489 0.9484 0.9479 0.9474 0.9470Columns 111 through 1200.9465 0.9460 0.9455 0.9451 0.9446 0.9441 0.9436 0.9432 0.9427 0.9422Columns 121 through 1300.9418 0.9413 0.9408 0.9404 0.9399 0.9394 0.9389 0.9385 0.9380 0.9375Columns 131 through 1400.9371 0.9366 0.9361 0.9357 0.9352 0.9347 0.9343 0.9338 0.9333 0.9329Columns 141 through 1500.9324 0.9319 0.9315 0.9310 0.9305 0.9301 0.9296 0.9291 0.9287 0.9282Columns 151 through 1600.9277 0.9273 0.9268 0.9264 0.9259 0.9254 0.9250 0.9245 0.9240 0.9236Columns 161 through 1700.9231 0.9227 0.9222 0.9217 0.9213 0.9208 0.9204 0.9199 0.9194 0.9190Columns 171 through 1800.9185 0.9181 0.9176 0.9171 0.9167 0.9162 0.9158 0.9153 0.9148 0.9144Columns 181 through 1900.9139 0.9135 0.9130 0.9126 0.9121 0.9116 0.9112 0.9107 0.9103 0.9098Columns 191 through 2000.9094 0.9089 0.9085 0.9080 0.9076 0.9071 0.9066 0.9062 0.9057 0.9053Columns 201 through 2100.9048 0.9044 0.9039 0.9035 0.9030 0.9026 0.9021 0.9017 0.9012 0.9008Columns 211 through 2200.9003 0.8999 0.8994 0.8990 0.8985 0.8981 0.8976 0.8972 0.8967 0.8963Columns 221 through 2300.8958 0.8954 0.8949 0.8945 0.8940 0.8936 0.8932 0.8927 0.8923 0.8918Columns 231 through 2400.8914 0.8909 0.8905 0.8900 0.8896 0.8891 0.8887 0.8883 0.8878 0.8874Columns 241 through 2500.8869 0.8865 0.8860 0.8856 0.8851 0.8847 0.8843 0.8838 0.8834 0.8829Columns 251 through 2600.8825 0.8821 0.8816 0.8812 0.8807 0.8803 0.8799 0.8794 0.8790 0.8785Columns 261 through 2700.8781 0.8777 0.8772 0.8768 0.8763 0.8759 0.8755 0.8750 0.8746 0.8742Columns 271 through 2800.8737 0.8733 0.8728 0.8724 0.8720 0.8715 0.8711 0.8707 0.8702 0.8698Columns 281 through 2900.8694 0.8689 0.8685 0.8681 0.8676 0.8672 0.8668 0.8663 0.8659 0.8655Columns 291 through 3000.8650 0.8646 0.8642 0.8637 0.8633 0.8629 0.8624 0.8620 0.8616 0.8611Columns 301 through 3100.8607 0.8603 0.8598 0.8594 0.8590 0.8586 0.8581 0.8577 0.8573 0.8568Columns 311 through 3200.8564 0.8560 0.8556 0.8551 0.8547 0.8543 0.8538 0.8534 0.8530 0.8526Columns 321 through 3300.8521 0.8517 0.8513 0.8509 0.8504 0.8500 0.8496 0.8492 0.8487 0.8483Columns 331 through 3400.8479 0.8475 0.8470 0.8466 0.8462 0.8458 0.8454 0.8449 0.8445 0.8441Columns 341 through 3500.8437 0.8432 0.8428 0.8424 0.8420 0.8416 0.8411 0.8407 0.8403 0.8399Columns 351 through 3600.8395 0.8390 0.8386 0.8382 0.8378 0.8374 0.8369 0.8365 0.8361 0.8357Columns 361 through 3700.8353 0.8349 0.8344 0.8340 0.8336 0.8332 0.8328 0.8324 0.8319 0.8315Columns 371 through 3800.8311 0.8307 0.8303 0.8299 0.8294 0.8290 0.8286 0.8282 0.8278 0.8274Columns 381 through 3900.8270 0.8265 0.8261 0.8257 0.8253 0.8249 0.8245 0.8241 0.8237 0.8232Columns 391 through 4000.8228 0.8224 0.8220 0.8216 0.8212 0.8208 0.8204 0.8200 0.8195 0.8191Columns 401 through 4100.8187 0.8183 0.8179 0.8175 0.8171 0.8167 0.8163 0.8159 0.8155 0.8151Columns 411 through 4200.8146 0.8142 0.8138 0.8134 0.8130 0.8126 0.8122 0.8118 0.8114 0.8110Columns 421 through 4300.8106 0.8102 0.8098 0.8094 0.8090 0.8086 0.8082 0.8078 0.8073 0.8069Columns 431 through 4400.8065 0.8061 0.8057 0.8053 0.8049 0.8045 0.8041 0.8037 0.8033 0.8029Columns 441 through 4500.8025 0.8021 0.8017 0.8013 0.8009 0.8005 0.8001 0.7997 0.7993 0.7989Columns 451 through 4600.7985 0.7981 0.7977 0.7973 0.7969 0.7965 0.7961 0.7957 0.7953 0.7949Columns 461 through 4700.7945 0.7941 0.7937 0.7933 0.7929 0.7925 0.7922 0.7918 0.7914 0.7910Columns 471 through 4800.7906 0.7902 0.7898 0.7894 0.7890 0.7886 0.7882 0.7878 0.7874 0.7870Columns 481 through 4900.7866 0.7862 0.7858 0.7854 0.7851 0.7847 0.7843 0.7839 0.7835 0.7831Columns 491 through 5000.7827 0.7823 0.7819 0.7815 0.7811 0.7808 0.7804 0.7800 0.7796 0.7792Columns 501 through 5100.7788 0.7784 0.7780 0.7776 0.7772 0.7769 0.7765 0.7761 0.7757 0.7753Columns 511 through 5200.7749 0.7745 0.7741 0.7738 0.7734 0.7730 0.7726 0.7722 0.7718 0.7714Columns 521 through 5300.7711 0.7707 0.7703 0.7699 0.7695 0.7691 0.7687 0.7684 0.7680 0.7676Columns 531 through 5400.7672 0.7668 0.7664 0.7661 0.7657 0.7653 0.7649 0.7645 0.7641 0.7638Columns 541 through 5500.7634 0.7630 0.7626 0.7622 0.7619 0.7615 0.7611 0.7607 0.7603 0.7600Columns 551 through 5600.7596 0.7592 0.7588 0.7584 0.7581 0.7577 0.7573 0.7569 0.7565 0.7562Columns 561 through 5700.7558 0.7554 0.7550 0.7547 0.7543 0.7539 0.7535 0.7531 0.7528 0.7524Columns 571 through 5800.7520 0.7516 0.7513 0.7509 0.7505 0.7501 0.7498 0.7494 0.7490 0.7486Columns 581 through 5900.7483 0.7479 0.7475 0.7471 0.7468 0.7464 0.7460 0.7456 0.7453 0.7449Columns 591 through 6000.7445 0.7442 0.7438 0.7434 0.7430 0.7427 0.7423 0.7419 0.7416 0.7412Columns 601 through 6100.7408 0.7404 0.7401 0.7397 0.7393 0.7390 0.7386 0.7382 0.7379 0.7375Columns 611 through 6200.7371 0.7368 0.7364 0.7360 0.7357 0.7353 0.7349 0.7345 0.7342 0.7338Columns 621 through 6300.7334 0.7331 0.7327 0.7323 0.7320 0.7316 0.7312 0.7309 0.7305 0.7302Columns 631 through 6400.7298 0.7294 0.7291 0.7287 0.7283 0.7280 0.7276 0.7272 0.7269 0.7265Columns 641 through 6500.7261 0.7258 0.7254 0.7251 0.7247 0.7243 0.7240 0.7236 0.7233 0.7229Columns 651 through 6600.7225 0.7222 0.7218 0.7214 0.7211 0.7207 0.7204 0.7200 0.7196 0.7193Columns 661 through 6700.7189 0.7186 0.7182 0.7178 0.7175 0.7171 0.7168 0.7164 0.7161 0.7157Columns 671 through 6800.7153 0.7150 0.7146 0.7143 0.7139 0.7136 0.7132 0.7128 0.7125 0.7121Columns 681 through 6900.7118 0.7114 0.7111 0.7107 0.7103 0.7100 0.7096 0.7093 0.7089 0.7086Columns 691 through 7000.7082 0.7079 0.7075 0.7072 0.7068 0.7065 0.7061 0.7057 0.7054 0.7050Columns 701 through 7100.7047 0.7043 0.7040 0.7036 0.7033 0.7029 0.7026 0.7022 0.7019 0.7015Columns 711 through 7200.7012 0.7008 0.7005 0.7001 0.6998 0.6994 0.6991 0.6987 0.6984 0.6980Columns 721 through 7300.6977 0.6973 0.6970 0.6966 0.6963 0.6959 0.6956 0.6952 0.6949 0.6945Columns 731 through 7400.6942 0.6938 0.6935 0.6932 0.6928 0.6925 0.6921 0.6918 0.6914 0.6911Columns 741 through 7500.6907 0.6904 0.6900 0.6897 0.6894 0.6890 0.6887 0.6883 0.6880 0.6876Columns 751 through 7600.6873 0.6869 0.6866 0.6863 0.6859 0.6856 0.6852 0.6849 0.6845 0.6842Columns 761 through 7700.6839 0.6835 0.6832 0.6828 0.6825 0.6822 0.6818 0.6815 0.6811 0.6808Columns 771 through 7800.6805 0.6801 0.6798 0.6794 0.6791 0.6788 0.6784 0.6781 0.6777 0.6774Columns 781 through 7900.6771 0.6767 0.6764 0.6760 0.6757 0.6754 0.6750 0.6747 0.6744 0.6740Columns 791 through 8000.6737 0.6733 0.6730 0.6727 0.6723 0.6720 0.6717 0.6713 0.6710 0.6707Columns 801 through 8100.6703 0.6700 0.6697 0.6693 0.6690 0.6686 0.6683 0.6680 0.6676 0.6673Columns 811 through 8200.6670 0.6666 0.6663 0.6660 0.6656 0.6653 0.6650 0.6646 0.6643 0.6640Columns 821 through 8300.6637 0.6633 0.6630 0.6627 0.6623 0.6620 0.6617 0.6613 0.6610 0.6607Columns 831 through 8400.6603 0.6600 0.6597 0.6594 0.6590 0.6587 0.6584 0.6580 0.6577 0.6574Columns 841 through 8500.6570 0.6567 0.6564 0.6561 0.6557 0.6554 0.6551 0.6548 0.6544 0.6541Columns 851 through 8600.6538 0.6534 0.6531 0.6528 0.6525 0.6521 0.6518 0.6515 0.6512 0.6508Columns 861 through 8700.6505 0.6502 0.6499 0.6495 0.6492 0.6489 0.6486 0.6482 0.6479 0.6476Columns 871 through 8800.6473 0.6469 0.6466 0.6463 0.6460 0.6456 0.6453 0.6450 0.6447 0.6444Columns 881 through 8900.6440 0.6437 0.6434 0.6431 0.6427 0.6424 0.6421 0.6418 0.6415 0.6411Columns 891 through 9000.6408 0.6405 0.6402 0.6399 0.6395 0.6392 0.6389 0.6386 0.6383 0.6379Columns 901 through 9100.6376 0.6373 0.6370 0.6367 0.6364 0.6360 0.6357 0.6354 0.6351 0.6348Columns 911 through 9200.6344 0.6341 0.6338 0.6335 0.6332 0.6329 0.6325 0.6322 0.6319 0.6316Columns 921 through 9300.6313 0.6310 0.6307 0.6303 0.6300 0.6297 0.6294 0.6291 0.6288 0.6284Columns 931 through 9400.6281 0.6278 0.6275 0.6272 0.6269 0.6266 0.6263 0.6259 0.6256 0.6253Columns 941 through 9500.6250 0.6247 0.6244 0.6241 0.6238 0.6234 0.6231 0.6228 0.6225 0.6222Columns 951 through 9600.6219 0.6216 0.6213 0.6210 0.6206 0.6203 0.6200 0.6197 0.6194 0.6191Columns 961 through 9700.6188 0.6185 0.6182 0.6179 0.6175 0.6172 0.6169 0.6166 0.6163 0.6160Columns 971 through 9800.6157 0.6154 0.6151 0.6148 0.6145 0.6142 0.6139 0.6135 0.6132 0.6129Columns 981 through 9900.6126 0.6123 0.6120 0.6117 0.6114 0.6111 0.6108 0.6105 0.6102 0.6099Columns 991 through 10000.6096 0.6093 0.6090 0.6087 0.6084 0.6080 0.6077 0.6074 0.6071 0.6068Column 10010.6065z2 =Columns 1 through 100 0.0314 0.0627 0.0940 0.1251 0.1560 0.1868 0.2174 0.2477 0.2777Columns 11 through 200.3075 0.3369 0.3659 0.3946 0.4228 0.4506 0.4779 0.5047 0.5310 0.5568Columns 21 through 300.5819 0.6065 0.6305 0.6538 0.6764 0.6983 0.7196 0.7401 0.7598 0.7788Columns 31 through 400.7970 0.8144 0.8309 0.8467 0.8615 0.8755 0.8887 0.9009 0.9123 0.9227Columns 41 through 500.9322 0.9408 0.9485 0.9552 0.9609 0.9657 0.9696 0.9724 0.9744 0.9753Columns 51 through 600.9753 0.9743 0.9724 0.9695 0.9657 0.9609 0.9552 0.9485 0.9409 0.9324Columns 61 through 700.9229 0.9126 0.9014 0.8893 0.8763 0.8625 0.8479 0.8324 0.8161 0.7990Columns 71 through 800.7812 0.7626 0.7433 0.7232 0.7025 0.6811 0.6590 0.6363 0.6130 0.5892Columns 81 through 900.5647 0.5398 0.5143 0.4883 0.4619 0.4351 0.4079 0.3802 0.3523 0.3240Columns 91 through 1000.2954 0.2666 0.2375 0.2082 0.1788 0.1492 0.1195 0.0897 0.0598 0.0299Columns 101 through 1100.0000 -0.0299 -0.0597 -0.0894 -0.1190 -0.1484 -0.1777 -0.2068 -0.2356 -0.2642Columns 111 through 120-0.2925 -0.3205 -0.3481 -0.3753 -0.4022 -0.4286 -0.4546 -0.4801 -0.5051 -0.5296Columns 121 through 130-0.5536 -0.5769 -0.5997 -0.6219 -0.6434 -0.6643 -0.6845 -0.7040 -0.7227 -0.7408Columns 131 through 140-0.7581 -0.7746 -0.7904 -0.8054 -0.8195 -0.8328 -0.8453 -0.8570 -0.8678 -0.8777Columns 141 through 150-0.8868 -0.8949 -0.9022 -0.9086 -0.9140 -0.9186 -0.9223 -0.9250 -0.9268 -0.9277Columns 151 through 160-0.9277 -0.9268 -0.9250 -0.9222 -0.9186 -0.9140 -0.9086 -0.9022 -0.8950 -0.8869Columns 161 through 170-0.8779 -0.8681 -0.8574 -0.8459 -0.8336 -0.8204 -0.8065 -0.7918 -0.7763 -0.7601Columns 171 through 180-0.7431 -0.7254 -0.7070 -0.6880 -0.6682 -0.6479 -0.6269 -0.6053 -0.5831 -0.5604Columns 181 through 190-0.5372 -0.5134 -0.4892 -0.4645 -0.4394 -0.4139 -0.3880 -0.3617 -0.3351 -0.3082Columns 191 through 200-0.2810 -0.2536 -0.2259 -0.1981 -0.1701 -0.1419 -0.1136 -0.0853 -0.0569 -0.0284Columns 201 through 210-0.0000 0.0284 0.0568 0.0850 0.1132 0.1412 0.1690 0.1967 0.2241 0.2513Columns 211 through 2200.2782 0.3048 0.3311 0.3570 0.3826 0.4077 0.4324 0.4567 0.4805 0.5038Columns 221 through 2300.5266 0.5488 0.5705 0.5915 0.6120 0.6319 0.6511 0.6696 0.6875 0.7047Columns 231 through 2400.7211 0.7369 0.7519 0.7661 0.7795 0.7922 0.8041 0.8152 0.8255 0.8349Columns 241 through 2500.8435 0.8513 0.8582 0.8643 0.8695 0.8738 0.8773 0.8799 0.8816 0.8825Columns 251 through 2600.8825 0.8816 0.8799 0.8773 0.8738 0.8695 0.8643 0.8582 0.8514 0.8437Columns 261 through 2700.8351 0.8258 0.8156 0.8047 0.7929 0.7804 0.7672 0.7532 0.7384 0.7230Columns 271 through 2800.7069 0.6900 0.6725 0.6544 0.6356 0.6163 0.5963 0.5758 0.5547 0.5331Columns 281 through 2900.5110 0.4884 0.4654 0.4419 0.4180 0.3937 0.3690 0.3441 0.3188 0.2932Columns 291 through 3000.2673 0.2412 0.2149 0.1884 0.1618 0.1350 0.1081 0.0811 0.0541 0.0270Columns 301 through 3100.0000 -0.0270 -0.0540 -0.0809 -0.1077 -0.1343 -0.1608 -0.1871 -0.2132 -0.2391Columns 311 through 320-0.2646 -0.2900 -0.3150 -0.3396 -0.3639 -0.3878 -0.4113 -0.4344 -0.4571 -0.4792Columns 321 through 330-0.5009 -0.5220 -0.5426 -0.5627 -0.5822 -0.6011 -0.6193 -0.6370 -0.6540 -0.6703Columns 331 through 340-0.6860 -0.7009 -0.7152 -0.7287 -0.7415 -0.7536 -0.7649 -0.7754 -0.7852 -0.7942Columns 341 through 350-0.8024 -0.8098 -0.8163 -0.8221 -0.8271 -0.8312 -0.8345 -0.8370 -0.8386 -0.8395Columns 351 through 360-0.8395 -0.8386 -0.8370 -0.8345 -0.8312 -0.8271 -0.8221 -0.8164 -0.8098 -0.8025Columns 361 through 370-0.7944 -0.7855 -0.7758 -0.7654 -0.7543 -0.7424 -0.7298 -0.7164 -0.7024 -0.6877Columns 371 through 380-0.6724 -0.6564 -0.6397 -0.6225 -0.6046 -0.5862 -0.5672 -0.5477 -0.5277 -0.5071Columns 381 through 390-0.4861 -0.4646 -0.4427 -0.4203 -0.3976 -0.3745 -0.3510 -0.3273 -0.3032 -0.2789Columns 391 through 400-0.2543 -0.2294 -0.2044 -0.1792 -0.1539 -0.1284 -0.1028 -0.0772 -0.0515 -0.0257Columns 401 through 410-0.0000 0.0257 0.0514 0.0769 0.1024 0.1278 0.1530 0.1780 0.2028 0.2274Columns 411 through 4200.2517 0.2758 0.2996 0.3231 0.3462 0.3689 0.3913 0.4132 0.4348 0.4558Columns 421 through 4300.4764 0.4966 0.5162 0.5352 0.5538 0.5717 0.5891 0.6059 0.6221 0.6376Columns 431 through 4400.6525 0.6667 0.6803 0.6932 0.7054 0.7168 0.7276 0.7376 0.7469 0.7555Columns 441 through 4500.7632 0.7703 0.7765 0.7820 0.7867 0.7907 0.7938 0.7962 0.7977 0.7985Columns 451 through 4600.7985 0.7977 0.7961 0.7938 0.7906 0.7867 0.7820 0.7766 0.7703 0.7634Columns 461 through 4700.7556 0.7472 0.7380 0.7281 0.7175 0.7062 0.6942 0.6815 0.6682 0.6542Columns 471 through 4800.6396 0.6244 0.6085 0.5921 0.5751 0.5576 0.5396 0.5210 0.5019 0.4824Columns 481 through 4900.4624 0.4419 0.4211 0.3998 0.3782 0.3562 0.3339 0.3113 0.2884 0.2653Columns 491 through 5000.2419 0.2183 0.1945 0.1705 0.1464 0.1221 0.0978 0.0734 0.0490 0.0245Columns 501 through 5100.0000 -0.0245 -0.0489 -0.0732 -0.0974 -0.1215 -0.1455 -0.1693 -0.1929 -0.2163Columns 511 through 520-0.2395 -0.2624 -0.2850 -0.3073 -0.3293 -0.3509 -0.3722 -0.3931 -0.4136 -0.4336Columns 521 through 530-0.4532 -0.4723 -0.4910 -0.5091 -0.5268 -0.5439 -0.5604 -0.5764 -0.5917 -0.6065Columns 531 through 540-0.6207 -0.6342 -0.6471 -0.6594 -0.6710 -0.6819 -0.6921 -0.7016 -0.7105 -0.7186Columns 541 through 550-0.7260 -0.7327 -0.7387 -0.7439 -0.7484 -0.7521 -0.7551 -0.7573 -0.7588 -0.7596Columns 551 through 560-0.7596 -0.7588 -0.7573 -0.7551 -0.7521 -0.7483 -0.7439 -0.7387 -0.7328 -0.7261Columns 561 through 570-0.7188 -0.7107 -0.7020 -0.6926 -0.6825 -0.6717 -0.6603 -0.6483 -0.6356 -0.6223Columns 571 through 580-0.6084 -0.5939 -0.5789 -0.5632 -0.5471 -0.5304 -0.5132 -0.4956 -0.4774 -0.4588Columns 581 through 590-0.4398 -0.4204 -0.4005 -0.3803 -0.3598 -0.3389 -0.3176 -0.2961 -0.2744 -0.2523Columns 591 through 600-0.2301 -0.2076 -0.1850 -0.1622 -0.1392 -0.1162 -0.0930 -0.0698 -0.0466 -0.0233Columns 601 through 610-0.0000 0.0233 0.0465 0.0696 0.0927 0.1156 0.1384 0.1610 0.1835 0.2058Columns 611 through 6200.2278 0.2496 0.2711 0.2923 0.3132 0.3338 0.3540 0.3739 0.3934 0.4125Columns 621 through 6300.4311 0.4493 0.4670 0.4843 0.5011 0.5173 0.5331 0.5482 0.5629 0.5769Columns 631 through 6400.5904 0.6033 0.6156 0.6272 0.6382 0.6486 0.6584 0.6674 0.6758 0.6836Columns 641 through 6500.6906 0.6970 0.7026 0.7076 0.7119 0.7154 0.7183 0.7204 0.7218 0.7225Columns 651 through 6600.7225 0.7218 0.7204 0.7182 0.7154 0.7118 0.7076 0.7027 0.6970 0.6907Columns 661 through 6700.6837 0.6761 0.6678 0.6588 0.6492 0.6390 0.6281 0.6166 0.6046 0.5919Columns 671 through 6800.5787 0.5649 0.5506 0.5358 0.5204 0.5046 0.4882 0.4714 0.4542 0.4365Columns 681 through 6900.4184 0.3999 0.3810 0.3618 0.3422 0.3223 0.3021 0.2817 0.2610 0.2400Columns 691 through 7000.2189 0.1975 0.1760 0.1543 0.1324 0.1105 0.0885 0.0664 0.0443 0.0221Columns 701 through 7100.0000 -0.0221 -0.0442 -0.0662 -0.0881 -0.1100 -0.1316 -0.1532 -0.1745 -0.1957Columns 711 through 720-0.2167 -0.2374 -0.2579 -0.2781 -0.2979 -0.3175 -0.3368 -0.3557 -0.3742 -0.3923Columns 721 through 730-0.4101 -0.4274 -0.4443 -0.4607 -0.4766 -0.4921 -0.5071 -0.5215 -0.5354 -0.5488Columns 731 through 740-0.5616 -0.5739 -0.5855 -0.5966 -0.6071 -0.6170 -0.6262 -0.6349 -0.6429 -0.6502Columns 741 through 750-0.6569 -0.6630 -0.6684 -0.6731 -0.6771 -0.6805 -0.6832 -0.6853 -0.6866 -0.6873Columns 751 through 760-0.6873 -0.6866 -0.6852 -0.6832 -0.6805 -0.6771 -0.6731 -0.6684 -0.6630 -0.6570Columns 761 through 770-0.6504 -0.6431 -0.6352 -0.6267 -0.6175 -0.6078 -0.5975 -0.5866 -0.5751 -0.5631Columns 771 through 780-0.5505 -0.5374 -0.5238 -0.5096 -0.4950 -0.4799 -0.4644 -0.4484 -0.4320 -0.4152Columns 781 through 790-0.3980 -0.3804 -0.3624 -0.3441 -0.3255 -0.3066 -0.2874 -0.2680 -0.2482 -0.2283Columns 791 through 800-0.2082 -0.1879 -0.1674 -0.1467 -0.1260 -0.1051 -0.0842 -0.0632 -0.0421 -0.0211Columns 801 through 810-0.0000 0.0210 0.0420 0.0630 0.0838 0.1046 0.1252 0.1457 0.1660 0.1862Columns 811 through 8200.2061 0.2258 0.2453 0.2645 0.2834 0.3020 0.3204 0.3383 0.3560 0.3732Columns 821 through 8300.3901 0.4066 0.4226 0.4382 0.4534 0.4681 0.4823 0.4961 0.5093 0.5220Columns 831 through 8400.5342 0.5459 0.5570 0.5675 0.5775 0.5869 0.5957 0.6039 0.6115 0.6185Columns 841 through 8500.6249 0.6306 0.6358 0.6403 0.6441 0.6473 0.6499 0.6518 0.6531 0.6538Columns 851 through 8600.6538 0.6531 0.6518 0.6499 0.6473 0.6441 0.6403 0.6358 0.6307 0.6250Columns 861 through 8700.6187 0.6117 0.6042 0.5961 0.5874 0.5782 0.5683 0.5580 0.5471 0.5356Columns 871 through 8800.5236 0.5112 0.4982 0.4848 0.4709 0.4565 0.4418 0.4265 0.4109 0.3949Columns 881 through 8900.3786 0.3618 0.3447 0.3273 0.3096 0.2917 0.2734 0.2549 0.2361 0.2172Columns 891 through 9000.1980 0.1787 0.1592 0.1396 0.1198 0.1000 0.0801 0.0601 0.0401 0.0200Columns 901 through 9100.0000 -0.0200 -0.0400 -0.0599 -0.0798 -0.0995 -0.1191 -0.1386 -0.1579 -0.1771Columns 911 through 920-0.1961 -0.2148 -0.2333 -0.2516 -0.2696 -0.2873 -0.3047 -0.3218 -0.3386 -0.3550Columns 921 through 930-0.3711 -0.3867 -0.4020 -0.4168 -0.4313 -0.4453 -0.4588 -0.4719 -0.4845 -0.4966Columns 931 through 940-0.5082 -0.5193 -0.5298 -0.5399 -0.5493 -0.5583 -0.5667 -0.5745 -0.5817 -0.5883Columns 941 through 950-0.5944 -0.5999 -0.6048 -0.6090 -0.6127 -0.6158 -0.6182 -0.6201 -0.6213 -0.6219Columns 951 through 960-0.6219 -0.6213 -0.6200 -0.6182 -0.6157 -0.6127 -0.6090 -0.6048 -0.5999 -0.5945Columns 961 through 970-0.5885 -0.5819 -0.5748 -0.5670 -0.5588 -0.5500 -0.5406 -0.5308 -0.5204 -0.5095Columns 971 through 980-0.4981 -0.4863 -0.4739 -0.4611 -0.4479 -0.4343 -0.4202 -0.4057 -0.3909 -0.3757Columns 981 through 990-0.3601 -0.3442 -0.3279 -0.3114 -0.2945 -0.2774 -0.2601 -0.2425 -0.2246 -0.2066Columns 991 through 1000-0.1884 -0.1700 -0.1514 -0.1328 -0.1140 -0.0951 -0.0762 -0.0572 -0.0381 -0.0191Column 1001-0.0000z3 =Columns 1 through 100 0.0313 0.0622 0.0923 0.1212 0.1484 0.1737 0.1967 0.2171 0.2345Columns 11 through 200.2488 0.2596 0.2667 0.2701 0.2695 0.2649 0.2561 0.2432 0.2261 0.2050Columns 21 through 300.1798 0.1508 0.1181 0.0819 0.0425 0.0000 -0.0452 -0.0928 -0.1424 -0.1937Columns 31 through 40-0.2463 -0.2998 -0.3538 -0.4079 -0.4616 -0.5146 -0.5665 -0.6167 -0.6650 -0.7110Columns 41 through 50-0.7542 -0.7944 -0.8311 -0.8643 -0.8934 -0.9184 -0.9391 -0.9552 -0.9667 -0.9734Columns 51 through 60-0.9753 -0.9724 -0.9647 -0.9524 -0.9353 -0.9139 -0.8881 -0.8582 -0.8245 -0.7872Columns 61 through 70。

数值计算上机实习题目(matlab编程)

数值计算上机实习题目(matlab编程)

数值计算上机实习题目(matlab编程)非线性方程求根一、实验目的本次实验通过上机实习,了解迭代法求解非线性方程数值解的过程和步骤。

二、实验要求1、用迭代法求方程230x x e -=的根。

要求:确定迭代函数?(x),使得x=?(x),并求一根。

提示:构造迭代函数2ln(3)x ?=。

2、对上面的方程用牛顿迭代计算。

3、用割线法求方程3()310f x x x =--=在02x =附近的根。

误差限为410-,取012, 1.9x x ==。

三、实验内容1、(1)首先编写迭代函数,记为iterate.mfunction y=iterate(x)x1=g(x); % x 为初始值。

n=1;while(abs(x1-x)>=1.0e-6)&(n<=1000) % 迭代终止的原则。

x=x1;x1=g(x);n=n+1;endx1 %近似根n %迭代步数(2)后编制函数文件?(x),记为g.mfunction y=g(x)y=log(3*x.^2);(3)设初始值为0、3、-3、1000,观察初始值对求解的影响。

将结果记录在文档中。

>>iterate(0)>>iterate(3) 等等2、(1)首先编制牛顿迭代函数如下,记为newton.mfunction y=newton(x0)x1=x0-fc(x0)/df(x0); % 牛顿迭代格式n=1;while(abs(x1-x0)>=1.0e-6)&(n<=1000000) % 迭代终止的原则。

x0=x1;x1=x0-fc(x0)/df(x0);n=n+1;endx1 %近似根n %迭代步数(2)对题目中的方程编制函数文件,记为fc.mfunction y=fc(x)y=3*x.^2-exp(x)编制函数的导数文件,记为df.mfunction y=df(x)y=6*x-exp(x)(3)在MATLAB 命令窗计算,当设初始值为0时,newton(0);给定不同的初始值,观察用牛顿法求解时所需要的迭代步数,并与上面第一题的迭代步数比较。

最新东南大学数值分析上机题matlab(前三章)

最新东南大学数值分析上机题matlab(前三章)

数值分析上机题第一章(17题)(1)从2依次累加到N的程序function sn = sum1( n )sn=0;sn=single(sn);for i=2:nai=1/(i^2-1);sn=sn+ai;endend(2)从N依次累加到2的程序function sn = sum2( n )sn=0;sn=single(sn);for i=n:-1:2ai=1/(i^2-1);sn=sn+ai;endend(3)编制求精确值的求和函数sum0function sn = sum0( n )sn=0;sn=single(sn);sn=1/2*(3/2-1/n-1/(n+1));end按第一种顺序得到的值及有效位数如下:N=100时sn0=sum0(100);sn=sum1(100)n=fix(-log10(2*abs(sn-sn0)))得到:sn =0.7400495 n =7N=10e4时sn0=sum0(10e4);sn=sum1(10e4)n=fix(-log10(2*abs(sn-sn0)))得到:sn =0.7498521 n =3N=10e6时sn0=sum0(10e6);sn=sum1(10e6)n=fix(-log10(2*abs(sn-sn0)))得到:sn =0.7498521 n =3按第二种顺序得到的值及有效位数如下:N=100时sn0=sum0(100);sn=sum2(100)n=fix(-log10(2*abs(sn-sn0)))得到:sn =0.7400495 n =7N=10e4时sn0=sum0(10e4);sn=sum2(10e4)n=fix(-log10(2*abs(sn-sn0)))得到:sn =0.7499900 n =7N=10e6时sn0=sum0(10e6);sn=sum2(10e6)n=fix(-log10(2*abs(sn-sn0)))得到:sn =0.7499999 n =7(4)通过这道上机题,我明白了,应用计算机进行求和运算时,求和的顺序不同对结果的精度是有影响的。

数值分析上机题 舍入误差与有效数

数值分析上机题  舍入误差与有效数
7位
(5)通过上述分析可以看出:按从小到大的顺序计算所得的结果与真值接近,而按从大到小的顺序计算所得的结果与真值的误差较大,且有效位数较前者少。
原因:这是由于机器数在进行加法运算时,首先比较两数的阶码,将阶码较小的尾数向右移位,每移一位阶码加一,直至其阶码与另一数的阶码一致为止,且将移位后的尾数多于计算机字长的部分进行四舍五入,之后对尾数进行加减运算,最后将尾数写成规格化的形式,当从大到小的顺序进行计算式,由于越到后面数字越小,就会产生大数吃小数的情况,从而产生误差的累积,最后使计算结果的不准确。
解:(1)从大到小的matlab程序:
functions=myfun1(N)
formatlong;
k=2;
s=single(0);
fork=2:1:N
a=1/(k*k-1);
s=a+s;
end
end
(2)从小到大的matlab程序
functions=myfun2(N)
formatlong;
s=single(0);
fori=N:-1:2
a=1/(i*i-1);
s=a+s;
end
真值
有效位数
0.7400495
0.7400495
0.7400495
大小
7位
小大
7位
0.7498521
0.7499000
0.7499000
大小
4位
小大
7位
0.7498521
0.7499990
0.749999
大小
4位
小大
舍入误差与有效数
东南大学机械工程学院
设SN= ,其精确值为 )。
(1)编制按从大到小的顺序SN= + + +……+ ,计算SN通用的程序;

东南大学matlab课程作业

东南大学matlab课程作业

Matlab Worksheet 1Part A1. Get into Matlab: Use the diary command to record your activity in to a file: diary mydiary01.doc before you start your work. (And diary off to switch off your diary when you finish your work.)At the Command Window assign a v alue x=10, then use the Up Key ↑ to repeat the expression, editing it to show the effect of using a semicolon after the 10, namely x=10;Answers:>> x=10x =10>> x=10;2. Confirm whether the following names of variables are acceptable: a) Velocity Yes Nob) Velocity1 Yes Noc) Velocity.1 Yes Nod) Velocity_1 Yes Noe) Velocity-01 Yes Nof) velocityONE Yes Nog) 1velocity Yes No3. Assign two scalar variables x and y values x=1.5, y=2.3, then construct Matlab expressions for the following: a) y x y x z +=35 b) ()3/27y x z = c) ()y e x x z 25106/111log -⋅⎥⎦⎤⎢⎣⎡+-= d) )2cos()2sin(x e y x z x ππ+-=Answers:>> x=1.5;y=2.3z1=5*x^3*y/(x+y)z2=(x^7*y^0.5)^(2/3)z3=(x^(1/6)/(log10(x^5-1))+1)*exp(-2*y)z4=sin(2*pi*x-y)+exp(x).*cos(2*pi*x)z1 =10.2138z2 =8.7566z3 =0.0232z4 =-3.73604. Assign two variables with complex values u=2+3j and v=4+10j and then construct expression for:a) v u b) j uv 2+ c) ju 2 d) u j ve π2- Answers:>> u=2+3j;v=4+10j;z1=u/vz2=u*v+2jz3=u/2jz4=v*exp(-j*2*pi*u)z1 =0.3276 - 0.0690iz2 =-22.0000 +34.0000iz3 =1.5000 - 1.0000iz4 =6.1421e+08 + 1.5355e+09ie the colon operator : to assign numerical values between 0 and 1 to vector arrayvariable a in steps of 0.1.Answer:>> V=0:0.1:1V =Columns 1 through 100 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.80000.9000Column 111.0000e linspace function to assign 20 values to vector variable y between 20 and 30.Answer:>> V=linspace(20,30,20)V =Columns 1 through 1020.0000 20.5263 21.0526 21.5789 22.1053 22.6316 23.1579 23.684224.2105 24.7368Columns 11 through 2025.2632 25.7895 26.3158 26.8421 27.3684 27.8947 28.4211 28.947429.4737 30.00007.Assign 20 values to a variable h increasing logarithmically between 10 and 1000.Next, use the colon operator to assign the first 10 elements of h to a variable p.Answers:>> v=logspace(1,3,20)v =1.0e+03 *Columns 1 through 100.0100 0.0127 0.0162 0.0207 0.0264 0.0336 0.0428 0.05460.0695 0.0886Columns 11 through 200.1129 0.1438 0.1833 0.2336 0.2976 0.3793 0.4833 0.61580.7848 1.0000>> p=v(1:10)p =10.0000 12.7427 16.2378 20.6914 26.3665 33.5982 42.8133 54.5559 69.519388.58678.Create 6 element row vector z with values 1.0 1.2 1.6 -1.7 1.8 1.9, then constructan expression for the sum of the 2nd 4th and 6th elements of z.Answers:>> z=[1.0 1.2 1.6 -1.7 1.8 1.9]x=z(2)+z(4)+z(6)z =1.0000 1.2000 1.6000 -1.7000 1.8000 1.9000x =1.4000e the colon operator to create a vector array x between 10 and -10in steps of -1,and second, an array vector y between 20 and -20 in steps -2 .a)Add x and y, b) subtract 10x from 5y.Answers:>> x=10:-1:-10y=20:-2:-20x =Columns 1 through 1710 9 8 7 6 5 4 3 2 1 0 -1 -2 -3 -4 -5 -6Columns 18 through 21-7 -8 -9 -10y =Columns 1 through 1720 18 16 14 12 10 8 6 4 2 0 -2 -4 -6 -8 -10 -12Columns 18 through 21-14 -16 -18 -20>> x+yans =Columns 1 through 1730 27 24 21 18 15 12 9 6 3 0 -3 -6 -9 -12 -15 -18Columns 18 through 21-21 -24 -27 -30>> 5*y-10*xans =Columns 1 through 170 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Columns 18 through 210 0 0 0e the size,length, who and whos commands to establish the size and length of xand y from Question 9, and use transpose operator ’ to convert vector x fromQuestion 9.Answers:>> size(x)length(x)ans =1 21ans =21>> whoYour variables are:ans x y>> whosName Size Bytes Class Attributesans 1x1 8 doublex 1x21 168 doubley 1x21 168 double>> z=x'z =10987654321-1-2-3-4-5-6-7-8-9-1011.Show that if w=[ 2i 3i 3+i] the .’ operator creates the transpose. What effect does theoperator ’ applied to w have on its own?Answer:>> w=[ 2i 3i 3+i]w =0 + 2.0000i 0 + 3.0000i 3.0000 + 1.0000i>> x=w'x =0 - 2.0000i0 - 3.0000i3.0000 - 1.0000i>> y=w.'y =0 + 2.0000i0 + 3.0000i3.0000 + 1.0000ie the ones function to create a 4 by 6 array of 1’s. Considering just the shape ofthe resulting array, what do the expression ones(3), ones(5) and ones(7) all have in common?Answer:>> v=ones(4,6)v =1 1 1 1 1 11 1 1 1 1 11 1 1 1 1 11 1 1 1 1 1>> ones(3)ans =1 1 11 1 11 1 1>> ones(5)ans =1 1 1 1 11 1 1 1 11 1 1 1 11 1 1 1 11 1 1 1 1Ones(n)是n阶全为1的方阵13.Create using the rand function a 5 by 4 random matrix and assign it to matrix arrayvariable A and observe carefully what A(:,3) A(1:2) and A(3,[2 4]) mean.Answer:>> A=rand(5,4)A =0.8147 0.0975 0.1576 0.14190.9058 0.2785 0.9706 0.42180.1270 0.5469 0.9572 0.91570.9134 0.9575 0.4854 0.79220.6324 0.9649 0.8003 0.9595>> A(:,3)ans =0.15760.97060.95720.48540.8003>> A(1:2)ans =0.8147 0.9058>> A(3,[2 4])ans =0.5469 0.9157ing array subscripts, create an expression for the sum of the element in the topright-hand-corner of A and the bottom left-hand-corner of A. Also assign the 2nd column of A to a column vector b, and assign the 3rd row of A to a row vector d.Answer:>> A=rand(5,4)A =0.7513 0.9593 0.8407 0.35000.2551 0.5472 0.2543 0.19660.5060 0.1386 0.8143 0.25110.6991 0.1493 0.2435 0.61600.8909 0.2575 0.9293 0.4733>> x=A(1,4)+A(4,1)x =1.0491>> b=A(:,2)b =0.95930.54720.13860.14930.2575>> d=A(3,:)d =0.5060 0.1386 0.8143 0.2511>>diary off to switch off your diary now.15. Using the colon operator, assign a row vector array t, values between 0 and 10 in steps of 0.01. Use the ; operator to prevent displaying the information. Obtain the term-by-term values of functions:a) t e z 05.0-= b) )sin(05.0t e z t π-= c) )2cos()sin(05.0t t e z t ππ-=Answers:0.5874 0.6186 0.6473 0.6731 0.6958 0.7153 0.7314 0.7439 0.75280.7581Columns 551 through 5600.7596 0.7573 0.7513 0.7417 0.7284 0.7117 0.6916 0.6684 0.64210.6131Columns 561 through 5700.5815 0.5476 0.5117 0.4741 0.4350 0.3948 0.3538 0.3123 0.27060.2291Columns 571 through 5800.1880 0.1477 0.1085 0.0706 0.0344 0.0000 -0.0322 -0.0621-0.0895 -0.1141Columns 581 through 590-0.1359 -0.1548 -0.1705 -0.1832 -0.1928 -0.1992 -0.2025 -0.2027 - 0.2000 -0.1944Columns 591 through 600-0.1861 -0.1753 -0.1621 -0.1467 -0.1295 -0.1105 -0.0901 -0.0686 -0.0462 -0.0232Columns 601 through 610-0.0000 0.0232 0.0461 0.0684 0.0898 0.1099 0.1287 0.1457 0.1608 0.1737Columns 611 through 6200.1843 0.1923 0.1976 0.2001 0.1997 0.1962 0.1897 0.1801 0.1675 0.1518Columns 621 through 6300.1332 0.1117 0.0875 0.0607 0.0315 -0.0000 -0.0335 -0.0687 -0.1055 -0.1435Columns 631 through 640-0.1824 -0.2221 -0.2621 -0.3022 -0.3420 -0.3813 -0.4197 -0.4569 -0.4927 -0.5267Columns 641 through 650-0.5587 -0.5885 -0.6157 -0.6403 -0.6619 -0.6804 -0.6957 -0.7076 -0.7161 -0.7211Columns 651 through 660-0.7225 -0.7204 -0.7147 -0.7055 -0.6929 -0.6770 -0.6579 -0.6358 -0.6108 -0.5832Columns 661 through 670-0.5532 -0.5209 -0.4868 -0.4510 -0.4138 -0.3756 -0.3366 -0.2971 -0.2574 -0.2179Columns 671 through 680-0.1788 -0.1405 -0.1032 -0.0672 -0.0327 -0.0000 0.0307 0.05910.0851 0.1085Columns 681 through 6900.1293 0.1472 0.1622 0.1743 0.1834 0.1895 0.1926 0.1928 0.1902 0.1849Columns 691 through 7000.1771 0.1667 0.1542 0.1396 0.1231 0.1051 0.0857 0.0652 0.0439 0.0221Columns 701 through 7100.0000 -0.0221 -0.0439 -0.0650 -0.0854 -0.1046 -0.1224 -0.1386 - 0.1530 -0.1653Columns 711 through 720-0.1753 -0.1829 -0.1880 -0.1903 -0.1899 -0.1866 -0.1805 -0.1713 - 0.1593 -0.1444Columns 721 through 730-0.1267 -0.1063 -0.0832 -0.0577 -0.0299 0.0000 0.0318 0.06540.1003 0.1365Columns 731 through 7400.1735 0.2113 0.2493 0.2874 0.3253 0.3627 0.3992 0.4346 0.4686 0.5010Columns 741 through 7500.5315 0.5598 0.5857 0.6090 0.6296 0.6472 0.6618 0.6731 0.68120.6859Columns 751 through 7600.6873 0.6853 0.6798 0.6711 0.6591 0.6440 0.6258 0.6048 0.5810 0.5548Columns 761 through 7700.5262 0.4955 0.4630 0.4290 0.3936 0.3573 0.3201 0.2826 0.2449 0.2073Columns 771 through 7800.1701 0.1336 0.0981 0.0639 0.0311 0.0000-0.0292 -0.0562 -0.0809 -0.1033Columns 781 through 790-0.1230 -0.1400 -0.1543 -0.1658 -0.1744 -0.1802 -0.1832 -0.1834 -0.1810 -0.1759Columns 791 through 800-0.1684 -0.1586 -0.1467 -0.1328 -0.1171 -0.1000 -0.0815 -0.0621 -0.0418 -0.0210Columns 801 through 810-0.0000 0.0210 0.0417 0.0619 0.0812 0.0995 0.1164 0.1318 0.1455 0.1572Columns 811 through 8200.1667 0.1740 0.1788 0.1811 0.1807 0.1775 0.1717 0.1630 0.1516 0.1374Columns 821 through 8300.1205 0.1011 0.0792 0.0549 0.0285 0.0000 -0.0303 -0.0622 -0.0954 -0.1298Columns 831 through 840-0.1651 -0.2010 -0.2372 -0.2734 -0.3094 -0.3450 -0.3797 -0.4134 - 0.4458 -0.4766Columns 841 through 850-0.5055 -0.5325 -0.5571 -0.5793 -0.5989 -0.6157 -0.6295 -0.6403 - 0.6480 -0.6525Columns 851 through 860-0.6538 -0.6518 -0.6467 -0.6384 -0.6270 -0.6126 -0.5953 -0.5753 - 0.5527 -0.5277Columns 861 through 870-0.5005 -0.4714 -0.4405 -0.4081 -0.3744 -0.3398 -0.3045 -0.2688 - 0.2329 -0.1972Columns 871 through 880-0.1618 -0.1271 -0.0934 -0.0608 -0.0296 -0.0000 0.0277 0.05350.0770 0.0982Columns 881 through 8900.1170 0.1332 0.1468 0.1577 0.1659 0.1714 0.1743 0.1745 0.1721 0.1673Columns 891 through 9000.1602 0.1509 0.1395 0.1263 0.1114 0.0951 0.0776 0.0590 0.0398 0.0200Columns 901 through 9100.0000 -0.0200 -0.0397 -0.0589 -0.0773 -0.0946 -0.1108 -0.1254 - 0.1384 -0.1495Columns 911 through 920-0.1586 -0.1655 -0.1701 -0.1722 -0.1718 -0.1689 -0.1633 -0.1550 - 0.1442 -0.1307Columns 921 through 930-0.1147 -0.0962 -0.0753 -0.0522 -0.0271 -0.0000 0.0288 0.05910.0908 0.1235Columns 931 through 9400.1570 0.1912 0.2256 0.2601 0.2944 0.3281 0.3612 0.3932 0.4240 0.4533Columns 941 through 9500.4809 0.5065 0.5300 0.5511 0.5697 0.5856 0.5988 0.6091 0.6164 0.6207Columns 951 through 9600.6219 0.6200 0.6151 0.6072 0.5964 0.5827 0.5663 0.5472 0.5257 0.5020Columns 961 through 9700.4761 0.4484 0.4190 0.3882 0.3562 0.3233 0.2897 0.2557 0.2216 0.1876Columns 971 through 9800.1539 0.1209 0.0888 0.0578 0.0281 0.0000-0.0264 -0.0509 -0.0732 -0.0934Columns 981 through 990-0.1113 -0.1267 -0.1396 -0.1500 -0.1578 -0.1631 -0.1658 -0.1660 -0.1637 -0.1592Columns 991 through 1000-0.1524 -0.1435 -0.1327 -0.1201 -0.1060 -0.0905 -0.0738 -0.0562 -0.0378 -0.0190Column 1001-0.000016.For Question 15 c), use the plot function to plot the value z against t. And usexlabel and ylabel to label the t axis ‘time’ and z axis ‘Response’ and use title to give your figure a title. Copy the figure into your mydiary01.doc (from the figure edit menu, select copy, then open mydiary01.doc and paste in the figure as an object).Answers:>> plot(t,z3,'m','LineWidth',2)xlabel('time')ylabel('Response')title('z=exp(-0.05*t)*sin(πt)*cos(2πt))')Part B1.Create a new Script m-file, called myfirst.m, to assign values to three vector arraysa, b, and c; add each component together and assign to array d, whereA=[ 1, 2, 3], b=[4 5 6], c=[7 8 9]. Run myfirst.m. Examine the variable values in the WorkSpace . Edit myfirst.m to change variable b to b=[10 20 30]. Re-run myfirst.mAnswers:myfirst.mA=[ 1, 2, 3];B=[4 5 6];C=[7 8 9];D=A+B+Cresult:>> myfirstD =12 15 18myfirst.mA=[ 1, 2, 3];B=[10 20 30];C=[7 8 9];D=A+B+C(2-2)result:>> myfirstD =18 30 422.Create a function m-file, called myfun.m, that accepts two arrays x and y asarguments, and produces the sum of x and y, and gives as the function output, the maximum of x+y.Answer:(1)myfun.mfunction[M] = myfun(x,y)%MAXIMUMsum=x+y;t=length(x)-1;fori=1:t;ifsum(1+i)>sum(i)max=sum(1+i);sum(1+i)=sum(i);endendM=maxend(2)result>> x=[1 2 3]y=[4 5 6]x =1 2 3y =4 5 6>> myfun(x,y)M =9ans =93.Modify your script m-file myfirst.m by calling in it myfun.m twice, namely with aand b as parameters in the argument list, and second with parameters b and c. Run myfirst.mand afterwards. Examine the WorkSpace variable values.Answers:(1)myfirst_modify.mA=[ 1, 2, 3];B=[10 20 30];myfun(A,B);disp('calling myfun again')C=[7 8 9];myfun(B,C);(2)result>> myfirst_modifyM =33calling myfun againM =394. Modify your script m-file myfirst.m by introducing variables A and B. Assignscalar values A=1, B=2. Declare A and B as global variables both in myfirst.m and myfun.m. Modify myfun.m by adding A and B to the maximum value of x+y. Answers:(1)myfirst.mglobalA B;A=1;a=[ 1, 2, 3];b=[10 20 30];myfun(a,b);disp('calling myfun again')c=[7 8 9];d=a+b+c;;myfun(c,d);(2)myfun.mfunction[M] = myfun(x,y)%MAXIMUMglobalA B;A=1;B=2;sum=x+y;t=length(x)-1;fori=1:t;ifsum(1+i)>sum(i)max=sum(1+i);sum(1+i)=sum(i);endM=max+A+Bend(3)result>> myfirstM =36calling myfun againM =545.Create a script m-file and, using a pair of nested for loops, assign to a 5 by 5matrix array A, values equal to the sum of the subscripts. Ensure that the array is first cleared before the loops and afterwards display the array values. Run the m-file.Answer:(1)home_work_1_B_5.mclearall;closeall;fori=1:5forj=1:5A(i,j)=i+j;endendA(2)result>> home_work_1_B_5A =2 3 4 5 63 4 5 6 74 5 6 7 85 6 7 8 96 7 8 9 106. Relational Operators:- Assign variables x=1 and y=2, then examine the values of the expressions:a) x>y, b)x<y, c) x==y. What is the value of z=(x>y)*(x==y)?Answer:(1)home_work_1_B_6.mx=1;y=2;u1=x>yu2=x<yu3=(x==y)z=(x>y)*(x==y)(2)result>> home_work_1_B_6u1 =u2 =1u3 =z =7. While loop:- Create a script m-file, and using a ‘while loop’, generate the partial sum for the series: ...31211+++πππ which stops adding-on terms when they are less than 1e-6 times the total sum.Answer:(1)home_wor_1_B_7.mclear all;close all;i=1;sum=0;t=1/pi;whilet>=exp(-6)sum=sum+t;i=i+1;t=1/(i*pi);enddisp('多项式之和sum') sumdisp('循环次数i')idisp('多项式最后一项t') t(2)result>> >> home_work_1_B_7 多项式之和sumsum =1.7294循环次数ii =129多项式最后一项tt =0.00258. While loop:- Use a ‘while loop’ to keep adding array A to itself until just one ofthe elements in A is greater than, but not equal to 40 where, initially ⎥⎦⎤⎢⎣⎡=4321A .Answer:(1)home_work_1_B_8.mA=[1 2 3 4 ];m=max(A(:));whilem<=40;A=A+A;m=max(A(:));endA(2)result>> home_work_1_B_8A =16 3248 649. If statements:- Create a function m-file that receives variable x and y as arguments, then uses an ‘if’ statement internally to execute the condition that: ‘if x is greater than y the function takes the value x, otherwise it takes the value y’. Test it on 2 numbers x=1 and y=1.Answer(1)greater.mfunction[ max ] = greater( x,y )%lbs_home_work_1_B_9ifx>y max=x;elsemax=y;endend(1) result>> x=1;y=1;>> greater(x,y)ans =110.If statements:- Create a function m-file that receives variable x, y and z asarguments, then uses an ‘if elseif and else’ statements, generate the output value to be =x if first of all x>1, otherwise =y if y>10, otherwise =z if z>20, otherwise =1 if none of those conditions hold. Test it on values (100,100,100) and (0, 0,0).Answer:(1)compare.mfunction[max] = compare( x,y,z )%lbs_home_work_1_B_10ifx>1 max=x;elseify>10 max=y;elseifz>2 max=z;elsemax=1;endendendmaxend(2)result>> compare(100,100,100)max =100ans =100>> compare(0,0,0)max =1ans =111.Switch Statement:- Create a function with one input argument x to test whether theexpression: real(x^2) is equal to 0,1, or -1, which then displays a string stating appropriately whether: ‘x is equal to zero’, ‘x is equal to +1 or -1’ or ‘x is equal to +j or –j’; otherwise display ‘test failed’. Test your m-file on three values: x=0, x=10 and x=j (1j).-=(1)test.mfunctionf = test( x%lbs home work 1 partB 11t=real(x^2);Switch tcase 0, disp('x is equal to zero');case1, disp('x is equal to +1');case-1, disp('x is equal to -1');otherwisedisp('test failed');end(2) result>> test(10)test failed>> test(0)x is equal to zero>> test(j)x is equal to -112. Polynomials:- Create a script m-file to generate the 5th degree polynomial:104322345+++++x x x x x and find all the roots. Use the plot function to plot the polynomial between x=-2 and x=2. Give the plot a title ‘A 5th degree polynomial for different domains’.Answer:(1)home_work_1_B_12.mclear all;close all;x=-2:2;y=x.^5+2*x.^4+3*x.^3+4*x.^2+x+10plot(x,y,'m','LineWidth',2)axis([-2 2 -2 120])p=[1 2 3 4 1 10]roots(p)(2)result:home_work_1_B_12y =0 11 10 21 116p =1 2 3 4 1 10-2.0000-0.6566 + 1.6409i-0.6566 - 1.6409i0.6566 + 1.0815i0.6566 - 1.0815i(3)home_work_1_B_12.fig。

MATLAB上机实验1答案

MATLAB上机实验1答案

实验1 Matlab 初步一、问题已知矩阵A 、B 、b 如下:⎥⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎢⎣⎡-------------=031948118763812654286174116470561091143A ⎥⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎢⎣⎡------=503642237253619129113281510551201187851697236421B []1187531=b应用Matlab 软件进行矩阵输入及各种基本运算。

二、实验目的学会使用Matlab 软件构作已知矩阵对应的行(列)向量组、子矩阵及扩展矩阵,实施矩阵的初等变换及线性无关向量组的正交规范化,确定线性相关相关向量组的一个极大线性无关向量组,且将其余向量用极大线性无关向量组线性表示,并能编辑M 文件来完成所有的实验目的。

三、预备知识1、 线性代数中的矩阵及其初等变换、向量组的线性相关性等知识。

2、 Matlab 软件的相关命令提示如下;(1) 选择A 的第i 行做一个行向量:ai=A(i,:);(2) 选择A 的第j 行做一个列向量:ai=A(j,:);(3) 选择A 的某几行、某几列上的交叉元素做A 的子矩阵:A([行号],[列号]);(4) n 阶单位阵:eye(n);n 阶零矩阵:zeros(n);(5) 做一个n 维以0或1为元素的索引向量L ,然后取A(:,L),L 中值为1的对应的列将被取到。

(6) 将非奇异矩阵A 正交规范化,orth(A) ;验证矩阵A 是否为正交阵,只需做A*A'看是否得到单位阵E 。

(7) 两个行向量a1和a2的内积:a1*a2'。

(8) 让A 的第i 行与第j 列互换可用赋值语句:A([i,j],:)=A([j,i],:);(9)让K乘以A的第i行可用赋值语句:A(i,:)=K*A(i,:);(10)让A的第i行加上第j行的K倍可用赋值语句:A(i,:)=A(i,:)+K*A(j,:);(11)求列向量组的A的一个极大线性无关向量组可用命令:rref(A)将A化成阶梯形行的最简形式,其中单位向量对应的列向量即为极大线性无关向量组所含的向量,其它列向量的坐标即为其对应向量用极大线性无关组线性表示的系数。

东南大学《数值分析》上机题

东南大学《数值分析》上机题

数值分析上机题1设2211NN j S j ==-∑,其精确值为1311221N N ⎛⎫-- ⎪+⎝⎭。

(1)编制按从大到小的顺序22211121311N S N =+++---,计算N S 的通用程序。

(2)编制按从小到大的顺序2221111(1)121N S N N =+++----,计算NS 的通用程序。

(3)按两种顺序分别计算210S ,410S ,610S ,并指出有效位数。

(编制程序时用单精度) (4)通过本上机题,你明白了什么?程序代码(matlab 编程):clc cleara=single(1./([2:10^7].^2-1)); S1(1)=single(0); S1(2)=1/(2^2-1); for N=3:10^2 S1(N)=a(1); for i=2:N-1S1(N)=S1(N)+a(i); end endS2(1)=single(0); S2(2)=1/(2^2-1); for N=3:10^2 S2(N)=a(N-1);for i=linspace(N-2,1,N-2) S2(N)=S2(N)+a(i); end endS1表示按从大到小的顺序的S N S2表示按从小到大的顺序的S N通过本上机题,看出按两种不同的顺序计算的结果是不相同的,按从大到小的顺序计算的值与精确值有较大的误差,而按从小到大的顺序计算的值与精确值吻合。

从大到小的顺序计算得到的结果的有效位数少。

计算机在进行数值计算时会出现“大数吃小数”的现象,导致计算结果的精度有所降低,我们在计算机中进行同号数的加法时,采用绝对值较小者先加的算法,其结果的相对误差较小。

数值分析上机题220.(上机题)Newton 迭代法(1)给定初值0x 及容许误差ε,编制Newton 法解方程()0f x =根的通用程序。

(2)给定方程3()/30f x x x =-=,易知其有三个根1x *=,20x *=,3x *=。

数值分析作业-matlab上机作业

数值分析作业-matlab上机作业

数值分析———Matlab上机作业学院:班级:老师:姓名:学号:第二章解线性方程组的直接解法第14题【解】1、编写一个追赶法的函数输入a,b,c,d输出结果x,均为数组形式function x=Zhuiganfa(a,b,c,d)%首先说明:追赶法是适用于三对角矩阵的线性方程组求解的方法,并不适用于其他类型矩阵。

%定义三对角矩阵A的各组成单元。

方程为Ax=d%b为A的对角线元素(1~n),a为-1对角线元素(2~n),c为+1对角线元素(1~n-1)。

% A=[2 -1 0 0% -1 3 -2 0% 0 -2 4 -3% 0 0 -3 5]% a=[-1 -2 -3];c=[-1 -2 -3];b=[2 3 4 5];d=[6 1 -2 1];n=length(b);u(1)=b(1);y(1)=d(1);for i=2:nl(i)=a(i-1)/u(i-1);%先求l(i)u(i)=b(i)-c(i-1)*l(i);%再求u(i)%A=LU,Ax=LUx=d,y=Ux,%Ly=d,由于L是下三角矩阵,对角线均为1,所以可求y(i)y(i)=d(i)-l(i)*y(i-1);endx(n)=y(n)/u(n);for i=(n-1):-1:1%Ux=y,由于U是上三角矩阵,所以可求x(i)x(i)=(y(i)-c(i)*x(i+1))/u(i);end2、输入已知参数>>a=[2 2 2 2 2 2 2];>>b=[2 5 5 5 5 5 5 5];>>c=[2 2 2 2 2 2 2];>>d=[220/27 0 0 0 0 0 0 0];3、按定义格式调用函数>>x=zhuiganfa(a,b,c,d)4、输出结果x=[8.147775166909105 -4.073701092835030 2.036477565178471 -1.017492820111148 0.507254485099400 -0.250643392637350 0.119353996493976 -0.047741598597591]第15题【解】1、编写一个程序生成题目条件生成线性方程组A x=b 的系数矩阵A 和右端项量b ,分别定义矩阵A 、B 、a 、b 分别表示系数矩阵,其中1(10.1;,1,2,...,)j ij i i a x x i i j n -==+=或1(,1,2,...,)1ij a i j n i j ==+-分别构成A 、B 对应右端项量分别a 、b 。

东南大学数值分析上机报告完整版

东南大学数值分析上机报告完整版

数值分析上机实验报告目录1.chapter1舍入误差及有效数 (2)2.chapter2Newton迭代法 (3)3.chapter3线性代数方程组数值解法-列主元Gauss消去法 (7)4.chapter3线性代数方程组数值解法-逐次超松弛迭代法 (9)5.chapter4多项式插值与函数最佳逼近 (10)1.chapter1舍入误差及有效数1.1题目设S N =∑1j 2−1N j=2,其精确值为)11123(21+--N N 。

(1)编制按从大到小的顺序11131121222-+⋯⋯+-+-=N S N ,计算S N 的通用程序。

(2)编制按从小到大的顺序1211)1(111222-+⋯⋯+--+-=N N S N ,计算S N 的通用程序。

(3)按两种顺序分别计算64210,10,10S S S ,并指出有效位数。

(编制程序时用单精度)(4)通过本次上机题,你明白了什么?1.2编写相应的matlab 程序clear;N=input('please input N:');AValue=((3/2-1/N-1/(N+1))/2);sn1=single(0);sn2=single(0);for i=2:Nsn1=sn1+1/(i*i-1); %从大到小相加的通用程序%endep1=abs(sn1-AValue);for j=N:-1:2sn2=sn2+1/(j*j-1); %从小到大相加的通用程序%endep2=abs(sn2-AValue);fprintf('精确值为:%f\n',AValue);fprintf('从大到小的顺序累加得sn=%f\n',sn1);fprintf('从大到小相加的误差ep1=%f\n',ep1);fprintf('从小到大的顺序累加得sn=%f\n',sn2);fprintf('从小到大相加的误差ep2=%f\n',ep2);disp('=================================');1.3matlab 运行程序结果>> chaper1please input N:100精确值为:0.740050从大到小的顺序累加得sn=0.740049从大到小相加的误差ep1=0.000001从小到大的顺序累加得sn=0.740050从小到大相加的误差ep2=0.000000>> chaper1please input N:10000精确值为:0.749900从大到小的顺序累加得sn=0.749852从大到小相加的误差ep1=0.000048从小到大的顺序累加得sn=0.749900从小到大相加的误差ep2=0.000000>> chaper1please input N:1000000精确值为:0.749999从大到小的顺序累加得sn=0.749852从大到小相加的误差ep1=0.000147从小到大的顺序累加得sn=0.749999从小到大相加的误差ep2=0.0000001.4结果分析以及感悟按照从大到小顺序相加的有效位数为:5,4,3。

——数值分析上机题

——数值分析上机题

.......................课程名称:数值分析上机实习报告姓名:学号:专业:联系电话:目录序言 (3)第1章必做题 (4)1.1必做题第一题 (4)1.1.1题目 (4)1.1.2 分析 (4)1.1.3 计算结果 (4)1.1.3 总结 (6)1.2必做题第二题 (6)1.2.1题目 (6)1.2.2分析 (6)1.2.3计算结果 (6)1.2.4结论 (8)1.1必做题第一题....................................................................... 错误!未定义书签。

1.1.1题目 ............................................................................ 错误!未定义书签。

第2章选做题 (8)2.1选做题第一题 (8)2.1.1题目 (8)2.1.2分析 (8)2.1.3计算结果 (8)附录 (10)附录一:必做题第一题程序 (10)附录二:必做题第二题程序 (11)附录三:选做题第一题的程序 (13)序言本次数值分析上机实习采用Matlab数学软件。

Matlab是一种用于算法开发、数据可视化、数据分析以及数值计算的高级技术计算语言和交互式环境。

在数值分析应用中可以直接调用Matlab软件中已有的函数,同时用户也可以将自己编写的实用程序导入到Matlab函数库中方便自己调用。

基于Matlab数学软件的各种实用性功能与优点,本次数值分析实习决定采用其作为分析计算工具。

1.编程效率高MATLAB是一种面向科学与工程计算的高级语言,允许使用数学形式的语言编写程序,且比BASIC、FORTRAN和C等语言更加接近我们书写计算公式的思维方式,用MATLAB编写程序犹如在演算纸上排列出公式与求解问题。

因此,MATLAB语言也可通俗地称为演算纸式科学算法语言。

东南大学信息短学期matlab作业一

东南大学信息短学期matlab作业一

实验一、>> A=[1,2,3;4,5,6;7,8,9]A =1 2 34 5 67 8 9>> B=[9,8,7;6,5,4;3,2,1],C=[4,5,6;7,8,9;1,2,3]B =9 8 76 5 43 2 1C =4 5 67 8 91 2 3>> AA =1 2 34 5 67 8 9>> BB =9 8 76 5 43 2 1>> CC =4 5 67 8 91 2 3三、>> A=[1,2,3]A =1 2 3>> B=[4,5,6]B =4 5 6>> C=A+BC =5 7 9>> D=A-BD =-3 -3 -3>> E=A.*BE =4 10 18>> F=A./BF =0.2500 0.4000 0.5000 >> G=A.^BG =1 32 729>> A=[1,2,3;4,5,6;7,8,9]A =1 2 34 5 67 8 9>> inv(A)ans =1.0e+016 *-0.4504 0.9007 -0.45040.9007 -1.8014 0.9007-0.4504 0.9007 -0.4504 >>四、2、>> A=[1,1,1;1,-2,1;1,2,3];>> b=[2;-1;-1];>> x=inv(A)*bx =3.00001.0000-2.00004、>> A=[2,3,-1;3,-2,1;1,2,1];>> b=[18;8;24];>> x=inv(A)*bx =468>>实验二二、>> k=-10:10;>> y=sin(k).*(0*(k<0)+1*(k>0));>> stem(k,y)>> k=-10:10;>> y=sin(k)+sin(pi*k);>> stem(k,y)>> k=-10:10;>> y=k.*sin(k).*(0*(k<3)+1*(k>3));>> stem(k,y)>> k=-10:10;>> y=(-1).^k+((0.5).^k).*(0*(k<0)+1*(k>0));>> stem(k,y)七、>> f1=[1,1,1,1];>> f2=[3,2,1];>> y=conv(f1,f2)y =3 5 6 6 3 1>> f1=[0,0,1,1,1];>> f2=[0,0,0.5,0.25,0.125];>> y=conv(f1,f2)y =Columns 1 through 80 0 0 0 0.5000 0.7500 0.8750 0.3750 Column 90.1250>> f1=[0,0,1,1,1];>> f2=[0,0,-0.5,0.25,-0.125];>> y=conv(f1,f2)y =Columns 1 through 80 0 0 0 -0.5000 -0.2500 -0.3750 0.1250Column 9-0.1250实验三、二、1、x=[1,2,3,4,5,6,6,5,4,3,2,1];dtft=zeros(100);for i=1:100w(i)=(i-50)/10;for k=1:12dtft(i)=dtft(i)+x(k)*exp(-j*(k-1)*w(i));endendsubplot(1,2,1);plot(w,abs(dtft),'r-');xlabel('w'); ylabel('DTFT'); title('幅频特性');subplot(1,2,2);plot(w,angle(dtft),'r-');xlabel('w'); ylabel('DTFT');title('相频特性');2、X=[1,2,3,4,5,6,6,5,4,3,2,1];F=fftshift(fft(X,1000));k=[-500:499]*2*pi/1000;subplot(1,2,1);plot(k,abs(F),'b-')xlabel('w');ylabel('DFT');title('幅频特性');subplot(1,2,2);plot(k,angle(F) ,'b-')xlabel('w');ylabel('DFT');title('相频特性');3、x=[1,2,3,4,5,6,6,5,4,3,2,1];dtft=zeros(100);for i=1:100w(i)=(i-50)/10;for k=1:12dtft(i)=dtft(i)+x(k)*exp(-j*(k-1)*w(i));endendsubplot(1,2,1);plot(w,abs(dtft),'r-');xlabel('w'); title('幅频特性'); hold;subplot(1,2,2);plot(w,angle(dtft),'r-');xlabel('w');title('相频特性'); hold;F=fftshift(fft(X,1000));k=[-500:499]*2*pi/1000;subplot(1,2,1);plot(k,abs(F),'b-')hold;subplot(1,2,2);plot(k,angle(F) ,'b-')三、1、%f1.mfunction y=fun1(x)if((-pi<x) && (x<0))y=pi+x;elseif ((0<x) && (x<pi))y=pi-x;elsey=0endfor i=1:1000g(i)=f1(2/1000*i-1);w(i)=(i-1)*0.2*pi;endfor i=1001:10000g(i)=0;w(i)=(i-1)*0.2*pi;endG=fft(g)/1000;subplot(1,2,1);plot(w(1:50),abs(G(1:50)));xlabel('w');ylabel('G');title('DFT幅度频谱1'); subplot(1,2,2);plot(w(1:50),angle(G(1:50)))xlabel('w');ylabel('Fi');title('DFT相位频谱1');2、%f2.mfunction y=fun2(x)if x<1 && x>-1y=cos(pi*x/2);elsey=0;endfor i=1:1000g(i)=f2(2/1000*i-1);w(i)=(i-1)*0.2*pi;endfor i=1001:10000g(i)=0;w(i)=(i-1)*0.2*pi;endG=fft(g)/1000;subplot(1,2,1);plot(w(1:50),abs(G(1:50)));xlabel('w');ylabel('G');title('DFT幅度频谱2'); subplot(1,2,2);plot(w(1:50),angle(G(1:50)))xlabel('w');ylabel('Fi');title('DFT相位频谱2');3、%f3.mfunction y=fun3(x)if x<0 && x>-1y=1;elseif x>0 && x<1y=-1;elsey=0endfor i=1:1000g(i)=f3(2/1000*i-1);w(i)=(i-1)*0.2*pi;endfor i=1001:10000g(i)=0;w(i)=(i-1)*0.2*pi;endG=fft(g)/1000;subplot(1,2,1);plot(w(1:100),abs(G(1:100)));xlabel('w');ylabel('G');title('DFT幅度频谱3'); subplot(1,2,2);plot(w(1:100),angle(G(1:100)))xlabel('w');ylabel('Fi');title('DFT相位频谱3');。

最新(完美版)数值分析上机作业

最新(完美版)数值分析上机作业

一. 上机作业任务一: 用五点差分格式求解Poisson 方程边值问题,P124-------3、4(任选一题)。

二. 上机作业任务二:用Simpson 求积法计算定积分()baf x dx ⎰。

下面两种方法任选一。

(1)变步长复化Simpson 求积法。

(2)自适应Simpson 求积法三. 上机作业任务三:用MATLAB 语言编写连续函数最佳平方逼近的算法程序(函数式M 文件)。

要求算法程序可以适应不同的具体函数,具有一定的通用性。

并用此程序进行数值试验,写出计算实习报告。

所编程序具有以下功能:1. 用Lengendre 多项式做基,并适合于构造任意次数的最佳平方逼近多项式。

可利用递推关系 0112()1,()()(21)()(1)()/2,3,.....n n n P x P x xP x n xP x n P x n n --===---⎡⎤⎣⎦=2. 被逼近函数f(x)用M 文件建立数学函数。

这样,此程序可通过修改建立数学函数的M 文件以适用不同的被逼近函数(要学会用函数句柄)。

3. 要考虑一般的情况]1,1[],[)(+-≠∈b a x f 。

因此,程序中要有变量代换的功能。

4. 计算组合系数时,计算函数的积分采用数值积分的方法。

5. 程序中应包括帮助文本和必要的注释语句。

另外,程序中也要有必要的反馈信息。

6. 程序输入:(1)待求的被逼近函数值的数据点0x (可以是一个数值或向量)(2)区间端点:a,b 。

7. 程序输出:(1)拟合系数:012,,,...,n c c c c(2)待求的被逼近函数值00001102200()()()()()n n s x c P x c P x c P x c P x =++++ 8. 试验函数:()cos ,[0,4]f x x x x =∈+;也可自选其它的试验函数。

9. 用所编程序直接进行计算,检测程序的正确性,并理解算法。

10. 分别求二次、三次、。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

数值分析上机题1
2010/9/19
一、题目
二、程序
(1)的程序如下:
(2)的程序如下:
(3)完整程序见附录。

三、结果
四、分析
按从大到小的顺序计算出的S_N的精度不断降低(有效数字依次为7、4、3),而按从小到大的顺序计算出的S_N的精度不变(有效数字依次为7、7、7)。

产生这个现象的原因:当一个浮点数要与另一个浮点数相加时,这两个浮点数首先要保证指数一致(小的指数要向大的指数看齐),这样就使得指数小的浮点数舍弃其最后面的若干位,这就造成了误差。

两个浮点数的指数相差越大,由于相加产生的误差也越大。

当按从大到小的顺序计算时,以后所有的浮点数都必须向最大的浮点数(第一个)看齐,造成误差的累加,使得误差越来越大。

按从小到大的顺序计算时,由于总是后一个浮点数较大,所以前面的误差不会累加到以后的计算中。

五、附录。

相关文档
最新文档