Download presentation
Presentation is loading. Please wait.
1
Error Measurement and Iterative Methods
Absolute & Forward Error Relative Error Cauchy Error
2
* The relative error is not defined if the exact value is zero.
Errors and Estimates In this course we will develop different algorithms to solve different types of mathematical problems such as: solve an equation, find the value of and integral or solve a differential equation. The algorithms we use will hardly ever find the solution to such a problem but it will estimate the solution. This introduces an error to what the algorithm proposes as a solution there are two different ways to measure the error when the exact value of the solution is known. Use mathematica demonstration for (1+1/n)^n to find value for e * The relative error is not defined if the exact value is zero. The absolute error tells you exactly how much your answer is off by and the relative error tells you what percent your answer is off by.
3
Sequences Many of the algorithms we will consider generate a sequence of values to approximate a solution to a problem. A sequence is a succession of numbers. The idea will often be to use the number in the sequence you are currently considering to generate the next number in the sequence. Then next number will often be a value that is “closer” to the solution of the problem you want to solve. For example, we can use each of the sequence below to generate a value for the number e. In each of these sequences the larger the value for n the better the estimate for the number e in both the absolute and relative measures. Example of computing e accurate to 3 decimal places Suppose we want to compute the number e accurate to 3 decimal places using the sequence yn as our approximation.
4
This is the sequence of values that will approximate e.
When will we need to stop to 3 decimal places of accuracy? This will be when the change from one step to another will no longer change the 3rd decimal place assuming all decimal places are not all 9's. Look for a value that will not change the third decimal digit. There are some standard ideas that describe the error (i.e. achieve the accuracy you want). In this case we need to take 7 terms (or iterations of the algorithm) to get this accuracy.
5
Iterative Methods A numerical algorithms will very often use an iterative method to approximate a solution to a given problem. An iterative method (sometimes referred to as iteration or recursion) uses an existing approximation to generate a new and hopefully better approximation to the solution. These types of methods will most often have an initial approximation(s) for the solution then an algorithm is applied to this to get a better approximation and this continues until the desired accuracy (error) is achieved. We use the following notation: xn+1 = f(xn) or xn+1=f(xn,xn-1,…x1) An immediate problem is that the approximation may never meet the prescribed accuracy. To avoid the situation where the machine will do endless computations we will often put a limit on the numbers of computations (iterations) we are willing to let the machine work to find a solution. Problem with Absolute and Relative Measures of Error The problem with both the absolute and relative error measures we have talked about is that to find them you need to know the answer. From a practical or applied point of view why would be asking the question if you knew the answer?
6
Cauchy Error To solve the problem of measuring the error without knowing the exact answer we use what is known as the Cauchy Error for a sequence. The Cauchy Error is the difference between any two terms of a sequence. The advantage here is that the error is defined only using the sequence itself and not the answer. For a sequence given by xn we define the two types of Cauchy Error below.
7
The function 𝑓 𝑥 = 1 2 + 𝑥 2 − 𝑥 the root 1 has multiplicity 2.
Equations The error measures used to measure the error in approximating a solution to an equation of the form 𝑓 𝑥 =0 by a number 𝑥 𝑎 where the actual solution is 𝑟 are the forward error and the backward error. Forward Error= 𝑟− 𝑥 𝑎 Backward Error= 𝑓 𝑥 𝑎 𝑓 𝑥 𝑓 𝑥 𝑎 𝑥 𝑎 𝑟 𝑟− 𝑥 𝑎 Multiplicity of a root If 𝑟 is a root of a function 𝑓 𝑥 , in other words 𝑓 𝑟 =0 then the multiplicity of the root 𝑟 is the value 𝑛 so the first 𝑛−1 derivatives of 𝑓 𝑥 are zero at 𝑟, but the 𝑛 𝑡ℎ derivative is not zero. Example: The function 𝑓 𝑥 = 𝑥 2 − 𝑥 the root 1 has multiplicity 2. 𝑓 1 = − 1 =0 𝑓 ′ 𝑥 = − 𝑥 𝑓 ′′ 𝑥 = 𝑥 −3 2 𝑓 ′ 1 = − =0 𝑓 ′′ 𝑥 = 1 4
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.