SlideShare a Scribd company logo
Scientific Programming Using Excel
for Beginners: Newton's Method
by
RIZAuddin bin Saian
Faculty of Computer & Mathematical Sciences
Universiti Teknologi MARA (Perlis)
Venue: Lab 1, UiTM Perlis
5 February 2016 (Friday)
3pm
Scientific Programming Using Excel for Beginners: Newton's Method
Problem
• We want to find the root for .
 xfy 
 xfy 
5/2/2016
2
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Objective
• To approximate the root for
using Newton’s method (Newton-Raphson
method)
– Perform Newton’s method by hand.
– Write a VBA code to perform the Newton’s
method.
 xfy 
5/2/2016
3
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Newton’s Method
 
 n
n
nn
xf
xf
xx
'
1 
5/2/2016
4
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Equation of tangent line
      
 
    
 
 
 
 n
n
nn
n
n
nn
nnnn
n
nnnnn
xf
xf
xx
xf
xf
xx
xxxfxf
xxf
xxxfxfxf
'
'
'0
interceptat the0
'
1
1
1
1
11










5/2/2016
5
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Initial Guess of x
Actual root
 xfy 
X
X
x0
(Initial guess)
5/2/2016
6
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 1
X
Tangent line at x0 = -1
 
 0
0
01
' xf
xf
xx 
X
 xfy 
x0x1
Actual root
(Initial guess)
5/2/2016
7
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 2
x1
Tangent line at x1
 
 1
1
12
' xf
xf
xx 
X X
 xfy 
x0
Actual root
(Initial guess)
5/2/2016
8
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Example: Find the root.
Actual root
X
x0 = -1
X
5/2/2016
9
http://www.rizauddin.com
  13
 xxxf
Scientific Programming Using Excel for Beginners: Newton's Method
Initial guess of x
  13
 xxxf 
  13'
1
2
3


xxf
xxxf
1
,ofguessInitial
0 x
x
 
 
13
1
'
2
3
1




x
xx
x
xf
xf
xxn
The estimated root,
5/2/2016
10
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 1
i x xn+1
0 - 1 -1.5
5/2/2016
11
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 2
i x xn+1
0 - 1 -1.5
1 -1.5 -1.347826087
5/2/2016
12
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 3
i x xn+1
0 - 1 -1.5
1 -1.5 -1.347826087
2 -1.347826087 -1.325200399
5/2/2016
13
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 4
i x xn+1
0 - 1 -1.5
1 -1.5 -1.347826087
2 -1.347826087 -1.325200399
3 -1.325200399 -1.324718174
5/2/2016
14
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 5
i x xn+1
0 - 1 -1.5
1 -1.5 -1.347826087
2 -1.347826087 -1.325200399
3 -1.325200399 -1.324718174
4 -1.324718174 -1.324717957
5/2/2016
15
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 6
i x xn+1
0 - 1 -1.5
1 -1.5 -1.347826087
2 -1.347826087 -1.325200399
3 -1.325200399 -1.324718174
4 -1.324718174 -1.324717957
5 -1.324717957 -1.324717957
5/2/2016
16
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Iteration 6
i x xn+1
0 - 1 -1.5
1 -1.5 -1.347826087
2 -1.347826087 -1.325200399
3 -1.325200399 -1.324718174
4 -1.324718174 -1.324717957
5 -1.324717957 -1.324717957
STOP!
5/2/2016
17
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Visual Basic for Application (VBA)
Press Alt key and hold. Then, press F11 together to open the VBA Editor.
5/2/2016
18
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Add new Module
5/2/2016
19
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Define a function
5/2/2016
20
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Exercise 1
• Define function Newton with parameter “x”
and return the estimation value for the root of
with x0=-1.  13
 xxxf
5/2/2016
21
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Exercise 1
• Define function Newton with parameter “x”
and return the estimation value for the root of
with x0=-1.  13
 xxxf
5/2/2016
22
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Loop
5/2/2016
23
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Exercise 2
• Modify the Newton function in Ex. 1 to use
loop to calculate the root using 4 iterations.
5/2/2016
24
http://www.rizauddin.com
Scientific Programming Using Excel for Beginners: Newton's Method
Exercise 2
• Modify the Newton function in Ex. 1 to use
loop to calculate the root using 4 iterations.
5/2/2016
25
http://www.rizauddin.com
THANK YOU
www.rizauddin.com
5/2/2016
26
http://www.rizauddin.com

More Related Content

