通过MCP连接 →

输入计算

数学公式

广告

结果

Gauss-Lobatto rule, n = 20
20
points on the interval [-1, 1] · sum of weights = 2
i 节点 x_i 权重 w_i
1 -1 0.005263157894737
2 -0.980743704893914 0.032237123188489
3 -0.935934498812665 0.057181802127567
4 -0.86687797808995 0.08063176399612
5 -0.775368260952056 0.101991499699451
6 -0.663776402290311 0.120709227628675
7 -0.534992864031886 0.136300482358724
8 -0.392353183713909 0.148361554070917
9 -0.239551705922986 0.156580102647475
10 -0.080545937238822 0.160743286387846
11 0.080545937238822 0.160743286387846
12 0.239551705922986 0.156580102647475
13 0.392353183713909 0.148361554070917
14 0.534992864031886 0.136300482358724
15 0.663776402290311 0.120709227628675
16 0.775368260952056 0.101991499699451
17 0.86687797808995 0.08063176399612
18 0.935934498812665 0.057181802127567
19 0.980743704893914 0.032237123188489
20 1 0.005263157894737

这个计算器能做什么

本工具用于计算参考区间 [-1, 1] 上、权函数 \(w(x) = 1\) 时 \(n\) 点高斯-洛巴托(Gauss-Lobatto)求积公式的节点(横坐标)\(x_i\) 及对应权重 \(w_i\)。与标准的高斯-勒让德(Gauss-Legendre)求积不同,高斯-洛巴托公式始终把两个端点 \(x = -1\) 和 \(x = +1\) 作为求积节点。当边界取值很重要时(例如谱单元方法中),这一点尤为有用。本工具属于纯数值分析范畴,在任何国家和地区都通用,不涉及特定地域规则。

Number line from -1 to 1 with quadrature nodes including both endpoints, each marked by a vertical weight bar
Gauss-Lobatto nodes on [-1, 1] include both endpoints; bar heights suggest the associated weights.

如何使用

先选择点数 \(n\)(取值范围 2 到 100),如有需要可设置显示精度。计算器会返回一张包含 \(n\) 行的表格,每行给出节点 \(x_i\) 及其权重 \(w_i\)。节点关于 0 对称,权重同样对称,因此 \(x_i\) 与 \(-x_i\) 共用相同的权重。作为内置的校验手段,所有权重之和应当等于 2,即区间的长度。

公式详解

该公式将积分近似为 \(w_1 f(x_1) + \ldots + w_n f(x_n)\) 的和,并对次数不超过 \(2n-3\) 的多项式精确成立。 $$\begin{gathered} \int_{-1}^{1} f(x)\,dx \approx \sum_{i=1}^{n} w_i\, f(x_i) \\[1.5em] \text{where}\quad \left\{ \begin{aligned} x_1 &= -1,\quad x_{n} = 1 \\ x_i &: P_{n-1}^{\prime}(x_i) = 0 \quad(\text{interior}) \\ w_{1} &= w_{n} = \frac{2}{n\,(n-1)} \\ w_i &= \frac{2}{n\,(n-1)\,\left[P_{n-1}(x_i)\right]^{2}} \end{aligned} \right. \end{gathered}$$ 内部节点 \(x_2, \ldots, x_{n-1}\) 是 \(P'_{n-1}(x)\) 的 \(n-2\) 个零点,其中 \(P_{n-1}\) 为 \(n-1\) 次勒让德多项式,\(P'_{n-1}\) 为其导数。端点权重为 \(\frac{2}{n(n-1)}\),而每个内部节点 \(x_i\) 的权重为 \(\frac{2}{n(n-1)[P_{n-1}(x_i)]^2}\)。计算器以切比雪夫-高斯-洛巴托初值 \(\cos\left(\frac{\pi j}{n-1}\right)\) 为起点,通过牛顿迭代求出内部根,可达到完整的双精度(约 15-16 位有效数字)。

Curve f(x) over [-1,1] approximated by weighted samples at Gauss-Lobatto nodes including the endpoints
The integral is approximated by a weighted sum of function values at the nodes, with the two endpoints always included.

计算实例(n = 4)

内部节点满足 \(P'_3(x) = \frac{15x^2 - 3}{2} = 0\),故 \(x = \pm\frac{1}{\sqrt{5}} = \pm 0.4472135955\)。端点权重为 \(\frac{2}{4\cdot 3} = \frac{1}{6} = 0.1666666667\)。对于内部节点,\(P_3\left(\frac{1}{\sqrt{5}}\right) = -0.4472135955\),其平方为 \(0.2\),于是权重为 \(\frac{2}{4\cdot 3\cdot 0.2} = \frac{5}{6} = 0.8333333333\)。验证求和:\(\frac{1}{6} + \frac{5}{6} + \frac{5}{6} + \frac{1}{6} = 2\),与公式相符。

常见问题

它与高斯-勒让德有何区别?高斯-勒让德把所有节点都严格放在区间 \((-1, 1)\) 内部,对次数不超过 \(2n-1\) 的多项式精确;高斯-洛巴托则把两个端点固定为节点,对次数不超过 \(2n-3\) 的多项式精确——以牺牲两阶精度为代价换取对边界点的包含。

如何把这些值用到一般区间 [a, b] 上?将每个节点按 \(x \to \frac{b-a}{2} x + \frac{a+b}{2}\) 映射,并把每个权重乘以 \(\frac{b-a}{2}\) 即可。本页面只输出 [-1, 1] 上的对应值。

为什么权重之和必须等于 2?对 \(f(x) = 1\) 在 [-1, 1] 上积分结果为 2,而该公式对常数函数精确成立,因此所有权重之和必然等于区间长度。

最后更新: