Investigate issues of accuracy and iterative refinement

Assignment Help Computer Engineering
Reference no: EM131097571

E19: Numerical Methods for Engineering Applications Spring 2016 - PROJECT 1

Project: Estimating π-

OVERVIEW

In this project, you will strengthen your programming skills and investigate issues of accuracy and iterative refinement by implementing several simple numerical methods to estimate the constant π.

TASKS

Integration via Riemann Sums. Implement a function intpi(n) that estimates π by computing the integral

π = 401√(1-x2) dx

The integral should be approximated using the following formula:

01f(x) dx ≈ Δx i=0n-1f(xi)

where ?x = 1/n and xi = ?x · i.

Report the output of your function for n = 128, 256, 512, 1024, 2048, and 4096. Also report the true relative error (relative to the constant numpy.pi), as well as approximate relative error given the current estimate and previous estimate (for each value of n after the first one).

Taylor Series. The Maclaurin series (that is, the Taylor series expansion about zero) of the inverse tangent function is given by

Arctan(x) = x - x3/3 + x5/5 - x7/7 + x9/9 · · ·

Using the fact that

π = 4 arctan(1)

implement a function tspi1(n) that estimates π using the first n terms of the Maclaurin series above. Output the estimates for n = 1 through 20. For each estimate, have your program output the approximate relative error given the current and previous estimates, and the true relative error given the actual value of π.

It turns out that a superior method (discovered in 1706 by John Machin1) instead computes

π = 16 arctan (1/5) - 4 arctan (1/239)

Implement another function tspi2(n) that estimates π using the first n terms of the Maclaurin series given the Machin formula. Again, record your program's output for n = 1 through 20 with approximate and true relative errors.

WHAT TO TURN IN

You should submit a zip file containing all of your programs' source code, and a short PDF writeup containing the output of your program and which addresses these points:

  • Describe your approach to implementing each algorithm (about 1-2 paragraphs each).
  • Plot the true error versus the step size ?x for the Riemann sum implementation. Please use a log-log plot.
  • Comment on why the Machin formula is more accurate than the initial formula which computes arctan(1), in terms of Taylor series and truncation error.

Reference no: EM131097571

Questions Cloud

Efficient logic when you write the program : Write a class called AssignmentFive with the following methods. All input and output on the command line NO dialog boxes. Remember to use the most efficient logic when you write the program.
Create a structural hdl description for the data path : Use the earlier test bench to simulate the controller/data path system to verify correct behavior.
Provide a description of the american quality engineering co : Provide a description of the company that you work for. As part of your description include a discussion of the type of organizational structure.
What immanuel kant means by metaphysics of morals : Explain what Immanuel Kant means by Metaphysics of Morals (4 paragraphs). To do this, you will have to discuss the division of sciences as Kant presents it.
Investigate issues of accuracy and iterative refinement : E19: Numerical Methods for Engineering Applications Spring 2016 - PROJECT 1. In this project, you will strengthen your programming skills and investigate issues of accuracy and iterative refinement by implementing several simple numerical methods t..
Which of the following are legal single-cycle data path : Subtract data from two memory locations and store the result in another memory location.
Performs a11 alu operation on any two memory locations : Trace through the execution of this operation, as illustrated in Figure 8.3.
What would happen to the median : A group of people had their body fatness measured. The mean and standard deviation was 38% ± 4%. If there was a measurement error and the heaviest person went from 40% fat to 50% fat, what would happen to the median?
What are the policies easterly cites as desirable : Government Policies What are the policies Easterly cites as desirable? Conversely, what are some of the ways in which "Governments Can Kill Growth," as the chapter title put it?

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