Sei sulla pagina 1di 26

Numerical Methods

All the Excel File was prepared by Dr. Harimi Djamila


Dr. Harimi Djamila is a Senior Lecturer at the Universiti Malaysia Sabah
harimidjamila@gmail.com

Roots
1 Bisection Version
2 False Position 1
3 Newton-Raphson
4 Secant Method

Harimi Djamila. 8-10 August 2017. Excel Spreadsheet in Teaching Numerical Methods. 1st Intern
and Statistics 2017
(ICoAIMS 2017)
ti Malaysia Sabah

Version Date
26-May-17

umerical Methods. 1st International Conference on Applied & Industrial Mathematics


Equation . x3 -3 x + 1 Quadratic Equations Calculator w
Variable Factors Root Final Calculation
x2 -10 1 -10 Root
x 200 -1 -200
210 1 210
Sum 0

Equation . x3 -3 x + 1
Root Factors Root Final Calculation
x2 1 441 441 Root
x -3 21 -63
1 1 1
Sum 379

Graph of the Function within the range [1, 2]

x f(x)
1 -1
1.1 -0.969
1.2 -0.872
1.3 -0.703
1.4 -0.456
1.5 -0.125
1.6 0.296
1.7 0.813
1.8 1.432
1.9 2.159
2 3
2.1 3.961
2.2 5.048
2.3 6.267
2.4 7.624 80
2.5 9.125 70
2.6 10.776 60
2.7 12.583
50
2.8 14.552
2.9 16.689 40
3 19 30
3.1 21.491 20
3.2 24.168 10
3.3 27.037 0
3.4 30.104
-10 0.5 1 1.5 2 2.5 3 3.5 4
3.5 33.375
3.6 36.856
3.7 40.553
3.8 44.472
3.9 48.619
4 53
4.1 57.621
4.2 62.488
4.3 67.607
quations Calculator was used via the Link

-1

21

3.5 4 4.5
http://www.mathgoodies.com/calculators/quadratic_equations.html
Roots using Bisection Method

i Xl Xu Xr f(xl) f(xu)
1 1.0000 2.0000 1.5000 -1.0000 3.0000

i Xl Xu Xr f(xl) f(xu)
1 1.0000 2.0000 1.5000 -1.0000 3.0000
2 1.5000 2.0000 1.7500 -0.1250 3.0000
3 1.5000 1.7500 1.6250 -0.1250 1.1094
4 1.5000 1.6250 1.5625 -0.1250 0.4160
5 1.5000 1.5625 1.5313 -0.1250 0.1272
6 1.5313 1.5625 1.5469 -0.0034 0.1272
7 1.5313 1.5469 1.5391 -0.0034 0.0608
8 1.5313 1.5391 1.5352 -0.0034 0.0284
9 1.5313 1.5352 1.5332 -0.0034 0.0124
10 1.5313 1.5332 1.5322 -0.0034 0.0045
11 1.5313 1.5322 1.5317 -0.0034 0.0006
12 1.5317 1.5322 1.5320 -0.0014 0.0006
13 1.5320 1.5322 1.5321 -0.0004 0.0006
14 1.5320 1.5321 1.5320 -0.0004 0.0001
15 1.5320 1.5321 1.5321 -0.0002 0.0001
16 1.5321 1.5321 1.5321 -0.0001 0.0001

i Xl Xu Xr f(xl) f(xu)
1 -2.0000 22.0000 10.0000 -230.0000 -230.0000
2 -2.0000 10.0000 4.0000 -230.0000 1210.0000
3 -2.0000 4.0000 1.0000 -230.0000 850.0000
4 -2.0000 1.0000 -0.5000 -230.0000 400.0000
5 -2.0000 -0.5000 -1.2500 -230.0000 107.5000
6 -1.2500 -0.5000 -0.8750 -55.6250 107.5000
7 -1.2500 -0.8750 -1.0625 -55.6250 27.3438
8 -1.0625 -0.8750 -0.9688 -13.7891 27.3438
9 -1.0625 -0.9688 -1.0156 -13.7891 6.8652
10 -1.0156 -0.9688 -0.9922 -3.4399 6.8652
11 -1.0156 -0.9922 -1.0039 -3.4399 1.7181
12 -1.0039 -0.9922 -0.9980 -0.8595 1.7181
13 -1.0039 -0.9980 -1.0010 -0.8595 0.4296
14 -1.0010 -0.9980 -0.9995 -0.2149 0.4296
15 -1.0010 -0.9995 -1.0002 -0.2149 0.1074
16 -1.0002 -0.9995 -0.9999 -0.0537 0.1074
Equation x3 -3 x + 1

