Error Analysis in Numerical Methods for Solving Equations

In summary: The error that comes from a numerical process is the numerical error. It can arise from many sources, but the largest source of numerical error in this problem is the error in using 2.646 as the square root of 7. The numerical error is much larger than the rounding error.As for Heron's method, I was mistaken. The method used here is called Heron's algorithm, and is a generalization of Heron's method of finding the area of a triangle. The method used in this problem is the algorithm for finding the square root of a number.
  • #1
songoku
2,301
325

Homework Statement


a. Using equation x2 – a = 0, show that [tex]x_{n+1}=\frac{1}{2}\left(x_n+\frac{a}{x_n}\right)[/tex]


b. Given that Xn = √a + e, where e is a small error. Show that:

[tex]x_{n+1}=a^{1/2}+\frac{1}{2}\left(\frac{e^2}{a^{1/2}+e}\right)[/tex]


c. If x0 = 4 and a = 7, where √7 = 2.646, find x3. By using the value of x3, find the error for X4 (1 significant figure)



Homework Equations


Newton Raphson


The Attempt at a Solution


I am able to do (a) and (b) and having trouble with (c). I've tried to find x3 using the formulas (a) and (b) and I got different answer.

Using formula (a) :

[tex]x_{1}=\frac{1}{2}\left(x_0+\frac{a}{x_0}\right)=2.875[/tex]

[tex]x_{2}=\frac{1}{2}\left(x_1+\frac{a}{x_1}\right)=2.65489[/tex]

[tex]x_{3}=\frac{1}{2}\left(x_2+\frac{a}{x_2}\right)=2.64577[/tex]

[tex]x_{4}=\frac{1}{2}\left(x_3+\frac{a}{x_3}\right)=2.64575[/tex]


So :
X4 = √a + e4
e4 = -2.5 x 10-4


Using formula (b) :
I think the error e is not a constant value because if it's constant, the value Xn = √a + e will be constant. So I assume [tex]e\rightarrow e_n[/tex] ----> just guessing (is it possible [tex]e\rightarrow e_{n-1} ?[/tex] )

Then :
X0 = √a + e0
e0 = 4 - 2.646 = 1.354


Using the value of e0 :

[tex]x_{1}=a^{1/2}+\frac{1}{2}\left(\frac{(e_0)^2}{a^{1/2}+e_0}\right)=2.875[/tex]

X1 = √a + e1
e1 = 2.875 - 2.646 = 0.229


[tex]x_{2}=a^{1/2}+\frac{1}{2}\left(\frac{(e_1)^2}{a^{1/2}+e_1}\right)=2.65512[/tex]

X2 = √a + e2
e2 = 2.65512 - 2.646 = 9.12 x 10-3


[tex]x_{3}=a^{1/2}+\frac{1}{2}\left(\frac{(e_2)^2}{a^{1/2}+e_2}\right)=2.646015663[/tex]

X3 = √a + e3
e3 = 2.646015663 - 2.646 = 1.5663 x 10-3


[tex]x_{4}=a^{1/2}+\frac{1}{2}\left(\frac{(e_3)^2}{a^{1/2}+e_3}\right)=2.646000461[/tex]

X4 = √a + e4
e4 = 2.646000461 - 2.646 = 4.6136 x 10-7


Which one is right? I think the positive one is right because from the graph of y = x2 - 7 and x0=4, the approximation will be overestimate, so the error should be positive.
But I'm not sure..

Thanks
 
Last edited:
Physics news on Phys.org
  • #2
songoku said:
Which one is right? I think the positive one is right because from the graph of y = x2 - 7 and x0=4, the approximation will be overestimate, so the error should be positive.
But I'm not sure..
Neither one is right. You are truncating away the precision in both cases.

You are correct in that the error is not constant. Think of it this way: If the error was constant, what's the point? The entire purpose of the method is to make the error shrink with each step. The error changes with each step. It is thus better to write the nth term as

[tex]x_n = a^{1/2} + e_n[/tex]

With this, the look at the expression in part (b) becomes

[tex]x_{n+1}=a^{1/2} +\frac{1}{2}\left(\frac{e_n^2}{a^{1/2}+e_n}\right)[/tex]

