Você está na página 1de 19

Faculty of Mechanical Engineering NOOR SYAHADAH BINTI YUSSOFF 2008407362 EMD5M1B MEC 500: Numerical Method with Application

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.

Approximate Error (Ea) = Present Approximation Previous Approximation

iii) Stopping Criterion: Since

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,

, for each approximation. Comment on the results.

Answer: ( )

Zero order, ( )

( ( )

) ( )

( )

( ) True Error, Et = True Value Approximation = = ( )

( )

True value,

= Approximation + Error = = ( )

True percent Error,

= = =

First order,

( )

For

, ( ) ( ) ( )

) ( )

( )

( )

Substituting

True Error, Et

= True Value Approximation = = ( )

True value,

= Approximation + Error = =

True percent Error,

= = =

Second order,

( ) =

For

the second derivative is evaluated at ( ) ( )

( ) (

( ) )

( ) 2

Substituting = True Value Approximation = = ( )

True Error, Et

True value,

= Approximation + Error = =

True percent Error,

= = =

Third order,

( )

For

the second derivative is evaluated at ( )


( ) ( )

( )

( )

( Substituting = True Value Approximation = = ( )

( )

( )

True Error, Et

True value,

= Approximation + Error = =

True percent Error,

= = =

The inclusion of the second and third derivatives results in exactly the same equation we started with; ( ) Where the remainder term;
()

because the fourth derivative of a third-order polynomial is zero.

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,

( )
(

( ) ) ( )

( ) ( )

True percent Error, | | = = =


( ) ( ) ( ( ) ) ( )

Backward,

( )

( ) ( )

True percent Error, | | = = =


( )

Centered,

( )
(

( ) ( ( )

(
)

) ( )

True percent Error, | | = = = ( )


( )

To estimate the first derivative of

the centered difference

approximation will used to get the value more accurately.

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

Use the following notation for the x-values:

eq.2 Substitute eq.1 in eq.2 ( ) ( ) ( ) ( )

When ( ) ( ) ( ) ( )

Then, ( ) ( )

2d.

Using incremental search, prove that function three roots between and

( )

has

Initial guess for this function is

and

First iteration;

( (

) ) (

( ) ( ) )

( ) ( ( ) )

( ) ( )

( ) ( )

( )

Root is in upper interval

Second iteration;

( ( (

) ) ) (

( ) ( ) )

( ) ( )

( ) ( ( )

( ) ) ( )

Root is in lower interval

Third iteration;

( ( (

) ) ) (

( ( )

) )

( (

) ) ( )

( (

) )

( (

) )

Root is in upper interval

Fourth iteration;

) (

( ) ( )

) (

( ) (

) ( )

( )

) (

( )

) ( )

Root is in upper interval

sign change in calculation, so there is the root between

and

2e.

Use MATLAB to graphically locate all roots of function ( ) . Clearly indicate all roots on the plot of the graph.

2f.

Use Bisection method, conduct four iterations with initial guesses of

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;

( ( ( ) ) ( (

) ) )

( (

) ) (

) ( )

) ( )

root is in lower interval

Second iteration;

( ( ( ) ) ( (

) ) )

) ( (

( ) )

) (

( )

) (

( )

root is in upper interval

Third iteration;

( ( ( ) ) ( (

( )

) ( (

( ) )

) (

( )

) (

( )

root is in upper interval

Fourth iteration;

( ( (

) ) ) (

( ( )

) )

( (

) ) ( )

( (

) )

( (

) )

root is in lower interval

So, the highest root of the function is

2g.

Use the Newton-Raphsons method and with an initial guess of

, try estimate

the highest root ( ) propose solution to this problem?

. Give your comment on what happens and

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:
( )

. The first derivative of the function

which can be substituted along with the original

starting with an initial guess of

, this iterative equation can be applied to compute:

) ( )

) ( )

) ( )

) ( )

Based on the calculation above, the value of

and

was the same which is 2.0 if we start with

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 .

( ) ( )

( ) ( )

( )

) (

( )

) (

( )

) (

( )

) (

( )

) (

( )

) (

( )

) (

( )

) (

( )

2h. Use MATLABs fzero function to determine all roots of ( )

Você também pode gostar