Numerical Methods (NM)
Solutions of equations
TO DO: Rate of convergence - NMe3; not covered until chapter 6
e1-4 Bisection method:
- 1) Find an interval estimate (two -coordinates which straddle the root, one each side). These can be confirmed by checking for a change of sign
- 2) Find the mid-point and calculate
- 3) Out of the three -coordinates now available, find the smallest interval which has a change of sign
- 4) Repeat steps 2 and 3 until the root is approximated to the required accuracy
- 5) Stop once the left and right interval are equal when rounded to the required number of decimal places/significant figures
Newton-Raphson method:
- This method draws a tangent at a starting approximation. The -coordinate where this tangent intersects the -axis is used as the approximation for the next iteration. As the iterations progress, the value of should converge towards the true value
- The initial approximation is written as
- Use the following equation (2nd page of the exam formula booklet):
- In most cases, if two iterations produce the same approximation when rounded to the required number of decimal places/significant figures, no further iterations will be required. To confirm this, use the change of sign method to check the error bounds (like in the C3 coursework)
- This method has second order convergence
Secant method:
- This is similar to the Newton-Raphson method, but doesn't require differentiation. Instead, two points are connected to create an approximation for the tangent to the curve. The -intercept of this tangent then creates the next point
- 1) Start with two -estimates; and . They can be either straddling the root or with both on the same side of it
- 2) Calculate with
- You must memorize this equation. The order of the subscripts is 0110 10
- In terms of and :
Quick secant method on a Casio calculator:
- Enter and save to memory slot A
- Enter and save to memory slot B
- Use the secant formula with As and Bs (e.g. for ):
- Press =
- Now save this to slot C
- Copy the contents of slot B to slot A [ALPHA+B, STO+A (note: don't press ALPHA before pressing A on the second step)]
- Copy the contents of slot C to slot B [ALPHA+C, STO+B (same applies here)]
- Use the up arrow (if you followed the above steps exactly you'll need to press it 3 times) to return to the equation in terms of A and B
- Now repeat again from the step 'press ='
- Summary: save to A and to B. Enter the equation and press =. Save the answer to slot C. Copy slot B to A and then C to B. Return to the original equation, press = and repeat.
False position (linear interpolation) method:
- This method uses two starting approximations, one each side of the root
- It then connects them with the line to approximate a tangent, and uses the intersection of that line with the -axis as the next value. This value is used alongside whichever starting approximation is on the opposite side of the root to it - so a change of sign check is required after each iteration
- and are used as the approximations, the root must between these two values
- The formula is the same as with the secant method:
- After applying this formula, check the sign on , and and use , and either or (the signs must be different)
- This method has first order convergence
Fixed-point iteration method (rearranging to form):
- 1) Rearrange the equation, e.g. into the form
- 2) Now use this as an iterative formula; , repeating for the necessary number of iterations
- If the value of diverges from the root, try another rearrangement - this method only works when
Errors
v1-5 Notation:
- is the symbol for an approximation of
Error:
- Error
- Absolute error
- Relative error
- Absolute relative error
- Percentage error
Intervals:
- The interval 1.25 ≤ ≤ 1.35 can be written as [1.25, 1.35]
- The interval 1.25 ≤ < 1.35 can be written as [1.25, 1.35) - the bracket represents greater than/less than, and square bracket is greater than or equal to/less than or equal to
Function error propogation:
- If there is an error in , then will also contain this error. The will be the error in multiplied by . As a formula this is written as
- For example, if we know that ,
- So the median value is
- The upper bound is approximately
- If we don't have the original function definition, can be approximated with the above formula
Numerical differentiation
c1-2 The forward difference method:
- This method calculates the gradient of a tangent drawn to the curve at the point . To measure the gradient of the tangent, it uses a second point
- where is a small number
- As decreases, the approximation will become more accurate provided that can be calculated to a high accuracy
The central difference method:
- This method instead calculates the gradient of a line drawn through and
Numerical integration
c3-4 The midpoint rule:
- This method splits the curve into equal width strips, makes each strip a rectangle up to the height of the curve, and sums the area of each rectangle
- Use where is the number of strips and is the strip width
- is usually a power of , starting at
- This is a second-order method, because absolute error is proportional to . Therefore, doubling would reduce the error by a factor of
The trapezium rule:
- This method creates trapezia of equal width touching the curve, and sums their areas
- Use the formula where is the number of strips, is the width of each strip and is ( is the lower bound of the integral)
- A shortcut is to use the relationship . With this method, you only need to compute the first trapezium rule estimate provided that you have more midpoint rule estimates
- Like the midpoint rule, this method is also second-order
Simpson's rule:
- The midpoint rule is about twice as accurate as the trapezium rule for strips
- The midpoint and trapezium rule estimates will straddle the exact answer
- These two properties can be used to derive the Simpson's rule formula to more accurately determine the value of the integral without increasing the strip count
- The following can also be derived:
- Simpson's rule is fourth-order. In other words, doubling would reduce the error by a factor of
- With two successive Simpson's estimates, the formula will extrapolate it to infinity for the absolute best estimate with this strip count [coursework only, not required in the exam]
Approximations to functions
f1-2 Newton's forward difference interpolation:
- This method is used to create a polynomial equation to fit a set of points which are equally spaced in the axis
- The coordinates are called and the coordinates for these values are called
- 1) Create a finite difference table as shown below:
Continue this for as many columns as necessary until you reach a value of .
If all of the values in are equal, then the polynomial is of th order - 2) Now use Newton's interpolating polynomial:
- Remember that you may not have to simplify this if you are only asked to find for a value of - just substitute this value into the unsimplified interpolating polynomial
Lagrange's method:
- This method does not require equally spaced points
- Lowercase letters are used to represent coordinates and uppercase letters represent coordinates: e.g.
- For a quadratic,
- With higher order polynomials, the above can be extended (e.g. for a cubic, the first term would be )
- In the exam, the required degree will be where is the number of points