Gauss型積分公式(共13頁)_第1頁
Gauss型積分公式(共13頁)_第2頁
Gauss型積分公式(共13頁)_第3頁
Gauss型積分公式(共13頁)_第4頁
Gauss型積分公式(共13頁)_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、摘要求函數(shù)在給定區(qū)間上的定積分,在微積分學(xué)中已給出了許多計(jì)算方法,但是,在實(shí)際問題計(jì)算中,往往僅給出函數(shù)在一些離散點(diǎn)的值,它的解析表達(dá)式?jīng)]有明顯的給出,或者,雖然給出解析表達(dá)式,但卻很難求得其原函數(shù)。這時(shí)我們可以通過數(shù)值方法求出函數(shù)積分的近似值。當(dāng)然再用近似值代替真實(shí)值時(shí),誤差精度是我們需要考慮因素,但是除了誤差精度以外,還可以用代數(shù)精度來判斷其精度的高低。已知n+1點(diǎn)的Newton-Cotes型積分公式,當(dāng)n為奇數(shù)時(shí),其代數(shù)精度為n;當(dāng)n為偶數(shù)時(shí),其代數(shù)精度達(dá)到n+1。若對(duì)隨機(jī)選取的n+1個(gè)節(jié)點(diǎn)作插值型積分公式也僅有n次代數(shù)精度。如何選取適當(dāng)?shù)墓?jié)點(diǎn),能使代數(shù)精度提高?Gauss型積分公式可是

2、實(shí)現(xiàn)這一點(diǎn),但是Gauss型求積公式,需要被積函數(shù)滿足的條件是正交,這一條件比較苛刻。因此本實(shí)驗(yàn)將針對(duì)三種常用的Gauss型積分公式進(jìn)行討論并編程實(shí)現(xiàn)。關(guān)鍵詞:Newton-Cotes型積分公式 正交多項(xiàng)式 代數(shù)精度1、實(shí)驗(yàn)?zāi)康?) 通過本次實(shí)驗(yàn)體會(huì)并學(xué)習(xí)Gauss型積分公式,在解決如何取節(jié)點(diǎn)能提高代數(shù)精度這一問題中的思想方法。2) 通過對(duì)Gauss型積分公式的三種常見類型進(jìn)行編程實(shí)現(xiàn),提高自己的編程能力。3) 用實(shí)驗(yàn)報(bào)告的形式展現(xiàn),提高自己在寫論文方面的能力。2、算法流程下面介紹三種常見的Gauss型積分公式1) 高斯-勒讓德(Gauss-Legendre)積分公式勒讓德(Legendre)

3、多項(xiàng)式如下定義的多項(xiàng)式Lnx=12nn!dndxn(x2-1)n,x-1,1,n=0,1,2稱作勒讓德多項(xiàng)式。由于(x2-1)n是2n次多項(xiàng)式,所以Lnx是n次多項(xiàng)式,其最高次冪的系數(shù)An與多項(xiàng)式12nn!dndxnx2n=12nn!2n(2n-1)(2n-2)(n+1)xn的系數(shù)相同。也就是說n次勒讓德多項(xiàng)式具有正交性即勒讓德多項(xiàng)式Lnx是在-1,1上帶x=1的n次正交多項(xiàng)式,而且Lm,Ln=-11Lm(x)Ln(x)dx=0, mn22n+1, m=n 這時(shí)Gauss型積分公式的節(jié)點(diǎn)就取為上述多項(xiàng)式Lnx的零點(diǎn),相應(yīng)的Gauss型積分公式為-11f(x)dxk=1nAkf(xk)此積分公式

4、即成為高斯-勒讓德積分公式。其中Gauss-Legendre求積公式的系數(shù)Ak=-11xnxx-xknxdx=-11xLnxx-xkLnxdx其中k的取值范圍為k=1,2,nGauss點(diǎn)和系數(shù)不容易計(jì)算,但是在實(shí)際計(jì)算中精度要求不是很高,所以給出如下表所示的部分Gauss點(diǎn)xk和系數(shù)Ak,在實(shí)際應(yīng)用中只需查表即可。nxAnxA10260.93246951420.66120938651.23861918160.1713244920.3607615730.46791393420.5773502692170.94910791230.74153118560.405845151400.129484966

