




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
数值计算方法实验报告11什么是数值计算方法及应用与误差计算 1什么是数值计算方法及应用计算数学也叫做数值计算方法或数值分析。主要内容包括代数方程、线性代数方程组、微分方程的数值解法,函数的数值逼近问题,矩阵特征值的求法,最优化计算问题,概率统计计算问题等等,还包括解的存在性、唯一性、收敛性和误差分析等理论问题。数值计算方法,是一种研究并解决数学问题的数值近似解方法,是在计算机上使用的解数学问题的方法,简称计算方法。在科学研究和工程技术中都要用到各种计算方法。 例如,在航天航空、地质勘探、汽车制造、桥梁设计、 天气预报和汉字字样设计中都有计算方法的踪影.Numerical analysis involves the study of methods of computing numerical data. In many problems this implies producing a sequence of approximations by repeating the procedure again and again. People who employ numerical methods for solving problems have to worry about the following issues: the rate of convergence (how long does it take for the method to find the answer), the accuracy (or even validity) of the answer, and the completeness of the response (do other solutions, in addition to the one found, exist).Numerical methods provide approximations to the problems in question. No matter how accurate they are,they do not, in most cases, provide the exact answer. In some instances working out the exact answer by a different approach may not be possible or may be too time consuming and it is in these cases where numerical methods are mostoften used.The ever-increasing advances in computer technology has enabled many in science and engineering to apply numerical methods to simulate physical phenomena. Numerical methods are often divided into elementary ones such as finding the root of an equation, integrating a function or solving a linear system of equations to intensive ones like the finite element method. Intensive methods are often needed for the solution of practical problems and they often require the systematic application of a range of elementary methods, often thousands or millions of times over. In the development of numerical methods, simplifications need to be made to progress towards a solution: for example general functions may need to be approximated by polynomials and computers cannot generally represent numbers exactly anyway. As a result, numerical methods do not usually give the exact answer to a given problem, or they can only tend towards a solution getting closer and closer with each iteration. Numerical methods are generally only useful when they are implemented on computer using a computer programming language. In the study of numerical methods, we can make a general distinction between a set of methods such as solving linear systems of equations , solving matrix eigenvalue problems , interpolation , numerical integration and finding the roots or zeros of equations , which can be somewhat considered as the building blocks for larger that arise in engineering/applied mathematics/physics. For example the problem of solving ordinary differential equations , optimisation and solvingintegral equations . But from the point of view of aplied mathematics or engineering, erhaps the most significant problems in numerical methods is the solution of partial differential equations by Finite Difference Methods , Finite Element Methods or Boundary Element Methods . 数值分析是涉及计算数字数据的方法的研究。在许多问题中,这意味着一遍又一遍重复程序以产生近似值得序列。应用数值方法解决问题的人关心以下问题:收敛率(算法需要多久来找到答案),答案的准确性(或者有效性),响应的完整性(做其他的解决方案,另外一个发现,存在的话)。数值方法提供了问题的近似答案。无论它是如何准确,它在大多数情况下也不会提供真切的答案。在某些情况下用不同的方式寻求确切的答案是不太可能的或也可能是太耗费时间,这就是数值计算方法最经常使用情况。计算机技术的不断进步使许多科学和工程应用数值方法来模拟物理现象。数值方法通常分为初级的,如找到一个方程的根,集成功能型向集约型的,如有限元法求解线性系统的方程。密集的方法往往是解决实际问题的需要,他们往往需要系统应用一系列的基本方法,通常是数千或数百万次。在发展的数值方法中,简化是取得进展的解决方案所必需的,例如:大多函数可能需要近似多项式和计算机不能准确地表示数字。因此,数值方法通常不会给出给定问题确切的答案,或者它们在每次迭代中只能越来越密切地趋近解决方案。数值方法一般仅在当它们被电脑上的一种计算机编程语言实现时起作用。在研究数值方法中,我们可以得到一些一整套方法的大体特性,如求解线性方程组,求解矩阵特征值问题,插值,数值积分,发现根部或零方程组的,这些可以在一定程度上被视为解决工程/应用数学/物理问题的桥梁。例如求解常微分方程,优化和解决的问题,积分方程。但是,。用于数学或工程的角度来看,数值方法的最重要的问题是用有限差分法,有限元方法,边界元法解决偏微分方程。2. 误差计算1.实验描述1根据习题12和习题13构造算法和MATLAB程序,以便精确计算所有情况下的二次方程的根,包括的情况。2参照1.25对3个差分方程计算出前十个数值的近似值,构造列表和图形。误差算法分别为,.2.实验内容1设,且有方程。通过如下二次根公式可解出方程的根: (1)这些根还可通过下列等价公式解出: (2)2对下列三个差分方程计算出前10个数值近似值。在每种情况下引入一个小的初始误差。如果没有初始误差,则每个差分方程将生成序列。用MATLAB构造生成图表。(a),其中n=1,2, (b) ,其中n=2,3, (c), 其中n=2,3, 3.实验结果及分析1.二次方程的的求根根据习题12所述,若b0,两个根为=,=;若b0Input a, b ,coutputoutputoutputend2.误差传播按附件的代码得到下面的图表。表 1 序列=以及近似值,和n01.0000000000000000.994000000000000 1.000000000000000 1.000000000000000 10.500000000000000 0.497000000000000 0.4970000000000000.49700000000000020.2500000000000000.2485000000000000.2455000000000000.24250000000000030.1250000000000000.1242500000000000.119750000000000 0.11525000000000040.0625000000000000.0621250000000000.056875000000000 0.05162500000000050.0312500000000000.0310625000000000.025437500000000 0.01981250000000060.0156250000000000.0155312500000000.0097187500000000.00390625000000070.007812500000000 0.0077656250000000.001859375000000-0.00404687500000080.0039062500000000.003882812500000-0.002070312500000-0.00802343750000090.001953125000000 0.001941406250000-0.004035156250000-0.010011718750000100.0009765625000000.000970703125000-0.005017578125000-0.011005859375000表 2 误差序列,和 00.006000000000000 0.000000000000000 0.000000000000000 10.0030000000000000.0030000000000000.00300000000000020.0015000000000000.004500000000000 0.00750000000000030.0007500000000000.0052500000000000.01575000000000040.0003750000000000.0056250000000000.03187500000000050.0001875000000000.0058125000000000.06393750000000160.0000937500000000.0059062500000000.12796875000000170.0000468750000000.0059531250000000.25598437500000380.0000234375000000.0059765625000000.51199218750000590.0000117187500000.0059882812500001.023996093750010100.0000058593750000.0059941406250002.047998046875021是误差稳定的,且按指数级递减,相差不大较为稳定,说明该序列和等比序列较为接近。的误差不大较为稳定,但误差呈递增状态,所以其逼近效果不如。的误差是不稳定的,变化幅度较大,即n越大,误差越大,说明当时,误差可能比数值更大。以下就是差分方程的的图形图 1 稳定递减的误差序列 图 2 稳定的误差序列图 3 不稳定的误差序列4.结论1.运行程序后,当输入a,b,c分别为0,0和0时,输出 there are infinite roots当输入a,b,c分别为1,-1000000.000001和1时,输出x1= 1000000.000000000000,x2= 0.000001000000。对于特殊情况和高精度运算,算法能得出精确的值。由此我们可以得出我们所采用的算法可行。 2通过对于差分方程的求解可知,不同的差分方程的初始误差传播会随着其表达式的不同有很大差异性。因此,对于不同差分方程的选取问题和计算问题应慎重选择,选择稳定算法。附件(代码):1. function x1,x2=input(a,b,c)%input -a is the coefficient of x2% -b is the coefficient of x% -c is the Constant coefficient%output-x1 is one root of the equation% -x2 is one root of the equationif a=0&b=0 disp(there are infinite roots) returnendif a=0 x1=x2=-c/belseif b0 x1=(-2*c)/(b+sqrt(b*b-4*a*c) x2=(-b-sqrt(b*b-4*a*c)/(2*a) else x1=(-b+sqrt(b*b-4*a*c)/(2*a) x2=(-2*c)/(b-sqrt(b*b-4*a*c)end2. n=0:10;xn=1./(2.n) %-n is the input-sequence%-xn is the value of the sequence(a)r0=0.994;r(1)=r0/2for n=2:10r(n)=r(n-1)/2;%-r(n) is the general term of xnendr0,r(b)p0=1;p(1)=0.497;p(2)=3*p(1)/2-p0/2;for n=3:10p(n)=3*p(n-1)/2-p(n-2)/2;%-p(n) is the general term of pnendp0,p%- show all the items of pn(c)q0=1;q(1)=0.497;q(2)=5*q(1)/2-q0;for n=3:10q(n)=3*q(n-1)/2-q(n-2)/2;%-r(n) is
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 7.5 解直角三角形说课稿-2025-2026学年初中数学苏科版2012九年级下册-苏科版2012
- 人教版二年级上册数学全册集体备课教学设计(配2025年秋改版教材)
- 二年级品德下册 主题三“我们一起做”说课稿 首师大版
- 探究与实践 看云识天气教学设计-2025-2026学年初中地理湘教版2024七年级上册-湘教版2024
- 《第一单元 唱歌 大雨和小雨》(教学设计)-2023-2024学年人教版(2012)音乐一年级上册
- 农药的田间药效试验说课稿-2025-2026学年中职专业课-植物保护技术-农林类-农林牧渔大类
- 蒲城县医院知识培训课件
- 蒜苔农业知识培训课件
- 葡萄酒酒标基础知识培训
- 2025年林业时政试题及答案解析
- 中级注册安全工程师《法律法规》试题及答案
- 2025年汽车转向系统行业需求分析及创新策略研究报告
- 2025年四川省成都市高新区事业单位招聘考试综合类面试真题模拟试卷
- 2025年秋统编版语文二年级上册全册课件(课标版)
- 七下期末人教版数学试卷
- 2025新疆巴音郭楞州和硕县面向社会招聘社区工作者7人笔试参考题库附答案解析
- 2025年六安市裕安区石婆店镇公开招考村级后备干部8名笔试备考试题及答案解析
- 2025年事业单位考试题库及参考答案
- 2025全国农业(水产)行业职业技能大赛(水生物病害防治员)选拔赛试题库(含答案)
- 石油钻采设备与工具专业标准分类
- GB/T 39725-2020信息安全技术健康医疗数据安全指南
评论
0/150
提交评论