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. DIFFERENZIAZIONE NUMERICA ED EQUAZIONI ALLE DERIVATE ORDINARIE<br />

Stu<strong>di</strong>eremo la convergenza e la stabilità dei meto<strong>di</strong> <strong>di</strong> Eulero esplicito, implicito e Crank-Nicolson<br />

applicati all’equazione test y ′ = −λy (λ > 0 in modo che −λ < 0) con con<strong>di</strong>zione iniziale y(0) = y 0 .<br />

La soluzione esatta <strong>di</strong> questo IVP è y(t) = y 0 e −λt : tende a zero per valori <strong>di</strong> t crescenti. Ci aspettiamo che<br />

anche la soluzione numerica si comporti in maniera simile.<br />

11.9.1 Convergenza <strong>di</strong> Eulero esplicito<br />

Per semplicità, applichiamo la formula del metodo <strong>di</strong> Eulero esplicito all’equazione test con λ = 1.<br />

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

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

.<br />

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

Andando a ritroso troviamo una formula che lega y i <strong>di</strong>rettamente a y 0 .<br />

y 1 = (1 − h)y 0<br />

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

.<br />

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

La soluzione numerica al tempo t i è data da y i = (1 − h) i y 0 . Fissato un tempo t = i h, ve<strong>di</strong>amo se<br />

cioè se<br />

lim<br />

h→0<br />

i→+∞<br />

y i = y(t).<br />

i h<br />

⎡<br />

1<br />

⎤<br />

Osserviamo che: (1 − h) i = (1 − h) h = ⎣(1 − h) h ⎦<br />

t<br />

lim<br />

h→0<br />

i→+∞<br />

Ricor<strong>di</strong>amo la proprietà per la quale x α = e ln(xα) = e αln(x) . Perciò: (1 − h) h = e ln(1−h)(1/h) = e h<br />

Quando facciamo il limite per h → 0 e per i → +∞ consideriamo che, per il teorema dell’ Hôpital, vale<br />

Di conseguenza lim h→0 e<br />

Allora<br />

lim<br />

h→0<br />

i→+∞<br />

ln(1 − h)<br />

h<br />

y i = lim<br />

h→0<br />

i→+∞<br />

ln(1 − h) −1<br />

lim = lim<br />

h→0 h h→0 1 − h = −1<br />

= e −1<br />

⎡<br />

y 0 (1 − h) i = lim y 0 h→0<br />

i→+∞<br />

1<br />

⎤t<br />

⎣(1 − h) h ⎦ = y 0 e −t = y(t)<br />

1<br />

ln(1 − h)<br />

ɛ i = 0<br />

In questo modo abbiamo provato che il metodo converge. Il <strong>di</strong>scorso si ripete in maniera del tutto simile,<br />

per λ ≠ 1.<br />

11.9.2 Stabilità <strong>di</strong> Eulero esplicito<br />

Per quanto riguarda la stabilità, dobbiamo provare che l’errore si mantiene limitato. Sia λ > 0. Abbiamo<br />

y i+1 = y i − hλy i = (1 − hλ)y i , vale a <strong>di</strong>re y i+1 = y 0 (1 − hλ) i+1 . La soluzione esatta <strong>di</strong> questo problema è<br />

178

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

Saved successfully!

Ooh no, something went wrong!