5、0.2797053910.3818300500.41795918330.7745966692000.55555555560.888888888940.86113631160.33998104360.34785484510.652145154980.96028985650.79666647740.525532409901012285360.2223810340.3137066450.36268378350.90617984590.538469310100.23692688510.47862867050.56888888892) 高斯-拉蓋爾(Gauss-Laguerre

6、)積分公式拉蓋爾(Laguere)多項(xiàng)式Lnx=exdndxn(xne-x),0x+,n=0,1,2稱為拉蓋爾多項(xiàng)式。其首項(xiàng)系數(shù)為(-1)n,且具有性質(zhì):正交性,在區(qū)間0,+上關(guān)于權(quán)函數(shù)x=e-x正交,而且Lm,Ln=0e-xLm(x)Ln(x)dx=0, mn(n!)2, m=n 積分區(qū)間為0,+,權(quán)函數(shù)為x=e-x的Gauss型積分公式稱為高斯-拉蓋爾積分公式,其中Gauss點(diǎn)為拉蓋爾多項(xiàng)式Lnx的零點(diǎn),高斯-拉蓋爾積分公式為0e-xf(x)dxk=1nAkf(xk)同樣高斯-拉蓋爾積分公式的Gauss點(diǎn)和求積系數(shù)如下表所示:nxAnxA20.58578643763.41421356240

7、.85355339050.146446609450.26356031971.41340305913.59642577107.085810005812.64080084420.52175561050.39866681100.07594244970.00361175870.000023370030.41577455672.29428036026.28994508290.71109300990.278517733540.32254768961.74576110114.53662029699.39507091230.60315410430.35741869240.03888790850.0005392

8、94760.2228466041199273632605.77514356919.837467418315.98287398060.45896467930.41700083070.11337338200.01039919750.00026101720.00000089853) 高斯-埃爾米特(Gauss-Hermite)積分公式埃爾米特(Hermite)多項(xiàng)式Hnx=(-1)nex2dne-x2dxn,-x+,n=0,1,2被稱作埃爾米特多項(xiàng)式,其首項(xiàng)系數(shù)為2n,具有性質(zhì)如下正交性,在區(qū)間-,+上關(guān)于權(quán)函數(shù)e-x2正交,而且Hm,Hn=-+e-x2Hm(x)Hn(x)

9、dx=0, mn2nn!, m=n 積分區(qū)間為-,+,權(quán)函數(shù)為x=e-x2的Gauss型積分公式稱為Gauss-Hermite積分公式,其Gauss點(diǎn)就是Hermite正交多項(xiàng)式Hnx的零點(diǎn)。Gauss-Hermite求積公式為-e-x2f(x)dxk=1nAkf(xk)同樣高斯-埃爾米特積分公式的Gauss點(diǎn)和求積系數(shù)如下表所示:nxAnxA20.70710678110.886226925570.43607741191.33584907042.35030497360.72462959520004530009931.224744871400.29540897511.8

10、16359000640.52464762321.65068012380.80491409000.081312835480.81628788281.67355162872.651961356300.42560725260.05451558280.00097178120.810264617550.95857246462.02018287040.39361932310.01995324210.94530872040.56888888893、算法實(shí)例1) 用3點(diǎn)Gauss型求積公式計(jì)算-11cosxdx解:根據(jù)積分限可以知道應(yīng)該用Gauss-Legendre積分公式,具體程序如下所示#include

11、#include using namespace std; const int M(10);void main()int i=0;int n=0;int m=0;int sign=0;double sum=0;double xM=0;double AM=0;double x1=0;double x2=-0.57735502692,0.57735502692;double x3=-0.77459666920,0.77459666920,0;double x4=-0.8611363116,0.8611363116,-0.3399810436,0.3399810436;double x5=-0.90

12、61798459,0.9061798459,-0.53846931010,0.53846931010,0;double x6=-0.9324695142,0.9324695142,-0.6612093865,0.6612093865,-1.2386191816,1.2386191816;double x7=-0.9491079123,0.9491079123,-0.7415311856,0.7415311856,-0.40584515140,0.40584515140,0;double x8=-0.9602898565,0.9602898565,-0.7966664774,0.79666647

13、74,-0.5255324099,0.5255324099,-0.1834346425,0.1834346425;double A1=2;double A2=1;double A3=0.5555555556,0.8888888889;double A4=0.3478548451,0.6521451549;double A5=0.2369268851,0.4786286705,0.5688888889;double A6=0.1713244924,0.3607615730,0.4679139346;double A7=0.1294849662,0.2797053915,0.3818300505,

