ME 292
Fall 1999
Mechanical Engineering Computer Applications
Instructor: Dr.
Melvin R. Corley
Textbook: An
Introduction to Numerical Methods in C++, B.H.
Flowers, Oxford, 1995, ISBN 0-19-853863-4
Supplementary Text: Elementary Numerical Methods and C++,
M.R. Corley. (Available for cost of duplication from College
Discount Supply, Ruston)
Syllabus last revised on November 2, 1999
Click here
to view errata in PDF format.(Revised 12/22/1998)
Click here to download
program listings from the book. (Revised 04/20/1999)
Class Schedule
- Introduction and Organization
- F 09/03: Introduction, Course
Policies, Coding
Standards, Computer
Program Report Format, Course
Educational Objectives, DJGPP
software installation instructions,
programming tools for C++
- Program #1 (due 09/10) Write a C++
program patterned after the one on page 1 of your
textbook that introduces yourself to the
instructor. The program should supply your name
and a few facts about yourself, such as where you
are from, what previous programming experience
you have had, and other interesting stuff. The
purpose of this assignment is see if you can
successfully install and run the C++ compiler and
follow the coding and report standards for the
course.
- M 09/06: Labor Day Holiday
- C++ Basics
- W 09/08: Writing the first
program (pp. 1-19)
- F 09/10: Constants and variables,
data types (Notes)
- Program #2 (due 09/17) Write a C++
program that illustrates common mathematical
operations involving
int,
float,
and double
data types. Create int variables ia = 1, ib = 2, and ic = 3; float
variables fa = 1.0,
fb = 2.0,
and fc = 3.0;
and double
variables da = 1.0,
db = 2.0,
and dc = 3.0.
Your program should print out the results of
several different expressions using the addition,
subtraction, multiplication, and division
operators with these variables. Be sure to
include some expressions that involve integer
division. Your discussion of results will be very
important for this program.
- M 09/13: Expressions (pp. 20-25)
- W 09/15: Statements (pp. 25-30)
- F 09/17: Selection and
Repetition (pp. 30-37)
- Program #3 (due 09/27) You are
given the task of designing an industrial drying
oven. Material that is 99% water is placed in the
oven in 100 lbm batches. How many pounds of water
must be removed for the moisture content to be
reduced to 98%? Find the solution to this problem
by setting up a repetition structure that
successively subtracts a fixed amount of water
until the desired moisture content is reached.
Print a table of the moisture percentage as a
function of the amount of water removed.
- M 09/20: Repetition statements (pp.
30-57)
- W 09/22: Functions (pp. 37-52)
- F 09/24: Passing function
arguments (pp. 37-52)
- M 09/27: Working with projects (Notes)
- Program #4 (due 10/04) The
Maclaurin series expansion for sine(x) is:
sine(x)= x - (x**3)/3! + (x**5)/5! - (x**7)/7! +
. . .
Write a C++ program that uses functions to
compute this series two different ways. The first
method simply computes each term as it is written
and adds it to the total. (Note: you will have to
write a factorial function.) The second method
should exploit the fact that each succeeding term
can be calculated by multiplying the preceding
term by -x**2/(n*(n+1)). Test your program by
computing the sine of 30, 60, 90, 450, 810, and
1170 degrees using 5, 10, 20, 40, and 60 terms of
the series, respectively.
- W 09/29: EXAM #1 (Here's
a practice exam for your reference.)
- Programming and Fundamentals of Numerical Error Analysis
- F 10/01: Truncation and Roundoff Error (pp.
53-65)
- M 10/04: Introduction to C++ classes for
numerical computing (pp. 90-199)
- Program #5 (due 10/11) You wish
to measure the rainfall of an approaching
thunderstorm, but all you have available is a
galvanized pail having the following dimensions:
base diameter - 8.5 inches, top diameter - 11
inches, height - 10 inches. Recognizing that the
tapered wall of the pail will produce an
inaccurate reading, you choose to make a
calibrated depth gage for the bucket. Write a C++
program that will determine how far from the end
of the gage you would place marks corresponding
to rainfall amounts in increments of 0.5 inch.
- Roots of non-linear equations
- W 10/06: Bracketing and Iterative Methods (pp.
66-82)
- F 10/08: Roots of Polynomials (pp. 82-89)
- Direct Solution of Linear Equations
- M 10/11: Gaussian Elimination (pp. 200-211)
- Program #6 (due 10/20) Matrices
are used extensively in computer graphics
applications. For a brief introduction, click here.
Write a C++ program that uses the
enmvec
and enmmat
classes to construct a transformation matrix that
will transform a 1 by 1 rectangle originally
centered at position (6,0) so that its new center
is at (-3,7). As the rectangle is moved, it grows
in size by a factor of 2 and also rotates 15
degrees counterclockwise about its own center.
Print out a sequence of transformation matrices
that will accomplish this task and show the
coordinates of the four corners of the rectangle
after each step of the transformation. Construct
a composite transformation matrix that does the
entire sequence in one step. Print this matrix
and apply it to the original data and show that
the transformed rectangle is the same as the one
obtained using the step by step approach.
- W 10/13: LU Decomposition (pp. 211-222)
- Iterative Solution of Systems of Equations and Eigenvalue
Problems
- F 10/15: Introduction to Classes
- M 10/18: Jacobi and Gauss-Seidel Iteration
(pp. 232-242)
- Matrix Eigenvalue Problems (cont'd)
- W 10/20: Power and Inverse Power Method (pp.
243-255)
- Program #7 (due 10/27) A digital
flowmeter samples the water velocity in a 12-inch
schedule 40 cast iron water main every 5 minutes.
Write a C++ program that will use the thirteen
velocity measurements (ft/sec) below taken over a
one-hour period to calculate the number of
gallons of water supplied by the water main.
DATA: 3.2, 3.8, 4.4, 4.5, 4.5, 5.2, 5.0, 5.4, 5.5,
5.2, 5.0, 4.8, 4.7
- F 10/22: Jacobi Rotation and Householder
Methods (pp. 256-272)
- Interpolation and Data Fitting
- M 10/25: EXAM #2
- W 10/27: Interpolation and Data Fitting (pp.
273-290)
- Program #8 (due 11/03) Write a C++
program that will find the coefficients of the
least-squares polynomials of degree zero through
twelve for the data used in Program #7. Plot the
original data and the three best least-squares
polynomial approximations (in your opinion).
Justify your choices of the best curve fits. Do
not use MathCad to generate publication quality
plots! Spreadsheets such as Excel and Quattro
generate much more professional looking plots.
- Differentiation and Integration
- F10/29: Sorting (pp. 290-296)
- M 11/01: Differentiation and Newton-Cotes
Integration (pp. 326-337)
- Ordinary Differential Equations
- W 11/03: Adaptive Integration and Gaussian
Integration (pp. 338-372)
- Program #9 (due 11/12)
- F 11/05: Single Step Methods (pp. 371-382)
- Applications of Initial Value Problems
- M 11/08: Runge-Kutta Methods (pp. 382-389)
- W 11/10: Multi-Step Methods (pp. 389-402)
- Boundary Value Problems
- F11/12: Shooting Method & Finite
Difference Method (pp. 396-427)
- M 11/15: EXAM #3
-
| EXAM #1 |
20% |
| EXAM #2 |
20% |
| EXAM #3 |
25% |
| Homework and Computer Problems |
35% |
Useful pointers for this course:
Thanks for visiting the Louisiana Tech ME 292 home page. I
hope you will visit again soon.