Вы находитесь на странице: 1из 38

-

4 ( II)
:
,

:
:

______________
_____

: 14

..

__________________
" ___ " ______________ 2006 .

2006

4_2.1. y=f(x)

y0 , y1,... yn

x0 , x1,...xn .

(), p m ( x ) = a 0 + a1 x + ... + a m x
m=m* ( m =0,1,2,3).
m* ,
m

S (m) =

n
1
( Pm ( xi ) - y i ) 2 .
(n + 1) - (m + 1) i =0

:
1. x y .
2. mnk (. 4_2.), Pm (x) , m=1,2,3
. S (m) .
3. S (m) m,
m* .
4. Pm (x) , m=0,1,2,3
.

:
y=f(x) :
, i=0,1,-n.
m,
s ( a , m) :=

1
( n + 1) - ( m + 1)

( P (a , m , xk) - yk) 2

=0

.
,

.
, k=0,1,-m

:
, k=0,1,-m.

. , ,
. m
.
, 5. ,
, .

:
10

10.91
11.82
12.73

13.64
14.55
x :=

15.45
16.36
17.27

18.18
19.09
20

1.872

2.204
2.564
2.950

4.110
4.647
y :=

4.269
5.820
5.282

7.123
6.402
8.558

:
mnk, m
, a :
mnk( x , y , n , m) :=

for j 0 .. m
n

b
j

( i) j

y x
i

i=0

for k 0 .. m
n

j,k

-
Ga=b
(
2
m
- 1, x, , x ..., x )

k+ j
(xi)

i=0

a lsolve( G , b )
a

- MATHCAD,

Ga=b

:
x, y - ;
n+1 - x,y.
m+1 -

0,1,2,3
:

n := 11
a0 := mnk( x , y , n , 0 )
a1 := mnk( x , y , n , 1 )
a2 := mnk( x , y , n , 2 )
a3 := mnk( x , y , n , 3 )
a0 = ( 4.65008333333333 ) a1 =

-4.56483312939456

0.61432776418186

-0.76

a2 = 0.084

0.018

-13.558

2.788

a3 =
-0.167
0.004

P m
t; a:

P( a , m , t ) :=

a t
j

j=0

s0 P(a,m,t)
:
s0 ( a , m) :=

1
( n + 1) - ( m + 1)

2
(P(a , m , xk) - yk)

k=0

s m, m=0,1,2,3:
s 0 := s0 ( a0 , 0 )

s 1 := s0 ( a1 , 1 )

s 2 := s0 ( a2 , 2 )

s 3 := s0 ( a3 , 3 )

2.08030563568885
0.551090611989194
s=
0.552952169716338
0.574594334573263

min( s ) = 0.551090611989194
s 1 = 0.551090611989194

m*=1;
:
P12 ( x) := -4.564 + 0.614 x

a1 =

-4.565

0.614

0,1,2 :
t := x , x + 0.05 .. x
0

i := 0 .. n

10

P ( a0 , 0 , t )
P ( a1 , 1 , t )

P ( a2 , 2 , t )
P ( a3 , 3 , t )

yi
2

10

12

14

16

18

20

t , t , t , t , xi
6

P ( a0 , 0 , t ) 5.5
P ( a1 , 1 , t )
P ( a2 , 2 , t )

P ( a3 , 3 , t )
yi

4.5

14

15

16

17

18

t , t , t , t , xi

:
1. ,

.

4_2.2. x y y=f(x, a, b), a b


. ,
.

:
()

. ,
:
X

x1

x2

xn

y1

y2

yn


, , .
,
. ,

y = a + bx + 2 , (y - 2)2 = a + bx

y2 - 4y + 4 = a + bx m = y2 - 4y + 4,
m=+bx.
:
1
1.9

2.8
3.7
4.6

x := 5.5
6.4

7.3
8.2
9.1

10

3.178
3.269

3.492
3.881
4.442

y := 5.161
6.018

6.993
8.071
9.239

10.488

:
y = a + bx 3

n := 10


- .. ,
,
.
: t=y^2, x2=x^3

i := 0 .. n

( i )2

t := y
i

( i )3

x2 := x
i

t=

10.099684

10.686361

6.859

12.194064

21.952

15.062161

50.653

19.731364

97.336

26.635921

166.375

36.216324

262.144

48.902049

389.017

65.141041

551.368

85.359121

753.571

10

109.998144

10

110 3

x2 =

a1 := mnk( x2 , t , n , 1 )
a := a1

9.99926389145394

0.100002069886299

b := a1

Y ( x) :=

a1 =

a+ bx

V := y - Y ( x)
i

1
1.9

2.8
3.7
4.6

x := 5.5
6.4

7.3
8.2
9.1

10

)
3.178
3.269

3.492
3.881
4.442

y := 5.161
6.018

6.993
8.071
9.239

