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

  Questionthere was a sport in air craft on independence day

questionthere was a sport in air craft on independence day. on the air two aircrafts are in the air parallel to

  Describe stages of the processor

Describe the decode stage and Describe the execution stage of add, andi, mul, divi, and neg.

  Clyde and betty penley were married in 1949 in late 1967

clyde and betty penley were married in 1949. in late 1967 clyde operated automotive tire business and betty owned an

  Questionyour companys it department experiences a great

questionyour companys it department experiences a great deal of conflict in connection with its projects. there is a

  Questionfirst national banks president congratulates you on

questionfirst national banks president congratulates you on successfully managing her network addressing issues. she

  The purchase of hardware for the organization

What are important considerations for an organization to make while disposing of old computer equipment.

  Questionsuppose you are designing a hardware prefetcher for

questionsuppose you are designing a hardware prefetcher for unblocked matrix transposition code above. the simplest

  Make ajax programming based solutions to write a code

In the AJAX scripts you create, refer to the DSN datasource as flamingo. although its not in your own folder or directory, it has been set up as a SYSTEM DSN, so your AJAX script will have access to it.

  Write program that inputs a word representing binary number

Write a program that inputs a word representing a binary number (0s and 1s). First your program should verify that it is indeed a binary number, that is the number contains only 0s and 1s.

  Describing the car structure

Write down a definition statement which describes a Car structure variable initialized along with the following information: Make: Ford Model: Mustang.

  How does holy spirit work within us as believers

In examining Albert Bandura: Social Cognitive Theory, "Internal Factors in Self-Regulation". There are three main factors presented (1) Self-observation, (2) Judgmental Processes, (3) Self-Reaction in answering this what does God's Word teach us a..

  Write a program based on encryption scheme

Write a program based on encryption scheme.

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