Hi I have this mini project do only mini project one, all instructions provided with details in the pdf
EML3041: Computational Methods
Semester and Year
Fall 2020
Due Dates
Mini project 1 - Monday, September 28 at 2 PM
Mini project 2 – Monday, November 16 at 2PM
Title
Cooling the Aluminum Cylinder Experiment to Illustrate Use of Numerical Methods
Points
200 Points
Learning Objectives
• Identify the correct procedure to solve a given problem
• Implement a programming procedure for a given problem
• Improve existing programming skills of debugging, documentation, loops and
conditional statements
• Write your own numerical methods programs
• Reinforce prerequisite knowledge of programming and college mathematics
• Solve real-world problems
Page 2 of 12
Background of the Experiment
A solid aluminum cylinder treated as a lumped-mass1 system is immersed in a bath of iced
water. Let us develop the mathematical model for the problem to find how the temperature
of the cylinder would behave as a function of time.
When the cylinder is placed in the iced-water bath, the cylinder loses heat to its
surroundings by convection.
Rate of heat loss due to convection =ℎ??(??(??) − ????). (1)
where
??(??) = the temperature of cylinder as a function of time t, o
C
ℎ = the average convective cooling coefficient, W/(m2
o
C)
?? =surface area, m2
???? =the ambient temperature of iced water, o
C
The energy stored in the mass is given by
Energy stored by mass at a particular time = mC??(??) (2)
where
m = mass of the cylinder, kg
C = specific heat of the cylinder, J/(kg- o
C)
From an energy balance,
The rate at which heat is gained ─ Rate at which heat is lost
= rate at which heat is stored
gives
0 − ℎ??(??(??) − ????) = ???? ????(??)
????
−ℎ??(??(??) − ????) = ???? ????(??)
???? (3)
The ordinary differential equation is subjected to
??(0) = ??0
where
??0 =the initial temperature of cylinder, o
C
Assuming the convective cooling coefficient, h to be a constant function of temperature,
the exact solution to the differential equation (3) is
??(??) = ???? + (??0 − ????)??− ℎ????
???? (4a)
It can now also be written in a normalized form as
??(??)−????
??0−????
= ??−ℎ????
???? (4b)
1 It implies that the internal conduction in the trunnion is large enough that the temperature throughout the
trunnion is uniform. This allows us to assume that the temperature is only a function of time and not of the
location in the trunnion. This means that if a differential equation governs this physical problem, it would
be an ordinary differential equation for a lumped system and a partial differential equation for a nonlumped system. In your heat transfer course, you will learn when a system can be considered lumped or
non-lumped. In simplistic terms, this distinction is based on the material, geometry, and heat exchange
factors of the ball with its surroundings.
Page 3 of 12
What we would have done in the laboratory
- Fill the ice-cooler with half-water and half-ice. It is better to use the water from
the water-cooler, as it is cooler than the tap water. Keep stirring the ice, so that ice
cubes are not stuck to each other. - Take the thermocouple wires and connect them properly (+ to +, - to -) to the
temperature indicator. Two thermocouples are attached to illustrate the concept of
a lumped system. - Turn the temperature indicator on and wait for a few seconds to record the initial
temperature of the cylinder. - Record the temperature of the iced-water using a temperature indicator.
- Immerse the aluminum cylinder in a bath of iced water and start the stopwatch
simultaneously. Every five to ten seconds, record the temperature of the cylinder
as a function of time.
Figure 1. Cooling the Aluminum Cylinder
Data Collected
The following data for temperature vs. time was taken a few semesters ago
Time (s) 0 5 11 15 20 25 30 60
Temperature (
o
C) 22.018.2 15.2 13.4 12.0 10.9 10.3 8.5
The temperature of iced water = 1.3o
C
Page 4 of 12
Grading
This project is part of the Computer Projects grade. Your solution will be graded on the
following categories:
• The merit of the conceptual portion
• The merit of programming portion
• The format of submission
Help
If you need assistance, some resources are listed below.
• Instructor office hours
• TA office hours
• Discussion board for project
• How do I do that in MATLAB?
Academic Dishonesty
For this project, you may not receive ANY help from anyone outside of the instructor or
the TA or the CANVAS discussion.
Refer to the academic dishonesty policy of the University of South Florida.
Also, visit the ethics resources at USF for even more information.
Formatting
• Follow the sample project format including cell formatting, published mfile
format, commenting, typed pages, etc.
• Use MATLAB to solve all the problems, unless mentioned otherwise.
• Use comments, display commands, fprintf statements, sensible variable names, and
units to explain your work. Use the SI system of units throughout.
Page 5 of 12
What to submit
You will be uploading two files in response to two questions in a CANVAS quiz named
Computer Miniproject for each of the two mini-project.
Question One
The mfile needs to be submitted in response to the first question in the quiz. It is a single
mfile. - Name it as lastname_firstinitial_conv_fall20_x.m, where x is one or two
depending on the mini-project number. For example, if your name is Abraham
Lincoln, the name of your file would be Lincoln_A_conv_fall20_one.m for miniproject 1 and Lincoln_A_conv_fall20_two.m for mini-project 2.
Question Two
The whole mini-project report needs to be submitted in response to second question on
the quiz and will have the following submitted as a single pdf file (learn how to make a
single pdf file). See sample submission for reference The single pdf file would include
the following. - A signed typed affidavit sheet (Your printed name can be considered to be the
signature). PDF DOC - Published mfile. Use any format that allows you to save it successfully as a pdf
file. Click here to learn how to publish a mfile as a pdf file. - Any typed pages when asked for. Each answer needs to start on a fresh page.
- Attach completed checklist given at the end of this assignment. Checkmark the
boxes you have accommodated in your assignment. Do not checkmark this
without thought.
Why do I ask for an mfile separately?
There are two reasons: 1) Your mfile is put through a plagiarism checker along with
mfiles from previous semesters. Some overlap is expected because of the nature of the
program. Each program that is flagged for plagiarism is looked at manually as well for it
to progress to an academic dishonesty case. 2) Sometimes, while grading your project,
the grader may not follow your logic. So, the grader may need to run your mfile.
Page 6 of 12
Mini project 1 (100 points) – Monday September 28 by 2PM
- Type in a word processor the data of temperature vs. time we collected and the
following data even if it is not used.
Diameter of cylinder = 50 mm
Length of cylinder = 100 mm
Density of aluminum = 2700 kg/m3
Specific heat of aluminum = 904 J/(kgo
C)
Thermal conductivity of aluminum = 241 W/(mo
C)
Table 1. Linear coefficient of thermal expansion vs. temperature for aluminum
(http://www.llnl.gov/tid/lof/documents/pdf/322526.pdf)
Temperature
(oC)
Linear coefficient of
thermal expansion
(μm/m/oC)
-10 5.8
77 9.3
127 13.9
177 25.5
227 32.6
277 34.1
327 36.1
377 38.9
427 39.8 - Assign all the required input data (experimental data and other data that is needed
for the mini project one to variables as MATLAB statements at the beginning of
the mfile as one section. Do not change the units of the inputs – enter them as
given. Of course, fprintf/sprintf/disp the input data using the variables.
a. Any variables that are calculated from the input variables say the surface
area should be done in the first section where you need them – not here, as
this section is reserved for input variables only.
b. Any changes in the input data should not require one to change any part of
the rest of the program, and that is what is called "avoiding hardcoding". - Change the units of input variables, if needed, to the SI system in a new section.
No fprintf/sprintf/disp should be used in this section. - Only using the experimental temperature vs time data, and no other data, use
second-order polynomial interpolation to estimate the rate at which temperature is
changing with respect to time at the 3rd data point. You cannot use MATLAB
functions for this question. Set up the problem instead as three equations – three
unknowns. You can solve the equations though using the MATLAB linsolve
Page 7 of 12
command. You need to use loops to set up the equations. Display the second-order
polynomial as well. - Use the right-hand-side of equation (3) to estimate the rate of change of heat stored
in the cylinder at the time corresponding to the 3rd data point. - Use the left-hand-side of the equation (3) to estimate the rate of change of heat lost
in the cylinder at the time corresponding to the 3rd data point. The value of the
convection coefficient is given to you as 883.67 W/(m2
o
K) as calculated from the
third data point using Equation (4b).
- Type the answer to this question on a separate sheet of paper. Compare the
magnitude of your answers from #5 and #6. Did you expect the magnitude of the
answers to be same? Type the question and underneath it, explain your answer
using proper formulas and text. It should read like a technical memo that is at least
200 words long. - Using the polynomial obtained from #4, find the time when the temperature of the
aluminum cylinder is 13°C. You cannot use MATLAB functions such as solve for
this question. Instead, use bisection method and conduct 40 iterations. There is NO
need to calculate relative approximate errors to see if a prespecified tolerance is
met. Use suitable initial guesses and these guesses can be hardcoded. - Compare your result for #8 with the vpasolve command.
Page 8 of 12
Mini project 2 (100 points) – Monday November 16 by 2PM. - Type in a word processor the data of temperature vs. time collected and the
following data, even if it is NOT used.
Diameter of cylinder = 50 mm
Length of cylinder = 100 mm
Density of aluminum = 2700 kg/m3
Specific heat of aluminum = 904 J/(kg-°C)
Thermal conductivity of aluminum = 241 W/(m-°C)
Table 1. Linear coefficient of thermal expansion vs. temperature for aluminum
(http://www.llnl.gov/tid/lof/documents/pdf/322526.pdf)
Temperature
(oC)
Linear coefficient of
thermal expansion
(μm/m/oC)
-10 5.8
77 9.3
127 13.9
177 25.5
227 32.6
277 34.1
327 36.1
377 38.9
427 39.8 - Assign all the required input data (experimental data and other data that is needed
for the miniproject two to variables as MATLAB statements at the beginning of the
mfile as one section. Do not change the units of the inputs – enter them as given.
Of course, fprintf/sprintf/disp the input data using the variables.
a. Any variables that are calculated from the input variables say the surface
area should be done in the first problem where you need them – not here, as
this section is reserved for input variables only.
b. Any changes in the input data should not require one to change any part of
the rest of the program, and that is what is called "avoiding hardcoding." - Change the units of input variables, if needed, to the SI system in a new section.
No fprintf/sprintf/disp should be used in this section. - Find the value of the convective cooling coefficient h by using the temperature at
the 3rd data point. Use vpasolve to solve for h. - Regress the temperature vs time data to the model
??(??) = ???? + (??0 − ????)??− ℎ????
????
to find the convective cooling coefficient h of the regression model.
Page 9 of 12
You are required to use transforming of data to do the problem. You should not do
any part of this problem by hand. - Plot in one figure the temperature vs. time data that shows individual data points
and the temperature vs. time curve using the values of convective cooling
coefficient h from problem #4 and problem#5. Use axes labels with names, symbols
and units, figure title, and legends. - With the value of the convective cooling coefficient h from #5, use Euler's method
to solve the ordinary differential equation (3) for the value of the temperature at the
3rd data point. Use 10, 20, and 30 time-steps in a nested loop. - Estimate the change in the surface area of the aluminum cylinder at the end of 55
seconds from when the aluminum cylinder was first immersed in iced water. You
can use any MATLAB functions to do this problem.
Page 10 of 12
How to approach solving problems on paper
This following is meant to help students approach engineering problems effectively and
efficiently. Without the proper approach, engineering problems can be very confusing. The
following guidelines are written with common correct and incorrect approaches in mind.
Remembering and implementing these approaches can not only help you find a solution
faster, but it can increase your understanding of the problem and its conceptual basis. Most
of these guidelines are not relegated to this class; you can use them in any engineering
class!
• Start with what you know. If you do not know where to start, start with what you
know. It is a little bit like connecting the dots. You cannot connect the dots until
you have put some down.
• Look at the information you're given.
• Look at the applicable equations. What are the restrictions on these equations?
• Be methodical in your approach.
• Often students will say, "I don't know anything about this!" Typically, this is
because they don't know what they know and what they don't know. Start with what
you know!
• Use dimensions as a hint.
• If you cannot find a mistake in your work, check the unit consistency in the
problem.
• If you do not know how to solve a problem, determine the units of the solution, and
then look to see what units you're missing in the solution.
• Do not cut corners! This WILL hurt you sooner or later.
How to approach programming
• Start with what you know.
• If you have trouble programming a problem, start by working through the problem
on paper.
• Don't try to think up the whole program in your head and then type it out!
• When translating the problem solution into a program, display each part of the code.
Fix one piece at a time.
• Avoid using ";" at the end of statements while debugging the program. You can
add the ";" later when the program is finalized.
• Look at the 'How do I do that in MATLAB series.'
• Use the MATLAB help site (http://www.mathworks.com/help/matlab/) to look up
error codes, syntax, etc.
• If you're looking for syntax examples, click the "example" links on the right side of
MathWorks sections for a sample program.
Page 11 of 12
Common mistakes in programming
• Hard coding
• Incorrect format
• Misunderstanding the conceptual (paper) solution
• Inefficient program debugging
• The published mfile is cut off
• Unit errors/no units/SI System not used
• Professional presentation lacking
• Missing comments
• Unsuppressed lines
• Vector data not in table form
• Questions not read properly, and hence answered incorrectly.
• Section numbers not matching problem numbers.
• Spelling and grammar mistakes
Look at the checklist on the next page that needs to be attached to the hard copy of
your submissions.
Page 12 of 12
Checklist for submission
Name __________
Semester __________
Project Number _____
I submitted this submission as a SINGLE pdf file.
I followed the general format as given in the sample project.
I uploaded the mfile as a separate submission.
I attached the affidavit sheet.
I wrote the code only by myself.
I did not show my code to anyone else.
I attached any handwritten pages if asked for.
I attached any typed pages if asked for.
I followed the section format as given in the sample project.
I published the mfile in published format.
I wrote proper and reasonable comments.
I put the comments on their own lines, as seen in the sample project mfile (not
at the end of a code line).
I identified my methods for each problem.
I suppressed all statements.
I showed input and output variables using fprintf/sprintf/disp statements for all
exercises unless specified otherwise.
I checked for cutoff text in the published file.
I avoided all hard coding (i.e., the program should still work if ANY of the
input