# Gauss型求积公式及其Matlab程序

1 篇文章 0 订阅
1 篇文章 0 订阅
1 篇文章 0 订阅

## 为什么要引入数值积分

I ( f ) = ∫ a b f ( x ) d x I(f)=\int_{a}^{b} f(x) dx

I ( f ) = ∫ a b f ( x ) d x = F ( b ) − F ( a ) I(f)=\int_{a}^{b}f(x)dx=F(b)-F(a)

## Gauss型求积公式的定义

x k ( k = 1 , 2 , 3.... ) x_k(k=1,2,3....) 为n次Legendre多项式的根。
A k = ∫ − 1 1 ω ( x ) ( x − x k ) ω ′ ( x k ) d x A_k=\int_{-1}^{1} \frac{\omega(x)}{(x-x_k)\omega'(x_k)}dx

## Gauss公式的应用

Gauss公式主要应用为二点Gauss公式和三点Gauss公式

∫ 0 1 s i n x x d x = ∫ − 1 1 s i n 0.5 ( t + 1 ) t + 1 d x \int_{0}^{1}\frac{sinx}{x}dx=\int_{-1}^{1}\frac{sin0.5(t+1)}{t+1}dx
t 0 = − 1 3 , t 1 = 1 3 t_0=\frac{-1}{\sqrt 3},t_1=\frac{1}{\sqrt 3}
∫ 0 1 s i n x x d x = 0.5 [ s i n 0.5 ( t 0 + 1 ) 0.5 ( t 0 + 1 + s i n 0.5 ( t 1 + 1 ) 0.5 ( t 1 + 1 ] \int_{0}^{1}\frac{sinx}{x}dx=0.5[\frac{sin0.5(t_0+1)}{0.5(t_0+1}+\frac{sin0.5(t_1+1)}{0.5(t_1+1}]

## Matlab程序

function [w,p] = Gauss_point_1D(n,a,b)
% Gauss quarature point on [-1,1]
if n == 2
w = [1,1];
p = [-1/sqrt(3),1/sqrt(3)];
elseif n == 4
w = [0.3478548451,0.3478548451,0.6521451549,0.6521451549];
p = [0.8611363116,-0.8611363116,0.3399810436,-0.3399810436];
elseif n == 8
w = [0.1012285363,0.1012285363,0.2223810345,0.2223810345,0.3137066459,0.3137066459,0.3626837834,0.3626837834];
p = [0.9602898565,-0.9602898565,0.7966664774,-0.7966664774,0.5255324099,-0.5255324099,0.1834346425,-0.1834346425];
end

% Gauss quarature point on [a,b]
w = 0.5*(b-a)*w;
p = 0.5*(b-a)*p+0.5*(b+a);

[w,p] = Gauss_point_1D(n,a,b);
q = sum(w.*fun(p));
• 15
点赞
• 96
收藏
• 打赏
• 2
评论
12-31
10-15 283
12-31
02-04
01-27 3003
11-12 9468

### “相关推荐”对你有帮助么？

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助

¥2 ¥4 ¥6 ¥10 ¥20

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