Vous êtes sur la page 1sur 52

Calcul Numeric

Cursul 12

2011-2012



Anca Ignat

1
Forma Newton a polinomului de interpolare Lagrange

Fie l
k
(x, x
0
, x
1
,, x
k
, f) polinomul de interpolare Lagrange
pentru funcia f pe sistemul de noduri distincte {x
0
, x
1
,, x
k
}.

Propoziie
Fie l
k-1
(x, x
0
, x
1
,, x
k-1
, f), l
k-1
(x, x
1
, x
2
,, x
k
, f)eH
k-1
polinoamele de interpolare Lagrange pentru funcia f pe
sistemele de noduri {x
0
, x
1
,, x
k-1
} i respectiv {x
1
, x
2
,, x
k
}.
Atunci:
2
0 1
1 0 1 1 0 1 1 2
0
( , , , , , )
( ) ( , , , , , ) ( ) ( , , , , , )
k k
k k k k k
k
l x x x x f
x x l x x x x f x x l x x x x f
x x

=

=




(1)
Demonstraie: Exerciiu.

Considerm urmtoarele probleme de interpolare pentru funcia
f:

{ }
{ }
0 0 1 1 1 1 1 0 1 1
0 0 1 1 0 1
( , ), ( , ), , ( , ) ( , , , , , )
( , ), ( , ), , ( , ) ( , , , , , )
k k k k
k k k k
x y x y x y l x x x x f
x y x y x y l x x x x f






Ne intereseaz s gsim o formul de trecere rapid de la
polinomul de interpolare pe k noduri la cel care are un nod n
3
plus. Deoarece polinomul de grad cel mult k:
0 1 1 0 1 1
( ) ( , , , , , ) ( , , , , , )
k k k k k
q x l x x x x f l x x x x f

= eH
are ca rdcini punctele x
0
,x
1
,,x
k-1
(q(x
i
) = y
i
- y
i
= 0, i=0,...,k-1)
avem relaia:
1
0 1 1 0 1 1
0
( , , , , , ) ( , , , , , ) ( )
k
k k k k j
j
l x x x x f l x x x x f A x x


