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.

11.2. Differenziazione numerica<br />

Se, invece, applichiamo la formula <strong>di</strong> Taylor a x = x 0 + h abbiamo la forward <strong>di</strong>fference formula, formula<br />

delle <strong>di</strong>fferenze in avanti:<br />

da cui<br />

f (x 0 + h) = f (x 0 ) + h f ′ (x 0 ) + h2<br />

2 f ′′ (ξ)<br />

f ′ (x 0 ) = f (x 0 + h) − f (x 0 )<br />

− h h<br />

2 f ′′ (ξ)<br />

La forward formula è f ′ (x 0 ) = f (x 0 + h) − f (x 0 )<br />

h<br />

L’errore è sempre del primo or<strong>di</strong>ne.<br />

Una formula <strong>di</strong> grado più elevato si ottiene considerando tre punti x 0 −h, x 0 , x 0 +h. Pren<strong>di</strong>amo le formule<br />

<strong>di</strong> Taylor <strong>di</strong> centro x 0 − h e x 0 + h scritte fino alla derivata terza <strong>di</strong> f ,<br />

f (x 0 + h) = f (x 0 ) + h f ′ (x 0 ) + h2<br />

2 f ′′ (x 0 ) + h3<br />

6 f ′′′ (ξ 1 )<br />

f (x 0 − h) = f (x 0 ) − h f ′ (x 0 ) + h2<br />

2 f ′′ (x 0 ) − h3<br />

6 f ′′′ (ξ 2 )<br />

Sottraendo membro a membro abbiamo<br />

f (x 0 + h) − f (x 0 − h) = 2h f ′ (x 0 ) + h3<br />

6 (f ′′′ (ξ 1 ) + f ′′′ (ξ 2 ))<br />

Ora le due derivate terze nei due punti ξ 1 e ξ 2 (che non conosciamo) sono comprese tra un valore minimo e<br />

un valore massimo, da cui anche il loro valore me<strong>di</strong>o f ′′′ (ξ 1 ) + f ′′′ (ξ 2 )<br />

è compreso tra il minimo e il massimo<br />

2<br />

della funzione f ′′′ stessa (si veda il Teorema del Valore Interme<strong>di</strong>o), cioè esiste ξ (compreso tra ξ 1 e ξ 2 e,<br />

quin<strong>di</strong>, tra x 0 − h e x 0 + h) per cui f ′′′ (ξ) = f ′′′ (ξ 1 ) + f ′′′ (ξ 2 )<br />

. Sostituendo abbiamo<br />

2<br />

f (x 0 + h) − f (x 0 − h) = 2h f ′ (x 0 ) + h3<br />

6 2f ′′′ (ξ )<br />

Risolviamo ora per f ′ (x 0 ), ottenendo<br />

f ′ (x 0 ) = f (x 0 + h) − f (x 0 − h)<br />

− h2<br />

2h<br />

6 f ′′′ (ξ)<br />

Se trascuriamo il termine che <strong>di</strong>pende da h 2 otteniamo un’approssimazione <strong>di</strong> f ′ (x 0 ).<br />

La formula centrata è data da f ′ (x 0 ) = f (x 0 + h) − f (x 0 − h)<br />

2h<br />

Il termine che trascuriamo per ottenere le formule <strong>di</strong> <strong>di</strong>fferenziazione numerica, cioè l’errore <strong>di</strong><br />

<strong>di</strong>scretizzazione, prende il nome <strong>di</strong> errore <strong>di</strong> troncamento.<br />

La formula centrata valuta il valore della f in soli due punti, come è stato fatto per le formule backward e<br />

forward ma ha un or<strong>di</strong>ne <strong>di</strong> accuratezza più elevato.<br />

Formule più accurate si possono ottenere usando più punti nell’intorno <strong>di</strong> x 0 e considerando espansioni<br />

<strong>di</strong> Taylor che coinvolgono derivate <strong>di</strong> or<strong>di</strong>ne più elevato. Ad esempio, prendendo i punti x 0 −2h, x 0 −h, x 0 +h<br />

e x 0 + 2h si può ricavare<br />

f ′ (x 0 ) = 1 (<br />

f (x0 − 2h) − 8f (x 0 − h) + 8f (x 0 + h) − f (x 0 + 2h) ) + h4<br />

12h<br />

30 f (v) (ξ)<br />

167

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

Saved successfully!

Ooh no, something went wrong!