10.488

V=

6.5771394844649210 -5

1.8093360858051410 -4

-6.3763678720185610 -5

-3.2306532252857110 -4

-1.9150486635144410 -4

-1.1502185206158110 -4

1.7593313596275810 -4

2.0012011155756710 -5

2.3763449059011110 -4

6.4796322986282510 -5

10

-1.5206686827795610 -4

: , ,
,
, .

4_2.3. y=f(x) y1 , y 2 ,... y n x1 , x 2 ,...x n .


.
.

:
,
, . ,
, ,
. .
f (x ) [a, b]
a = x1 < x 2 < ... < x n = b . S m (x)
m f (x ) , :
1) [ x k -1 , x k ] (k=2,,n) S m (x) m;
2) [a, b] S m (x) m-1;
3) S m ( x k ) = f ( x k ) (k=1,,n).
m 2 , S m (x) m-1
, [a, b] ,
f (x ) .
m=1 . , S1 ( x)
[a, b] f (x ) , max xi - xi -1 0 n .
2 k n

S 2 ( x )
S 3 ( x ) ,
f (x ) . -
.
S 3 ( x ) . [a, b]
f (x ) xi (i=1,,n), x1 = a , x n = b . S 3 ( x ) i [ xi , xi +1 ] . Pi (x) . Pi (x)

Pi ( x) = ai + bi ( x - x i ) + ci ( x - x i ) 2 + d i ( x - xi ) 3 , i=1,, n-1.
(1)
S 3 ( x ) :
Pi ( xi ) = f ( xi ) , i=1,, n-1,
(2)
Pi ( xi +1 ) = f ( xi +1 ) , i=1,, n-1,
(3)
Pi( xi +1 ) = Pi+1 ( x i +1 ) , i=1,, n-2,
(4)
Pi( xi +1 ) = Pi+1 ( xi +1 ) , i=1,, n-2.
(5)
:
P1( x1 ) = 0 , Pn-1 ( x n ) = 0 .
(6)
. .
.
:
f ( xi +1 ) - f ( xi )
hi = x i +1 - xi , g i =
, i=1,, n-1.
hi

(2)-(6) (1) (7),


:
ai = f ( xi ) , i=1,, n-1,
(8)
bi + ci hi + d i hi2 = bi +1 , i=1,, n-1,

(9)

bi + 2ci hi + 3d h = bi +1 , i=1,, n-2,


(10)
c -c
d i = i +1 i , i=1,, n-1,
(11)
3hi
c1 = 0 , c n = 0 .
(12)
(11) (9),
1
bi = g i - hi (ci +1 + 2c i ) , i=1,, n-1.
(13)
3
(11) (13), (10)
hi ci + 2(hi + hi +1 )ci +1 + hi +1ci + 2 = 3( g i +1 - g i ) , i=1,, n-2.
(14)
(12),
c1 , c 2 ,..., c n .
c1 , c 2 ,..., c n (8), (11) (13)
.
2
i i

:
n := 6

-21

-11
-7
x := 1

8
9

12

-9

-15
-27
y := -27

-28
-14

-15

:
g h:
g( x , y , n , h) :=

for i 0 .. n - 1
g
i

h( x , n) :=

for i 0 .. n - 1

-y

i +1

h x

g := g( x , y , n , h)

a := y

h := h( x , n)

i +1

-x

-0.6

-3

g=
-0.142857142857143

14

-0.333333333333333

10
4

8
h=
7
1

3

- :
b ( n , g) :=

for i 0 .. n - 2

( i +1 - gi )

b 3 g
i

b
-7.2

B = -0.428571428571429
42.4285714285714

-43

B := b ( n , g)

3 :
d0( n , x) :=

for i 0 .. n - 2

d1( n , x) :=

for i 0 .. n - 2

(i

d 2 h +h

d h

i +1

d2( n , x) :=

d h
i

d
d0 := d0( n , x)

d1 := d1( n , x)

d
d2 := d2( n , x)

:
A( d0 , d1 , d2 , n) :=

for i 0 .. n - 2
A

i, i

d1

for i 0 .. n - 3
A

d0

d2

i+1 , i
i , i +1

i
i

A
A := A( d0 , d1 , d2 , n)

28
10

A= 0
0

0 0

4 30 7 0
0 8 16 1

0 0 7 8

24 8

0 0

for i 0 .. n - 3
i +1

, *=B
-0.380449692512293
0.86314784758605

X = -0.988881427117785
3.68361142780256

-8.59815999932724

X := lsolve( A , B )

C ( X , n) :=

0.380449692512293

0.86314784758605
c = -0.988881427117785

3.68361142780256
-8.59815999932724

for i 0 .. n - 2
C

i+1

c := C( X , n)

C 0
n

C 0
0

b&d:
b ( h , g , c , n) :=

for i 0 .. n - 1
b g i

1
3

d( h , c , n) :=

h c
i

i+1

+ ( 2 c)

for i 0 .. n - 1

d
i

i+1

-c

3h

d
b := b ( h , g , c , n)

d := d( h , c , n)

0.668165641707643
-3.13633128341529

-1.96643804814484

b=
-4.12317048118012
14.4103123812407

16.8629866653211

-0.012681656417076
0.103633128341529

-0.077167886445993

d=
0.222499659758112
-4.09392380904327

0.95535111103636

t:
SP( z) :=

tn
while z < x

tt-1

a +b z-x +c z-x
t

)2 + dt (z - xt )3

= -5:
SP( -5 ) = -28.0976277975134

.
i := 0 .. n
15

20

10

1.25

10

SP( z)
yi

17.5

33.75

50
z , xi

: ,
,
.. .
4_2.4. [ -l , l ] y = f (x ) .
Tm ( x) =

m
a0
p
p
+ a k cos( kx) + bk sin( kx) .
2 k =1
l
l

:
1. m ( m =
1,3,5,10 20.
2. . m .
l

1
kp
a k = f (u ) cos( u )du , k = 0,1,2,3,..., m
l -l
l

l
b = 1 f (u ) sin( kp u )du , k = 1,2,3,..., m .
k l
l

-l

3.

m
a0
p
p
+ a k cos( kx) + bk sin( kx) .
2 k =1
l
l
4. y = f (x ) [ -l , l ]

Tm ( x ) =

, m. .

:
:
f( x) := x + e

( - x)

x := -2 , -2 + 0.01 .. 2

L := 2

f( 2) = 56.5981500331442

:
Koeff_a( m , L, f) :=

f( -2 ) = 52.5981500331442

for k 0 .. m
1
a
k
L

p k x dx

f( x) cos

-L

a
Koeff_b( m , L, f) :=

for k 0 .. m
1
b
k
L

p k x dx

f( x) sin

-L

:
T( x , m , L, a , b ) :=

k=1

a cos p k x + b sin p k x
k

m=1,3,5,10,20 :
m := 1
a := Koeff_a( m , L, f)

b := Koeff_b( m , L, f)

F_1( x) := T( x , m , L, a , b)
100
50

f( x)
F_1( x)
2

0
50
x

m := 3
a := Koeff_a( m , L, f)

b := Koeff_b( m , L, f)

F_3( x) := T( x , m , L, a , b)
100
50

f( x)
F_3( x)
2

50
x

m := 5
a := Koeff_a( m , L, f)

b := Koeff_b( m , L, f)

F_5( x) := T( x , m , L, a , b)

100
50

f( x)
F_5( x)
2

50
x

m := 10
a := Koeff_a( m , L, f)

b := Koeff_b( m , L, f)

F_10( x) := T( x , m , L, a , b )
100

f( x)
50

F_10( x)

0
x

m := 20
a := Koeff_a( m , L, f)

b := Koeff_b( m , L, f)

F_20( x) := T( x , m , L, a , b )

100

f( x)
50

F_20( x)

y=f(x) -2 2
, m=1,3,5,10,20

f ( x)
40

F_1 ( x)
F_3 ( x)
F_5 ( x)

20

F_10( x)
F_20( x)

1.5

0.5

0.5

1.5

: ,
, ,
.

4_2.5. y=f(t) , ,

y i = f ( xi ) [0, 2p ] xi =

2p
i , N ,
N

i = 0,..., N - 1 . ,
, , .. y i = f ( xi ) + Noisei .
.
()
,

()

Qm (t ) =

A0 m
+ Ak cos(kt ) + Bk sin(kt ) ( )
2 k =1

m.
Qm (t ) .

:
,
f (x ) {a k , bk }k =0 - . ,

. a k
-

f (x ) , bk

f (x ) .
; , ,
f (x ) ,
.
. f (x ) [0.2p ]

2p
l , l = 0,1,..., n - 1
n
n . f (x )
xl =

f l = f ( x l ), l = 0,1,..., n - 1 .

f (x ) =

a0
+ (a k cos(kx ) + bk sin( kx ))
2 k =1

x = xl .

a0
fl =
+ ( ak cos(kx l ) + bk sin( kx l ))
2 k =1

(1)

(1). k
n , k = pn + q , p, q
:
p = 0,1,2,..., q = 0,1,2,..., n - 1 .
(1) ,
:
(2)

fl =

A0 n -1
+ ( Aq cos(qx l ) + Bq sin( qx l )) ,
2 q =1

A0 = a0 + 2 a pn , Aq = a pn+ q ,
p =1

p =0

B0 = 0, Bq = b pn + q ,
p= 0

q = 1,2,..., n - 1.
, (2) - .
:

q = 1,2,3,...n - 1
n -1

n -1

cos(qx ) = 0, sin( qx ) = 0.
l

l =0

l =0

(2) cos( rx l ) l , ,
, ,

Ar =

(3)

2 n -1
f l cos(rxl ) ;
n l =0

(2) sin( rx l ) ,
,

Br =

(3)

2 n -1
f l sin( rxl ),
n l =0

(3) (3) r = 0,1,2,..., n - 1 .

Ar , Br , r = 0,1,2,..., n - 1 ,
f (x ) . (2) xl x ,
.
f (x ) .

d := 8.89168197002832 7.23030753944281 9.04159870460986 9.04604086793189 8.09279400592598 5.3735425649


N := 118
i := 0 .. N - 1
x :=
i

2p
N

y := d

:
0

8.89168197002832

0.053247333111691

7.23030753944281

0.106494666223383

9.04159870460986

0.159741999335074

9.04604086793189

0.212989332446766

8.09279400592598

0.266236665558457

5.37354256495133

0.319483998670148

4.00280118161518

0.37273133178184

2.16299559425184

0.425978664893531

2.7334742563888

0.479225998005223

2.65644591191931

10

0.532473331116914

10

3.04700220933884

11

0.585720664228606

11

4.05828797365486

12

0.638967997340297

12

6.14701321256455

13

0.692215330451988

13

5.37817286193427

14

0.74546266356368

14

6.04807600866672

15

0.798709996675371

15

6.80259522317658

x=

y=

10

yi

xi

1. Aq Bq, q=0,1..,N-1:
A :=

for q 0 .. N - 1
A
q

2
N

N- 1

B :=

(l

l = 0

for q 0 .. N - 1

l ))