14、0.4179591834;double A8=0.1012285363,0.2223810345,0.3137066459,0.3626837834;cout請(qǐng)輸入節(jié)點(diǎn)個(gè)數(shù)n;switch(n)case 1:for(i=0;in;i+)xi=x1i;Ai=A1i;break;case 2:for(i=0;in;i+)xi=x2i;for(i=0;in;i+)Ai=A2i/2;break;case 3:for(i=0;in;i+)xi=x3i;for(i=0;in;i+)Ai=A3i/2;break;case 4:for(i=0;in;i+)xi=x4i;for(i=0;in;i+)Ai=A4i

15、/2;break;case 5:for(i=0;in;i+)xi=x5i;for(i=0;in;i+)Ai=A5i/2;break;case 6:for(i=0;in;i+)xi=x6i;for(i=0;in;i+)Ai=A6i/2;break;case 7:for(i=0;in;i+)xi=x7i;for(i=0;in;i+)Ai=A7i/2;break;case 8:for(i=0;in;i+)xi=x8i;for(i=0;in;i+)Ai=A8i/2;break;default:cout輸入出錯(cuò),請(qǐng)從新輸入!endl;break;for(i=0;in;i+)sum=sum+Ai*cos(

16、xi);coutsum;運(yùn)行結(jié)果:2) 用兩點(diǎn)Gauss型求積公式計(jì)算積分0e-10xsinxdx解:根據(jù)積分限可以知道應(yīng)該用Gauss-Laguerre積分公式,具體程序如下所示#include stdafx.h#include #include using namespace std;const int M(10);void main()int i=0;int n=0;int m=0;int sign=0;double sum=0;double xM=0;double AM=0;double x2=0.5857864376,3.4142135624;double x3=0.41577455

17、67,2.2942803602,6.2899450829;double x4=0.3225476896,1.7457611011,4.5366202969,9.3950709123;double x5=0.2635603197,1.4134030591,3.5964257710,7.0858100058,12.6408008442;double x6=0.2228466041,1.1889321016,2.9927363260,5.7751435691,9.8374674183,15.9828739806;double A2=0.8535533905,0.1464466094;double A

18、3=0.7110930099,0.2785177335,0.0103892565;double A4=0.6031541043,0.3574186924,0.0388879085,0.0005392947;double A5=0.5217556105,0.3986668110,0.0759424497,0.0036117587,0.0000233700;double A6=0.4589646793,0.4170008307,0.1133733820,0.0103991975,0.0002610172,0.0000008985;cout請(qǐng)輸入節(jié)點(diǎn)個(gè)數(shù)n;switch(n)case 2:for(i

19、=0;in;i+)xi=x2i;for(i=0;in;i+)Ai=A2i;break;case 3:for(i=0;in;i+)xi=x3i;for(i=0;in;i+)Ai=A3i;break;case 4:for(i=0;in;i+)xi=x4i;for(i=0;in;i+)Ai=A4i;break;case 5:for(i=0;in;i+)xi=x5i;for(i=0;in;i+)Ai=A5i;break;case 6:for(i=0;in;i+)xi=x6i;for(i=0;in;i+)Ai=A6i;break;default:cout輸入出錯(cuò),請(qǐng)從新輸入!endl;break;for

20、(i=0;in;i+)sum=sum+Ai*sin(xi)*exp(-9*xi);coutsum;運(yùn)行結(jié)果:3) 用兩點(diǎn)Gauss型求積公式計(jì)算積分-e-x2cosxdx解:根據(jù)積分限可以知道應(yīng)該用Gauss-Hermite積分公式,具體程序如下所示#include stdafx.h#include #include using namespace std;const int M(10);void main()int i=0;int n=0;int m=0;int sign=0;double sum=0;double xM=0;double AM=0;double x2=-0.70710678

21、11,0.7071067811;double x3=-1.2247448714,1.2247448714,0;double x4=-0.5246476232,0.5246476232,-1.6506801238,1.6506801238;double x5=-0.9585724646,0.9585724646,-2.0201828704,2.0201828704;double x6=-0.4360774119,0.4360774119,-1.3358490704,1.3358490704,-2.3506049736,2.3506049736;double x7=-0.8162878828,0.8162878828,-1.6735516287,1.6735516287,-2.65196135630,2.65196135630,0;double A2=0.8862269255;double A3=0.2954089751,1.8163590006;double A4=0.8049140900,0.0813128354;double A5=0.3936193231,0.0199532421

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論