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.

3. RAPPRESENTAZIONE DEI NUMERI NEL CALCOLATORE<br />

in<strong>di</strong>ce <strong>di</strong><br />

con<strong>di</strong>zionamento<br />

piccole variazioni sui dati <strong>di</strong> ingresso del problema ci possono essere piccole o gran<strong>di</strong> variazioni sui dati <strong>di</strong><br />

uscita – si chiama in<strong>di</strong>ce <strong>di</strong> con<strong>di</strong>zionamento (o numero <strong>di</strong> con<strong>di</strong>zionamento) del problema.<br />

Diamo la definizione nel caso in cui il nostro problema si possa identificare come una funzione f : R −→<br />

R. Il valore y = f (x) è il valore <strong>di</strong> uscita del problema f . Vogliamo vedere cosa succede se il dato <strong>di</strong> ingresso<br />

non è più x ma x + ∆x. ∆x rappresenta quin<strong>di</strong> una perturbazione sul dato iniziale. Assumiamo x ≠ 0, y ≠ 0.<br />

Applichiamo la formula <strong>di</strong> Taylor <strong>di</strong> centro x. Si ha:<br />

f (x + ∆x) = f (x) + f ′ (x)∆x +O(∆x 2 ) ≈ f (x) + f ′ (x)∆x<br />

La variazione sul dato d’uscita è data dalla <strong>di</strong>fferenza f (x + ∆x) − f (x). Chiamiamo questa <strong>di</strong>fferenza con<br />

∆y. Quin<strong>di</strong> ∆y = f (x + ∆x) − f (x) ≈ f ′ (x)∆x (utilizziamo il risultato ottenuto dalla formula <strong>di</strong> Taylor).<br />

Se utilizziamo gli errori relativi, abbiamo (e sapendo che y = f (x)):<br />

∆y<br />

y<br />

∆y<br />

y<br />

≈ f ′ (x)∆x<br />

f (x)<br />

Moltiplico poi numeratore e denominatore a secondo membro per x<br />

≈ x f ′ (x) ∆x<br />

f (x) x<br />

Al limite per ∆x → 0, questa uguaglianza approssimata (abbiamo usato il simbolo ≈) <strong>di</strong>venta una vera<br />

uguaglianza. Questo suggerisce <strong>di</strong> definire l’in<strong>di</strong>ce <strong>di</strong> con<strong>di</strong>zionamento <strong>di</strong> f me<strong>di</strong>ante la formula<br />

(cond f )(x) =<br />

x f ′ (x)<br />

∣<br />

f (x)<br />

∣<br />

Questo numero ci <strong>di</strong>ce quanto gran<strong>di</strong> sono le perturbazioni relative per y confrontate con le relative<br />

perturbazioni <strong>di</strong> x.<br />

Per x = 0 e y ≠ 0, non ha senso considerare l’errore relativo ∆x , e si considera l’errore assoluto su x. In tal<br />

x<br />

caso, si definisce in<strong>di</strong>ce <strong>di</strong> con<strong>di</strong>zionamento la quantità<br />

(cond f )(x) =<br />

f ′ (x)<br />

∣<br />

f (x)<br />

∣<br />

Per x = y = 0 si considera invece l’errore assoluto sia per x che per y, <strong>di</strong>modochè l’in<strong>di</strong>ce <strong>di</strong><br />

con<strong>di</strong>zionamento <strong>di</strong>venta<br />

(cond f )(x) = |f ′ (x)|<br />

Esempio<br />

Esempio 3.7.3 Sia f (x) = x 1/α , con x > 0 e α > 0. Calcoliamo l’in<strong>di</strong>ce <strong>di</strong> con<strong>di</strong>zionamento applicando<br />

la formula (poichè abbiamo supposto x > 0, si ha f (x) ≠ 0). Risulta<br />

∣ (cond f )(x) =<br />

x f ′ ∣∣∣∣∣∣<br />

(x)<br />

x 1 ∣ ∣∣∣∣∣∣ ∣<br />

f (x)<br />

∣ = α x1/α−1<br />

= 1 α<br />

x 1/α<br />

Per α grande, (cond f )(x) tende a zero, quin<strong>di</strong> abbiamo un problema bencon<strong>di</strong>zionato. Se, invece α è<br />

molto piccolo si ha un problema malcon<strong>di</strong>zionato (se α = 10 −10 , si ha f (x) = x 1010 e (cond f )(x) = 10 10 ,<br />

un valore molto grande).<br />

36

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

Saved successfully!

Ooh no, something went wrong!