y cos q x

B
q

2
N

N- 1

(l (

l = 0

l ))

y sin q x

2. :
q := 1 .. N - 1

(Aq)2 + (Bq)2

Am :=
q

Am q

12

18

24

30

36

42

48

54

60

66

72

78

84

90

96 102 108 114 120

3. ( 1 N/2 ) ,
8- 10- (
).
(m=10).
m := 10

4. c m. ,
, m, ,
.
t := 0 , 0 + 0.001 .. 2p

Q ( t ) :=

(Aq cos(q t) + Bq sin(q t))

q= 1

10

Q( t )
yi

t , xi

:
, .

. ""
,
, ,
.

5.37354256495133 4.00280118161518 2.16299559425184 2.7334742563888 2.65644591191931 3.04700220933884 4.058287

4.05828797365486 6.14701321256455 5.37817286193427 6.04807600866672 6.80259522317658 5.32017320693121

5.32017320693121 6.79658081675874 4.31218479331483 2.31001244869613 0.822114749785924 -0.52594829260019 -1.2354502787

1.23545027872038 -1.95586877908039 -1.42182598767635 -0.802813889487389 0.226010926088534 1.95265932842387

1.95265932842387 2.3063284604662 3.10492250895034 5.06620922024132 5.17933802185956 4.89784763035459 0.729679205995

0.729679205995231 0.907017043507153 -0.598077892362567 -2.47984813895489 -2.42269123064766 -3.56007243900931

3.56007243900931 -2.73625722942743 -1.80220488277554 -1.13045711992103 -0.110429759527893 0.470550464069544 0.87232

0.87232362738573 1.26254196868239 0.420384982103557 -0.80454900336432 -2.57547939448773 -3.4277043933129

3.4277043933129 -5.23280473334654 -6.38433752018586 -7.24780425886451 -6.51277779701542 -5.45739974495161

-15

-5.1295822549688 -3.53101773940388 -2.12921606031346 -1.28739833809685 -1.11001017486173 10

0.25601

0.256017170958476 0.17863875038054 -0.512320013249459 -2.2226525970073 -3.19286287936221 -4.377693456608

4.37769345660873 -3.44458467977092 -4.51786661400753 -3.20728253616838 -3.74515712090383 -2.87644095094699

2.87644095094699 -1.93455377743427 -0.174344908930416 0.786689143372415 1.20006059703734 1.16800652879445 0.780757751

0.780757751625119 -0.313506471405829 -1.58322920529438 -3.6055957804856 -4.67808064078204 -4.81287610680471

4.81287610680471 -4.30341042932406 -3.88290366637356 -2.71924185747186 -1.08653632258306 0.229307711403722 1.71467

1.71467104895324 2.78583141779363 3.68428508969795 4.29423980949297 4.06981016312853 3.48199800096521

3.48199800096521 1.86496215921678 1.42685413406034 0.865146352095875 0.534809297950937 0.59450965519918 1.259886759

1.259886759784 2.09287680490791 2.73848852785491 1.96490655046458 6.05834609824354 9.17348438238193 8.494815

8.49481519453113 5.99469600305947 5.99381472546139 2.91541868734843 3.95662196093584 2.48551843811124