18.01.2015 Views

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5. INTERPOLAZIONE<br />

Dalla relazione s ′′<br />

i (x i+1) = s ′′<br />

i+1 (x i+1), i = 1,2,...,m − 2 ricaviamo<br />

2c i + 6d i h i = 2c i+1 , i = 1,2,...,m − 2<br />

che si semplifica in<br />

c i + 3d i h i = c i+1 , i = 1,2,...,m − 2<br />

Da quest’ultima relazione otteniamo<br />

d i = c i+1 − c i<br />

3h i<br />

, i = 1,2,...,m − 2 (5.3)<br />

Adesso i coefficienti d i sono in funzione dei coefficienti c i . Sostituiamo il valore <strong>di</strong> d i appena ricavato<br />

nell’equazione (5.1) e ricaviamo b i in funzione dei coefficienti c i . abbiamo<br />

y i + b i h i + c i h 2 i + d i h 3 i = y i+1<br />

b i h i + c i h 2 i + ( c i+1 − c i<br />

)h 3 i<br />

3h = y i+1 − y i<br />

i<br />

<strong>di</strong>vi<strong>di</strong>amo tutto per h i e per compattare i termini utlizziamo le <strong>di</strong>fferenze <strong>di</strong>vise dove servono<br />

b i + c i h i + ( c i+1 − c i<br />

3<br />

)h i = f [x i , x i+1 ]<br />

Otteniamo, per b i , la relazione<br />

b i = f [x i , x i+1 ] − (2c i + c i+1 )h i<br />

3<br />

Sostituiamo ora i valori per b i e per d i nell’equazione (5.2):<br />

f [x i , x i+1 ] − (2c i + c i+1 )h i<br />

3<br />

, i = 1,...,m − 1 (5.4)<br />

b i + 2c i h i + 3d i h 2 i = b i+1, i = 1,2,...,m − 2<br />

+ 2c i h i + 3 c i+1 − c i<br />

h 2 i<br />

3h = f [x i+1, x i+2 ] − (2c i+1 + c i+2 )h i+1<br />

i 3<br />

raccogliendo i termini in h i a sinistra<br />

f [x i , x i+1 ] + (c i + 2c i+1 )h i<br />

= f [x i+1 , x i+2 ] − (2c i+1 + c i+2 )h i+1<br />

3<br />

3<br />

moltiplichiamo ambo i membri per 3 e portiamo le <strong>di</strong>fferenze <strong>di</strong>vise a destra<br />

c i h i + 2c i+1 (h i + h i+1 ) + c i+2 h i+1 = 3(f [x i+1 , x i+2 ] − f [x i , x i+1 ]), i = 1,...,m − 2 (5.5)<br />

Abbiamo adesso un sistema <strong>di</strong> m − 2 equazioni, ma le incognite c i che abbiamo introdotto sono m:<br />

c 1 ,c 2 ,...,c m . Aggiungiamo, allora, le con<strong>di</strong>zioni per le spline naturali: deve essere s<br />

1 ′′(x<br />

1) = s<br />

m−1 ′′ (x m) = 0.<br />

Si ha<br />

s ′′<br />

1 (x 1) = 2c 1 = 0<br />

s ′′ m−1 (x m) = 2c m−1 + 6d m−1 h m−1 = 0<br />

da cui c 1 = 0 e, d m−1 = − c m−1<br />

3h m−1<br />

. Di conseguenza, ponendo c m = 0 possiamo estendere all’in<strong>di</strong>ce i = m − 1 la<br />

relazione (5.3) per i coefficienti d i : d m−1 = c m − c m−1<br />

3h m−1<br />

.<br />

78

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!