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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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