You are on page 1of 5

Formulario de Calculo Numerico

F ormula de Lagrange :
p
n
(x) =
(x x
1
)(x x
2
) . . . (x x
n
)
(x
0
x
1
)(x
0
x
2
) . . . (x
0
x
n
)
f(x
0
) +
(x x
0
)(x x
2
) . . . (x x
n
)
(x
1
x
0
)(x
1
x
2
) . . . (x
1
x
n
)
f(x
1
) +. . . +
+
(x x
0
)(x x
1
) . . . (x x
n1
)
(x
n
x
0
)(x
n
x
1
) . . . (x
n
x
n1
)
f(x
n
)
f(x

)p
n
(x

) = (x

x
0
)(x

x
1
) . . . (x

x
n
)
f
(n+1)
()
(n + 1)!
Diferen cas divididas :
f[x
i
, x
j
] =
f(x
j
) f(x
i
)
x
j
x
i
f[x
i
, x
i+1
, . . . , x
i+k
] =
f[x
i
, x
i+1
, . . . , x
i+k1
] f[x
i+1
, x
i+2
, . . . , x
i+k
]
(x
i
x
i+k
)
f[x
i
, x
i+1
, . . . , x
i+k
] =
k

j=0
f(x
i+j
)
k

l=0
l=j
(x
i+j
x
i+l
)
=
f
(k)
()
(k)!
Diferen cas descendentes : f
i
= f
i+1
f
i
Diferen cas ascendentes : f
i
= f
i
f
i1
Rela cao entre as diferen cas :

k
f
i
=
k
f
i+k
i, k {0, 1, . . . , n}
f[x
i
, x
i+1
, . . . , x
i+k
] =

k
f
i
k! h
k
f[x
i+k
, x
i+k1
, . . . , x
i
] =

k
f
i+k
k! h
k
F ormula de Newton com diferen cas divididas :
p
n
(x) = f
0
+ (x x
0
)f[x
0
, x
1
] + (x x
0
)(x x
1
)f[x
0
, x
1
, x
2
] +. . .
. . . + (x x
0
)(x x
1
) . . . (x x
n1
)f[x
0
, x
1
, . . . , x
n
]
F ormula de Newton com diferen cas descendentes :
p
n
(x) = f
0
+ (x x
0
)
f
0
h
+ (x x
0
)(x x
1
)

2
f
0
2! h
2
+. . . + (x x
0
)(x x
1
) . . . (x x
n1
)

n
f
0
n! h
n
p
n
(x
0
+sh) = f
0
+sf
0
+s(s 1)

2
f
0
2!
+. . . +s(s 1) . . . (s n + 1)

n
f
0
n!
, s =
x x
0
h
F ormula de Newton com diferen cas ascendentes :
p
n
(x) = f
n
+
(x x
n
)
h
f
n
+
(x x
n
)(x x
n1
)
2! h
2

2
f
n
+. . . +
(x x
n
)(x x
n1
) . . . (x x
1
)
n! h
n

n
f
n
p
n
(x
n
+sh) = f
n
+sf
n
+
s(s + 1)
2!

2
f
n
+
s(s + 1)(s + 2)
3!

3
f
n
+. . . +
s(s + 1)(s + 2) . . . (s +n 1)
n!

n
f
n
, s =
x x
n
h
1
Expressao do spline c ubico interpolador de f em x
0
, x
1
, . . . , x
n
no intervalo [x
i
, x
i+1
] :
s
i
(x) =
(x
i+1
x)
3
6h
i
m
i
+
(x x
i
)
3
6h
i
m
i+1
+(f
i
m
i
h
2
i
6
)
(x
i+1
x)
h
i
+(f
i+1
m
i+1
h
2
i
6
)
(x x
i
)
h
i
, i = 0, 1, . . . , n1
Sistema de equa c oes que garantem a continuidade de s

(x) em x
i
, i = 1, 2, . . . , n 1 :
(1) h
i1
m
i1
+ 2(h
i
+h
i1
)m
i
+h
i
m
i+1
= b
i
, b
i
= 6(
f
i+1
f
i
h
i

f
i
f
i1
h
i1
), i = 1, 2, . . . , n 1
h
i
= x
i+1
x
i
, i = 0, 1, . . . , n 1, m
i
= s

(x
i
), i = 0, 1, . . . , n
Sistema de equa coes para a determina cao do spline c ubico (completo) que satisfaz as condi c oes
s

(x
0
) = f

0
e s

(x
n
) = f

n
:
Adicionar `as equa c oes (1) :
2h
0
m
0
+h
0
m
1
= 6(
f
1
f
0
h
0
f

0
)
h
n1
m
n1
+ 2h
n1
m
n
= 6(f

n

f
n
f
n1
h
n1
)
Sistema de equa c oes para a determinacao do spline c ubico com s

(x
0
) = k
0
e s

(x
n
) = k
n
Adicionar a (1) as equa c oes m
0
= k
0
e m
n
= k
n
. Se k
0
= k
n
= 0 obtem-se o spline c ubico natural.
Sendo s(x) a fun cao spline c ubica completa ou a fun cao spline c ubica natural, tem-se
|f(x

) s(x

)| h
3
2
_
_
b
a
f
2
(t)dt
_1
2

(x

) s

(x

h
1
2
_
_
b
a
f
2
(t)dt
_1
2
, h = max
i=0,1,...,n1
(x
i+1
x
i
), x

[x
o
, x
n
]
Metodo dos mnimos quadrados :
Considere-se uma fun c ao tabelada por
x x
0
x
1
. . . x
M
f(x) y
0
y
1
. . . y
M
(a = x
0
< x
1
< . . . < x
M
= b)
e seja P
n
(x) =

n
k=0
a
k
x
k
, o polin omio de grau n < M que melhor aproxima a fun c ao tabelada no sentido dos
mnimos quadrados. Ent ao, os coecientes a
0
, a
1
, . . . , a
n
s ao obtidos pelas equa c oes normais
a
0
M

i=0
x
0
i
+a
1
M

i=0
x
1
i
+a
2
M

i=0
x
2
i
+. . . +a
n
M

i=0
x
n
i
=
M

i=0
y
i
x
0
i
,
a
0
M

i=0
x
1
i
+a
1
M

i=0
x
2
i
+a
2
M

i=0
x
3
i
+. . . +a
n
M

i=0
x
n+1
i
=
M

i=0
y
i
x
1
i
,
.
.
.
a
0
M

i=0
x
n
i
+a
1
M

i=0
x
n+1
i
+a
2
M

i=0
x
n+2
i
+. . . +a
n
M

i=0
x
2n
i
=
M

i=0
y
i
x
n
i
.
2
F ormulas de integra cao e respectivos erros :
n F ormula de Newton-Cotes fechada Erro
1
_
x
1
x
0
f(x)dx
h
2
(f
0
+f
1
) (Regra dos Trapezios)
h
3
12
f

()
2
_
x
2
x
0
f(x)dx
h
3
(f
0
+ 4f
1
+f
2
) (Regra de Simpson)
h
5
90
f
(4)
()
3
_
x
3
x
0
f(x)dx
3h
8
(f
0
+ 3f
1
+ 3f
2
+f
3
) (Regra dos 3/8)
3h
5
80
f
(4)
()
4
_
x
4
x
0
f(x)dx
2h
45
(7f
0
+ 32f
1
+ 12f
2
+ 32f
3
+ 7f
4
) (Regra de Milne)
8h
7
945
f
(6)
()
5
_
x
5
x
0
f(x)dx
5h
288
(19f
0
+ 75f
1
+ 50f
2
+ 50f
3
+ 75f
4
+ 19f
5
)
275h
7
12096
f
(6)
()
6
_
x
6
x
0
f(x)dx
h
140
(41f
0
+ 216f
1
+ 27f
2
+ 272f
3
+ 27f
4
+ 216f
5
+ 41f
6
) (Regra de Weddle)
9h
9
1400
f
(8)
()
n F ormula de Newton-Cotes aberta Erro
0
_
x
1
x
1
f(x)dx 2hf
0
h
3
3
f

()
1
_
x
2
x
1
f(x)dx
3h
2
(f
0
+f
1
)
3h
3
4
f

()
2
_
x
3
x
1
f(x)dx
4h
3
(2f
0
f
1
+ 2f
2
)
14h
5
45
f
(4)
()
3
_
x
4
x
1
f(x)dx
5h
24
(11f
0
+f
1
+f
2
+ 11f
3
)
95h
7
144
f
(4)
()
F ormulas do metodo de Romberg
T
(k)
0
= h[
1
2
f(a) +f(a +h) +. . . +f(b h) +
1
2
f(b)] k = 0, 1, 2, . . .
h =
b a
2
k
T
(k)
n
=
4
n
T
(k+1)
n1
T
(k)
n1
4
n
1
= T
(k+1)
n1
+
T
(k+1)
n1
T
(k)
n1
4
n
1
k = 0, 1, 2, . . . n = 1, 2, . . .
Metodos de resolu cao da equa cao f(x) = 0 :
1) Metodo de Newton
x
n+1
= x
n

f(x
n
)
f

(x
n
)
, n = 0, 1, 2, . . . , | x
n
|
M
2
2m
1
(x
n
x
n1
)
2
, | x
n
|
M
2
2m
1
( x
n1
)
2
onde designa a raz separada em [a, b], 0 < m
1
|f

(x)|
[a,b]
e M
2
|f

(x)|
[a,b]
.
2) Metodo da Secante
x
n+1
=
f(x
n
)x
n1
f(x
n1
)x
n
f(x
n
) f(x
n1
)
= x
n

f(x
n
)(x
n
x
n1
)
f(x
n
) f(x
n1
)
, n = 1, 2, . . .
| x
n+1
|
M
2
2m
1
| x
n
| | x
n1
| , onde M
2
e m
1
tem o signicado explicitado a prop osito do
metodo de Newton.
3
3) Metodo do ponto xo :
Teorema : Seja C([a, b]) e : [a, b] [a, b]. Supondo que

existe em ]a, b[ e

(x)

k < 1 x ]a, b[
a sucess ao denida por
_
x
0
[a, b]
x
n
= (x
n1
) n = 1, 2, . . .
converge para o unico ponto xo [a, b].
Corolario : Se satisfaz as condi c oes do teorema, ent ao
| x
n
|
k
n
1 k
|x
0
x
1
| e | x
n
|
k
1 k
|x
n
x
n1
| , para n 1.
Normas de Vectores e Normas de Matrizes
Dado X =
_
x
1
x
2
. . . x
n

T
vamos considerar as normas seguintes :
1) X

= max
i
|x
i
|
2) x
1
=
n

i=1
|x
i
|
As normas matriciais a) e b) denidas a seguir, s ao subordinadas ` as normas vectorias 1) e 2), respectivamente.
Sendo A uma matriz quadrada de ordem n de elemento generico a
ik
,
a) A

= max
i
n

k=1
|a
ik
|
b) A
1
= max
k
n

i=1
|a
ik
|
Metodo iterativo geral para resolu cao de sistemas de equa c oes lineares
Considere-se o seguinte sistema de equac oes lineares na forma matricial AX = B. Fa ca-se A = N P, com N
regular. O sistema e equivalente a X = GX +H, com G = N
1
P e H = N
1
B.
Se X

e a solu c ao do sistema AX = B e X
(j)
s ao obtidos a partir da rela c ao X
(j+1)
= GX
(j)
+ H, j = 0, 1, . . . ,
entao, se G < 1, ent ao a sucess ao de iteradas X
(j)
e convergente para X

. Tem-se ainda :
_
_
_X

X
(j)
_
_
_
G
j
1 G
_
_
_X
(1)
X
(0)
_
_
_
_
_
_X

X
(j)
_
_
_
G
1 G
_
_
_X
(j)
X
(j1)
_
_
_
_
_
_X

X
(j)
_
_
_ G
j
_
_
_X
(0)
_
_
_ +
G
j
1 G
H
Metodos particulares
1) Jacobi
Fazer no metodo geral, G = D
1
(L +U) e H = D
1
B.
2) Gauss-Seidel
Fazer no metodo geral, G = (D +L)
1
U e H = (D +L)
1
B,
sendo em ambos os casos L a matriz triangular inferior em sentido estrito e U a matriz triangular superior em
sentido estrito .
Nota:
_
_
a 0
b c
_
_
1
=
_

_
1
a
0
b
ac
1
c
_

_
(ac = 0) ;
_

_
a 0 0
b c 0
d e f
_

_
1
=
_

_
1
a
0 0
b
ac
1
c
0
becd
acf
e
cf
1
f
_

_
(acf = 0)
4
_

_
a 0 0 0
b c 0 0
d e f 0
g h i j
_

_
1
=
_

_
1
a
0 0 0
b
ac
1
c
0 0
becd
acf
e
cf
1
f
0
bfh+cdicfgbei
acfj
eifh
cfj
i
fj
1
j
_

_
(acfj = 0)
Resolu cao Numerica de Equa c oes Diferenciais
Metodo de Taylor de ordem n
_
w
0
=
w
i+1
= w
i
+hT
(n)
(t
i
, w
i
), i = 0, 1, ..., N 1
,
onde
T
(n)
(t
i
, w
i
) = f(t
i
, w
i
) +
h
2
f

(t
i
, w
i
) +... +
h
n1
n!
f
(n1)
(t
i
, w
i
).
Erro de truncatura local

i+1
= y
(n+1)
(
i
)
h
n
(n + 1)!
,
i
]t
i
, t
i+1
[, y C
4
([a, b])
Metodo de Runge-Kutta de ordem quatro
w
i+1
= w
i
+
1
6
(k
1
+ 2k
2
+ 2k
3
+k
4
),
com k
1
= hf(t
i
, w
i
), k
2
= hf
_
t
i
+
h
2
, w
i
+
k
1
2
_
, k
3
= hf
_
t
i
+
h
2
, w
i
+
k
2
2
_
e k
4
= hf (t
i+1
, w
i
+k
3
),
i = 0, 1, ..., N 1
5

You might also like