, , , , , , , , , , , , , , , , , , , , , , , , , , .
ENG
 

            

 

.


3 :

1)     

2)     

3)     

.

, . , , .


φ()

 
, f(x) φ() f(x), .



φ()- .


( )

y=f(x), x0 f(x0) j(x) xi c ,

, f(x) ,

j(x)=pn(x)=anxn+an-1xn-1++a0

an ,an-1, a0 , , :

Pn(xi)=yi i=0,1,n

, Ln(x).


i¹j

.


y xc, D=4,1 0=1,3 y={-6.56,-3.77,-1.84,0.1,2.29,4.31,5.86,8.82,11.33,11.27}.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
















































CLS

DIM Y(9)

DATA -6.56,-3.77,-1.84,0.1,2.29,4.31,5.86,8.82,11.33,11.27

X0 = 1.3: H = 4.1: N = 10: XC = 10

FOR I = 0 TO N - 1

1 X(I) = X0 + H * I

READ Y(I)

PRINT Y(I); X(I)

NEXT I

S1 = 0: S2 = 0: S3 = 0: S4 = 0

FOR I = 0 TO N - 1

2 S1 = S1 + X(I) ^ 2

S2 = S2 + X(I)

S3 = S3 + X(I) * Y(I)

S4 = S4 + Y(I)

NEXT I

D = S1 * N - S2 ^ 2

D1 = S3 * N - S4 * S2

D0 = S1 * S4 - S3 * S2

A1 = D1 / D: A0 = D0 / D

YC = A1 * XC + A0

PRINT "A0="; A0, "A1="; A1, "YC="; YC

FOR X = 0 TO 50 STEP 10

Y = A1 * X + A0

PRINT X, Y

NEXT X

END


XC= 10

ՠ Y

1.3 -6.56

5.4 -3.77

9.5 -1.84

13.6 .1

17.7 2.29

21.8 4.31

25.9 5.86

30 8.82

34.1 11.33

38.2 11.27

S=-1.594203










. .


, (xi,yi), i=0,1,2,...n, n - . , . (, ), "" , , .


.

() . "" .

fi , x=xi yi.

S = (fi-yi) min ,

.. x=xi ( ). , .

S = |fi-yi| min , , .. .

, , .. ,
S = (fi-yi)2 , (1)

.

f(x)=C0 + C1X + C2X2+...+CMXM. (2)

(1) S = ( C0 + C1Xi + C2Xi2+...+CMXiM - Yi ) 2

S , S 0,1,... :

SC0 = 2 ( C0 + C1Xi + C2Xi2+...+CMXiM - Yi ) = 0 ,

SC1 = 2 ( C0 + C1Xi + C2Xi2+...+CMXiM - yi ) Xi = 0 ,

................................................................................................. (3)

SCM = 2 ( C0 + C1Xi + C2Xi2+...+CMXiM - Yi ) XiM = 0 ,

(3)

C0 (N+1) + C1 Xi + C2Xi2 +...+ CM XiM = Yi ,

C0Xi + C1Xi2 + C2Xi3 +...+ CMXiM+1 = Yi Xi ,

....................................................................................................... (4)

C0XiM + C1XiM+1 + C2XiM+2 +...+ CMXi2M = Yi XiM .

i , , (2) (4). (4) . .

(N+1)

Xi

Xi2

...

XiM

Yi



Xi

Xi2

Xi3

...

XiM+1

Yi Xi



...

...

...

...

...

...



XiM

XiM+1

XiM+2

...

Xi2M

Yi XiM


, (4) , "" .


y{-6.56,-3.77, -1.84,0.1,2.29,4.31,5.56,8.82,11.33,11.27}, x0=1.3 h=4.1, .




















































CLS

XC = 10: X0 = 1.3: H = 4.1: N = 10

DIM Y(9): DIM X(9)

DATA -6.56,-3.77,-1.84,0.1,2.29,4.31,5.86,8.82,11.33,11.27

FOR I = 0 TO N - 1

X = X0 + H * I:

X(I) = X

READ Y(I)

PRINT X(I), Y(I)

NEXT I

S1 = 0: S2 = 0: S3 = 0: S4 = 0

I = 0

10 S1 = S1 + X(I) ^ 2:

S2 = S2 + X(I):

S3 = S3 + X(I) * Y(I):

S4 = S4 + Y(I)

I = I + 1

IF I <= N - 1 THEN 10

D = S1 * N - S2 ^ 2:

D1 = S3 * N - S2 * S4:

D0 = S1 * S4 - S2 * S3

A1 = D1 / D:

A0 = D0 / D

Y = A1 * XC + A0

PRINT TAB(2); " A0="; A0,

PRINT TAB(2); " A1="; A1,

PRINT TAB(2); " XC Y="; Y

FOR X = 10 TO 50 STEP 10

Y = A1 * X + AO

PRINT X, Y

NEXT X

FOR I = 1 TO N - 1

S = S + Y(I): NEXT I

D = H / 2 * (Y(0) + Y(N - 1) + 2 * S)

PRINT " D="; D

ՠ Y

1.3 -6.56

5.4 -3.77

9.5 -1.84

13.6 .1

17.7 2.29

21.8 4.31

25.9 5.86

30 8.82

34.1 11.33

38.2 11.27

A0=-6.709182

A1= .5007687

XC Y=-1.701495

10 5.007687

20 10.01537

D= 166.9725



© 2010.