• Non ci sono risultati.

cn@0D =0.5*Ha+bL

N/A
N/A
Protected

Academic year: 2021

Condividi "cn@0D =0.5*Ha+bL"

Copied!
2
0
0

Testo completo

(1)

H** ESERCIZIO 2.1.10 **L

Clear@fD; f@x_D:=x ^ 2-3;

Plot@f@xD,8x, 0, 3<, PlotStyle®8RGBColor@0, 0, 1D, Thickness@0.005D<D

0.5 1.0 1.5 2.0 2.5 3.0

-2 2 4 6

a=1.0; b=2.0;

tol=10 ^H-4L; fa=f@aD; fb=f@bD;

an@0D =a; bn@0D =b;

cn@0D =0.5*Ha+bL; test=b-a;

testbis@0D =bn@0D -an@0D; nmax=10;

n=1; While@test>tol,8fa=f@an@n-1DD; fc=f@cn@n-1DD;

If@fa*fc<0,8an@nD =an@n-1D; bn@nD =cn@n-1D<,8an@nD =cn@n-1D; bn@nD =bn@n-1D<D; cn@nD =0.5*Han@nD +bn@nDL; test=Abs@bn@nD -an@nDD; n++<D;

Print@"Bisezione: n = ", n-1, " c = ", cn@n-1DD Clear@xD; test=1.0; n=0;

x@0D =0.4;

While@test>tol,8x@n+1D =x@nD -f@x@nDD f '@x@nDD; test=Abs@x@n+1D -x@nDD; n++<D Print@"Newton: n = ", n, " c = ", x@nDD

PrintB" 3 = ", Sqrt@3.DF

Bisezione: n = 14 c = 1.73203 Newton: n = 6 c = 1.73205

3 = 1.73205

H** ESERCIZIO 2.1.11 **L H** ESERCIZIO 2.1.12 **L

(2)

Clear@fD;

f@x_D:=x ^ 3+x-4;

a=1.; b=4.;

nmax1=Log@2,Hb-aL tolD

14.8727

H** ESERCIZIO 2.1.17 **L

Clear@f, V, r, h, LD;

f@h_D:=L*Hr ^ 2*H0.5*Pi-ArcSin@hrDL -h*Hr ^ 2-h ^ 2LL; dati=8L®10., r®1., V®12.4<

Plot@Hf@hD -VL . dati,8h, 0, r. dati<,

PlotStyle®8RGBColor@0, 0, 1D, Thickness@0.005D<D

8L®10., r®1., V®12.4<

0.2 0.4 0.6 0.8 1.0

-10 -5

a=0.0; b=0.2;

tol=10 ^H-2L;

f1@h_D:=Hf@hD -VL . dati fa=f1@aD . dati

fb=f1@bD . dati

3.30796

-0.625616

an@0D =a; bn@0D =b;

cn@0D =0.5*Ha+bL; test=b-a;

testbis@0D =bn@0D -an@0D; nmax=10;

n=1; While@test>tol,8fa=f1@an@n-1DD; fc=f1@cn@n-1DD;

If@fa*fc<0,8an@nD =an@n-1D; bn@nD =cn@n-1D<,8an@nD =cn@n-1D; bn@nD =bn@n-1D<D; cn@nD =0.5*Han@nD +bn@nDL; test=Abs@bn@nD -an@nDD; n++<D;

Print@"Bisezione: n = ", n-1, " c = ", cn@n-1DD

Bisezione: n = 5 c = 0.165625 2 Esercitazione1.nb

Riferimenti

Documenti correlati

EM; dalla misura (effettuata a campionamento campionamento con un rivelatore con un rivelatore di sciami estesi) del numero di particella si può risalire. di sciami estesi)

[r]

For some branches of the general solution, the given boundary conditions lead to an

Provare la seguenti propriet` a utilizzando i soli assiomi algebrici dei numeri reali ed eventualmente le propriet` a che la precedono.. Risolvere gli esercizi 1-4 del libro

Per ogni esercizio si deve presentare lo svolgimento su un foglio a parte e riportare nel riquadro, su questo foglio, solo il risultato

[r]

Algebra e matematica

Universit` a degli Studi di Roma Tor Vergata.. Corso di Laurea