f(xr) f(xl)*f(xr) Approximate Error %


-0.1250 0.1250 /

f(xr) f(xl)*f(xr) Approximate Error %


-0.1250 0.1250 /
1.1094 -0.1387 14.29
0.4160 -0.0520 7.69
0.1272 -0.0159 4.00
-0.0034 0.0004 2.04
0.0608 -0.0002 1.01
0.0284 -0.0001 0.51
0.0124 0.0000 0.25
0.0045 0.0000 0.13
0.0006 0.0000 0.06
-0.0014 0.0000 0.03
-0.0004 0.0000 0.02
0.0001 0.0000 0.01
-0.0002 0.0000 0.00
-0.0001 0.0000 0.00
0.0000 0.0000 0.00

f(xr) f(xl)*f(xr) Approximate Error %


1210.0000 -278300.0000 /
850.0000 -195500.0000 150.00
400.0000 -92000.0000 300.00
107.5000 -24725.0000 300.00
-55.6250 12793.7500 60.00
27.3438 -1520.9961 42.86
-13.7891 767.0166 17.65
6.8652 -94.6651 9.68
-3.4399 47.4336 4.62
1.7181 -5.9103 2.36
-0.8595 2.9567 1.17
0.4296 -0.3693 0.59
-0.2149 0.1847 0.29
0.1074 -0.0231 0.15
-0.0537 0.0115 0.07
0.0269 -0.0014 0.04
Exact Error % Exact Solution -1.0000
250.00

Exact Error % Exact Solution 21.0000


92.86
91.67
92.26
92.56
92.71
92.63 ($H$3)
92.67
92.69
92.70
92.70
92.71
92.70
92.70
92.70
92.70
92.70
Roots using False Position Method

i Xl Xu Xr f(xl) f(xu)
1 1.0000 2.0000 1.2500 -1.0000 3.0000
2 1.2500 2.0000 1.4074 -0.7969 3.0000
3 1.4074 2.0000 1.4824 -0.4344 3.0000
4 1.4824 2.0000 1.5132 -0.1897 3.0000
5 1.5132 2.0000 1.5250 -0.0749 3.0000
6 1.5250 2.0000 1.5295 -0.0284 3.0000
7 1.5295 2.0000 1.5311 -0.0106 3.0000
8 1.5311 2.0000 1.5317 -0.0039 3.0000
9 1.5317 2.0000 1.5320 -0.0015 3.0000

i Xl Xu Xr f(xl) f(xu)
1 8.0000 22.0000 19.7000 1170.0000 -230.0000
2 19.7000 22.0000 20.9401 269.1000 -230.0000
3 20.9401 22.0000 20.9974 13.1438 -230.0000
4 20.9974 22.0000 20.9999 0.5745 -230.0000
5 20.9999 22.0000 21.0000 0.0250 -230.0000
6 21.0000 22.0000 21.0000 0.0011 -230.0000
7 21.0000 22.0000 21.0000 0.0000 -230.0000
8 21.0000 22.0000 21.0000 0.0000 -230.0000
9 21.0000 22.0000 21.0000 0.0000 -230.0000
10 21.0000 22.0000 21.0000 0.0000 -230.0000
11 21.0000 22.0000 21.0000 0.0000 -230.0000
12 21.0000 22.0000 21.0000 0.0000 -230.0000
13 21.0000 22.0000 21.0000 0.0000 -230.0000
14 21.0000 22.0000 21.0000 0.0000 -230.0000
15 21.0000 22.0000 21.0000 0.0000 -230.0000
16 21.0000 22.0000 21.0000 0.0000 -230.0000

