• Bajarish.
  • FOYDALANILGAN ADABIYOTLAR RO`YXATI
  • Chiziqli tenglamalar sistemasini Gauss usuli yordamida yechish algoritmi va dasturi




    Download 494,99 Kb.
    bet2/2
    Sana12.10.2024
    Hajmi494,99 Kb.
    #274793
    1   2
    Chiziqli tenglamalar sistemasini Gauss usuli yordamida yechish algoritmi va dasturi
    1-misol.
    Gauss usuli bilan quyidagi sistema yechilsin.

    (8) tenglamadan x1 ni topamiz
    2x1 −32 x+ 2x3 − 4x4 = 5,
    2x1 = 5+ 3x2 2x3 + 4x4 , (12) x1 = 52 + 32 x2 −x3 + 2x4 ,
    (12) tenglamani (9) tenglamadagi x1 ni o‘rniga qo‘yamiz va uni ixchamlaymiz.
    3x1 +x2 − 2x3 − 2x4 = 4,
    (12) tenglamani (10) tenglamadagi x1 ni o‘rniga qo‘yamiz va uni ixchamlaymiz.
    4x1 + 2x2 −3x3 + x4 = 2,

    1. tenglamani (11) tenglamadagi x1 ni o‘rniga qo‘yamiz va uni ixchamlaymiz.

    x1 +x2 +x3 +x4 = 2,
    + 32 x2 x3 + 2x4 +x2 +x3 +x4 = 2,
    5+ 3x2 − 2x3 + 4x4 + 2x2 + 2x3 + 2x4 = 4,
    5x2 + 6x4 =−1.
    Yuqoridagilardan quyidagi yangi tenglamalar sistemasini hosil qilamiz

    1. tenglamadan x2 ni topamiz


    Algoritmi:



    Dasturi:
    a x a x11 1 + 12 2
    a x a x21 1 + 22 2

    ......
    a x a xn1 1 + n2 2 + +... a x1n n =b1
    + +... a x2n n =b2
    + +... a xnn n =bn

    Program Gauss1; label 1,2,3,4,5; var a:array[1..10, 1..10] of real; b,x:array[1..10] of real; c,s:real; i,j,k,n:integer; begin readln(n); for i:=1 to n do begin for j:=1 to n do read(a[i,j]); readln(b[i]); end; k:=1; 3: i:=k+1; 2: c:=a[i,k]/a[k,k]; a[i,k]:=0; j:=k+1; 1: a[i,j]:=a[i,j]-c*a[k,j]; if j1 then begin i:=i-1; goto 5 end;
    for i:=1 to n do writeln(x[i]:4:2); end.
    a x a x11 1 + 12 2 + +... a x1n n =a1 1n+

    a x a x21 1 + 22 2


    ......

    a x a xn1 1 + n2 2

    + +... a x2n n + +... a xnn n

    =a2 1n+
    =ann+1

    program Gauss; var a:array[1..10, 1..10] of real; x:array[1..10] of real; c,s,d:real; i,j,k,n,l,p:integer;
    begin readln(n); for i:=1 to n do for j:=1 to n+1 do readln(a[i,j]); for k:=1 to n do begin
    l:=k; while a[k,k]=0 do begin
    if a[l+1,k]=0 then else begin for p:=k to n+1 do7 begin d:=a[k,p]; a[k,p]:=a[l+1,p]; a[l+1,p]:=d; end; break; end; l:=l+1; end; for i:=k to n-1 do begin c:=a[i+1,k]; for j:=k to n+1 do
    a[i+1,j]:=(a[k,j]/a[k,k])*c-a[i+1,j]; end; end; x[n]:=a[n,n+1]/a[n,n]; for k:=n-1 downto 1 do begin s:=0; for i:=k+1 to n do s:=s+a[k,i]*x[i]; x[k]:=(a[k,n+1]-s)/a[k,k] end; for i:=1 to n do writeln(x[i]:4:2); end.
    2-masala. Quyidagi chiziqli tenglamalar sistemasini yeching:
    3x x1 − +2 5x3 + =x4 7 2x1 +5x2 −3x3 =−1

     2x1 −4x3 +3x4 =6

    6x1 +4x2 −3x3 −2x4 =3
    Bajarish. 1-masaladagidek, tenglamalar sistemasini AX =B ko`rinishda yozib olamiz. Bu yerda A – noma`lumlar koeffisentlardan tashkil topgan matritsa, B– ozod hadlardan tashkil topgan ustun (vektor), X– noma`lumlar ustuni (vektori).
    3 -1 5 1
    A=-22 5 -3 0 -4 03, B=7−1, X =   xx12
     
    6 4 -3 -2
    Demak, X =A1B .
    A matritsani, ya`ni noma`lumlar koeffisentlarini A1:D4 maydonga, B vektorni, ya`ni ozod hadlarni F1:F4 maydonga kiritamiz. X vektor uchun H1:H4 maydonni belgilab =МУМНОЖ(МОБР(A1:D4);F1:F4) formulani kiritamiz va Ctrl+Shift+Enter tugmalarini birgalikda bosamiz. Natijada H1:H4 maydonda izlanayotgan noma`lumlar hosil bo`ladi:


    FOYDALANILGAN ADABIYOTLAR RO`YXATI


    1. Isroilov M. «Hisoblash metodlari», T., "O`zbekiston", 2003

    2. Shoxamidov Sh.Sh. «Amaliy matematika unsurlari», T., "O`zbekiston", 1997

    3. Boyzoqov A., Qayumov Sh. «Hisoblash matematikasi asoslari», O`quv qo`llanma. Toshkent 2000.

    4. Abduqodirov A.A. «Hisoblash matematikasi va programmalash», Toshkent. "O`qituvchi" 1989.

    5. Vorob`eva G.N. i dr. «Praktikum po vichislitel’noy matematike» M. VSh. 1990.

    6. Abduhamidov A., Xudoynazarov S. «Hisoblash usullaridan mashqlar va laboratoriya ishlari», T.1995.

    7. Siddiqov A. «Sonli usullar va programmalashtirish», O`quv qo`llanma. T.2001.

    8. Internet ma`lumotlarini olish mumkin bo`lgan saytlar:

    Download 494,99 Kb.
    1   2




    Download 494,99 Kb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Chiziqli tenglamalar sistemasini Gauss usuli yordamida yechish algoritmi va dasturi

    Download 494,99 Kb.