Documente Academic
Documente Profesional
Documente Cultură
Metoda bisectiei
Exemplul -1.1 S
a se aproximeze solutia ecuatiei x3 + 4x2 10 = 0 (continut
a n
intervalul [1, 2]).
Solutie Avem
a0 = a = 1, b0 = b = 2, f(a) = 7, f(b) = 14.
Atunci c0 = (a0 + b0 )/2 = 1/2. Cum f(c0 ) < 0 rezulta ca
a1 = c0 = 1/2, b1 = b0 = 2, c1 = (a1 + b1 ) /2 = 5/4 = 1, 25
Cum f (c1) < 0 rezult
a c
a
a2 = c1 = 5/4, b2 = b1 = 2, c2 = (a2 + b2) /2 = 13/8 = 1, 625
Cum f (c2) > 0 rezulta ca
a3 = a2 = 5/4, b3 = c2 = 13/8, c3 = (a3 + b3 ) /2 = 23/16 = 1, 4375
Cum f (c3) > 0 rezult
a c
a
a4 = a3 = 5/4, b4 = c3 = 23/16, c4 = (a4 + b4 ) /2 = 43/32 = 1, 34375
etc.
Regula falsi
Exemplul -1.2 S
a se aproximeze solutia ecuatiei x3 + 4x2 10 = 0 (continut
a n
intervalul [1, 2]).
1
Solutie Avem
a0 = a = 1, b0 = b = 2, f(a) = 7, f(b) = 14.
Atunci c0 = (a0f (b0) b0 f(a0))/(f(b0) f (a0 ) = 0. Cum f(c0 ) < 0 rezulta ca
a1 = c0 = 0, b1 = b0 = 2, c1 = (a1 f(b1 ) b1 f(a1 ))/(f(b1 ) f(a1) = 5/6 = 0, 83333
Cum f (c1) < 0 rezulta ca
a2 = c1 = 5/6, b2 = b1 = 2, c2 = (a2 f(b2 )b2 f(a2))/(f(b2)f (a2 ) = 110/91 = 1, 20879
etc.
Metoda coardei
Exemplul -1.3 S
a se aproximeze solutia ecuatiei 2x3 4x + 1 = 0 (continuta n
intervalul [1/4, 1]), folosind metoda coardei.
Solutie: Fie f(x) = 2x3 4x + 1. Avem: f (x) = 6x2 8x si f (x) = 12x. Luam
a = 1/4 si b = 1. Evident, f nu se anuleaza pe [a, b], f(a) f (a) = 3/32 > 0 si
f(a) f (b) = 1/32 < 0. Deci conditiile de aplicabilitate ale metodei coardei sunt
indeplinite. Luam x0 = 1/4 si x1 = 1. Atunci
x2 =
x0 f(x1 ) x1 f(x0 )
3
x0 f(x3 ) x3 f(x0 )
899
= , x3 =
=
, etc.
f(x1 ) f(x0)
11
f(x3 ) f(x0)
3475
Metoda secantei
Exemplul -1.4 S
a se aplice metoda secantei pe intervalul [0, 1] pentru rezolvarea ecuatiei
3ex 4 cos x = 0 pentru x0 = 1 si x1 = 0, 9.
2
x2 :=
Exemplul -1.5 Sa
se arate ca se aplica metoda lui Newton pe intervalul [0, 1] pentru
rezolvarea ecuatiei 3ex 4 cos x = 0. Lund x0 = 1, s
a se calculeze valoarea primei
iteratii.
Solutie: Evident f este de dou
a ori derivabil
a pe [0, 1] si f (x) = 3ex + 4 sin x,
f(x) = 3ex + 4 cos x, functii care evident nu se anuleaza pe [0, 1]. Cum f (0) f(1) =
3e + 4 cos 1 < 0 si f(1) f(1) = 9e2 16 cos 1 > 0, rezulta ca metoda lui Newton se
aplic
a.
Avem
x1 := x0
f(x0 )
3e 4 cos 1
4 sin 1 + 4 cos 1
=1
=
= 0, 47975
f (x0 )
3e + 4 sin 1
3e + 4 sin 1
Principiul contractiei
Exemplul -1.6 Fie functia
3 1
7
f : , R, f (x) = x2 + x
4 2
16
Sa se arate c
a f este o contractie. Lund x0 = 58 , sa se determine num
arul de iteratii
necesari pentru a aproxima solutia ecuatiei f(x) = x cu o eroare .
3
3
max |f (x)| = max |2x + 1| = max (2x 1) = 2
4
x[ 34 , 12 ]
x[ 43 , 12 ]
x[ 34 , 12 ]
1=
1
2
Deci
1
|f (x)| q := .
2
Notam a = 43 , b = 12 . Atunci
a
+
b
a
+
b
b
a
5
5
1 1
f
(1 q)
f
+ (1 )
2
2
2
8
8
2 8
25 5
7
5
1
3
4
+
Deci f este o contractie. Fie z solutia ecuatiei f (x) = x pe intervalul [a, b].
Din formula de evaluare a erorii avem
qn
|xn z|
|x1 x0|
1q
Daca
qn
|x1 x0 | , atunci |xn z| , deci xn aproximeaz
a pe z cu eroarea .
1q
Avem
si
Atunci
5
25 5
7
43
x1 = f(x0) = f
=
=
8
64 8 16
64
43 5
3
|x1 x0 | = + =
64 8
64
1 n
qn
3
3
|x1 x0 | 2 1
n+5
1q
2
1 2 64
4
n+5
3
n log2
3
5
1 2 3
A = 4 5 6
7 8 9
Atunci
A
1 = max
1j3
3
i=1
|aij | =
= max (|1| + |4| + |7| , |2| + |5| + |8| , |3| + |6| + |9|) = max (12, 15, 18) = 18
si
A
= max
1i3
3
j=1
|aij | =
= max (|1| + |2| + |3| , |4| + |5| + |6| , |7| + |8| + |9|) = max (6, 15, 24) = 24.
10 7 8 7
7 5 6 5
A=
8 6 10 9
7 5 9 10
32
23
b=
33
31
5
cu solutia
1
1
x=
1
1
Consider
am sistemul perturbat
10
A=
8
A(x + x) = b + b unde
7 8 7
5 6 5
b
+
b
=
6 10 9
5 9 10
9, 2
12, 6
cu solutia x + x =
4, 5
1, 1
32, 1
22, 9
33, 1
30, 9
7
8, 1 7, 2
32
10
23
7, 08 5, 04
6
5
A=
b=
33
8
5, 98 9, 89
9
30
6, 99 4, 99
9
9, 98
(1)
81
137
cu solutia x + x =
34
22
Exemplul -1.9 Sa se arate ca
x
x
(2)
= cond(A) b
(Vom considera cazul sistemului
b
x
=
x + x x
=
(9, 2 1; 12, 6 1; 4, 5 1; 1, 1 1)
=
=
(8, 2; 13, 6; 3, 5; 2, 1)
= max(|8, 2| ; |13, 6| ; |3, 5| ; |2, 1|) = 13, 6.
6
x
=
(1; 1; 1; 1)
= max(|1| ; |1| ; |1| ; |1|) = 1.
Atunci
A1
25
41
=
10
13, 6
= 13, 6
1
41
10
68 17 10
17 5 3
10 3 2
A
= max(|10|+|7|+|8|+|7| , |7|+|5|+|6|+|5| , |8|+|6|+|10|+|9| , |7|+|5|+|9|+|10|) =
= max(32, 23, 33, 31) = 33
1
A
Rezult
a c
a
Avem
cond(A) :=
A
A1 = 33 136 = 4488
b
=
b + b b
=
(32, 1 32; 22, 9 23; 33, 1 33; 30, 9 31)
=
=
(0, 1; 0, 1; 0, 1; 0, 1)
= max(|0, 1| ; |0, 1| ; |0, 1| ; |0, 1|) = 0, 1.
b
=
(32; 23; 33; 31)
= max(|32| ; |23| ; |33| ; |31|) = 33..
Atunci
0, 1
1
=
=
33
330
7
si
cond(A)
Deci
= 4488
= 13, 6
330
= cond(A)
Metode directe
Metoda lui Gauss (cu pivotare partiala)
Exemplul -1.10 Fie sistemul de ecuatii liniare
x + 21 y + 31 z = 1
1
x
2
+ 31 y + 14 z = 2
1
x
3
+ 41 y + 15 z = 3
x + 12 y + 13 z = 1
1
y
12
1
z
12
3
2
1
y
12
4
z
45
8
3
La etapa n = 2 c
aut
am cel mai mare element n modul de pe coloana n a matricei
sistemului (de la elementul a22 n jos). Acesta este max = |a22 | = 1/12 si se afla pa
8
x + 21 y + 13 z = 1
y + z = 18
1
z = 76
180
1
12
1
180
1
2160
1 12 13
A = 12 13 14
1
3
1 12 13
1 1 1
2 3 4
1
3
1
4
1
5
1 21 13
1
1
0 12
12
1
4
0 12
45
1
2
1
1
12
1
4
1
5
1 0 0
0 1 0
0 0 1
1 0 0
1
2 1 0
1
0 1
3
1 0 0
1 6 12 0
1
4
3 0 1
45
1
3
si
0 0
1
0 1 1 6 12 0
1
1
1 1
0 0 180
6
1 12 13 1
0
0
0 1 1 6 12
0
0 0 1
30 180 180
1 21 0 9
60
60
0 1 0 36 192 180
0 0 1 30 180 180
1 0 0 9
36
30
0 1 0 36 192 180
0 0 1 30 180 180
Deci
1
2
1
3
36
30
A1 = 36 192 180
30 180 180
Factorizarea LU
Exemplul -1.12 S
a se factorizeze sub forma LU matricea
4 2 0
2
1 1 2
A=
4
5 2 9
0
1
3
4
10
Solutie Se verific
a mai nti c
a determinantii de colt ai matricei A sunt nenuli. Cu
formulele din curs se obtine:
l11 = 2, l21 = 1, l31 = 4, l41 = 0
u11 = 1, u12 = 2, u13 = 1, u14 = 0
l22 = 1, l32 = 3, l42 = 1
u22 = 1, u23 = 1, u24 = 3
l33 = 5, l43 = 2
u33 = 1, u34 = 0
l44 = 1
u44 = 1
Deci
0 0
2
1 1 0
L=
4 3 5
0
1 2
1 2 1 0
0 1 1 3
U =
0 0 1 0
0 0 0 1
,
0
A = 2 10 4
2 4 6
, b = 16
12
11
Solutie Se verific
a imediat ca matricea A este simetric
a. Deoarece
4 2
1 = |4| > 0, 2 =
2 10
4 2 2
= 36 > 0, 3 = 2 10 4
2 4 6
= 144 > 0
0, 1
0, 2
0, 3
0, 9
0, 2 0, 8
0,
1
0,
4
A=
;
b
=
0, 1 0, 3 0, 7 0, 1
0, 3 0, 2 0, 1 0, 9
12
3, 6
.
2, 4
1, 5
0
0
(0)
Lund x = sa se determine num
arul de iteratii necesar pentru a aproxima
0
0
solutia sistemului cu o eroare mai mic
a de 1010 .
Solutie: Avem
0, 1 0, 1 0, 2 0, 3
0, 2
0,
2
0,
1
0,
4
B =I A=
0, 1 0, 3
0, 3
0, 1
0, 3
0, 2
0, 1
0, 1
Atunci
B
1 = max
1j4
4
i=1
|0, 2|+|0, 1|+|0, 3|+|0, 1| , |0, 3|+|0, 4|+|0, 1|+|0, 1|) = max(0, 7; 0, 8; 0, 7; 0, 9) = 0, 9 < 1.
si
B
= max
1i4
4
j=1
|0, 1|+|0, 3|+|0, 3|+|0, 1| , |0, 3|+|0, 2|+|0, 1|+|0, 1|) = max(0, 7; 0, 9; 0, 8; 0, 7) = 0, 9 < 1.
Deci metoda lui Jacobi se aplic
a. Din formula de evaluare a erorii avem:
x(n) x
p
qn
x(1) x(0)
p , n N
1q
qn
x(1)
1q
x(0)
p < . Avem
x(1) x(0)
1 =
b
1 = |3, 6| + |2| + |2, 4| + |1, 5| = 9, 5
13
si
x(1) x(0)
=
b
= max(|3, 6| , |2| , |2, 4| , |1, 5|) = 3, 6
Atunci
qn
0, 9n
x(1) x(0)
1 <
9, 5 < 0, 9n <
n = log0,9
+1
1q
1 0, 9
95
95
si
0, 9n
qn
x(1) x(0)
<
3, 6 < 0, 9n <
n = log0,9
+1
1q
1 0, 9
36
36
Metoda Gauss-Seidel
Exemplul -1.15 Fie sistemul de ecuatii liniare
x + 1x + 1x = 1
1 2 2 3 3
1
x
5 1
1
x
10 1
+ x2 + 16 x3 = 2
+
1
x
20 2
+ x3 = 3
Sa se arate ca se aplic
a metoda Gauss-Seidel.
Solutie Not
am cu A matricea ceoficientilor sistemului. Avem
1 12 13
A = 15 1 61
1
1
1
10
20
Atunci
si
12
13
1
B = I A = 5
0 6
1
1
10 20 0
1 1 5
q1 = |b11 | + |b12 | + |b13 | = + =
2
3
6
14
Deci
1 5 1 1
q2 = |b21 | q1 + |b22| + |b23| = + =
5 6
6
3
1 5 1 1
1
q3 = |b31| q1 + |b32 | q2 + |b33| = + =
10 6
20 3
10
q = max(q1, q2, q3 ) = max
5 1 1
, ,
6 3 10
5
<1
6
Rezult
a c
a metoda Gauss-Seidel se aplic
a.
5x + 3x2 + 2x3 = 1
1
3x1 + 6x2 + 3x3 = 2
S
a se arate c
a se poate aplica metoda relax
arii simultane. S
a se determine parametrul
optim de relaxare. Lund x(0) = (0, 0, 0) sa se evalueze eroarea x x(n) .
Solutie: Notam cu A matricea sistemului. Avem
5 3 2
A = 3 6 3 = At transpusa matricei A.
2 3 5
Deci A simetrica. Deoarece
5 3
1 := |5| > 0, 2 :=
3 6
5 3 2
> 0, 3 := 3 6 3
2 3 5
> 0,
3/5 2/5
D A = 1/2 1 1/2
2/5 3/5 1
1
6
si det(D1A I) = 0 (1 )3 19
(1 ) + 25
= 0. Dac
a not
am 1 = t, atunci
25
2
5
=
1 + 3
6
q=
2
1 3
= .
1 + 3
3
caruia i corespunde
Avem x(1) = C x(0) + c = c = D1 b = 5/6 (1/5; 2/6; 3/5)t unde b = (1; 2; 3)t este
vectorul termenilor liberi din sistem. Atunci
x(1)
2D
(1)
= Dx , x
(1)
25
=
36
1 2 9
+ +
5 3 5
si
(n)
qn
x
D
x(1) x(0)
D = 5
1q
2 25
3 9
n+ 12
2
.
3
1 2 3 4
2 5 1 10
4 10 5 30
1
culeze A .
16
Se verific
a mai nti c
a matricea A este simetric
a si pozitiv definita. Lu
am w0 =
(1, 0, 0, 0) . Atunci w0Aw0 = 1 si
1 0 0
0 0 0
C1 =
0 0 0
0 0 0
0
0 2 3 4
0 1
0
0
0
, D1 =
.
0
1
0
0 0
0
0 0
0
1
0 0 13 0
5 2 0 0
0 0 5 2
2 1 0 0
C2 =
.
, D2 =
0 0 1
0
0
0
0
0
0 0 0
1
0
0 0 0
Luam v2 = (0, 0, 1, 0) . Rezulta ca w2 = (13, 5, 1, 0) si w2Aw2
0 0 0
174 67 13 0
0 0 0
67 26
5 0
C3 =
, D3 =
0 0 0
13 5
1 0
0 0 0
0
0
0 0
Luam v3 = (0, 0, 0, 1) . Rezult
a c
a w3 = (39, 17, 3, 1) si
730 315
56
17
C4 =
, D4 =
130 56
10
3
39
17
3
1
17
= 1, de unde
39
17
.
3
w3 Aw3 = 1, de unde
0 0 0 0
0 0 0 0
.
0 0 0 0
0 0 0 0
1 0 1
0 1 0
T =
cu rang(T ) = 2 si H0 = 0.
1 1 1
1 2 1
y1
1
1
Lu
am y1 = T = 0 (avem y1 H0T y1 = y1 = 0. Atunci w1 =
0
1
0
2
0
H0 T y1 = y1 si T w1 = . Rezulta ca
T w1
2 = 12, iar w1 (T w1 ) =
2
2
2 0 2
2
0 0 0
0 . Deci
2 0 2 2
w1(T w1)
H1 = H0 +
2 =
T w1
0
0
1
Luam y2 = T = 1
0
0
0
1/6
1/6
1/6
(avem
y
H
T
y
=
2
1
2
18
1/2
1
1/2
= 0. Atunci
w2 = y2 H1T y2
1/2 1/2 0
1
1
0
1/2 1/2 0
2
si T w2 =
. Rezulta ca
T w2
= 3, iar w2(T w2 ) =
0
1/2
1 . Deci
1/2
1/3
w2 (T w2 )
H2 = H1 +
2 = 1/3
T w2
1/3
n concluzie
T+
.
1/6
1/3
1/6
1/6
0
1/3
1/6 0
= H2 = 1/3 1/3
0
1/3
1 0 1
0 1 0
T =
cu dim R(T ) = 2
1 1 1
1 2 1
Atunci
1
1
x2 = (1; 2; 1) , y2 = (1; 1; 0; 1)
2 3
3
Rezulta ca
+
T =
x1 y1
x2y2
= 2
6
2
1
2
1
0 2
1 0
1 0 1
0 1 0
T =
cu rang(T ) = 2 si H0 = T
1 1 1
1 2 1
5
1
3
0
Lund a1 = 0 , b1 = obtinem v0 := (I T H0) T a1 =
,
8
0
0
11
0
1
5/48
w0 = H0b1 = 0 , u0 :=
(I H0 T )w0 = 1/8 ,
v0 , T w0
1
5/48
1
23/48
H1 := H0 + u0 v0 = 5/8
5/8
0
5/8
7/8
0
0
7/8
1
Lund a2 = 1 , b2 = obtinem v1 := (I T H1 ) T a2 =
0
0
0
7/8
0
20
, w1 =
H1 b2 =
5/16
1/6
v1 , T w1
5/16
1/6
T + = H2 := H1 + u1 v1 = 1/3 1/3
0
1/3 .
5 4 3 1
4
2
9
A=
,
2
5
1
5
7
1
2 1
folosind metoda Krylov.
y (1) = Ay (0)
16
21
=
5
11
1
2
am
Krylov vectorul y(0) = si calcul
3
4
209
,
, y(2) = Ay(1) =
197
154
21
y (3)
1621
164
= Ay (2)
,
456
393
y(4) = Ay (3)
9210
4902
=
.
5571
10992
8 16 1 p1 9210
1621
164 209 21 2 p2 4902
=
456 197 5 3 p 5571
p4
10992
393 154
11 4
45
885
mul caracteristic este:
pA () = 4 + 93 452 + 369 + 885 .
Metoda Leverrier
Exemplul -1.22 Determinati, folosind metoda Leverrier, polinomul caracteristic si
matricea A1 , daca exista, pentru matricea
0 3
12
11
9 5
2
5
A=
,
2 4 15 11
2
6 7
10
Aplicnd metoda Leverrier pentru matriceaA si m = 4, obtinem:
s1 = 31 ,
p1 = 31 ,
22
- pentru k = 2:
84 162
285
139
40
47
12
105
2
A2 = A =
,
66 106
288
271
26
58 169
231
- pentru k = 3:
s2 = 705 ,
p2 = 128 ,
1938 4674
6720
1019
1049 913
1129
1427
A3 = A3 =
,
7714 2248
5807
5616
684
1772 3958
4147
s3 = 10060 ,
- pentru k = 4:
p3 = 2609 ,
49326 116331
140532
2141
3918 8513
28245
43842
A4 = A4 =
,
39468 45684
116779
110709
23094
31854 82803
85660
s4 = 191785 ,
p4 = 12761 ,
0.0753 0.0314
0.0794
0.1934
=
.
0.0060
0.0412
0.1103
0.1079
0.0296
0.0581
0.0302
0.0686
23
1 3
2
11
9 5 12
A=
,
2 4
5
11
2 16 7
10
folosind algoritmul Fadeev.
Aplicnd algoritmul Fadeev obtinem:
A1 = A ,
p1 = tr(A1 ) = 21 ,
1 3
2
10
9 26
12
5
B1 = A1 + p1 I4 =
,
2 4 16 11
2
16 7 11
- pentru k = 2
29
13
38
121
169
153 260 230
A2 = AB1 =
,
4
90
57
50
158 226
228
51
1
p2 = tr(A
= 13 ,
2)
29
13
38
134
169
140 260 230
B2 = A2 + p2 I4 =
,
4
90
70
50
158 226
228
38
24
- pentru k = 3
277
549
114
1633
381 3171
1483
1598
A3 = AB2 =
814
1534 1792
828
828
668 1364 3574
1
p3 = tr(A
= 3390 ,
3)
549
114
1757 277
381 219
1483 1598
B3 = A3 + p3 I4 =
814 1534
1598
828
- pentru k = 4
0
0
0
18160
0 18160
0
0
A4 = AB3 =
0
0 18160
0
0
0
0 18160
1
p4 = tr(A
= 18160 ,
4)
0 0 0
0 0 0
B4 = A4 + p4I4 =
0 0 0
0 0 0
25
.
0
A1
0.0302
0.0063
0.0968 0.0153
0.0210 0.0121
0.0817
0.0880
1
= B3 =
0.0448 0.0845
p4
0.0880
0.0456
Metoda rotatiilor
.
17
A = 2
8
3 3 2 3
3 3
2 3
11
si se calculeaz
a matricea
1
2 apq
arctan
= .
2
app aqq
6
T =
cos 0 sin
0
sin 0
cos
20 0 0
B = T t AT = 0
0
26
8 4
4 8
=
Se ia
T = 0 cos sin
0 sin cos
si se calculeaz
a matricea
20
B = T AT == 0
0
t
12 0
0 4
Rezult
a c
a valorile proprii ale matricei A sunt 1 = 20, 2 = 12, 3 = 4.
Ecuatii neliniare n Rm
Principiul contractiei
Exemplul -1.25 Fie sistemul de ecuatii
x = (80 + x3 x2 3yz)/100
y = (60 y 3 z 2 + 4xz)/86
z = (40 + z 3 + y 2 5xy)/72
(3)
F (x, y, z) =
(3x2 2x)/100
4z/86
5y/72
3z/100
3y/100
3y /86
(2z + 4x)/86 ,
2
(2y 5x)/72
3z /72
2
deci
F (x, y, z)
= max((|3x2 2x| + | 3z| + | 3y|)/100, (|4z| + | 3y 2 | +
| 2z + 4x|)/86, (| 5y| + |2y 5x| + |3z 2 |)/72) max(28/100, 32/86, 36/72) =
= 1/2 (am folosit 0 x, y, z 2). Putem lua q = 1/2. Pe de alta parte
F (a) a
=
max(28/100, 24/86, 35/72) = 35/72 < (1 q)r = 1/2. Deci F este 1/2-contractie a
multimii V n raport cu norma
. Din principiul contractiei rezulta ca ecuatia
F (x, y, z) = (x, y, z) are solutie unica n V .
Pentru x(0) = (1, 1, 1) se calculeaz
a x(n) cu formula de recurenta x(n) = F (x(n1) ),
n N . Se opreste procesul iterativ atunci cnd q/(1 q)
x(n) x(n1)
< .
(4)
F = (f, g, h) : V R
4x /234
(4y + 2yz )/234
(8z + 2y z)/234
deci
F (x, y, z)
= max((|4x3 | + |4y3 + 2yz 2 | + | 8z 3 + 2y 2 z|)/234, (| 4x3 + 6xz 2 | +
|8y 3 | + | 12z3 + 6x2z|)/432, (|8x3 2xy2 + 3| + | 12y3 2x2 y + 1| + |16z 3 |)/324)
max(48/234, 88/432, 108/234) = 1/3 (am folosit 2 x 2, 1 y 1, 0 z 1).
Putem lua q = 1/3. Pe de alta parte |f(x, y, z) a1 | (|432| + |x4 | + |y 4| + |2z 4| +
|y2 z 2 |)/234 452/234 < 2, |g(x, y, z)a2 | (|324|+|x4|+|2y 4 |+|3z 4 |+|3x2z 2 |)/432
357/432 < 1 si |h(x, y, z) a3 | (|234| + |2x4| + |3y4 | +|4z4 | +|x2 y2 | +|3x| +|y|)/324
122/324 < 1/2, (x, y, z) V . Deci F (V ) V si F este 1/3-contractie a multimii V n
raport cu norma
3
z + 3x2 z + 3y 2z 188(z 1) 1 = 0
(5)
unic
a v n V := [1, 1]2 [0, 2]. Pentru o eroare dat
a si pentru iterata initial
a
x(0) := (0, 0, 1) sa se calculeze iterata x(n), pentru care
x(n) v
.
Fie r = 1 si a = (0, 0, 1). Atunci multimea V este Br (a) n raport cu norma
. Fie functia F = (f, g, h) : V R3 cu f (x, y, z) := x3 + 3xy 2 + 3xz 2 183x + 2,
g(x, y, z) := y 3 ++3x2y+3yz 2 193y+1 si h(x, y, z) := z3 +3x2 z+3y 2 z188(z1)1 =
0, (x, y, z) V . Sistemul de ecuatii (5) este echivalent cu F (x, y, z) = 0.
Avem F (x, y, z) =
3x2 + 3y 2 + 3z 2 183
6xy
6xz
6xy
3x2 + 3y 2 + 3z 2 193
6yz
6xz
6yz
3x2 + 3y2 + 3z 2 188
6x 6y 6z 6y 6x
6z
6x
F (x, y, z) = 6y 6x 0 6x 6y 6z 0 6z 6x
6z 0 6x 0 6z 6y 6x 6y 6z
deci
F (x, y, z)
max(|18x| + |12y| + |12z|, |12x| + |18y| + |12z|, |12x| + |12y| +
|18z|) max(54, 54, 60) = 60 (am folosit 1 x, y 1, 0 z 2). Putem lua
180
0
0
0
0
185
1/180
0
0
si
(F (a))1
= max(1/180, 1/190, 1/185) = 1/180.
0
1/190
0
0
0
1/185
Luam = 1/180. Cum M r = 60/180 < 1 si /(1 M R) = 1/120, putem
lua = 120. Avem F (a) = (2, 1, 0)t si (F (a))1 F (a) = (1/90, 1/190, 0)t , deci
(F (a))1 F (a)
= 1/90. Lua m = 1/90. Conditia (1 q)r implica q 89/90.
Din
F (x, y, z)
max(|x3| + |3xy2 | + |3xz 2| + |183x| + 2, |y 3 | + |3x2 y| + |3yz 2 | +
|193y| + 1, |z3 | + |3x2 z| + |3y2 z| + |188(z 1)| + 1) max(201, 210, 209) = 210 rezulta
30
c
a (M/2 )
F (x, y, z)
qq 210/240 = 7/8. Din M r/ q rezult
a q 1/2.
Deci putem lua q = 7/8 si atunci ecuatia F (x, y, z) = 0 are o solutie unic
a n V .
Pentru x(0) = (0, 0, 1) se calculeaza x(n) cu formula de recurenta (5) (folosind la
fiecare pas o procedura de inversare a matricei (F (x(n) ))1 ). Se opreste calculul iterativ
n
x2 + y 2 + z 2 + x + y + z 853/144 = 0
(6)
2x + 1
F (x, y, z) = 6x + 1
10x + 2
2 0 0
F (x, y, z) = 6 0 0
10 0 0
31
2y + 1
2z + 1
8y 1
4y 4
0
0 8 0
0
2z 3 ,
6z 6
0 0 2
0 0 2 ,
0 0 6
deci
F (x, y, z)
max(|2|+|2|+|2|, |6|+|8|+|2|, |10|+|4|+|6|) = 20, (x, y, z)
3 9
3
V . Putem lua M = 20. Avem F (a) = 7 9 1 , cu det(F (a)) = 72, deci
12 0 12
9 3
2
9 3 4
2/9. Lu
a m = 2/9. Avem F (a) = (11/144, 13/432, 1/9)t si (F (a))1 F (a) =
(1/72, 1/144, 1/216)t , deci
(F (a))1 F (a)
= 1/72. Luam = 1/72. Conditia
(1 q)r implica q 67/72. Din M r q rezulta q 8/9. Deci putem lua
q = 8/9 si atunci ecuatia F (x, y, z) = 0 are o solutie unic
a n V .
Pentru x(0) = (1, 1, 1) se calculeaza x(n) cu formula de recurenta (6). Se opreste
calculul iterativ atunci cnd q/(1 q)
x(n) x(n1)
.
Interpolare polinomiala
Formula lui Lagrange
Exemplul -1.29 Utiliznd formula lui Lagrange de reprezentare s
a se determine polinomul de interpolare de grad 2 ce verific
a conditiile:
P (0) = 2, P (1) = 1, P (4) = 4.
Din curs rezult
a c
a:
P (x) = P (0)L1 (x) + P (1)L2(x) + P (4)L3(x).
Avem:
L1(x) =
(x 1)(x 4)
x2 5x + 4
=
,
(0 1)(0 4)
4
L2 (x) =
x(x 4)
x2 4x
=
,
(1 0)(1 4)
3
32
x(x 1)
x2 x
L3 (x) =
=
.
(4 0)(4 1)
12
Atunci:
P (x) = 2
x2 5x + 4
x2 4x
x2 x
1
3
+1
+4
= x2 x + 2.
4
3
12
2
2
Exemplul -1.30 Fie functia f : [0, 12] R cu f(x) = 6 2x + 1 2x, x [0, 12].
Sa se determine polinomul de interpolare Lagrange P (f; 0, 4, 12; x) utiliznd algoritmul
Aitken.
Nodurile sunt x1 = 0, x2 = 4, x3 = 12. Atunci P11 (x) = f (0) = 6, P12 (x) = f (4) =
10, P13(x) = f(12) = 6. Rezulta ca
P22 (x) =
10x 6(x 4)
= x + 6,
4
P23 (x) =
6x 6(x 12)
=6
12
si astfel
x2 3x
+6.
P (f ; 0, 4, 12; x) = P33 (x) = +
8
2
Exemplul -1.31 Fie functia f : [0, 12] R cu f(x) = 6 2x + 1 2x, x [0, 12].
Sa se determine polinomul de interpolare Lagrange P (f; 0, 4, 12; x) utiliznd algoritmul
Neville.
Nodurile sunt x1 = 0, x2 = 4, x3 = 12. Atunci P11 (x) = f (0) = 6, P12 (x) = f (4) =
10, P13(x) = f(12) = 6. Rezult
a c
a
P22 (x) =
10x 6(x 4)
= x + 6,
4
33
P23 (x) =
x
6(x 4) 10(x 12)
= + 12
8
2
si astfel
x2 3x
P (f ; 0, 4, 12; x) = P33 (x) = +
+6
8
2
d.d.
d.d.
d.d.
d.d.
d.d.
1n
2n
3n
4n
5n
x1
x2
x3
x4
x5
f(x5 )
3n
4n
5n
9/16 7/64
3/4 2/16
1/4
10
10
9 3
7
x x3(x 4).
16
64
M5 3
|x (x 4)2| x [0, 4],
5!
unde M5 = sup |f (5) (x)|. Avem f (3) (x) = 18(2x + 1)5/2, f (4) (x) = 90(2x + 1)7/2,
x[0,4]
(5)
(x) = 630(2x + 1)9/2. Cum f (6) (x) = 630 9(2x + 1)11/2 < 0, rezult
a c
a f (5) este
630 3
21
|x (x 4)2 | = x3(x 4)2 , x [0, 4].
120
4
35
Organiz
am calculul diferentelor nedivizate ascendente n tabelul urmator:
k xk f (xk ) 1h f (xk ) 2h f (xk ) 3h f (xk )
0
12
3 10
20
3
4
Cqi ih f (x0 ) = 1 + (x 4) + (x 4)(x 6) + (x 4)(x 6)(x 8)
8
48
si deci
P (f ; x0 , x1, x2 , x3 ; 7) = 1 + 3 +
39
9 1
=
= 4.875 .
8 4
8
36
Organiz
am calculul diferentelor nedivizate descendente n tabelul urm
ator:
k
10
20
12
= 20 +
7
4
12
(x 10) + (x 10)(x 8) + (x 10)(x 8)(x 6)
2
8
48
si deci
P (f; x0, x1 , x2 , x3 ; 7) = 20 18 +
21 1
39
+ =
= 4.875 .
8
4
8
37
3
4
3h f (x1 ) + Cq+1
4h f(x2 ).
= f(x0 ) + Cq1 1h f(x0 ) + Cq2 2h f (x1) + Cq+1
Organiz
am calculul diferentelor finite ascendente n tabelul urm
ator:
k
12
10
20
x6
(x 6)(x 8)
(x 4)(x 6)(x 8)
+3
+4
2
8
48
si
f(7) P (f; x2 , x1 , x0 , x1, x2 ; 7) = 3 +
5 3 1
39
=
= 4.875 .
2 8 4
8
Exemplul -1.36 S
a se determine, folosind formula de interpolare Gauss napoi, polinomul Lagrange atasat datelor: n = 2, x0 = 6, h = 2 (de unde x2 = 2, x1 = 4,
x1 = 8, x2 = 10) si f : R R o functie continua cu f(x2 ) = 2, f (x1) = 1,
f(x0 ) = 3, f(x1 ) = 8, f(x2 ) = 20 si sa
se estimeze valoarea functiei f n punctul
x = 7.
Printr-un calcul elementar, se arata ca, pentru orice i = 1, 2:
2i
2i1
f(x1/2 ) = 2i1
f(xi+1) si 2i
h f(x0 )) = h f (xi )).
h
h
2
3
4
= f(x0 ) + Cq1 1h f(x1 ) + Cq+1
2h f (x1 ) + Cq+1
3h f(x2 ) + Cq+2
4h f(x2 ).
12
10
20
= 3+2
(x 4)(x 6)
(x 4)(x 6)(x 8)
x6
+3
+4
2
8
48
si
f (7) P (f; x2 , x1, x0 , x1 , x2 ; 7) = 3 + 1 +
9 1
39
=
= 4.875 .
8 4
8
n
i=1
n
yi n x i yi
i=1
i=1
a = i=1
n 2
n
xi n x2i
n
xi
n
i=1
n
i=1
n
n
n
xi
xi yi
x2i
yi
i=1
i=1
i=1
i=1
b=
n 2
n
xi n x2i
i=1
i=1
Exemplu Pentru n = 4, (x1 , y1 ) = (0, 1), (x2, y2 ) = (1, 3), (x3 , y3 ) = (3, 7),
(x4, y4 ) = (5, 11) se obtine a = 2, b = 1.
n
i=1
s
a fie minim
a, coeficientii c1 , c2, . . . , cm+1 se determin
a ca solutia sistemului de ecuatii
liniare
n
xi
n
x2i
i=1
i=1
n
n
n x
2
x
x3i
i
i
i=1
i=1
i=1
n
n
n
2
3
x
x
x4i
i
i
i=1
i=1
i=1
...
...
...
n
n
n
xm
xm+1
xm+2
i
i
i
i=1
i=1
i=1
...
n
i=1
...
...
n
i=1
n
i=1
...
...
xm
i
xm+1
i
xm+2
i
...
n
x2m
i
i=1
c1
n
yi
i=1
x
y
i i
c2
i=1
2
=
c3
x
y
i
i
i=1
... ...
n
cm+1
xm
i yi
i=1
n t = 2, lund h = 0.5.
Avem f(t, y) = y2
y = y2 y 1 ,
t
4t2
y(1) = 0.75
t [1, 2]
y
1
2 , t0 = 1 si y0 = 0.75 . Se obtine N = 2 si yn+1 =
t 4t
41
y0 = y(t0 ),
y
= y + hf t + 1 h, y + 1 hf (t , y ) , n = 0, N 1 .
n+1
y0 = y(t0 ),
y
1
n+1 = yn + 2 h (f(tn , yn ) + f (tn + h, yn + hf (tn , yn ))) , n = 0, N 1 .
Metode Runge-Kutta
y = y2 y 1 ,
t
4t2
y(1) = 0.75
t [1, 2.9]
- pentru n = 1:
y0,1 = y0 = 1 ,
t0,1 = t0 = 1 ,
t1,1 = t1 = 1.95 ,
t [1, 2.25]
1
y
2 . Aplicnd metoda Euler progresiv
a se
t
4t
obtine:
t0 = 1 ,
y0 = 0.75 ,
f0 = f(t0 , y0 ) = 0.4375 ,
t1 = 1.25 ,
y1 = 0.6406 ,
f1 = f(t1 , y1 ) = 0.2621 ,
t2 = 1.5 ,
y2 = 0.5751 ,
f2 = f(t2 , y2 ) = 0.1638 ,
t3 = 1.75 ,
y3 = 0.5342 ,
f3 = f(t3 , y3 ) = 0.1015 ,
y4 = y3 +
h
(55f3 59f2 + 37f1 9f0) = 0.5166 ,
24
f4 = f(t4, y4 ) = 0.0539 ,
t5 = 2.25 ,
y5 = y4 +
h
(55f4 59f3 + 37f2 9f1) = 0.5096 ,
24
f5 = f(t5, y5 ) = 0.0162 .
44