i Xl Xu Xr f(xl) f(xu)
1 -2.0000 22.0000 #DIV/0! -230.0000 -230.0000
2 #DIV/0! #DIV/0! #DIV/0! #DIV/0! #DIV/0!
3 #DIV/0! #DIV/0! #DIV/0! #DIV/0! #DIV/0!
4 #DIV/0! #DIV/0! #DIV/0! #DIV/0! #DIV/0!
5 #DIV/0! #DIV/0! #DIV/0! #DIV/0! #DIV/0!
Equation .x3 -3 x +1

f(xr) f(xl)*f(xr) Approximate Error %


-0.7969 0.7969 /
-0.4344 0.3462 11.18
-0.1897 0.0824 5.06
-0.0749 0.0142 2.03
-0.0284 0.0021 0.78
-0.0106 0.0003 0.29
-0.0039 0.0000 0.11
-0.0015 0.0000 0.04
-0.0005 0.0000 0.01

f(xr) f(xl)*f(xr) Approximate Error %


269.1000 314847.0000 /
13.1438 3537.0057 5.92
0.5745 7.5506 0.27
0.0250 0.0144 0.01
0.0011 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00
0.0000 0.0000 0.00

f(xr) f(xl)*f(xr) Approximate Error %


#DIV/0! #DIV/0! /
#DIV/0! #DIV/0! #DIV/0!
#DIV/0! #DIV/0! #DIV/0!
#DIV/0! #DIV/0! #DIV/0!
#DIV/0! #DIV/0! #DIV/0!
Exact Error % Exact Solution -1
225.00
240.74
248.24
251.32
252.50
252.95
253.11
253.17
253.20

Exact Error % Exact Solution 21


6.19
0.29
0.01
0.00
0.00
0.00 ($H$3)
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
Equation .-10 x2 + 200 x + 210

Variable Function
Power Function Factors Derivative Function Factors
2.0000 -10.0000 -20.0000
1.0000 200.0000 200.0000
0.0000 210.0000 0.0000

i xi f(xi) f'(xi)
0 -6.0000 -1350.0000 320.0000
1 -1.7813 -177.9785 235.6250
2 -1.0259 -5.7055 220.5181
3 -1.0000 -0.0067 220.0006
4 -1.0000 0.0000 220.0000
5 -1.0000 0.0000 220.0000
6 -1.0000 0.0000 220.0000
7 -1.0000 0.0000 220.0000
8 -1.0000 0.0000 220.0000

i xi f(xi) f"(xi)
1 4.0000 850.0000 120.0000
2 -3.0833 -501.7361 261.6667
3 -1.1659 -36.7666 223.3174
4 -1.0012 -0.2711 220.0246
5 -1.0000 0.0000 220.0000
6 -1.0000 0.0000 220.0000
7 -1.0000 0.0000 220.0000
8 -1.0000 0.0000 220.0000
9 -1.0000 0.0000 220.0000

i xi f(xi) f"(xi)
1 8.0000 1170.0000 40.0000
2 -21.2500 -8555.6250 625.0000
3 -7.5610 -1873.8872 351.2200
4 -2.2256 -284.6613 244.5127
5 -1.0614 -13.5536 221.2287
6 -1.0002 -0.0375 220.0034
7 -1.0000 0.0000 220.0000
8 -1.0000 0.0000 220.0000
9 -1.0000 0.0000 220.0000

i xi f(xi) f"(xi)
1 22.0000 -230.0000 -240.0000
2 21.0417 -9.1840 -220.8333
3 21.0001 -0.0173 -220.0016
4 21.0000 0.0000 -220.0000
5 21.0000 0.0000 -220.0000
6 21.0000 0.0000 -220.0000
7 21.0000 0.0000 -220.0000
8 21.0000 0.0000 -220.0000
9 21.0000 0.0000 -220.0000

i xi f(xi) f"(xi)
1 -2.0000 -230.0000 240.0000
2 -1.0417 -9.1840 220.8333
3 -1.0001 -0.0173 220.0016
4 -1.0000 0.0000 220.0000
5 -1.0000 0.0000 220.0000
6 -1.0000 0.0000 220.0000
7 -1.0000 0.0000 220.0000
8 -1.0000 0.0000 220.0000
9 -1.0000 0.0000 220.0000
Approximate Error % Exact Error % Exact Solution -1
500.00
236.84 78.13 Jumping to different root
73.63 2.59
2.59 0.00
0.00 0.00
0.00 0.00
0.00 0.00
0.00 0.00
0.00 0.00

