南大数值分析课件§2 复合求积.pptVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
南大数值分析课件§2 复合求积

* §2 复合求积 /* Composite Quadrature */ Haven’t we had enough formulae? What’s up now? Oh come on, you don’t seriously consider h=(b?a)/2 acceptable, do you? Why can’t you simply refine the partition if you have to be so picky? Don’t you forget the oscillatory nature of high- degree polynomials! Uh-oh 高次插值有Runge 现象,故采用分段低次插值 ? 分段低次合成的 Newton-Cotes 复合求积公式。 ? 复合梯形公式: 在每个 上用梯形公式: = Tn /*中值定理*/ §2 Composite Quadrature ? 复化 Simpson 公式: 4 4 4 4 4 = Sn 注:为方便编程,可采用另一记法:令 n’ = 2n 为偶数, 这时 ,有 §2 Composite Quadrature ? 收敛速度与误差估计: 定义    若一个积分公式的误差满足 且C ? 0,则称该公式是 p 阶收敛的。 ~ ~ ~ 例:计算 解: 其中 = 3.138988494 其中 = 3.141592502 运算量基本相同 例: 用复化梯形公式、复化Simpson公式和复化 Cotes公式计算 要使精度要求达到 问N各取多少? HW: p.273 1,3,4,5,6 §2 Composite Quadrature Q: 给定精度 ?,如何取 n ? 例如:要求 ,如何判断 n = ? ? 上例中若要求 ,则 即:取 n = 409 通常采取将区间不断对分的方法,即取 n = 2k 上例中2k ? 409 ? k = 9 时,T512 = 3 S4 = 3.141592502 注意到区间再次对分时 可用来判断迭代 是否停止。 §2 Composite Quadrature Lab 13. Composite Trapezoidal Rule Use the Composite Trapezoidal rule with a given n 0 to approximate a given integral . You are supposed to write a function double CTR ( int n, double a, double b, double (*f)( ) ) to approximate the integral from a to b of the function f using the trapezoidal rule on n equal-length subintervals. Input There is no input file. Instead, you must hand in your function in a *.h file. The rule of naming the *.h file is the same as that of naming the *.c or *.cpp files. Output For each test case, you are supposed to return the approximation of the integral. §2 Composite Quadrature Sample Judge Program #include stdio.h #include math.h #include13.h ? double f1 ( double x ) { return (1.0/(1.0+sin(x)*sin(x))); } ? double f2 ( double x ) { return (x*log(x)); } ? void main( ) {

文档评论(0)

ma33756 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档