=
= +
[
(2)

n care A este dat de relaia:

0 1 1 0 1 1
1
0
( , , , , , ) ( , , , , , )
( )
k k k k k k
k
k j
j
l x x x x f l x x x x f
A
x x

[

(3)
4
1 1
0 0
1 1
0 0
1
1 1
0
0 0
( )
( ) ( )
( ) ( ) ( )
k k
k j
i
i j
i j
j i
k
k k
k j k j
j j
k
k i
k k
i
k j k i i j
j j
j i
x x
y
x x
y
A
x x x x
y y
x x x x x x

= =
=

= =


=
= =
=

= =

=

[
[ [

[ [





0
0
( )
k
i
k
i
i j
j
j i
y
A
x x
=
=
=
=

[
(4)

5
Considerm urmtoarele problemele de interpolare pentru f:

{ }
{ }
1 1 2 2 1 1 2
0 0 1 1 0 1
( , ), ( , ), , ( , ) ( , , , , , )
( , ), ( , ), , ( , ) ( , , , , , )
k k k k
k k k k
x y x y x y l x x x x f
x y x y x y l x x x x f







vom avea, analog ca mai sus
0 1 1 1 2
1
( , , , , , ) ( , , , , , ) ( )
k
k k k k j
j
l x x x x f l x x x x f B x x

=
= +
[

(5)

Dac nmulim relaia (2) cu (x-x
k
) iar relaia (5) cu (x-x
0
) i
scdem aceste relaii obinem:
6
0 0 1 1 0 1 1
0 1 1 2
0
( ) ( , , , , , ) ( ) ( , , , , , )
( ) ( , , , , , ) ( ) ( )
k k k k k k
k
k k j
j
x x l x x x x f x x l x x x x f
x x l x x x x f A B x x

=
=
+
[




innd seama de relaia (1) rezult c:
adic
0
( ) ( ) 0
k
j
j
A B x x A B
=
= =
[


Vom nota n cele ce urmeaz:
0 1
, , ,
k
f
A x x x = (


numit diferen divizat de ordin k a funciei f pe nodurile
{ }
0 1
, , ,
k
x x x .
7
Vom nlocui n formula (2) l
k-1
(x, x
0
,, x
k-1
, f) cu:
1 0 1 2 1 1
1
0 1 1
1
( , , , , ) ( , , , , )
, , , ( )
k k k k
k
k j
f
j
l x x x f l x x x f
x x x x x

=
= +
(

[


+


iar n formula (5) l
k-1
(x, x
1
,, x
k
, f ) cu:

1
1 1 2 1 1 1 2
1
( , , , , ) ( , , , , ) , , , ( )
k
k k k k k l
f
l
l x x x f l x x x f x x x x x


=
= + (

[


i apoi scdem membru cu memebru cele dou relaii.

Obinem:

8
1 1
0 1 0
1 0
1
1 0
1 1
, , ( ) , , ( )
, , ( ) , , ( ) 0
k k
k j k j
f f
j j
k k
k l k l
f f
l l
x x x x x x x x
x x x x x x x x

= =

= =
+ ( (

= ( (

[ [
[ [






Putem scrie:

1
0 1 1
1
1
0 0
0
( ) , , , ,
, , ( )
k
j k k
f f
j
k
k j n
f
j
x x x x x x
x x x x x x x x

=
+ ( (

+ ( (

[
[


+ = 0

relaie din care obinem:
9
1 1 0 2 1
0 1
0
, , , , , ,
, , ,
k k
f f
k
f
k
x x x x x x
x x x
x x

( (

= (



(6)

Relaia (6) justific denumirea de diferen divizat. Se introduce
i noiunea de diferen divizat de ordinul 0:
( ) ,
k k k
f
x y f x = = (

(7)
Diferenele divizate se pot obine folosind definiia direct (4)
sau folosind definiia recursiv (7), (6). Cele 2 definiii sunt
echivalente:


10
Propoziie

( )
0 1
0 0
1
0
, , ,
( ) '
( )
k k
i i
k k
f
i i
n k
i j
j
j i
y y
x x x
w x
x x
= =
+
=
=
= = (


[
(8)
pentru orice sistem de noduri
{ }
0 1
, , ,
k
x x x i orice k.
Demonstraie: Se face prin inducie. Pentru k=1 avem:
1 0
0 1
0 1
0 1 1 0 1 0
,
f f
f
x x
y y
x x
x x x x x x
( (

= + = (



Presupunem c relaia (8) este valabil pentru orice k i pentru
orice sistem de noduri
{ }
0 1
, , ,
k
x x x . Pentru k+1 folosim relaia
11
de recuren i apoi aplicm ipoteza inductiv:


1 1 1 0 2
0 1 1
1 0
1
1
1 0
1 0
1 0
, , , , , ,
, , ,

( )
( ) ( )
k k
f f
k
f
k
k k
i i
k k
i i
k
i j i j
j j
j i j i
x x x x x x
x x x
x x
y y
x x
x x x x
+
+
+
+
+
= =
+
= =
= =
( (

= = (


=



[ [


1
=

12
0 1
1
1 0
0 1
0 1
0 1
1
1 0
1
( ) ( )
1 1
[ ( )] }
( )
k
k k
k
j k j
j j
j j k
k
i
k
i
i k i
i j
j
j i
y y
x x
x x x x
y
x x x x
x x
+
+
+
+
= =
= = +
=
+
=
=
= +


+ =

[ [

[
1
{ +


13
0 1
1 1 1
1
0 1
0 0 0
0 1
1
1
0
0
( ) ( ) ( )
( )
k
k i
k k k
i
j k j i j
j j j
j j k j i
k
i
k
i
i j
j
j i
y y y
x x x x x x
y
x x
+
+ + +
=
+
= = =
= = + =
+
+
=
=
=
= + + =

=

[ [ [

[



Inducia este complet.


14
Din definiie se observ c diferena divizat
0 1
, , ,
k
f
x x x (


nu depinde de ordinea nodurilor
{ }
0 1
, , ,
k
x x x .
Vom nota n continuare cu l
k
(x) polinomul de interpolare
Lagrange pe nodurile
{ }
0 1
, , ,
k
x x x pentru funcia f. Avem:

0 1 0 1 1
0 0 1 0 0 1 0 1
0 1 0 1
( ) ( ) ( ) ( )] ( ) ( )] ( ) ( )]
, ( ) , , , ( ) ( )
, , , ( ) ( )
n k k n n
k k
f f
n n
f
l x l x l x l x l x l x l x l x
y x x x x x x x x x x x
x x x x x x x

= + + + + + =
= + + + + ( (

+ (




| | |



Am obinut forma Newton a pol. de interpolare Lagrange:
15
0 0 1 0 0 1 2 0 1
0 1 0 1
( ) , ( ) , , ( )( )
, , , ( ) ( )
n
f f
n n
f
l x y x x x x x x x x x x x
x x x x x x x

= + + + + ( (

+ (





Schema lui Aitken de calcul a diferenelor divizate

Ne propunem s calculm diferenele divizate
0 1
,
f
x x (

,
0 1 2
, ,
f
x x x (

, ,
0 1
, , ,
n
f
x x x (


necesare construirii polinomului de interpolare Lagrange n
forma Newton. Procedeul folosete definiia recursiv a
diferenelor divizate i se desfoar n n pai. La pasul 1 se
16
calculeaz numai diferene divizate de ordinul 1:
0 1
,
f
x x (

,
1 2
,
f
x x (

,,
1
,
n n
f
x x

(

.
n general, la pasul k se calc. diferene divizate de ordin k:
0 1
, , ,
k
f
x x x (

,
1 2 1
, , ,
k
f
x x x
+
(

,,
1
, , ,
n k n k n
f
x x x
+
(

.
La pasul n se calculeaz o singur diferen divizat de ordin n i
anume:
0 1
, , ,
n
f
x x x (

.

17
0 0
1 1 0 1
2 2 1 2
1
Pas 1 Pas Pas
,
,
,
f
f
k k k k
f
k n
x y
x y x x
x y x x
x y x x

(

(

(






0 1
1 1 2 1 1 1
1
, , ,
, , ,
,
k
f
n n n n n k n
f f
n n n n
f
x x x
x y x x x x
x y x x

(

( (

(





1 0 1
, , , ,
n k n n
f f
x x x x x

( (




18
Notm dd[i,k]=
1
, , ,
i i i k
f
x x x
+ +
(

diferena divizat de ordin k,
pe nodurile consecutive
{ }
1
, , ,
i i i k
x x x
+ +
i=0,,n-k, k=1,,n,
cu dd[i,0]=y
i
, i=0,,n. Schema lui Aitken se implementeaz
astfel:

[ , 0] , 0, , ;
for 1, ,
for 0, ,
[ 1, 1] [ , 1]
[ , ]
i
i k i
dd i y i n
k n
i n k
dd i k dd i k
dd i k
x x
+
= =
=
=
+
=






19
Putem face aceleai calcule folosind un singur vector, de
exemplu rescriind vectorul y astfel:
1
for 1, ,
for , ,
i i
i
i i k
k n
i n k
y y
y
x x

=
=





La finalul acestei secvene de program, vectorul y va conine
elementele:
y
0
,
0 1
,
f
x x (

,
0 1 2
, ,
f
x x x (

,,
0 1
, , ,
n
f
x x x (


(
0 1
, , ,
k k
f
y x x x = (

, k=0,...,n).
20
Interpolare Newton pe noduri echidistante
Pp. c nodurile de interpolare sunt echidistante:
0
, 0,1, ...,
i
x x i h i n = + =
n relaia de mai sus fie se d h distana ntre 2 noduri succesive,
fie se precizeaz primul i ultimul nod, x
0
i x
n
i h se calculeaz:
0
( )
n
x x
h
n

= .
1 1
1
1
( ) ( )
,
( )
i i i i
i i
f
i i
f x f x y y
x x
x x h
+ +
+
+

= = (



Se introduce noiunea de diferen finit de ordinul 1:
( ) ( ) ( ) f x f x h f x A = +
21
Pornind de la aceast definiie se pot introduce i diferene finite
de ordin superior:
2
( ) ( ( )) ( ( ) ( ))
( 2 ) 2 ( ) ( )
f x f x f x h f x
f x h f x h f x
A = A A = A + =
= + + +

i n general se pot introduce recursiv diferenele finite de ordin
k:
1 1 1
( ) ( ( )) ( ) ( )
k k k k
f x f x f x h f x

A = A A = A + A .
Prin inducie dup k, se poate deduce formula de calcul a
diferenelor finite de ordin k folosind doar valorile funciei f:
22
0
( ) ( 1) ( )
k
k k i i
k
i
f x C f x i h

=
A = +

.
Observaie: Dac funcia f este polinom de grad m atunci ( ) f x A
este polinom de grad m-1,
2
( ) f x A este polinom de grad m-2,
.a.m.d. Prin urmare:
( ) 0 , pentru , polinom de grad
k
f x k m f m A > .

Legtura ntre diferenele divizate i cele finite:
1
1
1
( ) ( ) ( )
,
( )
i i i
i i
f
i i
f x f x f x
x x
x x h
+
+
+
A
= = (



23
2
1 2 1
1 2
2
2
, ,
( )
, ,
( ) 2
i i i i
f f
i
i i i
f
i i
x x x x
f x
x x x
x x h
+ + +
+ +
+
( (
A
= = (



Prin inducie se poate arta urmtoarea legtur ntre diferenele
divizate de ordin k i cele finite:
1
( )
, , , .
!
k
i
i i i k
k
f
f x
x x x
k h
+ +
A
= (






24
Polinoame de interpolare pe noduri echidistante:
0 0 1 0 0 1 2 0 1
0 1 0 1 1
0 1 0 1 1
( ) , ( ) , , ( )( )
, , ..., ( )( ) ( )
, , ..., ( )( ) ( )
n
f f
k k
f
n n
f
l x y x x x x x x x x x x x
x x x x x x x x x
x x x x x x x x x

= + + + + ( (

+ + + (

+ (


Consider c punctul de interpolare este de forma:
0
x x t h = +
i nlocuim diferenele divizate cu diferene finite n forma
Newton a polinomului de interpolare:
25
0 1 0 0 0 0
( ) ( ) ( ) ( ( 1) )
( 1) ( 1)
k
k
x x x x x t h x x t h x k h
h t t t k

= + + =
= +


2
0 0 0 0
0
0
( 1)
( ) ( ) ( ) ( )
2
( 1) ( 1)
( )
!
( 1) ( 1)
( )
!
n n
k
n
t t
l x l x th y f x t f x
t t t k
f x
k
t t t n
f x
n

= + = + A + A + +
+
+ A + +
+
+ A


Aceast relaie poart numele de formula lui Newton
progresiv pe noduri echidistante.
26
Considerm polinomul de interpolare Lagrange pe nodurile n
ordine invers
1 0
{ , , ..., }
n n
x x x

:
1 1 2 1
1 0 1 0
( ) , ( ) , , ( )( )
, , ..., ( )( ) ( )
n n n n n n n n n n
f f
n n n n
f
l x y x x x x x x x x x x x
x x x x x x x x x


= + + + ( (

+ + (




Dac punctul de interpolare este de forma:
n
x x th = +


27
analog ca mai sus obine formula lui Newton regresiv pe
noduri echidistante:

2
1 2
0
( 1)
( ) ( ) ( ) ( )
2
( 1) ( 1)
( )
!
( 1) ( 1)
( )
!
n n n n n n
k
n k
n
t t
l x l x th y f x t f x
t t t k
f x
k
t t t n
f x
n

+
= + = + A + A + +
+ +
+ A + +
+ +
+ A


28
Funcii spline
Fie nodurile:

| |
, , 0,1, , ,
i
x a b i n e =
cu
0 1 2 1 n n
a x x x x x b

= < < < < < =



Se consider funcia continu polinomial pe poriuni:

1
( ) ( ) pentru [ , ] 0, ..., 1
i i i
S x P x x x x i n
+
= e =
29
0 0 1
1 1 2
2 2 3
2 2 1
1 1
( ) , [ , ],
( ) , [ , ],
( ) , [ , ],
( )
( ) , [ , ],
( ) , [ , ] .
n n n
n n n
P x x x x
P x x x x
P x x x x
S x
P x x x x
P x x x x


e









P
i
(x), i=0,...,n sunt polinoame. O asemenea funcie poart
numele de funcie spline.

30
Funcii spline liniare continue
Definiie
Funcia S(x) definit mai sus se numete funcie spline
liniar continu dac polinoamele
( )
, 0, , 1
i
P x i n = sunt
polinoame de gradul 1 i S(x)eC[a,b], adic:

lim lim
( ) ( ) 1, , 1.
i i
i i
x x x x
x x x x
S x S x i n

< >
= = ,
31
Fie funcia :[ , ] f a b pentru care se cunosc valorile:
( )
, 0, ,
i i
y f x i n = = .
Funcia spline liniar de interpolare S pentru funcia f
ndeplinete condiiile de interpolare:
( ) , 0, , .
i i
S x y i n = =
innd seam c polinoamele P
i
(x) sunt polinoame de gradul 1 i
S(x) este continu vom avea condiiile:
1 1
( ) ,
( ) 0, , 1,
( ) polinom de gradul 1.
i i i
i i i
i
P x y
P x y i n
P x
+ +
=

= =



,


32

Din aceste condiii rezult:
1
1
1 1
( ) , 0, , 1
i i
i i i
i i i i
x x x x
P x y y i n
x x x x
+
+
+ +

= + =


( ) ( )
( ) ( ) ( )
1
0 0 0 0 1
( ) , 1, , 1,
( ) , .
k k k k k k
n n n n
S x P x P x y k n
S x P x y S x P x y

= = = =
= = = =







33
Funcii spline cubice de clas C
2

Se consider sistemul de noduri distincte din intervalul [a,b]:

0 1 1
{ }
n n
a x x x x b

A = = < < < < =


Funcia S(x) asociat divizrii D care ndeplinete condiiile :
2
( ) [ , ] ,
polinoamele ( ) au gradul 0, , 1,
i
S x C a b
P x i n
e
=

3 ,

se numete funcie spline cubic.
Dat fiind o funcie :[ , ] f a b cu valorile:
( )
i i
y f x = , 0, , i n = ,

34
se consider funcia spline cubic S(x) de interpolare ce satisface
( ) , 0, , .
i i
S x y i n = =
Pentru determinarea funciei spline cubice de interpolare
observm c polinoamele:

3 2
1
( ) , [ , ] , 0, , 1,
i i i i i i i
P x x x x x x x i n o | o
+
= + + + e =

implic determinarea a 4n necunoscute
{ , , , 0, , 1}
i i i i
i n o | o = ; pentru care se impun:

35

' ''
1condi ii din rela iile de interpolare ( ) , 0, , ,
3( 1) condi ii de continuitate pentru ( ), ( ) i ( )
n nodurile , 1, , 1,
i i
i
n S x y i n
n S x S x S x
x i n
+ = =





n total 4n-2 condiii.
Se pot avea n vedere pentru adugarea a dou condiii
suplimentarea urmtoarele abordri :
- fixarea pantelor n extremitile intervalului [a,b]. Se
presupune c funcia f este derivabil i se cunosc valorile
f'(a), f'(b). Se impun condiiile:
36
0 0 0 1
( ) ( ) ( ) , ( ) ( ) ( );
n n n
S x P x f a S x P x f b

' ' ' ' ' '


= = = =
- periodicitatea primelor dou derivate:
0 0 0 1
0 0 0 1
( ) ( ) ( ( ) ( ) ( ) ( ) ,
( ) ( ) ( ( ) ( ) ( ) ( ))
n n n
n n n
f a f b S x P x P x S x
f a f b S x P x P x S x

' ' ' ' ' '


= = = =
'' '' '' '' '' ''
= = = =
)
;
- anularea derivatei secunde n capetele intervalului:
( ) ( ) ( ) ( )
0 0 0 1
( ) ( ) 0
( 0 , 0).
n n n
f a f b
S x P x S x P x

'' ''
= =
'' '' '' ''
= = = =

Funciile spline care ndeplinesc aceste condiii se numesc
funcii spline cubice normale.
37
- derivata de ordinul al treilea a funciei S este continu n
punctele x
1
i x
n-1
.

Aceasta nseamn c polinoamele P
0
, P
1

respectiv P
n-2
, P
n-1
coincid. Acest tip de funcie spline se
numete not a knot i este utilizat n MATLAB.
Vom calcula n cele ce urmeaz funcia spline cubic n cazul n
care cunoatem suplimentar valorile celei de-a doua derivate a
funciei f n capetele intervalului de interpolare:

0
''( ), ''( )
n
a f a a f b = = .
Recapitulnd, vom avea urmtoarele condiii :
38

1
1
1
1
( ) , 0, , 1, ( ) interpolare ,
( ) ( ) , 1, , 1, continuitatea func iei ,
( ) ( ) , 1, , 1, continuitatea primei derivatei,
( ) ( ) , 1,
i i i n n n
i i i i
i i i i
i i i i
P x y i n P x y
P x P x i n S
P x P x i n
P x P x i

= = =
= =
' '
= =
'' ''
= =





0 0 0 1
, 1, continuitatea derivatei secunde,
( ) ( ), ( ) ( ).
n n n
n
P x a f a P x a f b

'' '' '' ''


= = = =




Vom nota:
( ) , 0, .
i i
S x a i n
''
= =
innd seama de faptul c funcia S''eC[a,b] este o funcie
liniar pe fiecare din intervalele [x
i
, x
i+1
] rezult c:
39
1
1 1
1
( ) , [ , ] , 0, , 1
, 0, , 1
i i
i i i i
i i
i i i
x x x x
S x a a x x x i n
h h
h x x i n
+
+ +
+

''
= + e =
= =





iar din
( ) ( ) , ( ) ( ) S x S x dx S x S x dx
' '' '
= =
} }

rezult:


40
( ) ( )
3 3
1
1
1
( ) ,
6 6
[ , ] , , , 0, 1,
i i
i i i i
i i
i i i i
x x x x
S x a a b x c
h h
x x x b c i n
+
+
+

= + + +
e e =




( ) ( )
3 3
1
1
( ) ,
6 6
, , 0, 1,
i i
i i i i i
i i
i i
x x x x
P x a a b x c
h h
b c i n
+
+

= + + +
e =



Vom calcula funcia spline pentru cazul:
0 0 0
1
( ) ( ),
( ) (
n n n
S a a P x
S b a P x

'' ''
= =
'' ''
= = ).

41
(a
0
i a
n
sunt dou constante cunoscute)
Impunnd condiiile de interpolare i de continuitate vom obine:
2
2
1 1 1 1
( ) ,
6
( ) 0, 1.
6
i
i i i i i i i
i
i i i i i i i
h
P x a b x c y
h
P x a b x c y i n
+ + + +
= + + =
= + + = =

,


Din aceste relaii calculm i n funcie de
1 1
, , ,
i i i i i i
b c a a y y
+ +
:
42
( )
( )
1
1
1 1
1 1
,
6
.
6
i i i
i i i
i
i i i i i
i i i i i
i
y y h
b a a
h
x y x y h
c x a x a
h
+
+
+ +
+ +

=


0, 1 i n =
Avem:
Din condiia de continuitate a primei derivate a funciei spline
cubice
( )
1
( ) , 1, ..., 1
i i i i
P x P x i n

' '
= = , innd seama de:
( ) ( )
2 2
1
1 1 1
1 1
( ) ,
2 2
i i
i i i i
i i
x x x x
P x a a b
h h




'
= +
43
( ) ( )
2 2
1
1
( ) ,
2 2
i i
i i i i
i i
x x x x
P x a a b
h h
+
+

'
= +
rezult, utiliznd formulele pentru b
i-1
i b
i
deduse mai sus:
( )
( )
1 1 1
1 1
1
1
1
( )
2 6
( )
2 6
i i i i
i i i i i
i
i i i i
i i i i i
i
h y y h
P x a a a
h
h y y h
P x a a a
h

+
+

'
= + =

'
= +

sau
1 1
1 1
1
( ) 6 , 1, , 1.
i i i i
i i i i i
i i
y y y y
h h a h a i n
h h
+
+

| |
+ + = =
|
\ .

(1)
44
Pentru i=1 i i=n din (1) avem:
1 0 2 1
0 1 1 1 2 0 0
1 0
1 1 2
2 2 2 11 1 1
1 2
2( ) 6
2( ) 6
n n n n
n n n n n n n
n n
y y y y
h h a h a h a
h h
y y y y
h a h h a h a
h h



| |

+ + =
|
\ .
| |

+ + =
|
\ .

Sistemul liniar format din ecuaiile (1) cu necunoscutele
{ }
1 2 1
, , ,
n
a a a

are forma:

cu
( 1) ( 1) 1
, ,
n n n
Ha f H f
+ + +
= e e
45
1 0 2 1
0 1 1 1 2 0
1 0
1 1
1 1
1
1 1 2
2 2 2 11 1 1
1 2
2( ) 6 ''( )
( ) 6 , 1, , 1
2( ) 6 ''( )
i i i i
i i i i i
i i
n n n n
n n n n n n
n n
y y y y
h h a h a h f a
h h
y y y y
h h a ha i n
h h
y y y y
h a h h a h f b
h h
+
+




| |
+ + =
|
\ .
| |
+ + = =
|
\ .
| |
+ + =
|
\ .




46

0 1 1
1 1 2 2
2 2 3 3
3
2( ) 0 0 0 0 0
2( ) 0 0 0 0
0 2( ) 0 0 0
0 0 0 0 2(
n
h h h
h h h h
h h h h
H
h

+
+
+
=







3 2 2
2 2 1
)
0 0 0 0 0 2( )
n n n
n n n
h h h
h h h


(
(
(
(
(
(
(
+
(
(




+


47
1 0 2 1
0
1 0
1 1
1
1 1 2
1
1 2
6 ''( )
6 1, , 1
6 ''( )
i i i i
i i
n n n n
n
n n
y y y y
h f a
h h
y y y y
f i n
h h
y y y y
h f b
h h
+


( | |

( |
\ .
(
(
| |
= =
(
|
\ .
(
(
| |
(

|
(
\ .

Matricea H are diagonala dominant att pe linii ct i pe
coloane, este simetric i pozitiv definit prin urmare putem
utiliza metoda Gauss-Seidel sau o metod de relaxare pentru
rezolvarea sistemului Ha=f.

48
Interpolare n sensul celor mai mici ptrate

x x
0
x
1
x
2
... x
n-1
x
n

f y
0


y
1
y
2
... y
n-1
y
n


f(x
i
) = y
i
, i=0,...,n
f(x) ~ S
f
(x; a
0
, a
1
, ..., a
m
)
S
f
(x; a
0
, a
1
, ..., a
m
) = a
m
x
m
+ a
m-1
x
m-1
+ + a
1
x + a
0

Coeficienii a
0
, a
1
, ..., a
m
se gsesc rezolvnd problema de
minimizare n sensul celor mai mici ptrate:
49
( )
2
0 1 0 1
0
min{ ( ; , , ..., ) ; , , ..., } (LSP)
n
f r m r m
r
S x a a a y a a a
=
e


( )
1
2
0 1 0 1
0
: ,
( , , ..., ) ( ; , , ..., )
m
n
m f r m r
r
g
g a a a S x a a a y
+
+
=



( )
2
0 1 1 0
0
( , , ..., )
n
m k
m m r k r r r
r
g a a a a x a x a x a y
=
= + + + + +


( )
0 1 1 0
0
( , , ..., ) 2
n
m k k
m m r k r r r r
r
k
g
a a a a x a x a x a y x
a
=
c
= + + + + +
c




50
Soluia problemei de minimizare a problemei (LSP) este obinut
rezolvnd sistemul de ecuaii liniare, de dimensiune (m+1):
0 1
( , , ..., ) 0 , 0,1, ...,
m
k
g
a a a k m
a
c
= =
c

( )
1 0
0 0
, 0, ...,
n n
m k k k
m r k r r r r r
r r
a x a x a x a x y x k m
= =
+ + + + + = =



1 1
0 1 1
0 0 0 0 0
,
0, ...,
n n n n n
k k k m k m k
r r m r m r r r
r r r r r
a x a x a x a x y x
k m
+ + +

= = = = =
+ + + + =
=


51
Constantele { a
0
, a
1
, ..., a
m
} sunt soluia sistemului liniar:
( 1) ( 1) ( 1)
, 0 0
,
, ( ) , ( )
m m m m m
kj k j k k
Ba z
B B b z z z
+ + +
= =
=
e = e =

0 0
, , , 0, ...,
n n
k j k
kj r k r r
r r
b x z y x k j m
+
= =
= = =

Vous aimerez peut-être aussi