DOC PREVIEW
TAMU PETE 301 - 301.505.Lab6_Situ_E

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

(This sheet must be included with your work submission)Required Academic Integrity Statement: (Texas A&M University Policy Statement)Coursework Copyright Statement: (Texas A&M University Policy Statement)Lab Assignment Coversheet(This sheet must be included with your work submission)Required Academic Integrity Statement: (Texas A&M University Policy Statement)Academic Integrity StatementAll syllabi shall contain a section that states the Aggie Honor Code and refers the student to the Honor Council Rules andProcedures on the web.Aggie Honor Code"An Aggie does not lie, cheat, or steal or tolerate those who do."Upon accepting admission to Texas A&M University, a student immediately assumes a commitment to uphold the Honor Code, to accept responsibility for learning and to follow the philosophy and rules of the Honor System. Students will be required to state their commitment on examinations, research papers, and other academic work. Ignorance of the rules does not exclude any member of the Texas A&M University community from the requirements or the processes of the Honor System. For additional information please visit: www.tamu.edu/aggiehonor/On all course work, assignments, and examinations at Texas A&M University, the following Honor Pledge shall be preprintedand signed by the student:"On my honor, as an Aggie,I have neither given nor received unauthorized aid on this academic work."Aggie Code of Honor:An Aggie does not lie, cheat, or steal or tolerate those who do.Required Academic Integrity Statement:"On my honor, as an Aggie, I have neither given nor receivedunauthorized aid on this academic work." Evan Situ ____________(Print your name) Evan Situ __________(Your signature)Coursework Copyright Statement: (Texas A&M University Policy Statement)The handouts used in this course are copyrighted. By "handouts," this means all materials generated for this class, which include but are not limited to syllabi, quizzes, exams, lab problems, in-class materials, review sheets, and additional problem sets. Because these materials are copyrighted, you do not have the right to copy them, unless you are expressly granted permission.As commonly defined, plagiarism consists of passing off as one’s own the ideas, words, writings, etc., that belong to another. In accordance with this definition, you are committing plagiarism if you copy the work of another person and turn it in as your own, even if you should have the permission of that person. Plagiarism is one of the worst academic sins, for the plagiarist destroys the trust among colleagues without which research cannot be safely communicated.If you have any questions about plagiarism and/or copying, please consult the latest issue of the Texas A&M University Student Rules, under the section "Scholastic Dishonesty."Lab Assignment Grading Rubric(This sheet must be included with your work submission)Criteria PointsAdherence to the SPE Style Guide & Petroleum Engineering Handbook / 10Grammar/Professionalism / 5Completeness of Literature Review / 15Completeness of Introduction / 10Completeness of Methodology / 15Completeness of Discussion / 15Completeness of Conclusions / 10Completeness of References / 10Completeness of Nomenclature / 10Final Grade /100Numerical methods concepts that are used during the lab are Central Difference Approximation and the Richardson Extrapolation. Figure 1 shows the implementation process of the Central Difference Approximation. In that particular figure, the equation to calculate the Central Difference Approximation of the first-order derivative of f(x) is at the right corner of the f(x) versus x plot. Results from the Central Difference Approximation are later used for the implementation of the RichardsonExtrapolation Approximation of the first-order derivative of f(x). Figure 2 displays the equation of the Richardson Extrapolation Approximation of the first-order derivative of f(x). Fig. 1 – Implementation of the Central Difference ApproximationFig. 2 –RichardsonExtrapolation Approximation Equation IntroductionThe purpose of this lab is to understand how two sophisticated, numerical methods called Central Difference Approximation and the Richardson Extrapolation Approximation are implemented. This is accomplished by approximating the first-order derivative of f(x) using both numerical methods at 18 different step sizes. MethodologyHere is the code executed during the lab. Option ExplicitSub Lab_06() Dim x As Double, h As Double, Error1 As Double, Error2 As Double, dfx_h1 As Double Dim dfx_h2 As Double, i As Double, Fx_central As Double, Fx_rich As Double x = ThisWorkbook.Worksheets("Data").Cells(2, 3) 'Central Difference For i = 1 To 18 h = ThisWorkbook.Worksheets("Data").Cells(3 + i, 2) Fx_central = (f_x(x + h) - f_x(x - h)) / (2 * h) Error1 = Abs(Fx_central - d_fx(x)) With ThisWorkbook.Worksheets("Results") .Cells(6 + i, 2) = h .Cells(6 + i, 3) = Fx_central .Cells(6 + i, 4) = Error1 End With Next i 'Richardson Extrapolation For i = 1 To 17 With ThisWorkbook.Worksheets("Results") dfx_h1 = .Cells(6 + i, 3) dfx_h2 = .Cells(7 + i, 3) Fx_rich = (4 / 3) * dfx_h2 - (1 / 3) * dfx_h1 Error2 = Abs(Fx_rich - d_fx(x)) .Cells(7 + i, 5) = Fx_rich .Cells(7 + i, 6) = Error2 End With Next iEnd SubFunction f_x(x As Double) As Double f_x = Exp(0.5 * x)End FunctionFunction d_fx(x As Double) As Double d_fx = 0.5 * Exp(0.5 * x)End FunctionFirst, an executable Sub using a For loop is created to generate the Central Difference Approximation and the Richardson Extrapolation results for all values of h. For the Central Order approximation, h is reduced by a factor of two until the effect of round-off error is present in the log-log plot of absolute true error versus h. As Double are used for functions, variables, arguments, and constants to store real (non-integer) numbers. Next, the value of x is read from a cell in the “Data” worksheet,and the cell is labeled in the worksheet. The same is done for the values of h. Furthermore, a VBA function is concocted to evaluate the function f(x). In addition, the approximate value of f’(x) is outputted to the “Results” worksheet, and the columnfor that approximate value of f”(x) is labeled. Later, a table of the absolute true error in f’(x) as a function of h for the Central Difference Approximation is


View Full Document

TAMU PETE 301 - 301.505.Lab6_Situ_E

Documents in this Course
Load more
Download 301.505.Lab6_Situ_E
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view 301.505.Lab6_Situ_E and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view 301.505.Lab6_Situ_E 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?