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.

10. INTEGRAZIONE NUMERICA<br />

<strong>Esercizi</strong>o 10.8.3 Dato l’integrale<br />

∫ 0.5<br />

1<br />

I = d x<br />

1 − x<br />

2<br />

0<br />

(a) si approssimi I con i valori Q 1 e Q 2 ottenuti applicando il metodo <strong>di</strong> Cavalieri-Simpson prima a tutto<br />

l’intervallo e poi sud<strong>di</strong>videndo l’intervallo in due parti uguali;<br />

(b) si approssimi I usando la formula <strong>di</strong> estrapolazione <strong>di</strong> Richardson;<br />

(c) dopo aver calcolato analiticamente il valore esatto <strong>di</strong> I , determinare l’errore esatto commesso con<br />

l’estrapolazione <strong>di</strong> Richardson.<br />

Svolgimento<br />

(a) Applichiamo la formula <strong>di</strong> Cavalieri-Simpson su tutto l’intervallo, considerando che l’ampiezza<br />

dell’intervallo è b − a = 0.5<br />

Q 1 = 0.5 (f (0) + 4f (0.25) + f (0.5)) = 0.523823565<br />

6<br />

Si ha, infatti, f (0) = 1, f (0.25) = 1.03279556 e f (0.5) = 1.15470054.<br />

Sud<strong>di</strong>videndo l’intervallo in due parti uguali, abbiamo h = 0.25, da cui i punti: x 0 = a = 0, x 1 = 0.125,<br />

x 2 = 0.25, x 3 = 0.375, e x 4 = b = 0.5.<br />

Q 2 = h 6 (f (x 0) + 4(f (x 1 ) + 4f (x 3 )) + 2f (x 2 ) + f (x 4 )) = 0.523616326<br />

dove f (0.125) = 1.00790526, f (0.375) = 1.07871978 (essendo già in possesso <strong>degli</strong> altri valori, calcolati<br />

per Q 1 )<br />

(b) La formula <strong>di</strong> estrapolazione <strong>di</strong> Richardson è: I R = Q 2 + Q 2 −Q 1<br />

da cui ricaviamo I R = 0.5236025101<br />

15<br />

(c) Analiticamente l’integrale esatto è:<br />

I =<br />

∫ 0.5<br />

0<br />

1<br />

<br />

1 − x<br />

2 d x = arcsin(x)|0.5 0 = π/6 − 0 = 0.523598775<br />

L’errore esatto commesso con l’estrapolazione <strong>di</strong> Richardson, in valore assoluto, è: |I −I R | = 3.7351·<br />

10 −6 .<br />

<strong>Esercizi</strong>o 10.8.4 Si calcoli I = ∫ 5<br />

2 sin( x) d x utilizzando il metodo <strong>di</strong> Gauss-Legendre con 3 punti <strong>di</strong><br />

appoggio (x 1 = − (3/5), x 2 = 0, x 3 = (3/5); w 1 = w 3 = 5/9, w 1 = 8/9).<br />

Svolgimento<br />

Applichiamo la formula, ricordandoci che dobbiamo utilizzarla non in [2,5] ma in [−1,1]. Considerando<br />

che la trasformazione dall’intervallo [2,5] all’intervallo [−1,1] porta al cambiamento <strong>di</strong> variabili x = b − a<br />

2 t +<br />

b + a<br />

= 5 − 2<br />

2 2 t + 5 + 2 = 3 2 2 t + 7 2 si ha d x = 3 d t. La formula <strong>di</strong> Gauss-Legendre deve essere applicata sui no<strong>di</strong><br />

2<br />

trasformati dati da 3 2 x i + 7 . Perciò abbiamo<br />

2<br />

I G = 3 (w 1 f ( 3 2 2 x 1 + 7 2 ) + w 2 f ( 3 2 x 2 + 7 2 ) + w 3 f ( 3 2 x 3 + 7 )<br />

2 )<br />

= 1.5 ( (5/9)f (−1.161895004 + 3.5) + (8/9)f (3.5) + (5/9)f (1.161895004 + 3.5) )<br />

= 1.5(0.5550723689 + 0.8491794877 + 0.4621443545) = 2.799594317<br />

164

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

Saved successfully!

Ooh no, something went wrong!