This directly gives an expression for the error term:

[tex]e_{n+1}=\frac{1}{2}\left(\frac{e_n^2}{a^{1/2} + e_n}\right)[/tex]

If you use this to calculate the error for x4 you will know how many significant digits you need to carry when evaluating x4.
 
  • #3
Hi D H
D H said:
You are truncating away the precision in both cases.
I don't understand this fully. I used the digits until several decimal places and I think it still holds precision. I realized my mistake not answering the question in 1 significant figure, but is it really lost its precision?

If you use this to calculate the error for x4 you will know how many significant digits you need to carry when evaluating x4.
The question is asking about e4 , not x4

My lastest attempt:
x0 = √a + e0
e0 = 4 - 2.646 = 1.354

Using the formula you suggest, I found :
e1 = 0.2291645

And continuing it until e4, I got :
e4 = 4.66179395 x 10-11 = 5 x 10-11 ( 1 SF )

Do I get it right?

The answer is different form my previous two. Now I am starting to think that my answer is really lost the precision. But why ?

Thanks
 
  • #4
You lost precision precisely because you truncated your answers. The truncation destroyed your precision.
 
  • #5
Hi D H

I re-calculate my answer without truncating it, i.e. I directly use the answer from calculator to compute the next value and get the answer pretty close to my previous two, which are different from the answer I got using the formula you suggested. Are my answer still not precise?

Thanks
 
  • #6
"Pretty close" isn't good enough when you are trying to find an error that is about 5 x 10-11 (which, BTW, is correct). Too how many decimal places do you need to carry out your work to detect that small an error?
 
  • #7
Hi D H

Yes I can't find the error until 10-11 using my previous work. But I don't know the reason. I didn't truncate my calculation so I think the reason is not truncation.
 
  • #8
Going back to your original post, you used a truncated value for the square root of 7. This worked fine up to the calculation of e2 because the truncation error was smaller than the numerical error up to this point. Beyond this point, the truncation error overwhelms the errors inherent in Heron's method. Your calculated errors for e3 and beyond have zero precision because of your use of 2.646 for the square root of 7.

There is an important lesson to be learned here: You need to take care when you are truncating a result.
 
  • #9
Hi D H
D H said:
Going back to your original post, you used a truncated value for the square root of 7.
That approximation is given by the question and I think it should be used.

This worked fine up to the calculation of e2 because the truncation error was smaller than the numerical error up to this point.
Sorry, I don't get it. What is truncation error and what is numerical error ? :confused:

Beyond this point, the truncation error overwhelms the errors inherent in Heron's method.
Heron's method? I think Heron's method is used to find area of triangle. Can it be used here? Or maybe there is another formula called Heron besides for triangle?


Thanks :smile:
 
  • #10
Regarding 2.646: State the question, please. Did it explicitly say to use 2.646 as the value for the square root of seven, or did it say something along the lines of "If x0 = 4 and a = 7, where [itex]\surd 7 \approx 2.646[/itex], find x0 ..."

Using the error estimation technique,

[tex]e_{n+1}=\frac{1}{2}\left(\frac{e_n^2}{a^{1/2} + e_n}\right)[/tex]

with e2=9.12x10-3 and 2.646 as an approximation of √7 yields e3=1.57x10-5. So, what is 2.646+1.57x10-5? The answer is 2.646. Saying 2.6460157 as you did in the original post is erroneous. The correction term e3 is much smaller than the truncation error.
Regarding truncation error (better stated as rounding error) versus numerical error: Rounding error is what you get when you arbitrarily round a numerical result to some degree of precision. Each step of the application of this iterative algorithm has some error in it, even with infinite precision. The zeroth and first steps of the iteration, x0=4 and x1=(4+7/4)/2=23/8, will have zero rounding error in a base 2 representation (e.g., a computer) or on a base 10 calculator with four or more decimal places of accuracy. The numerical error is anything but zero.
Regarding this algorithm as a whole: While this algorithm can be derived from Newton's method, it is much older than that. The algorithm predates Newton by a couple thousand years. It may have been known to the Babylonians and was described by Heron (or Hero) of Alexandria. See http://www.mathpages.com/HOME/kmath190.htm, for example.
 
  • #11