PPT
Introduction au Domain Driven Design
PDF
Hawaii Pacific GIS Conference 2012: Plenary Session Keynote - Positioning the...
PDF
Great Writing Starts Here
PPT
Explore new dimensions with MapInfo Vertical Mapper
PDF
Programming inexcelvba anintroduction
PDF
7 geographic concepts
PPTX
Exploration and 3D GIS Software - MapInfo Professional Discover3D 2015
PDF
Projections Eps
Introduction au Domain Driven Design
Hawaii Pacific GIS Conference 2012: Plenary Session Keynote - Positioning the...
Great Writing Starts Here
Explore new dimensions with MapInfo Vertical Mapper
Programming inexcelvba anintroduction
7 geographic concepts
Exploration and 3D GIS Software - MapInfo Professional Discover3D 2015
Projections Eps

Viewers also liked (8)

ODP
Mapserver vs. geoserver
PPT
Gis Concepts 3/5
PDF
SIM Card Overview
PPTX
Fortran 95
PPT
Introduction to iso 9001
PDF
Fortran introduction
PPTX
The new ISO 9001:2015
PPTX
Ppt on ms excel
Mapserver vs. geoserver
Gis Concepts 3/5
SIM Card Overview
Fortran 95
Introduction to iso 9001
Fortran introduction
The new ISO 9001:2015
Ppt on ms excel
Ad

Similar to Scientific Programming using Excel for Beginners: Newton's Method (20)

PDF
Scientific programming using Excel VBA for beginners
PPT
Calc 3.8
PPT
Linear Approx, Differentials, Newton S Method
PPTX
Finding root of equation (numarical method)
PDF
Excel.fns frmls
PPT
Using visual basic for applications (vba)
PDF
0.0. falsa posicion-naol
PDF
Excel macro for integration of a function
PPT
Excel2007 Power Point Slides
PPT
Spreadsheets: Functional Programming for the Masses
PDF
2016 Excel/VBA Notes
PDF
A excel analysis toolpack -best
PDF
2. EXCEL BASICS.pdf IT course for medics
PPTX
Newton's Method in Calculus
PPT
Applying Formulas in Microsoft Excel.ppt
DOCX
MolinaLeydi_FinalProject
PDF
0.0. punto fijo
PDF
EXCEL FUNCTIONS and Advanced Formula Combinations Excel Mastery Series Unleas...
PDF
Solution of non-linear equations
Scientific programming using Excel VBA for beginners
Calc 3.8
Linear Approx, Differentials, Newton S Method
Finding root of equation (numarical method)
Excel.fns frmls
Using visual basic for applications (vba)
0.0. falsa posicion-naol
Excel macro for integration of a function
Excel2007 Power Point Slides
Spreadsheets: Functional Programming for the Masses
2016 Excel/VBA Notes
A excel analysis toolpack -best
2. EXCEL BASICS.pdf IT course for medics
Newton's Method in Calculus
Applying Formulas in Microsoft Excel.ppt
MolinaLeydi_FinalProject
0.0. punto fijo
EXCEL FUNCTIONS and Advanced Formula Combinations Excel Mastery Series Unleas...
Solution of non-linear equations
Ad

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Cell Types and Its function , kingdom of life
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Classroom Observation Tools for Teachers
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
Anesthesia in Laparoscopic Surgery in India
Supply Chain Operations Speaking Notes -ICLT Program
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
TR - Agricultural Crops Production NC III.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Microbial disease of the cardiovascular and lymphatic systems
Cell Types and Its function , kingdom of life
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Classroom Observation Tools for Teachers
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPH.pptx obstetrics and gynecology in nursing
Pharmacology of Heart Failure /Pharmacotherapy of CHF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Insiders guide to clinical Medicine.pdf
01-Introduction-to-Information-Management.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Basic Mud Logging Guide for educational purpose
Anesthesia in Laparoscopic Surgery in India

Scientific Programming using Excel for Beginners: Newton's Method

  • 1. Scientific Programming Using Excel for Beginners: Newton's Method by RIZAuddin bin Saian Faculty of Computer & Mathematical Sciences Universiti Teknologi MARA (Perlis) Venue: Lab 1, UiTM Perlis 5 February 2016 (Friday) 3pm
  • 2. Scientific Programming Using Excel for Beginners: Newton's Method Problem • We want to find the root for .  xfy   xfy  5/2/2016 2 http://www.rizauddin.com
  • 3. Scientific Programming Using Excel for Beginners: Newton's Method Objective • To approximate the root for using Newton’s method (Newton-Raphson method) – Perform Newton’s method by hand. – Write a VBA code to perform the Newton’s method.  xfy  5/2/2016 3 http://www.rizauddin.com
  • 4. Scientific Programming Using Excel for Beginners: Newton's Method Newton’s Method    n n nn xf xf xx ' 1  5/2/2016 4 http://www.rizauddin.com
  • 5. Scientific Programming Using Excel for Beginners: Newton's Method Equation of tangent line                      n n nn n n nn nnnn n nnnnn xf xf xx xf xf xx xxxfxf xxf xxxfxfxf ' ' '0 interceptat the0 ' 1 1 1 1 11           5/2/2016 5 http://www.rizauddin.com
  • 6. Scientific Programming Using Excel for Beginners: Newton's Method Initial Guess of x Actual root  xfy  X X x0 (Initial guess) 5/2/2016 6 http://www.rizauddin.com
  • 7. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 1 X Tangent line at x0 = -1    0 0 01 ' xf xf xx  X  xfy  x0x1 Actual root (Initial guess) 5/2/2016 7 http://www.rizauddin.com
  • 8. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 2 x1 Tangent line at x1    1 1 12 ' xf xf xx  X X  xfy  x0 Actual root (Initial guess) 5/2/2016 8 http://www.rizauddin.com
  • 9. Scientific Programming Using Excel for Beginners: Newton's Method Example: Find the root. Actual root X x0 = -1 X 5/2/2016 9 http://www.rizauddin.com   13  xxxf
  • 10. Scientific Programming Using Excel for Beginners: Newton's Method Initial guess of x   13  xxxf    13' 1 2 3   xxf xxxf 1 ,ofguessInitial 0 x x     13 1 ' 2 3 1     x xx x xf xf xxn The estimated root, 5/2/2016 10 http://www.rizauddin.com
  • 11. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 1 i x xn+1 0 - 1 -1.5 5/2/2016 11 http://www.rizauddin.com
  • 12. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 2 i x xn+1 0 - 1 -1.5 1 -1.5 -1.347826087 5/2/2016 12 http://www.rizauddin.com
  • 13. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 3 i x xn+1 0 - 1 -1.5 1 -1.5 -1.347826087 2 -1.347826087 -1.325200399 5/2/2016 13 http://www.rizauddin.com
  • 14. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 4 i x xn+1 0 - 1 -1.5 1 -1.5 -1.347826087 2 -1.347826087 -1.325200399 3 -1.325200399 -1.324718174 5/2/2016 14 http://www.rizauddin.com
  • 15. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 5 i x xn+1 0 - 1 -1.5 1 -1.5 -1.347826087 2 -1.347826087 -1.325200399 3 -1.325200399 -1.324718174 4 -1.324718174 -1.324717957 5/2/2016 15 http://www.rizauddin.com
  • 16. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 6 i x xn+1 0 - 1 -1.5 1 -1.5 -1.347826087 2 -1.347826087 -1.325200399 3 -1.325200399 -1.324718174 4 -1.324718174 -1.324717957 5 -1.324717957 -1.324717957 5/2/2016 16 http://www.rizauddin.com
  • 17. Scientific Programming Using Excel for Beginners: Newton's Method Iteration 6 i x xn+1 0 - 1 -1.5 1 -1.5 -1.347826087 2 -1.347826087 -1.325200399 3 -1.325200399 -1.324718174 4 -1.324718174 -1.324717957 5 -1.324717957 -1.324717957 STOP! 5/2/2016 17 http://www.rizauddin.com
  • 18. Scientific Programming Using Excel for Beginners: Newton's Method Visual Basic for Application (VBA) Press Alt key and hold. Then, press F11 together to open the VBA Editor. 5/2/2016 18 http://www.rizauddin.com
  • 19. Scientific Programming Using Excel for Beginners: Newton's Method Add new Module 5/2/2016 19 http://www.rizauddin.com
  • 20. Scientific Programming Using Excel for Beginners: Newton's Method Define a function 5/2/2016 20 http://www.rizauddin.com
  • 21. Scientific Programming Using Excel for Beginners: Newton's Method Exercise 1 • Define function Newton with parameter “x” and return the estimation value for the root of with x0=-1.  13  xxxf 5/2/2016 21 http://www.rizauddin.com
  • 22. Scientific Programming Using Excel for Beginners: Newton's Method Exercise 1 • Define function Newton with parameter “x” and return the estimation value for the root of with x0=-1.  13  xxxf 5/2/2016 22 http://www.rizauddin.com
  • 23. Scientific Programming Using Excel for Beginners: Newton's Method Loop 5/2/2016 23 http://www.rizauddin.com
  • 24. Scientific Programming Using Excel for Beginners: Newton's Method Exercise 2 • Modify the Newton function in Ex. 1 to use loop to calculate the root using 4 iterations. 5/2/2016 24 http://www.rizauddin.com
  • 25. Scientific Programming Using Excel for Beginners: Newton's Method Exercise 2 • Modify the Newton function in Ex. 1 to use loop to calculate the root using 4 iterations. 5/2/2016 25 http://www.rizauddin.com