.


:




:

































 

 

 

 





.

, δ =0.00002, .

.

M, φ (x) [ x 0, x 4], x 0 = 1.5 x 4 = 1.53202

= 1 0.6(31.52 14.61.5 + 16.8) = 0.01,

= 1 0.6(31.532022 14.61.53202 + 16.8) = 0.11574,

= 0.11574,

.

,

= 1 0.6(31.53202 14.61.5320 + 16.8) = 0.11567,

= 1 0.6(31.532022 14.61.53202 + 16.8) = 0.11574,

= 0.11574,

.

. , , .

(I.Newton, 1669, Mr.Raphson, 1720)

f (x) = 0

.

.

x 0 , [ a, b ] .

x k (k = 0, 1, 2,...) x , k - (xk)

,

, , , .

, .

.

x .

, ,

, , .

,

,

.

.5. y = f (x), x 0, 0 x. x 1 f (x) = 0. x 0, x 1,, x k, , .

[ a, b ], , , f (x), .

( )

.6. [ a, b ] x 1= (a + b)/2 . f (x 1) = 0, . , , [ a, x 1] [ x 1, b ]. f (x) . f (a) f (x 1) < 0. [ a, x 1], [ x 1, b ]. , .

.

.

[ a, b ], .

x 3 7.3 x 2 + 16.8 x 12.2 = 0.

[1.5, 1.6], (. .4).

f (1.5) = 1.53 7.31.52+ 16.81.5 12.2 = 0.05,

f (1.6) = 1.63 7.31.62+ 16.81.6 12.2 = 0.088.

x 1 = 1.55

f (1.55) = 1.553 7.31.552+ 16.81.55 12.2 = 0.0256.

, . f (1.5) f (x 1). , , , [1.5, 1.55].

, : f (1.5) = 0.05; f (1.55) = 0.0256. x 2 = 1.525

f (1.525) = 1.5253 7.31.5252+ 16.81.525 12.2 = 0.0105.

f (1.5) f (x 2) , [1.525, 1.55]. c ,

x 3= 1.5375 [1.525, 1.55],

x 4= 1.53125 [1.525, 1.5375],

x 5= 1.53438 [1.53125, 1.5375],

x 6= 1.53281 [1.53125, 1.53438],

x 7= 1.53203 [1.53125, 1.53281].

x 7= 1.53203

.

,

.

, ε = 0.002, .

f (x) [ a, b ] (. .7). x 1 , ,

f (a) f (x 1) < 0 f (x 1) f (b) < 0.

x 2 .

0 x

.

,

,

δ δ , .

,

, .

, f (x) [ a, b ] , M m

, .

. , ó , . , .

 

. , , IMSL Zbren. ,

Subroutine Zbren(F,errAbs,errRel,a,b,maxFn).

:

F - - (Real*4), f (x);

errAbs - (Real*4). x 譭, | f (x)|<errAbs. errAbs=0;

errRel - (Real*4). , errRel;

a b - (Real*4). a b , b ;

maxFn - f (x), (Integer*4).

, :

*** FATAL ERROR 1 from ZBREN. Failure to converge in

MAXFN = 10 function*** evaluations.

(Real*8) DZbren.

, :

-

Subroutine Iter(eps,km,kp,Fi,x,*);

-

Subroutine Newton(eps,km,kp,F,dF,x,*);

- 䠠 Subroutine Horda(a,b,eps,kp,F,x);

-

Subroutine Polov(a,b,eps,kp,F,x).

:

a b - (Real*4);

eps - (Real*4);

km - (Integer*4). , ;

kp - (Integer*4). kp = 0;

Fi F - - (Real*4), j (x) f (x), ;

dF - -, f (x). , F (Real*4);

x - (Real*4). . ;

* - , , . - *<>, , *25.

Fi, F, dF

Function F(x)

F =........

Return

End

( ) y = f (x) plot MATLAB.

.

x 3 7.3 x 2 + 16.8 x 12.2 = 0,

[1,4], 0.00001.

. , 101- :

Character*28 Nt

Real*4 Xm(101), Ym(101)

a = 1.

b = 4.

Nt = ' 101 .'

Do i = 1, 101

x = a + (b-a)*(i-1)/100

Xm(i) = a + (b-a)*(i-1)/100

Ym(i) = x**3-7.3*x**2+16.8*x-12.2

Enddo

Call Graf_1(101, Xm, Ym, 'x', 'y', Nt, 28)

Stop

End

Visual Fortran .

, , .8.

.8.

, : x 1 1.5; x 2 2.3; x 3 3.5. , , . , [3.4, 3.6].

, x = j (x).

x = x + λ (x 3 7.3 x 2+ 16.8 x 12.2),

j (x)

j (x) = x + λ (x 3 7.3 x 2+ 16.8 x 12.2),

= 1+ λ (3 x 2 14.6 x + 16.8).

, , x 0 = 1.5 (. ) λ 0.6. , Iter j (x):

j (x) = x 0.6(x 3 7.3 x 2+ 16.8 x 12.2).

f (x) = x 3 7.3 x 2+ 16.8 x 12.2,

.

= 3 x 2 14.6 x + 16.8.

Polov - , f (x).

, :

External Fi, F, dF

Open(2, file='res_2.txt')

x_1 = 1.5

Call Iter(0.00001,10,2,Fi,x_1,*20)

x_2 = 2.3

Call Newton(0.00001,10,2,F,dF,x_2,*20)

Call Polov(3.4,3.6,0.00001,2,F,x_3)

Go to 40

20 Write(*,30)

Write(2,30)

30 Format(' *** !!! . ***')

40 Close(2)

