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

  Efficiency and effectiveness of project communications

An effective communication strategy is absolutely essential for achieving effective project integration management. Any time the aim is to integrate numerous concurrently operating activities, the role of communication becomes central. This is as ..

  Describe the memory and paging sim

Your goal here is to use the simulators to understand these different types of memory caches. To do this, you need to run each type of simulator and document/explain what it is doing. For the three the cache simulators, you need to compare and con..

  Cashregister requires to support a method void undo()

imagine the CashRegister needs to support a method void undo() that undoes the addition of the preceding item. This enables a cashier to quickly undo a mistake. What instance variables should you add to the CashRegister class to support this modif..

  Questionwrite down a function that creates a cell array and

questionwrite down a function that creates a cell array and structure array and populate them with data about element

  How far should you be willing to push the ethical

will you personally and/or your company be criminally liable if you did.

  In what ways itil framework minimize the impact of change

ITIL stands for the Information Technology Infrastructure Library. ITIL is the international de facto management framework describing "good practices" for IT Service Management.

  How to create a quality management plan

Listing the  business and IT risks specific to developing and operating a web site to sell appliances over the Internet.

  What will the swap macro

What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile?

  Design model below to complete

Use the KCT design model below to complete this case.CUSTOMER(CustomerID, FirstName, LastName, Street, City, State, Zip, Phone)RENTAL(RentalID, RentalDate, NumberOfDays,

  Estimating average access time of system

The hit ratio for read accesses only is 0.9. A write-through procedure is used. Explain the average access time of system taking only memory read cycles?

  Write a program that reads the data from the file mydata.txt

Write a program that reads the data from the file 'mydata.txt', saves it in an array of structures and finally prints the array of structures to the monitor.

  What benefits the network provide

Explain what kind of network you are on at work or at home. If you do not have access to a network, ask a friend or family member to explain the type of network they have access to.

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