Approximate Error % Exact Error % Exact Solution -1


500.00
229.73 208.33 Jumping to different root
164.47 16.59
16.44 0.12
0.12 0.00
0.00 0.00
0.00 0.00
0.00 0.00
0.00 0.00

Approximate Error % Exact Error % Exact Solution 21


61.90
137.65 201.19
181.05 136.00
239.72 110.60
109.68 105.05
6.13 104.76
0.02 104.76
0.00 104.76
0.00 104.76

Approximate Error % Exact Error % Exact Solution 21


2300.00
4.55 2204.17
0.20 2200.01
0.00 2200.00
0.00 2200.00
0.00 2200.00
0.00 2200.00
0.00 2200.00
0.00 2200.00

Approximate Error % Exact Error %

92.00
4.16
0.01
0.00
0.00
0.00
0.00
0.00
Equation .-10 x2 + 200 x + 210

i xi-1 xi f(xi-1) f(xi)


1 -6.0000 4.0000 -1350.0000 850.0000
2 4.0000 0.13636364 850.0000 237.0868
3 0.1364 -1.3581662 237.0868 -80.0794
4 -1.3582 -0.9808213 -80.0794 4.2156
5 -0.9808 -0.9996925 4.2156 0.0676
6 -0.9997 -1.0000003 0.0676 -0.0001
7 -1.0000 -1 -0.0001 0.0000
8 -1.0000 -1 0.0000 0.0000

i xi-1 xi f(xi-1) f(xi)


1 8.0000 22.0000 1170.0000 -230.0000
2 22.0000 19.7 -230.0000 269.1000
3 19.7000 20.9400922 269.1000 13.1438
4 20.9401 21.0037732 13.1438 -0.8303
5 21.0038 20.9999897 -0.8303 0.0023
6 21.0000 21 0.0023 0.0000
7 21.0000 21 0.0000 0.0000

i xi-1 xi f(xi-1) f(xi)


1 -2.0000 22.0000 -230.0000 -230.0000
2 22.0000 #DIV/0! -230.0000 #DIV/0!
3 #DIV/0! #DIV/0! #DIV/0! #DIV/0!
4 #DIV/0! #DIV/0! #DIV/0! #DIV/0!
5 #DIV/0! #DIV/0! #DIV/0! #DIV/0!
Approximate Error % Exact Error %
Exact S -1
2833.33 500.00
110.04 113.64
38.47 -35.82
1.89 1.92
0.03 0.03
0.00 0.00
0.00 0.00

Approximate Error % Exact Error %


Exact S 21
11.68 4.76
5.92 6.19
0.30 0.29
0.02 0.02
0.00 0.00
0.00 0.00

Approximate Error % Exact Error %

#DIV/0!
#DIV/0!
#DIV/0!
#DIV/0!
Equation .-10 x2 + 200 x + 210

Finding Roots using Built in Function

x f(x)
-6 -1350
-1 -3.441E-07 Solution Using What is analysis
Goal Seek

x f(x)
-2 -230
-1 -2.778E-05 Solution Using What is analysis
Goal Seek

x f(x)
4 850
-1.0000029 -0.0006485 Solution Using What is analysis
Goal Seek

x f(x)
8 1170
-1 6.387E-05 Solution Using What is analysis
Goal Seek

x f(x)
22 -230
21.000002 -0.0003673 Solution Using What is analysis
Goal Seek

x f(x)
60 -23790
21 -1.221E-06 Solution Using What is analysis
Goal Seek
Equation .-10 x2 + 200 x + 210

Finding Roots using Built in Function

x f(x)
-6 -1350
-0.999995209 0.001054 Solution Using Solver

x f(x)
-2 -230
-1 5.913E-05 Solution Using Solver

x f(x)
4 850
-1.0000034 -0.0007589 Solution Using Solver

x f(x)
8 1170
-0.9999977 0.0005126 Solution Using Solver

x f(x)
22 -230
21 4.645E-05 Solution Using Solver

x f(x)
60 -23790
21 0 Solution Using Solver

Potrebbero piacerti anche