Stop

End

Function F(x)

F = x**3-7.3*x**2+16.8*x-12.2

Return

End

Function Fi(x)

Fi = x-0.6*(x**3-7.3*x**2+16.8*x-12.2)

Return

End

Function dF(x)

dF = 3*x**2-14.6*x+16.8

Return

End

, . , res_2.txt:

( )

0 1.5000000

1 1.5300010

2 1.5317970

3 1.5319980

( )

1 2.2890080

2 2.2889530

3 2.2889530

( )

1 3.5000000

2 3.4500000

3 3.4750000

4 3.4875000

5 3.4812500

6 3.4781250

7 3.4796870

8 3.4789060

9 3.4792970

10 3.4791010

11 3.4790040

12 3.4790530

13 3.4790280

.


3.

 

,

,

,

. , A - ( ). , . . .

, , .

(K.F.Gauβ, 1849)

,

.

. , .

.

,

, a 11

,

.

a 11 = 0, , . a 21 . a 21 x 1, x 1. .

.

. x 2 ,

.

, n , :

.

. x n, x n -1

.

, x n 2,..., x 2, x 1.

, . , , . . , x , ,

, .

: , .

, .

,

.

.

,

.

,

.

, , . , , , . . . , .

. . , () . , . i - ( i - n -), . i - , i - . , , . . .

.

.

1. .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2.

,

.

.

3. .

.

. ,

,

. 1 2. ( 1)

,

.

.

,

,

.

. , . , , A.

, D , A, p -, b. . , i - i - i:

D p

.

,

,

,

.

x 0 .

,

.

x k (k = 0,1,2,...) ( ), x . k - (x k)

, ,

D

, , .

, .

,

,

δ δ , . , δ δ . ε ε .

, x k (k = 0,1,2,...) . , . , x k (k = 0,1,2,...) x 0 , D , .

D, , , .

Ax , a x.

,

.

E , a k

,

, , .

a k , D k, . .

A, , . A T

,

,

,

H .

(L.Seidel, 1874)

. , , . k - i - x k, , ,..., , .

.

, , . , . , , , .

, .

0.01 .

,

,

,

, x.

.

, ,

, .

,

.

. , . , , . , , , . , .

. IMSL Lslrg

Subroutine Lslrg(n,A,Lda,B,Ipath,X).

:

n - (Integer*4);

A - n´n, (Real*4);

Lda - A , A(Lda,Lda), Lda ³ n, Lda = n (Integer*4);

B - n, b (Real*4);

Ipath - , : Ax = b, Ipath = 1, A T x = b, Ipath = 2 (Integer*4);

X - n, x (Real*4).

(Real*8) DLslrg.

, . Lsarg (DLsarg ), . , Lslrg DLslrg.

, :

-

Subroutine Gauss(n,A,B,X,*);

-

Subroutine Gauss_G(n,A,B,X,*);

-

Subroutine Su_It(n,A,B,eps,km,kp,X,ki,*);

-

Subroutine Su_It_RS(n,A,B,eps,km,kp,X,ki,*);

-

Subroutine Seidel(n,A,B,eps,km,kp,X,ki,*);

-

Subroutine Seid_RS(n,A,B,eps,km,kp,X,ki,*).

:

n - (Integer*4);

A - n´n, (Real*4);

B - n, b (Real*4);

X - n, x (Real*4);

eps - (Real*4);

km - (Integer*4). , ;

kp - (Integer*4). kp=0 ;

ki - , (Integer*4);

* - , , .

Gauss Gauss_G , B A, , .

.

.

.

.

Real*4 A(10,10), B(10), X(10)

Open(1, file='dat_3.txt')

Open(2, file='res_3.txt')

Read(1,1) ((A(i,j), j=1,10), B(i), i=1,10)

1 Format(/(10F5.1,F6.1))

Write(2,2) ((A(i,j), j=1,10), B(i), i=1,10)

2 Format(22x,' ',19x, ' '/(10F5.1,F6.1))

Call Gauss_G(10, A, B, X, *16)

Write(2,14) (X(i), i=1,10)

14 Format(/11x,' ...:'

* ' '/(5F12.7))

Go to 20

16 Write(*,18)

Write(2,18)

18 Format(/' *** ...:',

* ' !!! ***')

20 Close(1)

Close(2)

End

. dat_3.txt :

6.0 2.0 1.0 1.0

2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 1.0 2.0

1.0 2.0 6.0 2.0 2.0

1.0 2.0 6.0 1.0

, res_3.txt,

6.0 2.0 1.0.0.0.0.0.0.0.0 1.0

2.0 6.0 2.0 1.0.0.0.0.0.0.0 2.0

1.0 2.0 6.0 2.0 1.0.0.0.0.0.0 2.0

.0 1.0 2.0 6.0 2.0 1.0.0.0.0.0 2.0

.0.0 1.0 2.0 6.0 2.0 1.0.0.0.0 2.0

.0.0.0 1.0 2.0 6.0 2.0 1.0.0.0 2.0

.0.0.0.0 1.0 2.0 6.0 2.0 1.0.0 2.0

.0.0.0.0.0 1.0 2.0 6.0 2.0 1.0 2.0

.0.0.0.0.0.0 1.0 2.0 6.0 2.0 2.0

.0.0.0.0.0.0.0 1.0 2.0 6.0 1.0

...:

.0617220.2318464.1659752.1535270.1716805

.1716805.1535270.1659751.2318464.0617220

, .






:


: 2018-10-14; !; : 514 |


:

:

, .
==> ...

823 - | 746 -


© 2015-2024 lektsii.org - -

: 0.314 .