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

  List minimum five non-computer related businesses

List minimum five non-computer related businesses where software has a significant, if 'behind the scenes' impact.

  How agile processes adapt to embrace

Explain the difference between change control and version control.

  Circle any of the given which offer persistent byte storage

question 1 circle any of the following which offer persistent byte storagecpu flash memory hard drive random access

  In a four- to five-page paper analyze a business task that

in a four- to five-page paper analyze a business task that you would like to computerize. consider how you could use

  Importance of monitoring system performance

Describe in your own words the purpose of all user interfaces, whether command or menu driven and explain the importance of monitoring system performance and why Windows make this information available to the user.

  Http frame

Assume an HTTPS page links to an HTTP iframe where two are loaded from several origins. Should the browser display a warning dialog? If so describe why. If not, describe why not.

  List and in brief describe the five-component model of an

list and briefly explain the five-component model of an information system. how can you use them?your response should

  How to identify areas for improvement

plan a form that you would disseminate to your end user community that will aid in the assessment of a current system to identify areas for improvement.

  How to run and modify marie program

How to run and modify marie program Include a decision before storing and outputing result. If  value of the result is not positive (so zero or negative), set  Result value to the value ZERO (0)

  How big is the minimum value of n0 now

Locate the minimum value of n0 that works and how big is the minimum value of n0 now?

  Questionthere are eight cars in every team called chevy and

questionthere are eight cars in every team called chevy and ford. one car from each team races its opponent on drag

  How to use a sorting algorithm

Prompt the user for name and age of a group of people. The group's size is unknown at first , so the program must keep asking the user if they want to enter more data.

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