Calcolo Numerico Calogero Vetro 10/02/2010 Es.1. Data la funzione ...
Calcolo Numerico Calogero Vetro 10/02/2010 Es.1. Data la funzione ...
Calcolo Numerico Calogero Vetro 10/02/2010 Es.1. Data la funzione ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Calcolo</strong> <strong>Numerico</strong><br />
<strong>10</strong>/<strong>02</strong>/20<strong>10</strong><br />
<strong>Es.1.</strong> <strong>Data</strong> <strong>la</strong> <strong>funzione</strong><br />
( , , ) ( 0,1, 2)<br />
x x x = applicando:<br />
1 2 3<br />
<strong>Calogero</strong> <strong>Vetro</strong><br />
3 2<br />
f ( x) = 3x − 2x + 6x − 1,<br />
si chiede di interpo<strong>la</strong>r<strong>la</strong> sui nodi<br />
1. il metodo di Lagrange;<br />
2. il metodo di Newton;<br />
3. <strong>la</strong> tecnica dei minimi quadrati con modello lineare ( y = ax + b ).<br />
Es.2. Calco<strong>la</strong>re<br />
0<br />
(3<br />
2<br />
− 2 + 6)<br />
−1<br />
x x dx<br />
applicando:<br />
1. <strong>la</strong> formu<strong>la</strong> dei trapezi su due sottointervalli;<br />
2. <strong>la</strong> formu<strong>la</strong> di Simpson semplice;<br />
3. <strong>la</strong> formu<strong>la</strong> di Gauss-Legendre a tre punti;<br />
Calco<strong>la</strong>re inoltre gli errori commessi nei tre casi.<br />
Es.3. <strong>Data</strong> <strong>la</strong> famiglia di numeri macchina F(<strong>10</strong>,5,-3,2), individuare:<br />
1. il più piccolo numero rappresentabile;<br />
2. il più grande numero rappresentabile;<br />
3. <strong>la</strong> precisione di macchina;<br />
4. <strong>la</strong> distanza fra due numeri consecutivi del<strong>la</strong> famiglia aventi esponente del<strong>la</strong> base p=2.<br />
Es.4. Dati i numeri x1 = − 0,1 e x2<br />
= 0, 2,<br />
dire se l’operazione di somma è ben condizionta.<br />
Es.5. <strong>Data</strong> <strong>la</strong> <strong>funzione</strong><br />
1 5<br />
f ( x)<br />
= − , si chiede di:<br />
x 9<br />
1. individuare un intervallo [a,b], di ampiezza unitaria, che soddisfi le condizioni per<br />
l’applicazione del metodo di bisezione per <strong>la</strong> ricerca del<strong>la</strong> radice del<strong>la</strong> <strong>funzione</strong> f(x);<br />
2. stabilire, senza applicare il metodo, il numero di iterazioni necessarie all’approssimazione<br />
del<strong>la</strong> radice con un errore non superiore a 2 -<strong>10</strong> ;<br />
3. stimare l’errore commesso dopo 8 iterazioni del metodo usando quattro cifre decimali.
Soluzione.<br />
<strong>Es.1.</strong><br />
1. Applicando il metodo di Lagrange<br />
2. Applicando il metodo di Newton<br />
2 2<br />
x − 3x + 2<br />
2 x − x<br />
L1( x) = L2 ( x) = 2 x − x L3 ( x)<br />
=<br />
2 2<br />
P x L x L x L x x<br />
2<br />
2( ) = −1 ⋅ 1( ) + 6 ⋅ 2( ) + 27 ⋅ 3(<br />
) = 7 −1<br />
0 −1<br />
1 6 7<br />
2 27 21 7<br />
P x x x x x<br />
2<br />
2(<br />
) = − 1+ 7( − 0) + 7( − 0)( − 1) = 7 −1<br />
3. Applicando <strong>la</strong> tecnica dei minimi quadrati con modello lineare a partire dal sistema<br />
si ha<br />
Es.2.<br />
0a + b = −1 0 1 −1<br />
¢¥£<br />
a<br />
1a + b = 6 ovvero 1 1 = 6<br />
b<br />
2a + b = 27 2 1 27<br />
¢ £ ¢¤£<br />
¡<br />
§ ¨ § ¨<br />
¦<br />
§¨ § ¨ § ¨<br />
©<br />
¦ § ¨ § ¨ ¥<br />
¤<br />
<br />
<br />
a = 14<br />
<br />
5a + 3b = 60 <br />
<strong>10</strong> .<br />
3a + 3b = 32 b = −<br />
3<br />
<br />
<br />
1. <strong>la</strong> formu<strong>la</strong> dei trapezi su due sottointervalli:<br />
1<br />
h<br />
31 65<br />
= ( − 1) + 2 ( − 1 ) + ( 0) = 2 11+ 2 + 6 =<br />
2 2<br />
2 2 8<br />
IT f f <br />
f<br />
2. <strong>la</strong> formu<strong>la</strong> di Simpson semplice:<br />
<br />
;<br />
<br />
<br />
1<br />
h<br />
31<br />
= ( − 1) + 4 ( − 1 ) + ( 0) = 2 11+ 4 + 6 = 8<br />
3 2<br />
3 2<br />
IS f f <br />
f<br />
3. <strong>la</strong> formu<strong>la</strong> di Gauss-Legendre a tre punti:<br />
<br />
;<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
b − a 5 b + a b − a<br />
IG = f + −<br />
2 9 2 2<br />
3 8 b + a b − a 5 b + a b − a<br />
+ f + 0 + f +<br />
5 9 2 2 9 2 2<br />
3<br />
=<br />
5<br />
1 5 8 5<br />
f ( − 0,8873) + f ( − 0,5000) + f ( − 0,1127) = 8.<br />
2 9 9 9
Si ha inoltre:<br />
E = 0,1250 e E = E = 0.<br />
T S G<br />
Es.3. <strong>Data</strong> <strong>la</strong> famiglia di numeri macchina F(<strong>10</strong>,5,-3,2)<br />
1. il più piccolo numero rappresentabile è<br />
2. il più grande numero rappresentabile è<br />
3. <strong>la</strong> precisione di macchina è<br />
ε m<br />
1<br />
<strong>10</strong><br />
2<br />
−4<br />
= ⋅ ;<br />
m<br />
−3<br />
= 0,<strong>10</strong>000 ⋅ <strong>10</strong> ;<br />
2<br />
M = 0,99999 ⋅ <strong>10</strong> ;<br />
4. <strong>la</strong> distanza fra due numeri consecutivi del<strong>la</strong> famiglia aventi esponente del<strong>la</strong> base p=2 è<br />
d = 0,001 .<br />
Es.4. L’operazione di somma è mal condizionata essendo<br />
Es.5.<br />
4<br />
9<br />
1. Risulta f ( 1) = > 0 e ( )<br />
c<br />
x 0,2<br />
=2>1.<br />
+ − 0,1+ 0, 2<br />
2<br />
2 = =<br />
x1 x2<br />
1<br />
f 2 = − < 0 . Essendo inoltre <strong>la</strong> f(x) continua nell’intervallo<br />
18<br />
[ 1,2 ] , tale intervallo soddisfa le condizioni per l’applicazione del metodo di bisezione;<br />
a + b 1+ 2<br />
2. Ponendo x1<br />
= = , dal<strong>la</strong> formu<strong>la</strong> di stima dell’errore dopo n bisezioni, si ricava:<br />
2 2<br />
2 −1 1<br />
≤ cioè n = <strong>10</strong>;<br />
n <strong>10</strong><br />
2 2<br />
3. Dopo 8 iterazioni si stima un errore pari a<br />
E<br />
b − a 2 −1<br />
2 2<br />
−8<br />
8 = = = 2 = 0,0039 .<br />
8 8