高斯求积公式matlab程序_选择积分方法—高斯积分

本文介绍了高斯积分法在数值计算中的优势,并提供了MATLAB中的计算实例,强调了高斯求积在处理平滑函数时的高精度。讨论了如何通过映射积分点和利用勒让德多项式来实现高斯积分,同时对比了与其他积分方法如梯形法和辛普森法则的适用场景。

无限区间 (1)梯形法则,(2)辛普森法则,(3)龙伯格积分法或(4)高斯积分法,有一些适用的指导原则。

通常,更高阶的方法对于平滑函数更好。 如果不是,那么使用更简单的方法会更好,因为数据的变化不会反映在采样点上。 梯形法则适用于在均匀间隔的采样点处积分来自实验的数据。 这对于表现不佳的函数是有好处的。 辛普森的规则依赖于被积函数的更高阶的近似,以便准确。 而高斯积分是非常准确的,如果你需要均匀间隔的采样点,它不是令人满意的。

高斯积分

######################################################################
#
# Functions to calculate integration points and weights for Gaussian
# quadrature
#
# x,w = gaussxw(N) returns integration points x and integration
#           weights w such that sum_i w[i]*f(x[i]) is the Nth-order
#           Gaussian approximation to the integral int_{-1}^1 f(x) dx
# x,w = gaussxwab(N,a,b) returns integration points and weights
#           mapped to the interval [a,b], so that sum_i w[i]*f(x[i])
#           is the Nth-order Gaussian approximation to the integral
#           int_a^b f(x) dx
#
# This code finds the zeros of the nth Legendre polynomial using
# Newton's method, starting from the approximation given in Abramowitz
# and Stegun 22.16.6.  The Legendre polynomial itself is evaluated
# using the recurrence relation given in Abramowitz and Stegun
# 22.7.10.  The function has been checked against other sources for
# values of N up to 1000.  It is compatible with version 2 and version
# 3 of Python.
#
# Written by Mark Newman <mejn@umich.edu>, June 4, 2011
# You may use, share, or modify thi
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值