Assignment Numec
Assignment Numec
Assignment 01
Question 01 1a. Briefly describe round-off and truncation errors and measures to reduce these errors in practice? Answer: Round-off errors Originate from the fact that computers retain only a fixed number of significant figures during a calculation. Numbers such as , e, or cannot be expressed by a fixed
number of significant figures. Therefore, they cannot be represented exactly by the computer.
Truncation errors
are those that result from using an approximation in place of an exact mathematical procedure.
was introduced into the numerical solution because the difference equation only approximates the true value of the derivatives.
1b.
Briefly describe the terms true error, approximate error and stopping criterion.
Answer:
i) True Error: True error,Et is the difference between the true value in a calculation and the approximate value found using a numerical method etc. True Error, Et = True Value Approximate Value (+/-)
ii) Approximate Error: Approximate error,Ea is defined as the difference between the present approximation and the previous approximation.
an
iterative
method
computes
successive
approximations to the solution of a linear system, a practical test is needed to determine when to stop the iteration. Ideally this test would measure the distance of the last iterate to the true solution, but this is not possible. Instead, various other metrics are used, typically involving the residual.
A good stopping criterion should 1. identify when the error is small enough to stop,
2. stop if the error is no longer decreasing or decreasing too slowly 3. Limit the maximum amount of time spent iterating.
1c.
Use zero through third-order Taylor series expansions to predict f(6) for ( ) using a base point at . Compute the true percent relative error,
Answer: ( )
Zero order, ( )
( ( )
) ( )
( )
( )
True value,
= Approximation + Error = = ( )
= = =
First order,
( )
For
, ( ) ( ) ( )
) ( )
( )
( )
Substituting
True Error, Et
True value,
= Approximation + Error = =
= = =
Second order,
( ) =
For
( ) (
( ) )
( ) 2
True Error, Et
True value,
= Approximation + Error = =
= = =
Third order,
( )
For
( )
( )
( )
( )
True Error, Et
True value,
= Approximation + Error = =
= = =
The inclusion of the second and third derivatives results in exactly the same equation we started with; ( ) Where the remainder term;
()
Consequently, the Taylor series expansion to the third derivative yields an exact estimate at
( )
( )
( )
( )
1d.
Use forward, backward and centered difference approximations to estimate the first derivative of ( ) size of Evaluate the derivative at using step
. Compare the result with the true value of the derivative. Interpret the
result on the basis of the remainder term of the Taylor series expansion. True Value, ( ) ( ) ( )
= = = ( ) = ( )
Solution:
) =( = ) ( ) ( )
( ) =( ) ( ) ( )
) =( = ) ( ) ( )
Forward,
( )
(
( ) ) ( )
( ) ( )
Backward,
( )
( ) ( )
Centered,
( )
(
( ) ( ( )
(
)
) ( )
Question 02
2a.
In Finding roots of equations, briefly describe, how do we determine all the possible roots of an equation?
One method to obtain an approximate solution is to plot the function and determine where it crosses the x axis. This point, which represents the x value for which f(x) = 0, is the roots. Although the graphical methods are useful for obtaining rough estimates of roots, they are limited because of their lack of precision. Numerical Method such as fixed point iteration, The Newton-Raphson method, bisection method and so on, is an alternative approach that be used trial and error.
2b.
Roots finding using open methods such as Newton-Raphson and Secant methods may Sometimes NOT converge to the true values. Describe the procedure for checking of the possibility of convergence of open methods.
The procedure for checking of the possibility of convergence of open methods can be depicted graphically. We graphed a function to visualize its structure and behavior. An alternative graphical approach is to separate the equation into two component parts, can be plotted separately. The x values corresponding to the intersections of these functions represent the roots of f(x) = 0.
2c.
Newton-Raphson formula given below is based on first order Taylor expansion of the function f(x) about xi . Derive the Newton-Raphson formula using the second order Taylor expansion of the function f(x) about xi.
Answer: Let ( ) For the derivation of the formula used for solving a one-dimensional problem, we simply make a firstorder Taylor series expansion of the function F(x) ( ) ( ) ( ) eq.1
When ( ) ( ) ( ) ( )
Then, ( ) ( )
2d.
Using incremental search, prove that function three roots between and
( )
has
and
First iteration;
( (
) ) (
( ) ( ) )
( ) ( ( ) )
( ) ( )
( ) ( )
( )
Second iteration;
( ( (
) ) ) (
( ) ( ) )
( ) ( )
( ) ( ( )
( ) ) ( )
Third iteration;
( ( (
) ) ) (
( ( )
) )
( (
) ) ( )
( (
) )
( (
) )
Fourth iteration;
) (
( ) ( )
) (
( ) (
) ( )
( )
) (
( )
) ( )
and
2e.
Use MATLAB to graphically locate all roots of function ( ) . Clearly indicate all roots on the plot of the graph.
2f.
and
to locate the highest root of the function and compute the percentage approximation relative error. Problem statement. Use bisection method with four iterations with initial guesses of and to locate the highest root of the function.
First iteration;
( ( ( ) ) ( (
) ) )
( (
) ) (
) ( )
) ( )
Second iteration;
( ( ( ) ) ( (
) ) )
) ( (
( ) )
) (
( )
) (
( )
Third iteration;
( ( ( ) ) ( (
( )
) ( (
( ) )
) (
( )
) (
( )
Fourth iteration;
( ( (
) ) ) (
( ( )
) )
( (
) ) ( )
( (
) )
( (
) )
2g.
, try estimate
Problem statement. Use the Newton-Raphson method to estimate the highest root of ( ) , employing an initial guess of can be evaluated as function into equation: ( ) ( ) to give:
( )
) ( )
) ( )
) ( )
) ( )
and
initial guess of 2.0. If we wrongly choose the initial guess, the problem cannot be settled. So, the best solution to this problem is we start the estimating highest root with initial guess of .
( ) ( )
( ) ( )
( )
) (
( )
) (
( )
) (
( )
) (
( )
) (
( )
) (
( )
) (
( )
) (
( )