数值实验指导书数值实验一实验名称:非线性方程求根(SolutionofNon-linearEquation)实验目的:掌握二分法、不动点迭代、牛顿迭代法等常用的非线性方程迭代算法;加深对不同算法收敛速度、对初值的依赖性等的认识。基本要求:应用C语言或Fortran语言及Matlab编程,并上机调试通过;2学时。算法描述:计算的二分法(bisectionMethod):PURPOSE:TofindasolutiontoF(x)=0giventhecontinuousfunctionFontheinterval[A,B],whereF(A)andF(B)haveoppositesignsINPUT:endpoints:A,B,tolerance:TOL>,maximumnumberofiterationsNOUTPUT:approximationsolutionPormessagethatthealgorithmfailsStep1SetI=1FA=F(A);FB=F(B)Step2WhiledoSteps3-6Step3SetP=A+(B-A)/2;FP=F(P).Step4IFFP=0or(B-A)/2<TOLTHENOUTPUT(P)(essfully)STOPENDIFStep5SetI=I+1Step6IFTHENSetA=P;FA=FPELSESetB=P;FB=FPENDIFStep7OUTPUT(MethodfailedafterNiteration)(Fixed-PointIteration):PURPOSE:Tofindasolutiontogivenaninitialapproximationp0INPUT:initialapproximationp0;toleranceTOL;maximumnumberofiterationsNOUTPUT:approximationsolutionpormessageoffailsStep1SetI=1Step2WhiledoSteps3-pute)Step4IFTHENOUTPOT(P)(essful.)STOPENDIFStep5SetI=I+1Step6Set(Update)Step7OUTPUT(MethodfailedafterNiteration)(MewtonMethod):PURPOSE:Tofindasolutiontogivenaninitialapproximation:INPUT:initialapproximation;toleranceTOL;:-6Step3Set(*Compute*)Step4Ifthen Output(p)StopStep5SetStep6SetStep7Output(ThemethodfailedafterNiterations)(*essful*):、Fortran语言或Matlab编写以上三种算法的通用程序。,,比较收敛速度。,取不同的初值,观察算法对初值的敏感性。。:如何比较迭代法收敛的快慢?何为收敛阶数?如何加速迭代序列的收敛速度?埃特金加速法的处理思想是什么?数值实验二实验名称:多项式插值(PolynomialInterpolation)实验目的:掌握多项式逼近的思想,熟悉Lagrange插值算法,分段低次插值(piecewisePolynomialApproximation),三次样条(CubicSpline)插值,体会它们不同的特征。基本要求:应用C语言或Fortran语言及Matlab编程,并上机调试通过;2学时。算法描述:三次样条插值(CubicSplineInterpolation)PURPOSE:Tofindapiecewisecubicsplinefunction.(,,…).where,and,….INPUT:interpolatedpoints;:Step1ForStep2Byclampedboundarycondition,Set,,Step3Solvetri-:、Fortran语言或Matlab编写以上三种算法的通用程序。,十等分闭区间[-1,1],
数值实验指导书 来自淘豆网www.taodocs.com转载请标明出处.