Ask Other Engineering Expert

Numerical Methods - Assignment

Robustness of numerical methods

Problem.

Devise a robust and efficient scheme for finding all simple roots of a given (real nonlinear scalar) equation f (x) = 0 in a given interval x ∈ [a, b].

Background. Important qualities of numerical methods, in addition to convergence, are

(a) efficiency - requires a small number of function evaluations;

(b) robustness - fails rarely, if ever;

(c) minimality - uses a minimal amount of user input, e.g. does not require the derivative in addition to the function.

No single method meets all criteria. For instance, the Newton-Raphson map g[f ](x) is guaranteed to converge quickly if the initial iterate x0 is "close enough" to a simple root so that gxj [f](x0) < 1.

However, convergence is only local and the neighbourhood of convergence is difficult to assess ahead of time for a given f(x). In contrast, the bisection method is slow but it is guaranteed to converge provided only that a bracketing interval is found on which f(x) changes sign. A natural idea, then, is to combine the two in a fast and robust hybrid method.

Question 1. Write a MATLAB function [ai,ci,bi] = bisect(f, ai, bi, niter) to per- form the interval bisection method for a given function f on an interval given by its left and right ends ai and bi. The MATLAB function must check if f (x) changes sign in the interval and if so perform a specified number of iterations niter and then return the estimated root in ci and the left and right ends of the bracket where it is located in ai and bi; else return in ci a NaN MATLAB object.

Question 2. Write a MATLAB function ci = newtonraphson(f, x0, tol) to perform the Newton-Raphson method for the function f starting from initial iterate x0. The function must check if the absolute value of the derivative of the Newton-Raphson map at x0 is less than unity, and if so perform iterations and return in ci the estimated root; else return in ci a NaN value. To avoid non-essential input all derivatives needed must be computed using the finite-difference formula gprim = (g(x + eps)-g(x -eps))/(2*eps), where eps=1e-5. Use xk xk-1 < tol(1 + xk ) as a stopping condition for iterations; what is your interpretation of this condition?

Question 3. Write a MATLAB function rts=findroots(f,a,b,n,tol) to combine the bisection and the Newton-Raphson methods as follows. Uniformly partition the given inter- val [a, b] into n intervals of equal length. For each subinterval [ai, bi] over which the function changes sign use 3 bisection steps to approach the root more closely calling your bisect. Next, call your newtonraphson to perform Newton-Raphson iterations if the method con- verges, otherwise revert back to the last bisection bracket and apply 3 further bisection steps. Loop until the stopping condition f (xk) < tol is met. Return in the array rts all roots found.

Question 4. Write a MATLAB script Q04.m where the function findroots is used to find all of the roots of the Chebyshev polinomials Tn(x) of degrees n from 1 to 20 with tolerance tol=1e-12. In one figure, plot all roots found on the abscissa axis versus the polynomial degree on the ordinate axis. In a second figure, plot together the graphs of all Chebyshev polinomials Tn(x). For the polynomial T15 compare the roots found numerically with the known exact solutions and print the absolute error in each root in the format of the following example.

Roots and their Errors for the Chebyshev polinomial T[5]:
-9.51056516295153531182e-01 +0.00000000000000000000e+00
-5.87785252292473137103e-01 +0.00000000000000000000e+00
+3.21265594383589607162e-17 +9.33588993957266210749e-17
+5.87785252292473137103e-01 +1.11022302462515654042e-16
+9.51056516295153531182e-01 +0.00000000000000000000e+00

[Hint: you may use fprintf with format +30.20e'.]

Further hints and directions.

1. Since this Assignment is largely a programming exercise, it is essential to include all MATLAB codes in the pdf files of your report. Explain the steps your codes perform, list the variables used.

2. MATLAB codes for the interval bisection method and the Newton-Raphson method appear in our MATLAB lecture notes and in past Assignments. Feel free to modify these.

3. Do not use MATLAB inbuilt root-finding functions such as roots and fzero.

4. The definition and the exact roots of the Chebyshev polinomials are given in section 2.3.2 of the Lecture Notes.

5. Formatted output can be printed to screen or file e.g. by fprintf(' +30.20e +30.20e \n', [array1; array2]).

6. Write code in a"bottom-up" approach - implement the building blocks first; then test and verify for one equation; then loop over many equations.

7. While writing code it is useful to include MATLAB statements to compute and print out errors, orders of convergence and otherwise monitor what you code does.

Other Engineering, Engineering

  • Category:- Other Engineering
  • Reference No.:- M92499048
  • Price:- $90

Priced at Now at $90, Verified Solution

Have any Question?


Related Questions in Other Engineering

Register design a cpu register is simply a row of

Register design A CPU register is simply a row of flip-flops (i.e. SR, JK, T, etc) put side by side in an array to make the size of register required. For example, an 8 bit register has 8 flip-flops side by side for stor ...

A detailed review of spatial modulation and simulation

A Detailed Review of Spatial Modulation and Simulation Learning Outcomes a. Learn how to model mobile communication channels d. Discern knowledge development and directions on the recent advances in 4G to the research pr ...

Mine safety amp environmental engineering assignment -part

Mine Safety & Environmental Engineering Assignment - Part 1 - Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the fo ...

Projectflow processing of liquor in a mineral refining

Project Flow Processing of Liquor in a Mineral Refining Plant The aim of this project is to design a flow processing system of liquor (slurry) in a mineral (aluminum) refining plant. Aluminum is manufactured in two phase ...

Learning outcomes evaluate multiuser communication and

Learning Outcomes Evaluate multiuser communication and resource sharing techniques; Apply the techniques of, and report on, digital communication applications using Matlab and hardware devices. Assignment Description The ...

Operations engineering assignment -please select only one

Operations Engineering Assignment - Please select only one of the following case studies for your assignment: CASE A. Tesla Motors Tesla is an innovative manufacturer that designs, assemble and sells fully electric vehic ...

Select a risk problem from the list below and prepare a

Select a risk problem from the list below and prepare a risk management plan in accordance with AS/NZS ISO 31000:2009. Please ensure that: - Establish the context clearly, in accordance with the Standard; - Define your s ...

Engineering materials term paper assignment -conduct a

ENGINEERING MATERIALS TERM PAPER ASSIGNMENT - Conduct a thorough literature search and write a 15-20 page technical review paper on the evolution of the engineering materials used in the manufacturing of any one of the f ...

Task 1using the lab kit design a circuit for the processor

Task 1: Using the lab kit, design a circuit for the processor to control the output of a connected 7-segment LED display device. You will be provided with a standard common anode 7-segment display of the type FND-507 (or ...

Control theory - lab reportsfor experiments 1 to 4 you must

Control Theory - Lab Reports For experiments 1 to 4 you must undertake the following: a) At the start of each section (including the pre-lab activities) there are a number learning outcomes. That is, what students should ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As