Professional Documents
Culture Documents
IMPORTANTE: Lean esta deduccin, porque podra ir para el examen. Adems, por supuesto,
debern leer la teora general sobre los splines (aunque nos enfoquemos en los splines cbicos, podra
hacer preguntas sobre los splines en general).
Ante todo, recordemos que queremos construir un spline cbico de interpolacin que pase por
los nodos descritos a continuacin:
x
x0
x1
x2
xn
y0
y1
y2
yn
S0 ( x ) , x
S1 ( x ) , x
S (x )=
(
)
Sn 1 x , x [ x n1 , x n ]
Adems, recordemos las condiciones que deben cumplirse:
i.
Si( x )
Condiciones de interpolacin:
S ( xi ) = y i
S ( xi +1 )= y i +1
iv.
S i ( x)
en cada intervalo
[x i , x i +1]
en cada intervalo
'
'
: S i1 ( x i1 )=S i( x i )
[x i , x i +1]
''
''
: S i1 ( x i1 )=S i ( xi )
4 n2
condiciones que
determinar; por lo tanto, necesitamos agregar 2 condiciones ms para asegurar la unicidad de la funcin
obtenida (ms adelante veremos cules son esas condiciones faltantes).
Sea
S
Ki
''
es lineal, y satisface que S i ( x i )=K i
S 'i ' ( x )=
( xi +1x ) K i+ ( xx i ) K i +1
x i+1x i
Llamemos
hi=x i +1x i
''
y S i+1 ( x i+1 )=K i+1 . Entonces, podemos escribir:
(I )
( xi +1x)3 K i +(xx i )3 K i +1
S i ( x )=
+C ( x i+1 x ) + D ( xx i ) ( II )
6 hi
Donde C y D son constantes de integracin. Vamos a averiguar cunto valen:
a) Por las condiciones de interpolacin:
h3i K i
y hK
S i ( xi ) =
+C hi = y i C= i i i ( III )
6 hi
hi
6
h3i K i+1
y
hK
S i ( xi +1 )=
+ D hi = y i+1 D= i+1 i i+1 (IV )
6 hi
hi
6
Sustituyendo (III) y (IV) en (II), concluimos que:
S i ( x )=
3
3
( x i+1 x ) K i + ( xx i ) K i+1 y i ( x i+1x ) + y i+1 ( xx i ) hi
6 hi
hi
[ K i ( x i+1x ) + K i +1 ( xx i ) ] (V )
x i x xi +1 , i=1, 2 ,n1
Aunque a primera vista (V) parece complicada, nos ayuda a hallar los coeficientes que
[x 1 , x n ]
buscamos sin trabajar ms, ya que los valores de C y D hacen que S (x) sea continua en
.
[x 1 , x n ]
b) Veamos ahora si S '( x) es continua en
; es decir:
'
S i ( x )= lim
'
en[ xi , xi +1 ]
x xi Si (x)
+
i
x x
lim
en[ x i , x i+1 ]
6 hi
hi
6
'
i
+
xi
S 'i
xi
S 'i
d i=
y i+1 y i
hi
'
+
xi
. Llamando
xi
S 'i
+
xi
xi
S 'i
hi ( K i+1K i ) hi1 K i
hi K i
h (K K i1 )
+ d i
=
+d i1 i1 i
2
6
2
6
hi1
h +h
h
K i1+ i1 i K i+ i K i+1=d i d i1 para 2 i n1
6
3
6
Ki
=
i
Si decimos que
6 , podemos escribir el resultado en la forma dada a continuacin:
i1 K i1 +2 i ( hi 1 +hi ) + i +1 h i=d idi1 para 2 i n1(VI )
Si seguimos con detenimiento esta deduccin, vemos que tenemos un problema: cules son los
valores de 1 y n ? Pues estas son las condiciones faltantes de las que hablamos anteriormente!
Distinguiremos 2 casos:
i)
1= n=0
0
0
0
0
0
0
hn3
0
n2 h n3+ h
0
0
0
2(h1 +h2 )
h2
0
0
0
0
0
h2
2(h2 +h3 )
h3
0
h3
0
0
hn2
2(h3 +h 4 )
h4
h4
2(h 4 +h5 )
0
[ ][ ]
2
d 2d 1
3
d 3d 2
0 2 4 = d 4d3
n2
d n2d n3
n1
d n1d n2
ii)
][ ] [ ]
2h1
h1
0
0
0
0
0
d 1 y '1
1
h 1 2(h1 +h2 )
h2
0
0
0
0
d 2d 1
2
0
h2
2(h 2+ h3)
h3
0
0
0
3 = d 3d2
0
0
h3
2(h3 +h 4)
hn2
0
d
d
0
0
0
2(h n2 +h n1) h n1 n1
n1
n2
'
0
0
0
0
0
hn1
2 hn 1
y ndn 1
n
Ejemplo de spline cbico natural: Interpole los siguientes datos mediante un spline cbico natural:
x
y
-3
7
-1
11
0
26
3
56
1= 5=0
4
29
. Recordemos las
ecuaciones a usar:
S i ( x )=
3
3
( x i+1 x ) K i + ( xx i ) K i+1 y i ( x i+1x ) + y i+1 ( xx i ) hi
6 hi
hi=x i +1x i , d i=
hi
[ K i ( x i+1x ) + K i +1 ( xx i ) ]
y i+1 yi
K
, i = i
hi
6
K 1=K 5 =0
construir es la siguiente:
S1 ( x ) ,3 x 1
S ( x ) = S2 ( x ) ,1 x 0
S 3 ( x ) , 0 x 3
S 4 ( x ) ,3 x 4
h4 =x 5x 4 =43=1
d 1=
y 2 y 1 117
=
=2
h1
2
d 2=
y 3 y 2 2611
=
=15
h2
1
d 3=
y 4 y 3 5626
=
=10
h3
3
d4 =
y 5 y 4 2956
=
=27
h4
1
Debido a que tenemos un spline cbico natural el sistema que debemos formar es el siguiente:
][ ] [ ]
2( h1 +h2 )
h2
0
2
d 2d 1
h2
2(h2 +h 3)
h3
3 = d 3d 2
0
h3
2( h3 +h4 ) 4
d 4d 3
[ ][ ] [ ]
6 1 0 2
13
1 8 3 3 = 5
0 3 8 4 37
Ki
2=2 , 3 =1 , 4 =5
:
K 2=6 2=12
K 3=6 3=6
K 4 =6 4=30
Y recordando que
(V):
K 1=K 5 =0
S 1 ( x )=
S 1 ( x )=
S 1 ( x )=
S 1 ( x )=
S 1 ( x ) x +9 x +25 x+28
De manera anloga, usando la misma ecuacin (V), hallamos las dems S i (x) , obteniendo la
definicin definitiva de S (x) :
x 3 +9 x 2+25 x +28 ,3 x 1
3
2
x+26 ,1 x 0
S ( x ) = x +3 3 x +19
2
2 x +3 x + 19 x +26 , 0 x 3
5 x 360 x 2+ 208 x163 , 3 x 4
Ejemplo de spline cbico sujeto: Interpolar los nodos (0, 0) , (1 ; 0,5) , (2, 2) y (3 ; 1,5)
'
'
mediante un spline cbico sujeto a las siguientes condiciones: S ( 0 )=0,2 y S ( 3 )=1 .
Igual que en el caso anterior, comenzamos a calcular los datos que nos hacen falta para formar
nuestro sistema y resolverlo, tomando en cuenta que
y '1=0,2 y
h1=x 2x 1=10=1
y 'n=1 :
h2=x 3x 2=21=1
h3=x 4 x 3=32=1
d 1=
y 2 y 1 0,50
=
=0,5
h1
1
d 2=
y 3 y 2 20,5
=
=1,5
h2
1
d 3=
y 4 y 3 1,52
=
=0,5
h3
1
2h1
h1
0
0
h 1 2(h1 +h2 )
h2
0
0
h2
2(h 2+ h3) h3
0
0
h3
2h 3
][ ] [ ]
1
d 1 y '1
2 = d2 d 1
3
d 3 d 2
4
y 'nd 3
[ ][ ] [ ]
2
1
0
0
1
4
1
0
0
1
4
1
0
0
1
2
1
0,3
2
= 1
2
3
0,5
4
4=0,63
1=0,24
Ki
,
:
2=0,49
K 4 =6 4=6 0,63=3,78
Finalmente, podemos calcular los S i ( x ) :
( x 2x )3 K 1 +(xx 1)3 K 2 y 1 ( x 2x ) + y 2 (xx 1 ) h1
S 1 ( x )=
+
[ K 1 ( x 2x ) + K 2 ( xx 1 )]
6 h1
h1
6
S 1 ( x )=
S 1 ( x )=
(1,44 ) ( 13 x +3 x2 x3 ) +2,94 x3
+0,5 x0,24 x +0,240,49 x
6
S 1 ( x )=