Complete the implementation of the secant method

Assignment Help Computer Engineering
Reference no: EM131097588

E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 2

You will want to download and inspect the assignment.zip archive from the course website before answering these questions. Please submit a zipfile to the course Moodle page which contains a PDF writeup with answers to questions 1 and 2, and source code for question 3.

1. Associativity of addition

The hw2_sum.py program shows that adding two small lists of floating point numbers that differ only in their order may produce two different numerical results.

a. Why does this happen?

b. What does this imply about the associative property of floating point addition?

c. What other algebraic properties are similarly "funny" for floating point numbers? Give examples if you can.

2. Instability of numerical differentiation

Later in the course we will learn more about numerical approximations to the derivative. For now, it is sufficient to say that the derivative of some function f(x) can be well approximated by

f'(x) ≈ f(x+h) - f(x-h)/2h

for some small step size h.

The hw2_diff.py program illustrates this by repeatedly computing the first, second, third, etc. derivatives of sinpxq numerically, and comparing the computed value to the true function values of cos(x), -sin(x), -cos(x), etc.

A funny thing happens in the program - after just a few iterations, the answer seems to "blow up" with huge numerical errors.

a. What makes this happen? Is this a gradual process or a sudden one?

b. Explain why replacing np.float32 with np.float64 delays-but does not eliminate-the blowup.

c. Explain why the same is true for cutting down the step size h by a factor of 4.

3. Root finding

Modify the hw2_rootfinding.py code to perform the following tasks:

a. Complete the implementation of the Secant Method so the tests run correctly to find the roots of the example functions provided.

b. Ditto for Newton's method.

c. Add a test case in the functions list to define some function f(x) for which the Bisection method outperforms Regula Falsi (i.e. uses significantly fewer iterations). Add a comment in your program indicating why Bisection works better for this function.

d. Add a test case for which the Secant Method fails to converge, but Bisection search converges. Again, add a comment in your program indicating why this happens.

Attachment:- Assignment.zip

Reference no: EM131097588

Questions Cloud

Describe job compensated with incentive pay : Describe a job compensated with incentive pay in your company. What performance evaluation metric is used, and how is it tied to compensation? Does this compensation scheme align the incentives of the employee with the goals of the company? Estimate ..
What is the break-even quantity of this monopoly : A monopolistic firm faces the following demand curve. Q = 8000 -10 P This monopoly's cost function has been estimated as follows: TC = 480,000 + 40 Q. What is the break-even quantity of this monopoly? What would be its profit if it maximized its reve..
Discuss and critique the concluding paragraphs : Respond to Peers (due Monday, Day 7): In 125 to 200 words each, discuss and critique the concluding paragraphs of at least two of your classmates. Please identify, analyze, and discuss the following:
Prepare an interim innovation corporate action plan : Provide a report that compares and contrast the different generic innovation cycles. Include a table that summarizes the attributes of these innovation cycles. Minimum length = 400 words.
Complete the implementation of the secant method : E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 2. Complete the implementation of the Secant Method so the tests run correctly to find the roots of the example functions provided
List the basic register/memory transfers and operations : List the basic register/memory transfers and operations that occur during each clock cycle for the following program
Phonological awareness-phonemic awareness and phonics : Identify some good activities to help children explore these skills. Be sure to identify each activity as either phonological/phonemic awareness or phonics. Where did you find each activity?
Some activities for building alphabet awareness : What learning activities should early childhood teachers provide to children to help prepare them for reading?
Determine the operations reqltired to instruct the data path : Determine the operations reqltired to instruct the data path

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Frame problem of traveling one city to another as production

Explain how problem of traveling from one city in one country to another city, located in another country, could be framed as a production system. What are the states? What are the productions?

  Program in java that identifies the color underneath

writing a program in JAVA that identifies the color underneath the mouse pointer and fills a JFrame with that color, and displays the RGB values of that color.

  Establish separation of duties via role assignment

Setting security for each employee based on the specific role provides the tightest and most personalized security. The trade-off is increased amount of administration effort when setting up the specific roles to use and the access permitted for ea..

  How we can implement a cardiac machine simulator in c++

Keep track of the bug location; which could be an index into the memory array. Watch out for cells 0 and 99; they are special. Read the input tape from a file that starts with a number telling you how various items are on the tape.

  Question 1interpret the case study underneath and answer to

question 1interpret the case study underneath and answer to the questions that followunited parcel service throughout

  Laws and regulation in telecommunications field

What gives the federal government the right to regulate the Telecommunications arena, and what is the purpose of laws and regulations. Do you think we need laws and regulation in the telecommunications field at all? Why or why not?

  You have been asked to be the project manager for the

you have been asked to be the project manager for the development of an information technology it project. the system

  Carlisle carpets wants a program to calculate carpet costs

carlisle carpets wants a program to compute carpet costs. create the logic for a program that prompts the user for two

  Benefit of web-based computing environment

Web-based applications like e-commerce and e-government exemplify the platform shift from the client/server computing to the Web-based computing so for this essay question.

  Find a regular expression for the language

Find a regular expression for the language over {a, b} that consists of all strings containing exactly one occurrence of substring ab.

  Download an image from the online companion web site

Download an image from the Online Companion Web site or find out an image of your own. Add text around the image. Experiment with the float property and its values to view the way that the text wraps.

  Discuss the advantages of the approach

Briefly explain the main problem addressed and why you have found it interesting - Classify to which topic from the aforementioned areas this paper belongs.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd