0% found this document useful (0 votes)
52 views

Algos

The document outlines the steps for three root finding algorithms: 1) The bisection method iterates between two values to narrow the range containing the root until the tolerance is met. 2) The false position method calculates a new estimate for the root based on the function values and derivatives at two points. 3) Newton's method uses the tangent line of the function to iteratively estimate the root, updating the estimate until the tolerance is reached.

Uploaded by

Nirav Gohel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Algos

The document outlines the steps for three root finding algorithms: 1) The bisection method iterates between two values to narrow the range containing the root until the tolerance is met. 2) The false position method calculates a new estimate for the root based on the function values and derivatives at two points. 3) Newton's method uses the tangent line of the function to iteratively estimate the root, updating the estimate until the tolerance is reached.

Uploaded by

Nirav Gohel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit 2

Bisection Method Step 1 [Read the Initial Range values of x1 and x2]
Read x1, x2

Step 2 [Read prescribed tolerance]


Read epsilon

Step 3
Calculate f1=f (x1) and f2=f (x2)

Step 4
If (f1*f2)>0 Go to step 10 Endif

Step 5
If absolute ((x1-x2)/x1)<Epsilon Go to step 9 Endif

Step 6
Set x0=(x1+x2)/2

Step 7
Calculate f0=f (x0)

Step 8
If (f1*f0)<0 then Set x2=xo, f2=f0 Else Set x1=x0, f1=f0 Endif

Step 9
Repeat step 4

Step 10
Write root = x0

Step 11[Stop]
End

False Position Method Step 1 [Read the Initial Range values of x1 and x2]
Read x1, x2

Step 2 [Read prescribed tolerance]


Read epsilon

Step 3
Calculate f1=f (x1) and f2=f (x2)

Step 4
If (f1*f2)>0 Go to step 11 Endif

Step 5
Set x0=((x1*f2)-(x2*f1)/(f2-f1))

Step 6
If absolute ((x1-x2)/x1)<Epsilon Go to step 10 Endif

Step 7
Calculate f0=f (x0)

Step 8
If (f1*f0)<0 then Set x2=xo, f2=f0 Else Set x1=x0, f1=f0 Endif

Step 9
Repeat step 5

Step 10
Write root = x0

Step 11 [Stop]
End

Newton Raphson Step 1 [Read the Initial value of X0]


Read x0

Step 2 [Read Prescribed Tolerance]


Read Epsilon

Step 3
If absolute (f (x0)) <epsilon Go to step Endif

Step 4
Calculate x1=x0- (f (x)/f (x))

Step 5
If absolute ((x1-x0)/x1)<epsilon Go to step Endif

Step 6
Set x0=x1

Step 7
Go to step 3

Step 8
Write root = x1

Step 9 [Stop]
End

You might also like