透過 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) + \dots + w_n f(x_n)\),並對 \(2n-3\) 次以下的多項式精確成立。 $$\int_{-1}^{1} f(x)\,dx \approx \sum_{i=1}^{n} w_i\, f(x_i)$$ $$\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.$$ 內部節點 \(x_2, \dots, x_{n-1}\) 即為 \(P'_{n-1}(x)\)(即 \(n-1\) 次勒讓德多項式之導數)的 \(n-2\) 個零點。兩端點的權重為 \(\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 \times 3} = \frac{1}{6} = 0.1666666667\)。對於內部節點,\(P_3\!\left(\frac{1}{\sqrt{5}}\right) = -0.4472135955\),其平方為 \(0.2\),故權重為 \(\frac{2}{4 \times 3 \times 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,而此法則對常數函數精確成立,所以權重總和必然等於區間長度。

最後更新: