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.10. <strong>Esercizi</strong><br />

Figura 11.3: Confronto dei meto<strong>di</strong> <strong>di</strong> Eulero esplicito, implicito e Crank-Nicolson sull’equazione test y ′ = −y,<br />

prendendo come h il valore h = 2 (a sinistra) e h = 0.5 (a destra).<br />

Esempio<br />

Esempio 11.9.2 Consideriamo il metodo <strong>di</strong> Eulero esplicito e applichiamolo all’equazione test.<br />

Sappiamo che y i+1 = y i + hλy i .<br />

Per la soluzione esatta, sappiamo che vale y(t i+1 ) = y(t i )+hλy(t i )+hd i (con d i l’errore <strong>di</strong> troncamento<br />

locale).<br />

Sottraendo la prima equazione dalla seconda abbiamo<br />

ɛ i+1 = ɛ i + hλɛ i + hd i<br />

Considerato che d i = h 2 y′′ (ξ i ) e che, per stu<strong>di</strong>are la stabilità, h è fissato mentre i tende a +∞, il termine<br />

hd i non influisce sull’andamento dell’errore e possiamo trascurarlo. Si ha allora la relazione:<br />

ɛ i+1 = ɛ i + hλɛ i<br />

Ricaviamo ɛ i = ɛ 0 (1 + hλ) i .<br />

Il ragionamento da fare è lo stesso che abbiamo fatto in precedenza e troviamo gli stessi risultati.<br />

Dobbiamo infatti verificare quando ɛ i tende a zero per i che tende a +∞. . .<br />

11.10 <strong>Esercizi</strong><br />

<strong>Esercizi</strong>o 11.10.1 Stu<strong>di</strong>are la stabilità del metodo <strong>di</strong> Eulero esplicito applicato all’equazione <strong>di</strong>fferenziale<br />

y ′ = −2y + 1, con y(0) = 1 (soluzione esatta y(t) = e−2t + 1<br />

)<br />

2<br />

Svolgimento<br />

Per provare la stabilità del metodo dobbiamo verificare che l’errore iniziale si mantiene limitato per valori<br />

crescenti del tempo.<br />

Il metodo <strong>di</strong> Eulero esplicito applicato all’ODE del problema <strong>di</strong>venta<br />

y i+1 = y i + h(−2y i + 1) = (1 − 2h)y i + h<br />

181

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

Saved successfully!

Ooh no, something went wrong!