Numerical methods

18
NUMERICAL METHODS By Ahmed Haider Ahmed Pre-M.Sc. Physics – ASU

description

Bisection method, Newton method, Falsi method and Secant method with examples.

Transcript of Numerical methods

Page 1: Numerical methods

NUMERICAL METHODS

ByAhmed Haider Ahmed Pre-M.Sc. Physics – ASU

Page 2: Numerical methods

To My father , May Allah

enter you his paradise

Page 3: Numerical methods

1 – Bisection Method

If F(wi+1) is negative we put wi+1 instead of ai or bi

21ii

i

baw

Page 4: Numerical methods

2 – Falsie Method

)()(

)()(1

ii

iiiii bfaf

afbbfax

Page 5: Numerical methods

3 – Newton Method

)(

)(1

i

iii xf

xfxx

Page 6: Numerical methods

4 – Secant Method

)()(

))((

1

11

ii

iiiii xfxf

xxxfxx

Page 7: Numerical methods

Examples

Page 8: Numerical methods

Find the positive root of x – cos x = 0 using bisection method.

We will take points that give positive value with the negative one i.e 0 and 1

)( 1)2(

)( 00015.0)1(

)( 1)0(

cos)(

vef

vef

vef

xxxf

Page 9: Numerical methods

)(249.0)75.0(

75.02

15.0

150

)( 5.0)5.0(

)( 5.02

10

10

2

1

vef

x

and .en root betweHence the

vef

vex

and en root betweHence the

Page 10: Numerical methods

062.0)9375.0(

9375.02

1875.0

18750

)( 12488.0)875.0(

875.02

75.01

1750

4

3

f

x

and .en root betweHence the

vef

x

and .en root betweHence the

Page 11: Numerical methods

Solve equation x3 – x – 1 = 0 using falsie method.

5128)2(

1 111)1(

1)( 3

f

f

xxxf

2 , 1

)()(

)()(

00

00

00001

ba

bfaf

afbbfax

Page 12: Numerical methods

)(279351.0)2547.1(

2547.15684.05

5684.02517.1

217.1 from

)(5684.0)17.1(

17.16

25

51

1251

2

2

1

vef

x

tox

vef

x

Page 13: Numerical methods

)(0578.0)311.1(

311.1127.05

127.025294.1

2 294.1 from

)(127.0)294.1(

294.1279351.05

279351.0252547.1

2 2547.1 from

4

4

3

3

vef

x

tox

vef

x

tox

Page 14: Numerical methods

3238.10109.05

0109.0253223.1

2 3223.1 from

0109.00)3223.1(

3223.1024255.05

024255.025319.1

2 319.1 from

)(024255.0)319.1(

319.10578.05

0578.025311.1

2 311.1 from

7

7

6

6

5

5

x

tox

f

x

tox

vef

x

tox

Page 15: Numerical methods

Solve equation x3 – x – 1 = 0 using Newton method at x0 = 1

213)(

1111)(

13)(

1)(

)(

)(

0

0

2

3

1

xf

xf

xxf

xxxf

xf

xfxx

i

iii

Page 16: Numerical methods

4497.4)3478.1(

1006.0)3478.1(

3478.175.5

875.05.1

)(

)(

75.5)5.1(

875.0)5.1(

5.12

11

)(

)(

1

112

0

001

f

f

xf

xfxx

f

f

xf

xfxx

Page 17: Numerical methods

000077.0)3247.1(

3247.1269.4

00206.03252.1

)(

)(

269.4)3252.1(

00206.0)3252.1(

3252.14497.4

1006.03478.1

)(

)(

3

334

2

223

f

xf

xfxx

f

f

xf

xfxx

Page 18: Numerical methods

REFERANCES

Lecture notes on numerical methods , Dr. Shemi 2011, Minia university written by Aya Hassan.

Lecture notes on computational physics for Pre-M.Sc. Students , Prof. Dr. S.Hendawi 2013, Ain Shams University.