數(shù)值計(jì)算-方程組

數(shù)值計(jì)算-方程組

ID:41414512

大?。?0.25 KB

頁數(shù):4頁

時(shí)間:2019-08-24

數(shù)值計(jì)算-方程組_第1頁
數(shù)值計(jì)算-方程組_第2頁
數(shù)值計(jì)算-方程組_第3頁
數(shù)值計(jì)算-方程組_第4頁
資源描述:

《數(shù)值計(jì)算-方程組》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。

1、分別用雅可比、高斯塞達(dá)爾、超松弛法解方程組。精度:0.0015*xl+2*x2+x*3二12-xl+x*2+2*x3二202*xl?*3x2+10*x3二31:雅可比迭代法(Jacobi):/*5*xl4-2*x2+x*3=-12-xl+x*2+2*x3二202*xl-*3x2+10*x3=3旬#include"math.h"#include"stdio.h"main(){doublea[3][3]={{5.0,2.0,1.0},{?1.0,4.0,2.0},{2.0,-3.0,10.0}};doublex[3]={0.0,0.0,0.0},y[3],b[3]

2、={?12.0,20.0,3.0};doubleeps=0.001,e,q,t,s;inti,j,k,N=0;e=eps+1.0;while(e>=eps){N++;e=0.0;for(k=0;k<3;k++)y[k]=x[k];for(i=0;i<3;i++){t=x[i];s=0.0;for(j=0;j<3;j++)if(j匸i)s=s+a[i][j]*y[j];x[i]=(b[i]-s)/a[i][i];printf(ux%2d(%2d)=%fi+1,N,x[i]);q=fabs(x[i]-t);if(q>e)e=q;}printf(””);X1<

3、1>-2.400000X2<1>5?000000X3<1>0.300000X1<2>-4.460000X2<2>4.250000X3<2>2.280000X1<3>-4.556000X2<3>2.745000X3<3>2.467000X1<4>-3.991400X2<4>2.627500X3<4>2.034700X1<5〉-3.857940X2<5〉2.984800X3<5〉1.886530X1<6〉-3.971226X2<6〉3.092250X3<6〉1.967028X1<7>-4.030306X2<7>3.023680X3<7>2.021920X1<8>-

4、4.013856X2<8>2.981464X3<8>2.013165X1<9〉-3.995218X2<9〉2.989954X3<9〉1.997210X1<10>-3.995423X2<10>3.002590X3<10>1.996030X1<11>-4.000242X2<11>3.003129X3<11>1.999862X1<12>-4.001224X2<12>3.000009X3<12>2.000987X1<13>-4.000201X2<13>2.999200X3<13>2.000247X1<14>-3.999730X2<14>2.999826X3<14>1.

5、999800c初:學(xué)習(xí)文件數(shù)值計(jì)算2DebugJacobi.exe*Pressanykeytocontinue2:高斯賽德爾迭代法(G?S)5*xl4-2*x2+x*3=-12-xl+x*2+2*x3=202*xl-*3x2+10*x3=3旬#include"math.h"#include"stdio.h”main(){doublea[3][3]={{5.0,2.0,1.0},{-1.0,4.0,2.0},{2.0,-3.0,10.0}};doublex[3]={0.0,0.0,0.0},b[3]={?12.0,20.0,3.0);doubleep

6、s=0.001,e,q,t,s;inti,j,k,N=O;e=eps+1.0;while(e>=eps){N++;e=0.0;for(i=0;i<3;i++){t=x[i];s=0.0;for(j=0;j<3;j++)if(j匸i)s=s+a[i][j]*x[j];x[i]=(b[i]-s)/a[i][i];printf(ux%2d(%2d)=%r,i+1,N,x[i]);q=fabs(x[i]-t);訐(q>e)e=q;}printfCVn");}}X1<1>-2?400000X2<1>4.400000X3<1>X1<2>-4.580000X2<2>2.80

7、5000X3<2>X1<3>-3.933500X2<3>2.987875X3<3>X1<4>-3.991763X2<4>3.010528X3<4>X1<5〉-4.004513X2<5〉2.998116X3<5〉X1<6〉-3.999314X2<6〉3?000003X3<6〉X1<7>-3.999974X2<7>3?000075X3<7>c八學(xué)習(xí)文件數(shù)值計(jì)算2DebugG-S.exe"2.1000002.0575001.9830632.0015112.0003381.9998642.00001?Pressanykeytocontinue3:逐次超松弛迭

8、代法(SOR):嚴(yán)5*xl+2*x2+

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

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

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