


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Computing Techniques; Subject: Mechanical Engineering; University: Georgia Institute of Technology-Main Campus; Term: Fall 2016;
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Numerical Integration
We all experienced significant problems with t-square the last two times assignments were due. The support staff has identified that the problems originated with the tool “Assignments Auto- Submission”. As a result, they have disabled the auto-submission feature. It will therefore be your responsibility to submit. So, as previously, you can upload your zip-file using the save as draft, but you will have to go back and click the final “Submit” button otherwise your assignment will not be submitted. Remember, though, once you hit the “Submit” button, you can not go back and upload an updated version. Because of the large number of students in ME2016, we cannot accept revised versions after you have submitted.
In this assignment, you will implement and test two numerical integration algorithms: Trapezoidal and Simpson 1/3 integration. After implementing the two integration algorithms you will compare their performance to the built-in Matlab function quad().
The learning objectives of this assignment are:
In this assignment, the focus is on the implementation of several numerical integration methods. The goal is to implement these algorithms efficiently in Matlab and to compare their performance – that is: How does the absolute error change as a function of the number of segments? You need to implement the Trapezoidal and Simpson 1/3 integration methods in such a way that they are both fast and flexible to use. Program execution speed is crucial in this assignment because we will be using the algorithms many times and for different numbers of segments (up to 10 6 segments for a single integral).
Task 1: Create the functions trapezoidal_integration_XYZ and simpson_integration_XYZ (where XYZ are your initials) To make it easier to perform the integration for different numbers of segments, start by implementing the trapezoidal and Simpson 1/3 integration rules as separate functions. Each function should have the following inputs and outputs: Inputs:
Outputs:
Be careful when implementing the “multiple-application” version of the Simpson Rule: The number of segments should be a multiple of 2 for Simpson 1/3. If the user provides a number of segments that does not fit this requirement, you can end the integration scheme with one application of the Simpson 3/8 rule as described in example 21.6 of Chapra and Canale (pg. 602).
Task 2: Write a script integration_accuracy_XYZ (where XYZ are your initials) for comparing the accuracy of your integration functions The script should solve for the integral using three methods: 1) the trapezoidal rule, 2) Simpson’s 1/3 rule, and the Matlab function quad(). You should use as a test case the following integral (It is best to implement this as an anonymous function as you did in HW4): 2
0
In order to compare the performance of the different integration algorithms, you should run all three of them with different values for the number of integration segments. This will allow you to interpret the convergence rate of the algorithms. To help you make this interpretation, you should generate a figure that plots the true error as a function of the number of segments on a log-log scale. Since the purpose is to test our implementations, we have chosen an integral for which we know the solution – this will allow you to compute the absolute error exactly:
10 1 10 2 10 3 10 4 10 5 10 6 10
10
10
10
10
10
10
10
10
number of segments
absolute error
trapezoidal simpson 1/ quad()
NOTE: it is best to use the “Save Draft” feature on t-square. This will allow you to resubmit as many times as you want anytime before the deadline. At the deadline, t-square will automatically submit the current draft — no action is required on your behalf.
Remember that the deadline for this assignment will be strictly enforced. After the deadline has passed you will receive a late-penalty. Don’t wait until the last minute to get started! We repeat here the policy that is included in the syllabus:
Late Submission T-square will be set up such that late submissions cannot be submitted electronically. We will accept late homework but with the following penalties. Submit by noon Saturday and receive 20% off of your grade. Submit by noon Sunday and receive 40% off. After noon on Sunday, no more partial credit will be awarded. If you are submitting late, e-mail the electronic version and bring a hardcopy to the office of your instructor (Section A: [email protected], IPST 378; Sections C&D: [email protected], MARC 256). If you plan on submitting late, a quick e-mail by the deadline would be appreciated so that we can make appropriate plans for grading your assignment.
We would like to re-emphasize the policy on collaboration. Collaboration is encouraged. Discussing the assignments with your peers will help you to develop a deeper understanding of the material. However, “discussing the assignment” does not mean solving it together; it does not mean asking your friend to debug your code for you. I encourage you to discuss how to approach the problem, which Matlab functions to use, or how to interpret the results, but I do expect each student to turn in a report and Matlab functions that reflect the student’s individual work. Do not copy code from another student. Do not copy parts of other electronic documents. In general, an activity is acceptable if it promotes learning by you and your peers. For example, you learn from discussing alternate solution approaches with your friend, but you don't learn from blindly copying your friend's code. To avoid any confusion, each homework solution should explicitly identify the students with whom you collaborated and what the extent of the collaboration was. Any copying on homework and/or exams will be dealt with severely and reported to the Dean of Students – No exceptions. If you have questions about this collaboration policy, do not hesitate to ask your instructor.