数值分析的一个小结
- 格式:pdf
- 大小:221.06 KB
- 文档页数:26
第1篇在数值分析这门课程的学习过程中,我深刻体会到了理论知识与实践操作相结合的重要性。
通过一系列的实验,我对数值分析的基本概念、方法和应用有了更加深入的理解。
以下是我对数值分析实验的心得体会。
一、实验目的与意义1. 巩固数值分析理论知识:通过实验,将课堂上学到的理论知识应用到实际问题中,加深对数值分析概念和方法的理解。
2. 培养实际操作能力:实验过程中,我学会了使用Matlab等软件进行数值计算,提高了编程能力。
3. 增强解决实际问题的能力:实验项目涉及多个领域,通过解决实际问题,提高了我的问题分析和解决能力。
4. 培养团队协作精神:实验过程中,我与同学们分工合作,共同完成任务,培养了团队协作精神。
二、实验内容及方法1. 实验一:拉格朗日插值法与牛顿插值法(1)实验目的:掌握拉格朗日插值法和牛顿插值法的原理,能够运用这两种方法进行函数逼近。
(2)实验方法:首先,我们选择一组数据点,然后利用拉格朗日插值法和牛顿插值法构造插值多项式。
最后,我们将插值多项式与原始函数进行比较,分析误差。
2. 实验二:方程求根(1)实验目的:掌握二分法、Newton法、不动点迭代法、弦截法等方程求根方法,能够运用这些方法求解非线性方程的根。
(2)实验方法:首先,我们选择一个非线性方程,然后运用二分法、Newton法、不动点迭代法、弦截法等方法求解方程的根。
最后,比较不同方法的收敛速度和精度。
3. 实验三:线性方程组求解(1)实验目的:掌握高斯消元法、矩阵分解法等线性方程组求解方法,能够运用这些方法求解线性方程组。
(2)实验方法:首先,我们构造一个线性方程组,然后运用高斯消元法、矩阵分解法等方法求解方程组。
最后,比较不同方法的计算量和精度。
4. 实验四:多元统计分析(1)实验目的:掌握多元统计分析的基本方法,能够运用这些方法对数据进行分析。
(2)实验方法:首先,我们收集一组多元数据,然后运用主成分分析、因子分析等方法对数据进行降维。
数值分析学习总结感想在数值分析学习的过程中,我深刻体会到了这门学科的重要性和广泛应用的范围。
通过学习数值分析,我不仅加深了对数学理论的理解,还掌握了一些重要的数值计算方法和算法。
在此过程中,我收获了很多,也产生了许多感想。
首先,数值分析教给我了科学问题解决的方法。
在数值计算中,我们通常无法通过简单的代数运算来求解问题,而是需要借助计算机和数值算法来逼近解。
这种方法可以应用于很多实际问题,例如求解线性方程组、积分、微分方程等。
通过数值分析课程的学习,我掌握了很多常见的数值计算方法,例如高斯消元法、插值方法、数值积分等。
这些方法在实际问题中的应用非常广泛,能够帮助我们解决许多实际问题,提高计算效率和精度。
其次,数值分析也教会了我如何分析和估计误差。
在数值计算中,误差是无法避免的,而且可能会在计算过程中不断累积。
因此,我们需要了解误差的来源,能够进行误差估计和控制。
通过学习数值分析,我学会了如何使用泰勒展开式、理解截断误差和舍入误差等概念,同时也学会了如何使用残差计算和误差估计方法。
这对于判断数值结果的可靠性和计算效果的好坏非常重要,能够帮助我们找到优化方法和改进方案。
另外,数值分析还教会了我如何进行数值模拟和数据处理。
在实际工程和科学研究中,常常需要通过数值模拟来研究分析问题。
通过数值分析的学习,我学会了如何建立数学模型、选择合适的数值方法和算法来模拟求解问题,并能够对模拟结果进行合理的处理和分析。
这对于科学研究和工程设计都非常有价值,能够提高研究效率和解决复杂问题的能力。
最后,数值分析还培养了我一种严谨的科学态度和问题解决的能力。
在数值计算中,一个细微的误差可能会导致完全不同的结果,因此需要我们对问题进行仔细的分析,并保持谨慎的态度。
通过编程实现数值算法,我学会了如何调试代码和检查问题,发现解决bug的方法。
这培养了我的逻辑思维和问题解决能力,也增强了我对科学研究和工程实践的兴趣和热情。
综上所述,通过数值分析的学习,我不仅掌握了一些重要的数值计算方法和算法,还学会了科学问题解决的方法和误差估计的技巧。
一、实验背景数值分析是研究数值计算方法及其理论的学科,是计算机科学、数学、物理学等领域的重要基础。
为了提高自身对数值分析理论和方法的理解,我们进行了数值分析实验,通过实验加深对理论知识的掌握,提高实际操作能力。
二、实验目的1. 理解数值分析的基本理论和方法;2. 掌握数值分析实验的基本步骤和技巧;3. 培养实验设计和数据分析能力;4. 提高编程和计算能力。
三、实验内容本次实验主要分为以下几个部分:1. 线性方程组求解实验:通过高斯消元法、LU分解法等求解线性方程组,并分析算法的稳定性和误差;2. 矩阵特征值问题计算实验:利用幂法、逆幂法等计算矩阵的特征值和特征向量,分析算法的收敛性和精度;3. 非线性方程求根实验:运用二分法、牛顿法、不动点迭代法等求解非线性方程的根,比较不同算法的优缺点;4. 函数插值实验:运用拉格朗日插值、牛顿插值等方法对给定的函数进行插值,分析插值误差;5. 常微分方程初值问题数值解法实验:运用欧拉法、改进的欧拉法、龙格-库塔法等求解常微分方程初值问题,比较不同算法的稳定性和精度。
四、实验过程1. 线性方程组求解实验:首先,编写程序实现高斯消元法、LU分解法等算法;然后,对给定的线性方程组进行求解,记录计算结果;最后,分析算法的稳定性和误差。
2. 矩阵特征值问题计算实验:编写程序实现幂法、逆幂法等算法;然后,对给定的矩阵进行特征值和特征向量的计算,记录计算结果;最后,分析算法的收敛性和精度。
3. 非线性方程求根实验:编写程序实现二分法、牛顿法、不动点迭代法等算法;然后,对给定的非线性方程进行求根,记录计算结果;最后,比较不同算法的优缺点。
4. 函数插值实验:编写程序实现拉格朗日插值、牛顿插值等方法;然后,对给定的函数进行插值,记录计算结果;最后,分析插值误差。
5. 常微分方程初值问题数值解法实验:编写程序实现欧拉法、改进的欧拉法、龙格-库塔法等算法;然后,对给定的常微分方程初值问题进行求解,记录计算结果;最后,比较不同算法的稳定性和精度。
数值分析总结数值分析是一门应用数学的学科,它的目标是使用数值方法来解决数学问题,尤其是那些难以使用解析方法求解的问题。
通过使用计算机来计算近似解,数值分析提供了一种实用而有效的解决方案。
在本文中,我将对我在学习数值分析过程中的一些主要收获进行总结。
一、数值方法的重要性数值方法不仅在科学计算中起着重要作用,而且在工程和实际应用领域也有广泛的应用。
无论是模拟天气预报、设计飞机的机翼,还是分析金融市场的波动,数值分析都可以提供快速、准确的结果。
因此,掌握数值方法成为了现代科学与工程领域必备的技能之一。
二、数值计算的误差与稳定性在数值计算中,我们经常会面对误差的问题。
舍入误差、截断误差和舍入误差都是我们需要关注的。
舍入误差是由于计算机在进行浮点数计算时的有限精度而引入的,而截断误差则是由于将无限精度的数学问题转化为有限精度计算引起的。
为了减小误差,我们可以使用舍入规则,并尽可能减小截断误差。
稳定性是另一个需要考虑的重要因素。
在一些计算中,输入数据的微小变化可能会导致输出结果的巨大变化。
这种情况下,我们说该算法是不稳定的。
为了确保计算的稳定性,我们需要选择合适的算法和数据结构,并且要进行合理的数值分析。
三、插值和拟合插值和拟合是数值分析的重要应用之一。
在实际问题中,我们往往只能够获得有限个数据点,但是我们需要获得一条曲线或函数来描述这些数据。
插值方法可以通过连接这些数据点来获得平滑的曲线,而拟合方法则通过选择一个合适的函数来逼近数据点。
在实际应用中,我们需要根据具体问题选择合适的插值和拟合方法,并进行适当的调整和优化。
四、求解非线性方程求解非线性方程是数值分析中的一个重要问题。
在实际应用中,很多问题都可以归纳为求解非线性方程。
例如,求解光学系统中的折射问题、解微分方程等。
数值分析提供了多种求解非线性方程的方法,如牛顿法、二分法、割线法等。
这些方法有着各自的特点和适用范围,我们需要根据问题的性质选择合适的方法。
数值分析学习总结感想第一篇:数值分析学习总结感想数值分析学习感想一个学期的数值分析,在老师的带领下,让我对这门课程有了深刻的理解和感悟。
这门课程是一个十分重视算法和原理的学科,同时它能够将人的思维引入数学思考的模式,在处理问题的时候,可以合理适当的提出方案和假设。
他的内容贴近实际,像数值分析,数值微分,求解线性方程组的解等,使数学理论更加有实际意义。
数值分析在给我们的知识上,有很大一部分都对我有很大的帮助,让我的生活和学习有了更加方便以及科学的方法。
像第一章就讲的误差,在现实生活中,也许没有太过于注意误差,所以对误差的看法有些轻视,但在学习了这一章之后,在老师的讲解下,了解到这些误差看似小,实则影响很大,更如后面所讲的余项,那些差别总是让人很容易就出错,也许在别的地方没有什么,但是在数学领域,一个小的误差,就很容易有不好的后果,而学习了数值分析的内容,很容易就可以将误差锁定在一个很小的范围内,在这一范围内再逼近,得出的近似值要准确的多,而在最开始的计算中,误差越小,对后面的影响越小,这无疑是好的。
数值分析不只在知识上传授了我很多,在思想上也对我有很大的影响,他给了我很多数学思想,很多思考的角度,在看待问题的方面上,多方位的去思考,并从别的例子上举一反三。
像其中所讲的插值法,在先学习了拉格朗日插值法后,对其理解透彻,了解了其中的原理和思想,再学习之后的牛顿插值以及三次样条插值等等,都很容易的融会贯通,很容易的就理解了其中所想,他们的中心思想并没有多大的变化,但是使用的方式却是不同的,这不仅可以学习到其中心内容,还可以去学习他们的思考方式,每个不同的思考方式带来的都是不同的算法。
而在看待问题上,不同的思考方式总是可以快速的全方位的去看透彻问题,从而知道如何去解决。
在不断的学习中,知识在不断的获取,能力在不断的提升,同时在老师的不懈讲解下,我逐渐的发现数值分析所涵盖的知识面特别的广泛,而我所需要学习的地方也更加的多,自己的不足也在不断的体现,我知道这只是我刚刚接触到了数学的那一角,在以后我还会接触到更多,而这求知的欲望也在不停的驱赶我,学习的越多,对今后的生活才会有更大的帮助。
一、实习背景数值分析是数学的一个重要分支,它研究如何用数值方法求解数学问题。
随着计算机技术的飞速发展,数值分析在各个领域得到了广泛的应用。
为了提高自己的实践能力,我选择了数值分析作为实习课题,希望通过这次实习,能够掌握数值分析的基本方法,并将其应用于实际问题中。
二、实习过程1. 实习初期在实习初期,我首先了解了数值分析的基本概念、理论和方法。
通过阅读相关教材和文献,我对数值分析有了初步的认识。
接着,我学习了数值分析的基本方法,如泰勒展开、牛顿法、高斯消元法等。
2. 实习中期在实习中期,我选择了几个实际问题进行数值计算。
首先,我使用泰勒展开法求解一个简单的微分方程。
通过编写程序,我得到了微分方程的近似解。
然后,我运用牛顿法求解一个非线性方程组。
在实际计算过程中,我遇到了一些问题,如收敛性、迭代次数过多等。
通过查阅资料和请教导师,我找到了解决方法,成功求解了方程组。
3. 实习后期在实习后期,我进一步学习了数值分析的高级方法,如复化梯形公式、复化Simpson公式、自适应梯形法等。
这些方法在解决实际问题中具有更高的精度和效率。
我选择了一个具体的工程问题,运用复化梯形公式求解定积分。
在计算过程中,我遇到了区间细分、精度控制等问题。
通过不断尝试和调整,我得到了较为精确的积分值。
三、实习收获与体会1. 理论与实践相结合通过这次实习,我深刻体会到理论与实践相结合的重要性。
在实习过程中,我不仅学习了数值分析的理论知识,还将其应用于实际问题中。
这使我更加深刻地理解了数值分析的基本方法,提高了自己的实践能力。
2. 严谨的学术态度在实习过程中,我养成了严谨的学术态度。
在编写程序、进行数值计算时,我注重细节,力求精确。
这使我更加注重学术规范,提高了自己的学术素养。
3. 团队合作精神实习过程中,我与其他同学进行了交流与合作。
在解决实际问题时,我们互相学习、互相帮助,共同完成了实习任务。
这使我更加懂得团队合作的重要性,提高了自己的团队协作能力。
数值分析第1章绪论--------学习小结一、本章学习体会通过本章的学习,让我初窥数学的又一个新领域。
数值分析这门课,与我之前所学联系紧密,区别却也很大。
在本章中,我学到的是对数据误差计算,对误差的分析,以及关于向量和矩阵的范数的相关内容。
误差的计算方法很多,对于不同的数据需要使用不同的方法,或直接计算,或用泰勒公式。
而对于二元函数的误差计算亦有其独自的方法。
无论是什么方法,其目的都是为了能够通过误差的计算,发现有效数字、计算方法等对误差的影响。
而对误差的分析,则是通过对大量数据进行分析,从而选择出相对适合的算法,尽可能减少误差。
如果能够找到一个好的算法,不仅能够减少计算误差,同时也可以减少计算次数,提高计算效率。
对于向量和矩阵的范数,我是第一次接触,而且其概念略微抽象。
因此学起来较为吃力,仅仅知道它是向量与矩阵“大小”的度量。
故对这部分内容的困惑也相对较多。
本章的困惑主要有两方面。
一方面是如何能够寻找一个可靠而高效的算法。
虽然知道算法选择的原则,但对于很多未接触的问题,真正寻找一个好的算法还是很困难。
另一方面困惑来源于范数,不明白范数的意义和用途究竟算什么。
希望通过以后的学习能够渐渐解开自己的疑惑。
二、本章知识梳理2.1 数值分析的研究对象数值分析是计算数学的一个重要分支,研究各种数学问题的数值解法,包括它致力于研究如何用数值计算的方法求解各种基本数学问题以及在求解过程中出现的收敛性,数值稳定性和误差估计等内容。
2.2误差知识与算法知识2.2.1误差来源误差按来源分为模型误差、观测误差、截断误差、舍入误差与传播误差五种。
其中模型误差与观测误差属于建模过程中产生的误差,而截断误差、舍入误差与传播误差属于研究数值方法过程中产生的误差。
2.2.2绝对误差、相对误差与有效数字1.(1)绝对误差e 指的是精确值与近似值的差值。
绝对误差:绝对误差限:(2)相对误差是指绝对误差在原数中所占的比例。
相对误差:相对误差限:研究对象方法的构造求解过程的理论分析结论:凡是经过四舍五入而得到的近似值,其绝对误差不超过该近似值末位的半个单位。
2024年数值分析学习心得体会____年数值分析学习心得体会随着技术的快速发展和应用的广泛推广,数值分析作为一门重要的学科,不断地在各个领域中展现出它的价值和作用。
在____年的这段时间里,我有幸学习了数值分析这门课程,并且在学习的过程中积累了一些心得体会。
在此将我的学习心得体会整理总结,与大家分享。
首先,数值分析是一门综合性的学科。
在学习数值分析的过程中,我逐渐认识到数值分析实际上是一个综合性的学科,它涉及到数学、计算机科学、物理学等多个领域的知识。
在数值分析的学习过程中,我们需要了解和掌握各种数值计算方法、算法和技术,同时还需要对计算机的运行原理和计算机编程有所了解。
只有全面掌握了这些知识,才能更好地应用数值分析方法来解决实际问题。
其次,数值分析需要具备良好的数学基础。
数值分析是建立在数学基础之上的一门学科,对于数学的掌握程度直接影响着数值分析的学习效果和应用能力。
在学习数值分析的过程中,我们需要有扎实的数学基础,特别是在微积分、线性代数、概率论等方面。
只有通过对数学知识的深入学习和理解,才能更好地把握数值分析方法的原理和应用技巧。
再次,数值分析需要具备良好的编程能力。
在数值分析中,计算机编程是必不可少的工具。
通过编程,我们可以将数值分析的方法和算法实现为具体的程序,使得计算机能够高效地完成复杂的计算任务。
因此,作为数值分析的学习者,我们需要具备良好的编程能力。
在学习数值分析的过程中,我通过学习和实践,逐渐掌握了Python等编程语言,学会了使用计算机编程解决数值分析中的各种问题。
此外,数值分析需要具备较强的分析和抽象能力。
数值分析是一个需要深入思考和抽象问题的学科。
在解决实际问题时,我们需要从具体问题中抽象出数学模型,并通过数值分析的方法来求解。
在学习数值分析的过程中,我逐渐锻炼了自己的分析和抽象能力,学会了从问题中抽象出数学模型,并通过数值计算的方法来解决问题。
最后,数值分析需要不断实践和总结。
数值分析总结随着现代科技的不断进步,数值分析已经成为各领域中不可或缺的一部分。
其在物理学、工程学、金融学等方面的应用都得到了广泛的认可,因此,对于计算机科学专业的同学们来说,学习数值分析已经成为必修的一门课程。
在本文中,我将就自己在学习数值分析课程中所掌握的知识做一些总结。
数值分析是一门关于如何使用数字来解决近似问题的科学。
在这个科学中,有许多有用的方法可以用来解决各种数学问题,其中最为常见的方法是数值计算。
数值计算是一种使用数字来解决特定的问题的方法。
在许多情况下,使用数值计算方法可以更加准确和快速地解决问题。
在数值分析课程中,学生需要掌握许多计算方法以及相关工具的使用。
例如,学生需要了解矩阵的乘法、矩阵分解、常微分方程等。
这些工具不仅可以应用于各种物理学和工程学问题中的数值解法,而且在生物学和社会科学领域也有着广泛的应用。
生物学家可以使用数值解法来模拟生物过程,比如分子动力学模拟。
社会学家可以使用数值方法来模拟不同的人类行为,例如人口数量增长预测。
在学习这些数值方法时,学生应该注意到这些方法的局限性。
尽管数值方法可以解决许多数学和物理问题,但在某些情况下会出现误差。
例如,在矩阵乘法的过程中,如果矩阵存在着特殊条件,那么乘法会变得更加困难。
此外,在微积分应用中,数值方法有时难以确定解是真的或近似的,因为误差可以在整个过程中积累。
在课程中,我们还学会了如何在计算中减少误差。
一个有用的方法是使用不同步长的方法,从而可以确定误差的上限。
为了减小误差,我们还可以使用不同的算法和不同的计算工具。
在实际的生产中,这些方法对于确保准确和可靠的计算是非常重要的。
另外,我们也学会了如何评估一种方法或算法的优点和缺点。
我们应该选择最适合特定问题的解决方案,以确保我们的计算是正确的。
在总结中,可以看出数值分析是一个广泛应用于各个学科领域的科学。
在学习数值分析时,我们需要了解各种数学和物理工具,并学会如何选择最适合我们的问题的数值方法。
2024年数值分析学习总结感想在____年的数值分析学习中,我经历了许多挑战和收获,我对此进行了总结和反思。
通过这篇总结感想,我希望能够回顾我的学习经历,进一步巩固自己的知识,并发现自己的不足之处,为今后的学习和成长做出调整和改进。
首先,我想感谢我的导师和同学们在这一年里给予我的帮助和支持。
没有他们的鼓励和指导,我无法取得今天的进步和成绩。
在课堂上,我的导师以生动有趣的授课方式引导我们学习数值分析的基本理论和方法。
在课后,导师愿意花时间和我们一起讨论并解答疑惑,他的耐心和细心使我受益匪浅。
同时,我的同学们也积极参与讨论和合作,他们的不同观点和方式让我开阔了思维,不断改进自己的学习方法。
在这一年里,数值分析的知识让我对计算机科学有了更深入的理解。
通过学习数值分析,我了解到了计算机在科学研究和工程实践中的重要性。
无论是对微积分的数值近似,还是对线性代数的数值解法,数值分析提供了一系列有效而实用的计算方法,对计算机科学的发展和技术应用起到了不可替代的作用。
在学习数值分析的过程中,我也迎来了许多挑战。
其中一个主要的挑战是数学基础的不足。
数值分析课程深入到诸如插值、积分和微分方程等数学领域的应用,这要求我具备扎实的数学基础。
然而,在我开始学习数值分析时,我意识到自己在数学上的缺陷。
为了填补这一漏洞,我不仅进行了系统的自学,还与同学一起组织小组学习和讨论。
通过持之以恒的努力,我逐渐提高了自己的数学能力,并能够更好地理解和应用课程中的数学知识。
另一个挑战是编程技巧的不足。
数值分析的实现通常需要编写程序来求解数学模型。
然而,我的编程技巧相对较弱,这对我在完成作业和实验时造成了一定的困扰。
为了克服这一困难,我主动请教导师和同学们,向他们学习优秀的编程技巧和实践经验。
此外,我也积极利用网络资源和编程书籍进行自学,不断提高自己的编程能力。
通过不断实践和尝试,我打破了自己的局限,逐渐掌握了一些常用的数值分析编程技巧,并能够独立完成一些较为复杂的编程任务。
Interpolation and Polynomial ApproximationXue Jingnan(200805090173)April1,2011AbstractIn this report,we reviewed three different interpolations and polynomial ap-proximations[1]respectively,say,Lagrange Polynomial,Hermite Interpolation and Cubic Spline Interpolation.We introduced their algorithm descriptions, related mathematical deductions and applications to practical problems respec-tively.Moreover,a brief discussion of their advantages and limits are presented at last.Contents1Introduction2 2Interpolation and the Lagrange Polynomial42.1Mathematical deduction (4)2.2Numerical experiments (5)2.2.1Example1 (5)2.2.2Example2 (6)3Hermite Interpolation93.1Mathematical deduction (9)3.2Algorithm description (11)3.2.1pseudocode (11)3.2.2code (12)3.3Numerical experiments (12)3.3.1Example1 (12)3.3.2Example2 (13)4Cubic Spline Interpolation164.1Mathematical deduction (16)4.2Algorithm description (18)4.2.1pseudocode (18)4.2.2code (20)4.3Numerical experiments (21)4.3.1Example1 (21)4.3.2Example2 (21)5Discussion and Conclusion235.1Interpolation and the Lagrange Polynomial (23)5.2Hermite Interpolation (23)5.3Cubic Spline Interpolation (23)1Chapter1IntroductionOne of the most useful and well-known classes of functions mapping the set of real numbers into itself is the class of algebraic polynomials,the set of functions of the formP n(x)=a n x n+a n−1x n−1+···+a1x+a0where n is a nonnegative integer and a0,...,a n are real constants.One reason for their importance is that they uniformly approximate continuous functions. Given any function,defined and continuous on a closed and bounded inter-val,there exists a polynomial that is as”close”to the given function as desired. Another important reason for considering the class of polynomials in the approx-imation of functions is that the derivative and indefinite integral of a polynomial are easy to determine and are also polynomials.For these reasons,polynomials are often used for approximating continuous functions.In this report,we discussed approximating a function using polynomials and piecewise polynomials.The function can be specified by a given defining equation or by providing points in the plane through which the graph of the function passes.A set of nodes x0,x1,···,x n is given in each case,and more information,such as the value of various derivatives,may also be required.We need tofind an approximating function that satisfies the conditions specified by these dataThe interpolating polynomial P(x)is the polynomial of least degree that satisfies,for a function f,P(x i)=f(x i),for each i=0,1,...,n.Although this interpolating polynomial is unique,it can take many different forms.The Lagrange form is most often used for interpolating tables when n is small and for deriving formulas for approximating derivatives and integrals. Neville’s method is used for evaluating several interpolating polynomials for computation and are also used extensively for deriving formulas for solving differential equations.The Hermite polynomials interpolate a function and its2CHAPTER1.INTRODUCTION3 derivative at the nodes.They can be very accurate but require more information about the function being approximated.When there are a large number of nodes,the Hermite polynomials also exhibit oscillation weaknesses.However,polynomial interpolation has the inherent weaknesses of oscillation, particularly if the number of nodes is large.In this case,there are other methods that can be better applied,the most commonly used one of which is piecewise-polynomial interpolation.If function and derivative values are available,piece-wise cubic Hermite interpolation is recommended.This is the preferred method for interpolating values of function that is the solution to a different equation. When only the function values are available,free cubic spline interpolation can be used.This spline forces the second derivative of the spline to be zero at the endpoints.Other cubic splines require additional data.For example,the clamped cubic spline needs values of the derivative of the function at the end-points of the interval.Chapter2Interpolation and the Lagrange Polynomial2.1Mathematical deductionThe problem of determining a polynomial of degree one that passes through the distinct points(x0,y0)and(x1,y1)is the same as approximating a function f for which f(x0)=y0and y(x1)=y1by means of afirst-degree polynomial interpolating,or agreeing with,or agreeing with,the values of f at the given points.Wefirst define the functionsL0(x)=x−x1x0−x1and L1(x)=x−x0x1−x0and then defineP(x)=L0(x)f(x0)+L1(x)f(x1).SinceL0(x0)=1,L0(x1)=0,L1(x0)=0,and L1(x1)=1,we haveP(x0)=1·f(x0)+0·f(x1)=f(x0)=y0andP(x1)=0·f(x0)+1·f(x1)=f(x1)=y1So P is the unique linear function passing through(x0,y0)and(x1,y1).To generalize the concept of linear interpolation,consider the construction of a polynomial of degree at most n that passes through the n+1points(x0,f(x0),(x1,f(x1),...(x n,f(x n).In this case we need to construct,for each k=0,1,...,n,a function L n,k(x) with the property that L n,k(x i)=0when i=k and L n,k(x k)=1.To satisfy4CHAPTER2.INTERPOLATION AND THE LAGRANGE POLYNOMIAL5 L n,k(x i)=0for each i=k requires that the numerator of L n,k(x)contains the term(x−x0)(x−x1)(x−x2)···(x−x k−1)(x−x k+1)···(x−x n).To satisfy L n,k(x)=1,the denominator of L n,k(x)must be equal to this term evaluated at x=x k.Thus,L n,k(x)=(x−x0)(x−x1)(x−x2)···(x−x k−1)(x−x k+1)···(x−x n)(x k−x0)(x k−x1)(x k−x2)···(x k−x k−1)(x k−x k+1)···(x k−x n).The interpolating polynomial is easily described once the form of L n,k is known.This polynomial,called the n th Lagrange interpolating polyno-mial,is defined in the following theorem.Theorem2.1If x0,x1,···,x n are n+1distinct numbers and f is a function whose values are given at these numbers,then a unique polynomial P(x)of degree at most n exists withf(x k)=P(x k),for each k=0,1,...,n.This polynomial is given byP(x)=f(x0)L n,0(x)+···+f(x n)L n,n(x)=nk=0f(x k)L n,k(x),(2.1)where,for each k=0,1,···,n,L n,k(x)=(x−x0)(x−x1)(x−x2)···(x−x k−1)(x−x k+1)···(x−x n) (x k−x0)(x k−x1)(x k−x2)···(x k−x k−1)(x k−x k+1)···(x k−x n)=ni=0i=kx−x ix k−x i.(2.2)We will write L n,k(x)simply as L k(x)when there is no confusion as to its degree2.2Numerical experiments2.2.1Example1Using the numbers(or nodes)x0=2,x1=2.5,and x2=4tofind the second in-terpolating polynomial for f(x)=1/x requires that we determine the coefficient polynomials L0(x),L1(x),and L2(x).In nested form they areL0(x)=(x−2.5)(x−4)(2−2.5)(2−4)=(x−6.5)x+10,L1(x)=(x−2)(x−4)(2.5−2)(2.5−4)=(−4x+24)x−323,CHAPTER 2.INTERPOLATION AND THE LAGRANGE POLYNOMIAL 6andL 2(x )=(x −2)(x −2.5)(4−2)(4−2.5)=(x −4.5)x +53Since f (x 0)=f (2)=0.5,f (x 1)=f (2.5)=0.4,and f (x 2)=f (4)=0.25,we haveP (x )=2k =0f (x k )L k (x )=0.5((x −6.5)x +10)+0.4((−4x +24)x −323)+0.25(x −4.5)x +53=(0.05x −0.425)x +1.15.An approximation to f (3)=1/3isf (3)≈P (3)=0.3252.2.2Example 2For the given functions f (x ),let x 0=0,x 1=0.6,and x 2=0.9.Construct interpolation polynomials of degree at most two to approximate f (0.45),and find the actual error.(1)f (x )=cos x (2)f (x )=√1+x (3)f (x )=ln(x +1)(4)f (x )=tan xAt the beginning,we determined the coefficient polynomials L 0(x ),L 1(x ),and L 2(x ).In nested form they areL 0(x )=(x −0.6)(x −0.9)(0−0.6)(0−0.9)=5027[(x −1.5)x +0.54]+10,L 1(x )=(x −0)(x −0.9)(0.6−0)(0.6−0.9)=−509(x −0.9)x )L 2(x )=(x −0)(x −0.6)(0.9−0)(0.9−0.6)=10027(x −0.6)x (1)f (x )=cos xSince f (x 0)=f (0)=1,f (x 1)=f (0.6)=cos(0.6)≈0.8253,and f (x 2)=f (0.9)≈0.6216,we haveP (x )=2k =0f (x k )L k (x )≈(5027[(x −1.5)x +0.54]+0.8253[−509(x −0.9)x )]+0.6216[10027(x −0.6)x ]≈(−0.4309x −0.0326)x +1CHAPTER2.INTERPOLATION AND THE LAGRANGE POLYNOMIAL7An approximation to f(0.45)=cos(0.45)=0.9004isf(0.45)≈P(0.45)=0.8980And the actual error is f(0.45)−P(0.45)=2.4×10−3(2)f(x)=√1+xSince f(x0)=f(0)=1,f(x1)=f(0.6)≈1.2649, and f(x2)=f(0.9)≈1.3784,we haveP(x)=2k=0f(x k)L k(x)≈(5027[(x−1.5)x+0.54]+1.2649[−509(x−0.9)x)]+1.3784[10027(x−0.6)x]≈(−0.0702x+0.4836)x+1An approximation to f(0.45)=1.2042isf(0.45)≈P(0.45)=1.2034 And the actual error is f(0.45)−P(0.45)=7.955×10−4 (3)f(x)=ln(1+x)Since f(x0)=f(0)=0,f(x1)=f(0.6)≈0.4700,and f(x2)=f(0.9)≈0.6419,we haveP(x)=2k=0f(x k)L k(x)≈0.4700[−509(x−0.9)x)]+0.6419[10027(x−0.6)x]≈(−0.2337x+0.9236)xAn approximation to f(0.45)=0.3716isf(0.45)≈P(0.45)=0.3683 And the actual error is f(0.45)−P(0.45)=3.3×10−3 (4)f(x)=tan xSince f(x0)=f(0)=0,f(x1)=f(0.6)≈0.6841,and f(x2)=f(0.9)≈1.2602,we haveP(x)=2k=0f(x k)L k(x)≈0.6841[−509(x−0.9)x)]+1.2602[10027(x−0.6)x]≈(0.8669x+0.6200)xCHAPTER2.INTERPOLATION AND THE LAGRANGE POLYNOMIAL8An approximation to f(0.45)=0.4830isf(0.45)≈P(0.45)=0.4545And the actual error is f(0.45)−P(0.45)=0.0285Chapter3Hermite InterpolationLet x0,x1,...,x n be n+1distinct numbers in[a,b]and m i be a nonnegative integer associated with x i,for i=0,1,...,n.Suppose that f∈C m[a,b], where m=max0≤i≤n m i.The osculating polynomial approximating f is the polynomial P(x)of least degree such thatd k P(x i) dx k =d k f(x i)dx k,for each i=0,1,...,n and k=0,1,...,nNote that when n=0,the osculating polynomial approximating f is the m0th Taylor polynomial for f at x0.When m i=0for each i,the osculating polynomial is the n th Lagrange polynomial interpolating f on x0,x1,...,x n The case when m i=1,for each i,gives the Hermite polynomials.For a given function f,these polynomials agree with those of f,they have the same ”shape”as the function at(x i,f(x i))in the sense that the tangent lines to the polynomial and to the function agree.We will restrict our study of osculating polynomials to this situation.3.1Mathematical deductionFirstly,consider a theorem that describes precisely the form of the Hermite polynomials.Theorem3.1If f∈C1[a,b]and x0,...,x n∈[a,b]are distinct,the unique polynomial of least degree agreeing with f and f at x0,...,x n is the Hermite polynomial of degree at most2n+1given byH2n+1(x)=nj=0f(x j)H n,j(x)+nj=0f (x j)ˆH n,j(x)whereH n,j(x)=[1−2(x−x j)L n,j(x j)]L2n,j(x)9CHAPTER3.HERMITE INTERPOLATION10andˆHn,j(x)=(x−x j)L2n,j(x)In this context,L n,j(x)denotes the j th Lagrange coefficient polynomial of degree n defined in Chapter2.Moreover,if f∈C2n+2[a,b],thenf(x)=H2n+1(x)+(x−x0)2...(x−x n)2(2n+2)!f2n+2(ξ)for someξwith a<ξ<bAlthough Theorem3.1provides a complete description of the Hermite poly-nomials,it is clear that the need to determine and evaluate the Lagrange poly-nomials and their derivatives makes the procedure tedious even for small values of n.An alternative method for generating Hermite approximations has as its basis the Newton interpolatory divided-difference formula for the Lagrange polynomial at x0,x1,...,x n,P n(x)=f[x0]+nk=1f[x0,x1,...,x k](x−x0)···(x−x k−1)and the connection between the n th divided difference and n th derivative of f.Suppose that the distinct numbers x0,x1,/dots,x n are given together with the values of f and f at these numbers.Define a new sequence z0,z1,...,z2n+1 byz2i=z2i+1=x i,for each i=0,1,...,n,and construct the divided difference table that uses z0,z1,....z2n+1 Since z2i=z2i+1=x i,for each i,we cannot define f[z2i,z2i+1]by the divided difference formula.If we assume that the reasonable substitution in this situation is f[z2i,z2i+1]=f (z2i)=f (x i),we can use the entriesf (x0),f (x1),...,f (x n)in place of the undefinedfirst divided differencesf[z0,z1],f[z2,z3],...,f[z2n,z2n+1]The remaining divided differences are produced as usual,and the appropriate divided differences are employed in Newton’s interpolatory divided-difference formula.The Hermite polynomial is given byH2n+1(x)=f[z0]+2n+1k=1f[z0,...,x k](x−z0)(x−z1)...(x−z k−1)CHAPTER3.HERMITE INTERPOLATION11 3.2Algorithm description3.2.1pseudocodeTo obtain the coefficients of the Hermite interpolating polynomial H(x)on the (n+1)distinct numbers x0,...,x n for the function f:INPUT numbers x0,x1,...,x n;values f(x0),...,f(x n)and f (x0),...,f (x n) OUTPUT the numbers Q0,0,Q1,1,...,Q2n+1,2n+1whereH(x)=Q0,0+Q1,1(x−x0)+Q2,2(x−x0)2+Q3,3(x−x0)2(x−x1) +Q4,4(x−x0)2(x−x1)2+···+Q2n+1,2n+1(x−x0)2(x−x1)2···(x−x n−1)2(x−x n)Step1For i=0,1,...,n do Step2and3Step2Set z2i=x i;z2i+1=x i;Q2i,0=f(x i);Q2i+1,0=f(x i)Q2i+1,1=f (x i)Step3If i=0then setQ2i,1=Q2i,0−Q2i−1,0 z2i−z2i−1Step4For i=2,3,...,2n+1for j=2,3,...,i setQ i,j=Q i,j−1−Q i−1,j−1z i−z i−jStep5OUTPUT(Q0,0,Q1,1...Q2n+1,2n+1) STOPCHAPTER3.HERMITE INTERPOLATION12 3.2.2code3.3Numerical experiments3.3.1Example1Use the Hermite polynomial that agrees with the data in Table3.1tofind an approximation of f(1.5)Table3.1:Example1k x k f(x k)f (x k)11.30.6200860−0.522023221.60.4554022−0.569895931.90.2818186−0.5811571Table3.2shows the entries that are used for determining the Hermite poly-nomial H5(x)for x0,x1,and x2.The entries in Table3.3use the given data.CHAPTER3.HERMITE INTERPOLATION13H5(1.5)=0.6200860+(1.5−1.3)(−0.5220232)+(1.5−1.3)2(−0.0897427) +(1.5−1.3)2(1.5−1.6)(0.0663657)+(1.5−1.3)2(1.5−1.6)2(0.0026663)+(1.5−1.3)2(1.5−1.6)2(1.5−1.9)(−0.0027738)=0.51182773.3.2Example2Use Hermite interpolation to construct an approximating polynomial for the following data The entries in Table3.5use the given data.H5(x)=−0.0247500+(x+0.5)(0.7510000)+(x+0.5)2(2.7510000)+(x+0.5)2(x+0.25)CHAPTER3.HERMITE INTERPOLATION14Table3.2:z f(z)First divided differences Second divideddifferencesz0=x0f[z0]=f(x0)f[z0,z1]=f (x0)z1=x0f[z1]=f(x0)f[z0,z1,z2]f[z1,z2]=f[z2]−f[z1]z2−z1z2=x1f[z2]=f(x1)f[z1,z2,z3]f[z2,z3]=f (x1)z3=x1f[z3]=f(x1)f[z2,z3,z4]f[z3,z4]=f[z4]−f[z3]z4−z3z4=x2f[z4]=f(x2)f[z3,z4,z5]f[z4,z5]=f (x2)z5=x2f[z5]=f(x2)Third divided differences Fourth divideddifferencesFifth divided differencesf[z0,z1,z2,z3]f[z0,z1,z2,z3,z4]f[z1,z2,z3,z4]f[z0,z1,z2,z3,z4,z5]f[z1,z2,z3,z4,z5]f[z2,z3,z4,z5]CHAPTER3.HERMITE INTERPOLATION15Table3.3:1.30.6200860-0.52202321.30.6200860-0.0897427-0.54894600.06636571.60.4554022-0.06983300.0026663-0.56989590.0679655-0.0027738 1.60.4554022-0.02905370.0010020-0.57861200.06856671.90.2818186-0.0084837-0.58115711.90.2818186Table3.4:Example2k x k f(x k)f (x k)1−0.5−0.02475000.75100002−0.250.33493752.1890000301.1010004.0020000Table3.5:-0.5-0.02475000.7510000-0.5-0.0247500 2.75100001.43875001-0.250.3349375 3.001000002.189000010-0.250.3349375 3.501000003.064250010 1.1010000 3.75100004.00200000 1.1010000Chapter4Cubic Spline Interpolation The previous chapter concerned the approximation of arbitrary functions on closed intervals by the use of polynomials.However,the oscillatory nature of high-degree polynomials and the property that afluctuation over a small portion of the interval can induce largefluctuations over the entire rage restricts their use.An alternative approach is to divide the interval into a collection of subin-tervals and construct a(generally)different approximating polynomial on each subinterval.Approximation by functions of this type is called piecewise-polynomial approximationThe most common piecewise-polynomial approximation uses cubic polyno-mials between each successive pair of nodes and is called cubic spline in-terpolation.A general cubic polynomial involves four constants,so there is sufficientflexibility in the cubic spline procedure to ensure that the interpolant is not only continuously differentiable on the interval,but also has a continuous second derivative.The construction of the cubic spline does not,however,as-sume that the derivatives of the interpolant agree with those of the function it is approximating,even at the nodes.4.1Mathematical deductionGiven a function f defined on[a,b]and a set of nodes a=x0<x1</cdots< x n=b,a cubic spline interpolant S for f is a function that satisfies the following conditions:a.S(x)is a cubic polynomial,denoted S j(x),on the subinterval[x j,x j+1]foreach j=0,1,...,n−1;b.S(x j)=f(x j)for each j=0,1,...,n;c.S j+1(x j+1)=S j(x j+1)for each j=0,1,...,n−2;d.S j+1(x j+1)=S j(x j+1)for each j=0,1,...,n−2;16CHAPTER4.CUBIC SPLINE INTERPOLATION17e.S j+1(x j+1)=S j(x j+1)for each j=0,1,...,n−2;f.One of the following sets of boundary conditions is satisfied:(1)S (x0)=S (x n)=0(free or natural boundary)(2)S (x0)=f (x0)and S (x n)=f (x n(clamped boundary)Although cubic splines are defined with other boundary conditions,the con-ditions given in(f)are sufficient for our purposes.When the free boundary conditions occur,the spline is called a natural spline,and its graph approxi-mates the shape that a longflexible rod would assume if forced to go through the data points{(x0,f(x0)),(x1,f(x1)),...,(x n,f(x n))}.In this chapter,we only consider this oneTo construct the cubic spline interpolant for a given function f,the condi-tions in the definition are applied to the cubic polynomialsS j(x)=a j+b j(x−x j)+c j(x−x j)2+d j(x−x j)3for each j=0,1,...,n−1.SinceS j(x j)=a j=f(x j)condition(c)can be applied to obtaina j+1=S j+1(x j+1)=S j(x j+1)=a j+b j(x j+1−x j)+c j(x j+1−x j)2+d j(x j+1−x j)3 for each j=0,1,...,n−2.Since the terms x j+1−x j are used repeatedly in this development,it is convenient to introduce the simpler notationh j=x j+1−x jfor each j=0,1,...,n−1..If we also define a n=f(x n),then the equationa j+1=a j+b j h j+c j h2j+d j h3j(4.1) holds for each j=0,1,...,n−2In a similar manner,define b n=S (x n)and observe thatS j(x)=b j+2c j(x−x j)+3d j(x−x j)2implies S j(x j)=b j,for each j=0,1,...,n−1.Applying condition(d)givesb j+1=b j+2c j h j+3d j h2j,(4.2) for each j=0,1,...,n−2Another relationship between the coefficients of S j is obtained by defining c n=S (x n)/2and applying condition(e).Then,for each j=0,1,...,n−1,c j+1=c j+3d j h j(4.3)CHAPTER4.CUBIC SPLINE INTERPOLATION18 Solving for d j in Eq.(4.3)and substituting this value into Eqs.(4.1)and(4.2) gives,for j=0,1,...,n−1,the new equationsa j+1=a j+b j h j+h2j3(2c j+c j+1)(4.4)andb j+1=b j+h j(c j+c j+1)(4.5)Thefinal relationship involving the coefficients is obtained by solving the appropriate equation in the form of equation(3.4),first for b j,b j=1h j(a j+1−a j)−h j3(2c j+c j+1)(4.6)and then,with a reduction of the index,for b j−1.This givesb j−1=1h j−1(a j−a j−1)−h j−13(2c j−1+c j),Substituting these values into the equation derived from Eq(4.5),with the index reduced by one,gives the linear system of equations.h j−1c j−1+2(h j−1+h j)c j+h j c j+1=3h j(a j+1−a j)−3h j−1(a j−a j−1)(4.7)for each j=1,2,...,n−1.This system involves only the{c j}n j=0as unknownssince the values of{h j}n−1j=0and{a j}n j=0are given,respectively,by the spacingof the nodes{x j}n j=0and the values of f at the nodes.Note that once the values of{c j}n j=0are determined,it is a simple matter tofind the remainder of the constants{b j}n−1j=0from Eq.(4.6)and{d j}n−1j=0fromEq.(4.3),and to construct the cubic polynomials{S j(x)}n−1j=0.The major question that arises in connection with this construction is whether the values of{c j}n j=0can be found using the system of equations given in Eq.(4.7) and,if so,whether these values are unique.The following theorems indicate that this is the case when the free or natural boundary is imposed.As the proof of this theorem require some knowledge we haven’t learned,we decide not to introduce the proof to this report.Theorem4.1If f is defined at a=x0<x1<···<x n=b,then f has a unique natural spline interpolant S on the nodes x0,x1,....x n;that is,a spline interpolant that satisfies the boundary conditions S (a)=0and S (b)=0. 4.2Algorithm description4.2.1pseudocodeTo construct the cubic spline interpolant S for the function f,defined at the numbers x0<x1<···<x n,satisfying S (x0)=S (x n)=0:CHAPTER4.CUBIC SPLINE INTERPOLATION19INPUT n;x0,x1,...,x n;a0=f(x0),a1=f(x1),...,a n=f(x n).OUTPUT a j,b j,c j,d j for j=0,1,...,n−1.Step1For i=0,1,...,n−1set h i=x i+1−x i.Step2For i=1,...,n−1setαi=3h i(a i+1−a i)−3h i−1(a i−a i−1)Step3Set l0=1;u0=0;z0=0;Step4For i=1,2,...,n−1set l i=2(x i+1−x i−1)−h i−1u i−1;u i=h i/l iz i=(αi−h i−1z i−1)/l iStep5Set l n=1;z n=0;c n=0;Step6For j=n−1,n−2,...,0set c j=z j−u j c j+1;b j=(a j+1−a j)/h j−h j(c j+1+2c j)/3;d j=(c j+1−c j)/(3h j).Step7OUTPUT(a j,b j,c j,d j for j=0,1,...,n−1) STOPCHAPTER4.CUBIC SPLINE INTERPOLATION20 4.2.2codeCHAPTER4.CUBIC SPLINE INTERPOLATION21 4.3Numerical experiments4.3.1Example1Table4.1:Example1x0.9 1.3 1.9 2.1 2.6 3.0 3.9 4.4 4.7 5.0 f(x) 1.3 1.5 1.85 2.1 2.6 2.7 2.4 2.15 2.05 2.16.07.08.09.210.511.311.612.012.61313.32.25 2.3 2.25 1.95 1.40.90.70.60.50.40.25Using the codes above to generate the free cubic spline for this data produces the coefficients shown in Table4.2.Table4.2:j x j a j b j c j d j00.9 1.3 5.400.00-0.251 1.3 1.50.42-0.300.952 1.9 1.85 1.09 1.41-2.963 2.1 2.1 1.29-0.37-0.454 2.6 2.60.59-1.040.455 3.0 2.7-0.02-0.500.176 3.9 2.4-0.5-0.030.087 4.4 2.15-0.480.08 1.318 4.7 2.05-0.07 1.27-1.589 5.0 2.10.26-0.160.0410 6.0 2.250.08-0.030.00117.0 2.30.01-0.04-0.02128.0 2.25-0.14-0.110.02139.2 1.95-0.34-0.05-0.011410.5 1.4-0.53-0.10-0.021511.30.9-0.73-0.15 1.211611.0.7-0.490.94-0.841712.00.6-0.14-0.060.041812.60.5-0.180.00-0.451913.00.4-0.39-0.540.604.3.2Example2Construct the free cubic spline for the following data.CHAPTER4.CUBIC SPLINE INTERPOLATION22Table4.3:Example2x f(x)0.1-0.620499580.2-0.283986680.30.006600950.40.24842440Using the codes above to generate the free cubic spline for this data produces the coefficients shown below.Table4.4:j x j a j b j c j d j00.1-0.6205 3.45510-8.995810.2-0.2840 3.1852-2.6987-0.946320.30.0066 2.6171-2.98269.9421Since the coefficients have been determined,the polynomial will also be arrived at easily.Chapter5Discussion and Conclusion In this chapter,we will analyze advantages and limitations of each method re-spectively.5.1Interpolation and the Lagrange Polynomial Among these methods,the Lagrange polynomial is considered the simplest one, meaning that it needs the least workload.However,as the Lagrange polynomial only requires that the values of the interpolating polynomial are the same with those of original function on the given nodes,therefore its accuracy is relative low,compared with Hermite polynomial.Moreover,it has the inherent weakness of oscillation,which limits its application to situation where the number of nodes is large.5.2Hermite InterpolationCompared with the Lagrange Polynomial,Hermite polynomial interpolate a function and its derivative at the nodes,thus it can be expected to be more accurate.However,it also means that more information about the function being appropriated will be required,which limits its application to situations where not enough information about the original polynomial can be provided. And when there are a large of number of nodes,the Hermite polynomial also exhibit oscillation weaknesses.5.3Cubic Spline InterpolationThe most obvious advantage of this interpolation is that it successfully solved the inherent problem,oscillatory nature of high-degree polynomial,within the Hermite Interpolation and the Lagrange Interpolation.However,the workload of this interpolation is somewhat heavier than others.23Bibliography[1]Richard L.Burden and J.Douglas Faires:Numerical Analysis,chapter3(2001)24。