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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11.8. Errori <strong>di</strong> troncamento locale<br />

Gli errori <strong>di</strong> arrotondamento nell’approssimare la derivata prima <strong>di</strong> una funzione si comportano come<br />

O ( 1 ) (si veda l’esempio fatto sulla propagazione <strong>degli</strong> errori a pag. 30). Tuttavia questo aspetto <strong>di</strong>venta secondario<br />

nella risoluzione delle ODE sia perchè il passo h nelle applicazioni non è mai troppo (esagerata-<br />

h<br />

mente) piccolo per ragioni <strong>di</strong> efficienza sia perchè è la y e non la y ′ la funzione che dobbiamo approssimare.<br />

Inoltre, nell’eseguire i calcoli in doppia precisione (come si fa nei moderni linguaggi <strong>di</strong> programmazione),<br />

l’aspetto dovuto all’arrotondamento si vede poco rispetto ad altri fenomeni che influenzano la propagazione<br />

<strong>degli</strong> errori.<br />

11.8 Errori <strong>di</strong> troncamento locale<br />

G Nel metodo <strong>di</strong> Eulero esplicito:<br />

G Nel metodo <strong>di</strong> Eulero implicito:<br />

d i = y(t i+1) − y(t i )<br />

− f (t i , y(t i )) = h h<br />

2 y′′ (ξ i ) = O (h)<br />

d i = y(t i+1) − y(t i )<br />

− f (t i , y(t i+1 )) = − h h<br />

2 y′′ (ξ i ) = O (h)<br />

G Nel metodo <strong>di</strong> Crank-Nicolson (derivando la formula dai trapezi e includendo il termine dell’errore):<br />

y(t i+1 ) − y(t i ) = h 2 [f (t i , y(t i )) + f (t i+1 , y(t i+1 ))] − f ′′ (ξ i ,τ i )<br />

h 3<br />

12<br />

dove ξ i e τ i sono opportuni punti. Ma f = y ′ da cui f ′ = y ′′ e f ′′ = y ′′′ .<br />

Perciò<br />

y(t i+1 ) − y(t i ) = h 2 [f (t i , y(t i )) + f (t i+1 , y(t i+1 ))] − y′′′ (ξ i )<br />

h 3<br />

12<br />

d i = y(t i+1) − y(t i )<br />

h<br />

11.9 Convergenza e stabilità<br />

Definizione 11.9.1 Un metodo si <strong>di</strong>ce convergente se lim h→0<br />

− 1 2 [f (t i , y(t i )) + f (t i+1 , y(t i+1 ))] = − y′′′ (ξ i )<br />

h 2 = O (h 2 )<br />

12<br />

i→+∞<br />

ɛ i = 0 cioè se l’errore va a zero al tendere del<br />

passo h a zero e <strong>di</strong> i all’infinito in modo che il prodotto i h si mantenga costante (così t 0 +i h tende ad un valore<br />

<strong>di</strong> t fissato: stu<strong>di</strong>amo l’errore fissato t).<br />

Esempio<br />

Esempio 11.9.1 Ve<strong>di</strong>amo come, fissato un certo istante t, possiamo fare tendere h a zero e far crescere i<br />

all’infinito in modo che t 0 + i h sia sempre uguale a t. Sia t 0 = 0 e t = 0.5:<br />

h i i h<br />

0.5 1 0.5<br />

0.25 2 0.5<br />

0.125 4 0.5<br />

0.0625 8 0.5<br />

.<br />

.<br />

.<br />

2.4414e-4 2048 0.5<br />

Definizione 11.9.2 Un metodo si <strong>di</strong>ce stabile se l’errore iniziale si mantiene limitato al crescere <strong>di</strong> i (per i → ∞):<br />

con M costante positiva.<br />

|ɛ i | ≤ M|ɛ 0 |<br />

177

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

Saved successfully!

Ooh no, something went wrong!