Hi D H
D H said:
Regarding 2.646: State the question, please. Did it explicitly say to use 2.646 as the value for the square root of seven, or did it say something along the lines of "If x0 = 4 and a = 7, where [itex]\surd 7 \approx 2.646[/itex], find x0 ..."
I've posted all the question. It didn't explicitly state that we have to use √7 = 2.646, but it did mention that √7 = 2.646 so I think that we should use this value. Or maybe not?

Using the error estimation technique,

[tex]e_{n+1}=\frac{1}{2}\left(\frac{e_n^2}{a^{1/2} + e_n}\right)[/tex]

with e2=9.12x10-3 and 2.646 as an approximation of √7 yields e3=1.57x10-5. So, what is 2.646+1.57x10-5? The answer is 2.646. Saying 2.6460157 as you did in the original post is erroneous. The correction term e3 is much smaller than the truncation error.
Why is 2.6460157 is erroneous compared to 2.646? I think it should be more precise because it contains more digits and it's not rounded.

And I found out my mistake when calculating e3. It should be 1.5663 x 10-5, not 1.5663 x 10-3, although it's still differs when using your formula (e3=1.57331257 x 10-5).

But when I used this value to calculate x4, I got x4=2.646 and e4=0, which is absolutely wrong.

I still don't get the idea about precision...:cry:
Thanks
 
  • #12
songoku said:
Hi D H

I've posted all the question. It didn't explicitly state that we have to use √7 = 2.646, but it did mention that √7 = 2.646 so I think that we should use this value. Or maybe not?
If you want to compute the error in the fourth iteration of this square root algorithm, absolutely not


Why is 2.6460157 is erroneous compared to 2.646? I think it should be more precise because it contains more digits and it's not rounded.
It is erroneous because you rounded √7 to 4 significant digits. This rounding poisons all subsequent calculations. 2.646+0.0000157 = 2.646 is correct; the addend is lost in the truncation error. Saying √7+0.0000157=2.6460157 is incorrect. The correct answer (to the accuracy implied by the addend) is 2.6457670.

Another way to look at it: The difference between 2.646 and √7 is 0.000248688935... That is your truncation error, and it is almost 16 times greater than the number your are trying to add to 2.646.
 
  • #13
Hi D H

Oh I think I get it now.

Thanks a lot for your help and passion :)
 

Related to Error Analysis in Numerical Methods for Solving Equations

1. What is a numerical method with error?

A numerical method with error is a mathematical technique used to approximate the solution to a problem with a certain level of accuracy. However, due to factors such as rounding errors and limitations of the method, there will always be some amount of error in the approximation.

2. How do you calculate error in a numerical method?

The error in a numerical method is typically calculated by taking the difference between the approximate solution and the exact solution. This difference is known as the absolute error. Alternatively, the relative error can be calculated by dividing the absolute error by the exact solution.

3. What is the significance of error in a numerical method?

The amount of error in a numerical method is important as it affects the accuracy and reliability of the solution. By minimizing the error, we can obtain a more precise approximation of the solution. Additionally, error analysis can provide insights into the limitations and potential improvements of a numerical method.

4. How do you reduce error in a numerical method?

There are several ways to reduce error in a numerical method. One approach is to use a more precise method or algorithm that is better suited for the problem at hand. Another way is to use more precise data or increase the number of iterations in the calculation. Additionally, error can be reduced by carefully selecting the initial conditions and parameters of the problem.

5. Can numerical methods with error be used for all types of problems?

No, not all problems can be solved using numerical methods with error. These methods are most suitable for problems with continuous and well-defined functions. For problems with discontinuities or singularities, other techniques may be more appropriate. It is important to carefully consider the nature of the problem before choosing a numerical method.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
532
  • Calculus and Beyond Homework Help
Replies
16
Views
621
  • Calculus and Beyond Homework Help
Replies
5
Views
459
  • Calculus and Beyond Homework Help
Replies
16
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
469
  • Calculus and Beyond Homework Help
Replies
5
Views
347
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
857
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
Back
Top