插值法VB源程序

插值法VB源程序

ID:41510412

大?。?0.50 KB

頁數(shù):6頁

時間:2019-08-26

插值法VB源程序_第1頁
插值法VB源程序_第2頁
插值法VB源程序_第3頁
插值法VB源程序_第4頁
插值法VB源程序_第5頁
資源描述:

《插值法VB源程序》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫。

1、第四章插值方法VB一、線性插值應(yīng)用實例VB1已知:169的平方根為13,196的平方根為14,編程求175的平方根。PrivateSubCommand1_click()Dimx(1To2),y(1To2)AsSinglex(1)=169:y(1)=13x(2)=196:y(2)=14x0=175y0=F(x,y,x0)a=Format$(y0,"###.##")Text1.Text="y0="&Str$(a)EndSubPrivateFunctionF(x,y,x0)F=y(1)+(y(2)-y(1))/(x

2、(2)-x(1))*(x0-x(1))EndFunction線性插值應(yīng)用實例VB2n已知水的溫度與密度和關(guān)系如下:0.9956460.9970440.9982030.990990.997000.999965密度/(g/ml)30.025.020.015.010.05.0溫度/0C試編程計算溫度為6、13、16、19、23、26oC時的密度。PrivateSubCommand1_click()N=6X=Array(0,5,10,15,20,25,30)Y=Array(0,0.999965,0.9997,0.99

3、9099,0.998203,0.997044,0.995646)xc=Array(0,6,13,16,19,23,26)List1.AddItem"x0"&"y0"ForI=1To6X0=xc(I)Y0=f(N,X,Y,X0)List1.AddItemStr$(X0)&Str$(Y0)NextIEndSubPrivateFunctionf(N,X,Y,X0)ForI=1ToNIfX0<=X(I)ThenW=IExitForEndIfNextIW=W-1IfW<=1ThenW=1:EndIfIfW>=NThen

4、W=N-1:EndIff=Y(W)+(Y(W+1)-Y(W))/(X(W+1)-X(W))*(X0-X(W))EndFunction二、拉格朗日三點插值實例例:實驗測得25OC乙醇溶液的平均摩爾體積v與乙醇的摩爾分?jǐn)?shù)xi的關(guān)系數(shù)據(jù)如下表。試編程求摩爾數(shù)xi為0.3時的乙醇溶液的平均體積v。0.24240.20680.17390.14350.11530.0891xi26.9525.5724.3223.1822.1621.22v0.47710.42070.36970.32340.2811xi36.3734.073

5、2.0130.1528.47vVB清單DimX,vPrivateSubCommand1_click()N=75X=Array(0,8,7,6,5,4.8,4.6,4.4,4.4,4.0,3.8,3.6,3.4,3.2,3.0,2.9,2.8,2.7,2.6,2.5,2.4,2.00,1.95,1.90,1.85,1.80,1.75,1.70,1.68,1.66,1.64,1.62,1.60,1.58,1.56,1.54,1.52,1.50,1.48,1.46,1.44,1.42,1.40,1.39,1.38,

6、1.37,1.36,1.35,1.34,1.33,1.32,1.31,1.30,1.29,1.28,1.27,1.26,1.25,1.24,1.23,1.22,1.21,1.20,1.19,1.18,1.17,1.16,1.15,1.14,1.13,1.12,1.11,1.10,1.09,1.08,1.07)v=Array(0,0.24978,0.24970,0.24958,0.24937,0.24931,0.24925,0.24917,0.24907,0.24896,0.24883,0.24868,0.24

7、849,0.24825,0.24795,0.24778,0.24758,0.24735,0.24708,0.24678,0.24643,0.24421,0.24380,0.24333,0.24281,0.24222,0.24156,0.24081,0.24048,0.24013,0.23977,0.23938,0.23897,0.23854,0.23807,0.23758,0.23705,0.23648,0.23588,0.23524,0.23455,0.23381,0.23301,0.23259,0.232

8、15,0.23170,0.23123,0.23073,0.23022,0.22968,0.22912,0.22854,0.22893,0.22729,0.22662,0.22593,0.22520,0.22443,0.22361,0.22275,0.22185,0.22090,0.21990,0.21884,0.21771,0.21652,0.21526,0.21390,0.21245,0.2109

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動畫的文件,查看預(yù)覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負(fù)責(zé)整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時聯(lián)系客服。
3. 下載前請仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時可能由于網(wǎng)絡(luò)波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。