Engineering ComputationFall 2007

COMPUTER ASSIGNMENT NUMBER 1

Due 8:00 AM, Friday, October10, 2007

Modern spreadsheet software is very useful for simple engineering calculations and generating graphs; the next few computer assignments will make use of spreadsheet programs. If you are a beginner with spreadsheets, you may wish to make use of the handout entitled, "Introduction to Spreadsheets: Using Microsoft Excel," which you can download from the course website Or you can use the recommended paperback text by Kuncicky, Introduction to Excel (2nd Edition)

. There should also be copies of program documentation for Excel in each of the campus facilities where the program is available.

Computer Assignments are to be submitted electronically no later 8:00 AM.

Learning Objectives

1.Become familiar with use of spreadsheets for numerical calculations and graphics.

2. Observe the effect of step size and order on convergence of a Taylor Series approximation.

Assignment

Many numerical methods and error estimates use Taylor Series to expand a function about x:

We often express the order of the truncation error as O(hn), in which h is the step size and n–1 is the number of terms retained in the series. This assignment explores why, even if h > 1.0, the more terms included in the series, the more accurate the solution in many cases.

Create a spreadsheet to estimate f(x+h) using a Taylor series about x = a for the function

f(x) = exp(1+x).

Set up the spreadsheet so that both a and h are inputs that may be easily varied. Design a neat and readable format for the spreadsheet. After the header on the spreadsheet, the body of the spreadsheet should include at least 6 columns containing --

(A)the term no. i (for i ranging from 0 to 11, i.e., include 12 rows in your spreadsheet),

(B)the factorial value (remember that 0! = 1),

(C)the value of the individual ith term,

(D)the value of the Taylor Series approximation with i terms,

(E)the approximate error in %, and

(F)the true error in %.

Create two plots. (Both plots may appear on a single graph). The first should plot the value of the ith term versus i, and the second should plot the value of the series with i terms versus i.

Try values of a = 1 and h = 3, and vary h to smaller and smaller values (say down to 0.01) to see the effect of step size h on convergence. Type your concise observations directly into the spreadsheet.

Note: A convenient way to enter extended text in Excel (not required) is the following:

  1. Select a row (preferably one with nothing else on it).
  2. Select a set of cells in that row that spans the length of a line that would be visible in the spreadsheet,
  3. Select Format/cells
  4. Choose the Alignment Tab and select "Wrap text," "Merge cells," and set the Vertical alignment to “Top.”
  5. Type the text into the merged cell as continuous text (no carriage returns or tabs)
  6. Increase the vertical size of the row to fit the number of lines in the text by choosing Format/Rows/Height and entering the height (typically about 4 pts more than the font size used per line of text, e.g., for 11-pt text, use a row height of 15 pts per line of text in the cell).

What to Submit and How to Submit It

This assignment should be done individually, because teams will not have been formed in time for you to work together. Submit the spreadsheet and charts in a single workbook. Name the file using you Network ID, followed by an underscore, the number of the computer assignment, and the extension ".xls". For example, if your NetID is xyz22, the file you submit would be named: xyz22_1.xls.

  • You name and NetID should be included within the spreadsheet as per the guidelines on Computer Assignments in the Course Information page of the course website
  • State and/or describe the problem briefly in the next few lines of the spreadsheet.
  • Clearly mark the variables to be supplied by the user.
  • Clearly label all variables in the spreadsheet.
  • Format the table to show all significant figures particularly when differences from row to row are small.

Enclose your workbook as an attachment to an e-mail message addressed to

Be sure to use the MIME format for the enclosure. With the Eudora mailer, this is directly called “MIME” on Windows but is referred to as “AppleDouble” on the Mac. It can be set for all message attachments:

Mac: Under the “Special” menu (submenu “Switches” on Windows, “Settings.../Attachments” on Mac).

PC:Select Tools/Options from the pull-down menu. In the Options window, scroll to the attachment icon on the left and select it. Select the MIME format on the right.

Page 1 of 2