| |
Homework assignments posted here are subject to correction in class or
through other means. Problems as assigned here are for your convenience
but are not a substitute for obtaining assignments in class.
Assignments as issued in class supersede these assignments unless otherwise
noted.
Homework Assignment: 1 2
3 4 5 6
7 8 9 10
11 12 13
14 15
Computers, Computations, and Chemical (& Mechanical) Engineering
Spreadsheets have become ubiquitous.
So have search engines and the World Wide Web. This assignment requires that you
put the two together in order to identify points at which chemical engineering
meets spreadsheet usage.
Your task is to identify at least five applications of spreadsheets to
chemical engineering. Now, just any
five applications will not do! You
should attempt to locate five "unusual" or especially interesting applications
of spreadsheets to chemical or mechanical engineering. These can be commercial or freely
available.
Prepare a list of the five applications, including a title of the
application, a URL where I might read more about it, and a brief description of
what the spreadsheet does for engineers. An example of one item on such
a list might be:
Costing Distillation Towers (http://www.fortunecity.com/campus/german/207/towers.html)
This spreadsheet add-in facilitates preparation of preliminary size and cost
estimates for distillation columns. Distillation columns are used to separate
the components of mixtures based on differences in boiling point.
Note that a term which you might not have known was defined. You should be
prepared to discuss your listed applications in class, which means you should
know (or look up) the meaning of words you use! The most unusual or interesting
engineering application of a spreadsheet (as judged by the instructor)
shall be rewarded with a trifle.
Submit your list in electronic format (Word file, Excel spreadsheet, PDF
file, text file, or plain text in the body of an email) by e-mail to SilverDL@engr.uky.edu
prior to the start of class on Wednesday, January 14.
Assignment Learning Objective:
-
Explore uses of spreadsheets in engineering, and maybe learn some engineering vocabulary while
doing so
Reading Assignments:
Just Getting Warmed Up
Within a single workbook, create a spreadsheet to solve each of
the following problems from your text. Solve each problem on a separate
worksheet. Label each worksheet to correspond with the assignment problem.
Change the color of the cells containing the answers to the questions asked.
E-mail me the complete spreadsheet, saving it with the filename "yourlastname
HW2.xls", where you substitute your last name for the italicized characters.
Submit a printout of your sheets at the start of
class on the due date.
From Chapter 1 of Engineering with Excel, 3rd Ed.:
Problems 3, 4
Assignment Learning Objectives:
Reading Assignments:
Engineering Graphics
Within a single workbook, create a spreadsheet to solve each of
the following problems from your text. Solve each problem on a separate
worksheet. Label each worksheet to correspond with the assignment problem.
Change the color of the cells containing the answers to the questions asked.
E-mail me the complete spreadsheet, saving it with the filename "yourlastname
HW3.xls", where you substitute your last name for the italicized characters.
Submit a printout of your sheets at the start of class on the due date.
P1.
Download the file called data.txt from the
course website. Import this column delimited data into a spreadsheet and plot.
Make sure you label the axes appropriately.
From Chapter 2: Problem 5 From Chapter 3: Problems 2,
4
Notes:
On problem 4, note that the table of data is available electronically. You
should practice copying and pasting from a web page to begin this spreadsheet.
Assignment Learning Objectives:
-
Import data from a delimited data
file
-
Prepare x-y plots of tabular data
-
Use trendlines to analyze data
-
Use editing skills, AutoFill, and formulas to
perform engineering calculations
Reading Assignments:
-
Monday (1/26): Sections 3.1-3.9
-
Wednesday (1/28): Chapter 4 (Workshop 3, HW3 Due, HW4 Assigned)
Formula for Grownups
Within a single workbook, create a spreadsheet to solve each of
the following problems from your text. Solve each problem on a separate
worksheet. Label each worksheet to correspond with the assignment problem.
Change the color of or outline the cells containing answers to the questions
asked. E-mail me the complete spreadsheet, saving it with the filename "yourlastname
HW4.xls", where you substitute your last name for the italicized characters.
Submit a printout of your sheets at the start of
class on the due date.
From Chapter 4: Problems
2, 8, 9, 11
Notes:
- On problem 2, the relationship between fluid average
velocity (v), volumetric flow rate (V), and diameter is
.Make sure your units
match! Also, express your final answer in inches. You may use the Excel
"convert" function or use conversion factors.
- Problems 8 and 9 are linked and may be solved on the same
worksheet if desired. Keep in mind that plots are described as "Y vs. X"
when deciding how to make the plot in problem 9.
You should make use of the IF() function in problem 9 so that you use the
same formula regardless of whether h<hcone or not.
- Problem 11 waits until the end of the problem statement
before giving you your input data. Make sure you design your spreadsheet
appropriately. Refer back to the previous chapter for problems involving the
ideal gas law. The molar volume is obtained by dividing the volume of gas by
the number of moles of gas present. You must watch your units on this
problem!
Assignment Learning Objectives:
-
Use Excel functions to perform
complex calculations using formulae
-
Practice designing spreadsheets
involving graphs and advanced functions
-
Use conditional statements when
creating spreadsheets
-
Ensure calculations are performed
using dimensionally consistent terms
Reading Assignments:
-
Monday (2/09):
Chapter 5
(Matrix basics) , WS3
-
Wednesday (2/11): Complete Chapter
5 Study (HW4 Due, HW5 Assigned)
Simultaneously Watching All "Matrix" Movies Is
Hazardous To Your Health
Within a single workbook, create a spreadsheet to solve each of
the following problems from your text. Solve each problem on a separate
worksheet. Label each worksheet to correspond with the assignment problem.
Change the color of or outline the cells containing answers to the questions
asked. E-mail me the complete spreadsheet, saving it with the filename "yourlastname
HW5.xls", where you substitute your last name for the italicized characters.
Submit a printout of your sheets at the start of
class on the due date.
From Chapter 5: Problems
2, 5, 7
Notes:
-
Problem 7 will require that you
write the equations you need. If you can do this, you will be prepared for a
key part of CME 200! Keep in mind that in all of these cases you are
equating all of a chemical coming in with that same chemical going out.
After all, where else is it going to go?
Assignment Learning Objectives:
-
Use Excel
functions to determine whether a set of simultaneous liner equations can be
solved
-
Solve systems of simultaneous linear algebraic
equations using matrix inverse methods
-
Apply matrix functions within spreadsheets
-
Write mass balances for simple chemical
engineering processes
Reading Assignments:
-
Monday (2/16):
Chapter 6,
Linear Regression (Workshop 4)
-
Wednesday (2/18): Complete
Chapter 6 Study (HW5 Due, HW6 Assigned); Begin Chapter 9
Is This Class Following A Trend? Another Iteration of Homework
Within a single workbook, create a spreadsheet to solve each of
the following problems from your text. Solve each problem on a separate
worksheet. Label each worksheet to correspond with the assignment problem.
Change the color of or outline the cells containing answers to the questions
asked. E-mail me the complete spreadsheet, saving it with the filename "yourlastname
HW6.xlsx", where you substitute your last name for the italicized characters.
Submit a printout of your sheets at the start of
class on the due date.
From Chapter 6: Problems
5, 7 From Chapter 9: Problems
3, 7, 9
Notes:
-
On problem 6.5, the definition of heat
capacity is given in terms of the partial derivative. When you have multiple
variables in a derivative, this terminology allows you to declare all but the
variable of current interest to be constant to enable the derivative to be
evaluated (more technical explanations will wait for Calculus III.) You should
read that partial derivative as the slope of a plot of specific enthalpy versus
temperature.
-
On problem 6.7, use a value for R of
8.314 J/(mol K). Make sure you report the heat of vaporization in the correct
units. Note that T is the absolute temperature, not pressure as printed in some
editions. This means that you will need to add 273 to temperatures listed in
degrees C to convert them to K. Note that the actual value of the latent heat of
vaporization of water is about 40.7 kJ/mol at 100 oC.
-
On all regression problems, make sure your plot
allows for comparison of experimental data with regressed curves
-
On problem 9.3, note that the equations are not
listed in the order you need them this time. Be wary of units. Also note
that the numerical value of R is actually 8.314.
-
On problem 9.7, the data on the textbook website
may be difficult to import. Allow yourself time to type the required data.
Also, it may be advisable to run Solver several times until the values for
the constants stop changing.
-
On problem 9.9, note that the problem ends just
before it says "Rework the linear-programming application example...". That
is actually the beginning of problem 10.
Assignment Learning Objectives:
-
Perform linear regression on a
set of experimental data in a spreadsheet
-
Use the slope and intercept reported
to determine physical constants
-
Exercise engineering judgment in
analyzing the results of a regression
-
Use Excel's Solver to identify
solutions to algebraic equations
-
Perform non-linear regression
using least squares error criterion optimization and Solver
-
Perform a constrained linear
optimization using Solver
Reading Assignments:
-
Monday (2/23): Chapter 9 (Iterative Solutions) (Workshop 5)
-
Wednesday (2/25): Complete Chapter 9 study (Workshop 6)
-
Monday (3/2): Excel Finale HW6 Due, Project Assigned
-
Wednesday (3/4): Exam 1: Excel and Numerical Methods
Skip
This one this term.
Within a single workbook, create a spreadsheet to solve each of the following
problems from your text. Solve each problem on a separate worksheet. Label each
worksheet to correspond with the assignment problem. Change the color of or
outline the cells containing answers to the questions asked. E-mail me the
complete spreadsheet, saving it with the filename "yourlastname HW7.xlsx", where
you substitute your last name for the italicized characters. Submit a printout
of your sheets at the start of class on the due date.
Notes:
Assignment Learning Objectives:
Reading Assignments:
-
Thursday (2/28): Excel Finale,
Workshop 6
-
Tuesday (3/4): Matlab Fundamentals, HW7 Due,
HW8 Assigned
-
Thursday (3/6): Exam 1: Excel and Numerical
Methods
Matlab is My Hero
For each of these problems, make sure you submit a printout of your m-file
and the relevant results (tables, plots). Also, submit your m-file
electronically.
From your Matlab text:
3.5, 3.11, 4.5, 4.6
Assignment Learning Objectives:
- Write scripts to perform basic arithmetic and matrix operations in
Matlab
- Use intrinsic functions in Matlab
- Prepare two-dimensional plots in Matlab
Reading Assignments:
- Monday (3/16): Matlab Text (Chapters 1-2); Fundamentals, HW8 Assigned
- Wednesday (3/18): Matlab Text (Chapters 3-4); Functions and Plots
- Monday (3/23): Matlab Text (Chapter 5); Programming in Matlab, HW8 Due, HW9
Assigned
- Wednesday (3/25): Matlab Text (Chapter 6); Matrix Operations, Solving
Linear Systems
- Friday (3/27): Excel Project Due
- Monday (3/30): Matlab Text
(Chapter 8); Interpolation and Regression
- Wednesday (4/01): Iterative Methods in
Matlab
- Monday (4/06): Matlab Finale
- Wednesday (4/08): Excel text pp. 257-294
(Recording macros in Excel)
- Monday (4/13): Exam 2: Matlab and Numerical Methods
Matlab, for the Best Calculations of Your Life
For each
of these problems, make sure you submit a printout of your m-file and the
relevant results (tables, plots).
Also,
submit your m-files electronically.
From your Matlab text:
6.3, 6.11, 6.14a
4.
You may have noticed that the SLOPE() function within the Excel calculates the
slope using linear least squares regression for a set of data without
restricting the y-intercept of the regressed line. In some cases, like on your
first project, you would prefer to force the y-intercept to a value of zero. In
this case, the expression used to calculate a slope with a zero intercept is
given by:
where
a is the slope of the equation y=ax+0.
Write a Matlab function to calculate the slope of an equation given a vector of
x-data and a vector of y-data. To test your function, repeat your analysis for
Project 1 for just the first set of experimental data. Compare your result using
your function with the value of k calculated using the Excel SLOPE()
function.
Assignment Learning Objectives:
-
Write Matlab scripts including interactive
input and formatted output
-
Write custom functions in Matlab
-
Use conditional statements and loops in Matlab
-
Solve systems of linear equations in
Matlab using matrix inverse methods
Reading Assignments:
- Monday (3/23): Matlab Text (Chapter 5); Programming in Matlab,
HW8 Due, HW9 Assigned
- Wednesday (3/25): Matlab Text (Chapter 6); Matrix Operations,
Solving Linear Systems
- Friday (3/27): Excel Project Due
- Monday (3/30): Matlab Text (Chapter 8); Interpolation and
Regression, HW9 Due, HW10 Assigned
- Wednesday (4/01): Iterative Methods in Matlab
- Monday (4/06): Class Meeting to be rescheduled
- Wednesday (4/08): Excel text pp. 257-294 (Recording macros in
Excel), HW10 Due, HW11 Assigned
- Monday (4/13): Exam 2: Matlab and Numerical Methods
For each of these problems, make sure you submit a printout of your m-file
and the relevant results (tables, plots). Also, submit your m-file
electronically.
From Your Previous Assignments:
Repeat the following problems using Matlab functions and scripts.
HW6: Repeat problem 6.5 from your Excel text.
HW6: Repeat problem 9.3 from your Excel text. Note that you must perform all
of the SRK related calculations within a function file, since this function is
too complex for inline use.
From Your Matlab Text:
8.3, 8.6a
Assignment Learning Objectives:
-
Use Matlab to determine regression parameters for linear and
polynomial regression
-
Solve single variable functions in Matlab
-
Perform interpolation using Matlab functions
Reading Assignments:
- Wednesday (4/01):
Iterative Methods in Matlab
- Monday (4/6):
Class Meeting to be rescheduled
- Wednesday (4/8): Excel text pp. 257-294 (Recording macros in Excel),
HW10 Due, HW 11 Assigned
- Thursday (4/10):
Exam 2: Matlab and Numerical Methods
Get With The Program
Within a single Excel document, create a worksheet to solve the following
problem from your text. Work from top to bottom. Change the color of or outline
the regions containing answers to the questions asked. E-mail me the complete
spreadsheet, saving it with the filename "yourlastname HW11.xlsm", where
you substitute your last name for the italicized characters. You should submit a
printout of your spreadsheet and the macro module at the start of class on the
due date.
From Engineering with Excel, Chapter 12: Problem
6
- Note that in some printings of the text, the last term in equation 7.9
is printed as dT2. It should be
dT3.
Assignment Learning Objectives:
Reading Assignments:
- Monday (4/13): Exam 2: Matlab and Numerical Methods
- Wednesday (4/15): Excel text pp. 511-526 (VBA), HW 11 Due, HW 12
Assigned
- Friday (4/17): MATLAB project due by 12:00PM
Back to Top
Within a single Excel document, create a worksheet to solve the following
problem from your text. E-mail me the complete spreadsheet, saving it with the
filename "yourlastname HW12.xlsm", where you substitute your last name for the
italicized characters. In class, submit both a printout of the worksheet and the
function code you develop.
From Engineering with Excel, Chapter 14: Problems
3,
4
Make sure you test your solutions, compare with hand
calculations, and comment on your code.
Assignment Learning Objectives:
-
Complete a
function involving conditional statements
-
Write a function to perform a task previously written as a subprogram
Reading Assignments:
- Friday (4/17): MATLAB project due by 12:00PM
- Monday (4/20): Power Programming text pp. 1-30 (VBA)
- Wednesday (4/22): Power Programming text pp. 32-54, HW12 Due, HW13
Assigned
- Monday (4/27): Excel text, pp. 530-566
- Wednesday (4/29): Power Programming text Chapters 7, 8
- Monday (5/4): Original Date for Comprehensive Final Exam (1:30-3:30)
The schedule will change as we adapt to the modified calendar.
When Intrinsic Is Just Not Good Enough
E-mail me your completed spreadsheets,
saving them with the filename "yourlastname HW13_#.xlsm", where you
substitute your last name for the italicized characters and the problem number
for #. You should submit a printout of your spreadsheets and the function
code for each problem at the start of class on the due date.
1.
Ever wonder how computer programs calculate things like trigonometric
functions? Typically, they use the things you learned (or will learn) about in
your calculus course. In the case of trigonometric functions, one common way is
using a “power series” approximation of a function (you’ll learn about this in
Calculus 3). For cos(x), that approximation is given in simplified form
as an infinite series:
If you
expand the series a few terms, it looks like this:
Write an
Excel function, Cosine, to calculate the cosine of an angle
given the
angle in radians and the number of terms to expand the series. You may call
an Excel function to evaluate the factorial term in the formula. You should test
your results with a combination of some hand calculations and comparison
with the values returned by the intrinsic Excel
COS() function. You should also
check the input to make sure
it is valid before your function performs calculations. Some limits on those
inputs might be determined through experimentation with your function. You must
explicitly declare variable types. How many terms are required to give an
answer for cos(p/4)
valid to 6 significant figures?
Submit
your code and a worksheet including sufficient examples indicating your function
works. Your spreadsheet should be readable without using the electronic file
(the reader should know what formula is used in a cell). Give 2 examples of
verification of results using hand calculations.
2.
We’ve discussed in class how to solve
non-linear algebraic equations using Newton’s method. To summarize, you need
three things to start. A guess for the solution x, the function for which you
are trying to find the root, f(x) = 0, and the derivative of that
function, f´(x)
= 0, Given that guess, you can approximate a new guess where the function will
cross the x-axis using the slope of the function at that point. This
relationship between your old and new guess is given by:
To find the actual root, you would repeat the process numerous times, until you
decided that the improvement between your old and new guesses wasn’t big enough
to worry about. That stopping point for this loop process is called a
convergence criterion. Two basic types of convergence criterion make sense for
this iterative solution. The first is called an absolute criterion, because it
depends on the absolute difference between successive iterations:
.
This is often an unsatisfactory criterion, since an appropriate value for the
criterion,
e,
depends on the magnitude of x. A preferred criterion, a relative
convergence criterion, is given by:
This version essentially gives you the fraction by which successive guesses
vary. There are guidelines as to what a reasonable value of the criterion,
e,
should be, but a suitable choice here is
e
=10-4.
You are
provided a template for this assignment on the course web site. Download and
save this spreadsheet, renaming it according to the filename given above. When
you open the spreadsheet you will notice a button. This button calls a
subprogram that in turn calls a function. Your job is to complete an Excel
function to implement Newton’s method. The button subprogram is attached to each
of the worksheets, but the function you will edit is attached to a module.
The variant type for the function enables us to return a string error
message if, for example, our solver was unable to converge after, say, 100
iterations.
It
should include error checking prior to a possible divide by zero and
continue to function properly even when a division by zero would occur. The
function must limit the number of iterations and report an error if that
number of iterations is exceeded. Additional instruction is contained in the
comments in the template code. Submit your code and the two worksheets for which
you should test your function (the worksheets are already complete). The first
worksheet is for the problem we used in class when talking about Newton’s
method, and the second is for a challenging problem for this method with an
initial guess of zero:
After proving your iteration counter is working for this second case, select a
better starting point to successfully find a root to this function.Assignment Learning Objectives:
-
Write a custom function involving both conditional statements and for…next
loops (1)
-
Check inputs to a function for validity (1)
-
Call Excel worksheet functions from a VBA function (1)
-
Use a Do loop in a function (2)
-
Check calculations for possible errors before computing (2)
Reading Assignments:
- Wednesday (4/22): Power Programming text pp. 1-30 (VBA), HW12 Due, HW13
Assigned
- Monday (4/27): Power Programming text pp. 32-54
- Wednesday (4/29): Power Programming text Chapters 7, 8, HW13 Due
- Monday (5/4): Statistics and Tables in Excel
- Wednesday (5/6): Course Review
- Monday (5/11): Comprehensive Final Exam (1:30PM-3:30PM)
Its Much Easier The Second Time
Within a single Excel document, create a worksheet to solve the following
problem from your text. E-mail me the complete spreadsheet, saving it with the
filename "yourlastname HW12.xls", where you substitute your last name for the
italicized characters. In class, submit both a printout of the worksheet and the
function code you develop.
From Engineering with Excel, Chapter 8: Problems
3,
4
Make sure you test your solutions, compare with hand
calculations, and comment on your code.
Assignment Learning Objectives:
- Write Matlab scripts including interactive input and formatted output
- Write custom functions in Matlab
- Use conditional statements and loops in Matlab
- Solve systems of linear equations in Matlab using matrix inverse methods
Reading Assignments:
- Tuesday (4/17) Matlab Text (Chapter 6); Matrix Operations, Solving
linear systems
Workshop
- Thursday (4/19) Matlab Text (Chapter 8); Interpolation and Regression
HW14 Due, HW15 Assigned
Its Much More Pleasant the Last Time
When Intrinsic Is Just Not Good Enough
Within a single Excel document, create a worksheet to solve the
following problem. E-mail me the complete spreadsheet, saving it with the
filename "yourlastname HW10.xls", where you substitute your last name for the
italicized characters. In class, submit both a printout of the worksheet and the
function code you develop.
You may have noticed that the SLOPE() function
within the Excel calculates the slope using linear least squares regression for
a set of data without restricting the y-intercept of the regressed line. In some
cases, like on your second project, you would prefer to force the y-intercept to
a value of zero. In this case, the expression used to calculate a slope with a
zero intercept is given by:
,
where is the slope of the equation y=ax+0.
Write an Excel function to calculate the slope of an
equation given a vector of x-data and a vector of y-data. You may find it easier
to work the problem by hand first and then sketch a flowchart before programming
the function. To test your function, repeat your analysis for Project 1 for just
the first set of experimental data. Compare your result using your function with
the value of k calculated using the intrinsic SLOPE() function.
Reading Assignments:
- Tuesday (4/24) Iterative Methods in Matlab, Workshop
- Thursday (4/26) Course Wrap-up,
HW15 Due
- Tuesday (5/1) Review,
Project 3 Due
- Thursday (5/3) FINAL EXAM (1:30-3:30)
|