EML 3041 UF MATLAB Convection Cooling Coefficient Programming Project

Project Instructions is given in the files attached. It is mostly MATLAB with a couple of handwritten questions.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

The data collected during the lab is also attached in a file below.

Semester and Year
Spring 2020
Due Dates
Mini project 1 – Thursday, March 26 at 3:30PM
Mini project 2 – Thursday, April 16 at 3:30PM
Title
Cooling the Aluminum Cylinder Experiment to Illustrate Use of Numerical Methods
Points
100 points
Background
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, oC
β„Ž = the average convective cooling coefficient, W/(m2-oC)
𝐴 =surface area, m2
πœƒπ‘Ž =the ambient temperature of iced water, oC
The energy stored in the mass is given by
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 1 of 9
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- oC)
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, oC
Assuming the convective cooling coefficient, h to be a constant function of temperature,
the exact solution to the differential equation (3) is
β„Žπ΄π‘‘
πœƒ(𝑑) = πœƒπ‘Ž + (πœƒ0 βˆ’ πœƒπ‘Ž )𝑒 βˆ’ π‘šπΆ
It can now also be written in a normalized form as
πœƒ(𝑑)βˆ’πœƒπ‘Ž
πœƒ0 βˆ’πœƒπ‘Ž
(4a)
β„Žπ΄π‘‘
= 𝑒 βˆ’π‘šπΆ
(4b)
Grading
This project is part of the Special Assignment/Project 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
Academic Dishonesty
For this project, you may not receive ANY help from anyone outside of the instructor or
the TA. Refer to academic dishonesty policy of the University of South Florida at
http://ugs.usf.edu/policy/AcademicIntegrityOfStudents.pdf. Also, visit the new ethics
resources at USF http://www.usf.edu/ethics/index.aspx for even more information.
Learning Objectives
β€’ Identify and implement the correct procedure for a given problem
β€’ Improve existing programming skills
β€’ Reinforce prerequisite knowledge
β€’ Solve real-world problems
Page 2 of 9
Formatting
β€’
β€’
β€’
Follow the sample project format including cell formatting, published html
format, commenting, etc.
Use MATLAB to solve all the problems, unless mentioned otherwise.
Use comments, display commands and fprintf statements, sensible variable names
and units to explain your work. Use SI system of units throughout.
What to do in the laboratory
1. 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.
2. 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.
3. Turn the temperature indicator on and wait for a few seconds to record the initial
temperature of the cylinder.
4. Record the temperature of the iced-water using a temperature indicator.
5. 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
Page 3 of 9
What to submit
For the hard copy, staple all the work in the following sequence.
1. Signed typed affidavit sheet
2. Attach completed checklist given at end of this assignment. Check-mark the
boxes you have accommodated in your assignment. Do not do this blindly.
3. Published mfile in html format
4. Answers on plain white paper or engineering graph paper when asked for in
problems of β€œProject Exercises” section. Each answer needs to be on a fresh page.
5. Any typed pages when asked for in problems of β€œProject Exercises” section. Each
answer needs to be on a fresh page.
For the soft copy submission on CANVAS
Submit the mfile of the computer simulation under the CANVAS assignment.
Name it as lastname_firstinitial_conv_spring20_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_spring20_one.m for
mini-project 1 and Lincoln_A_conv_spring20_two.m for mini-project 2.
Page 4 of 9
Project Exercises
Mini project 2 (100 points) – Thursday April 16, at class start time
1. On plain white paper or engineering graph paper, handwrite the data of temperature
vs. time we collected in class and the following data.
Diameter of cylinder = 49 mm
Length of cylinder = 100 mm
Density of aluminum = 2700 kg/m3
Specific heat of aluminum = 902 J/(kg-oC)
Thermal conductivity of aluminum = 240 W/(m-oC)
Table 1. Coefficient of thermal expansion vs. temperature for aluminum
(http://www.llnl.gov/tid/lof/documents/pdf/322526.pdf)
2.
3.
4.
5.
Temperature Coefficient of thermal expansion
(oC)
(ΞΌ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 Mini project 2 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. 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”. Of course, f
fprintf/sprintf/disp the input data using the variables.
Change the units of input variables, if needed, to the SI system in a new section.
There is no need to fprintf/sprintf/disp in this section.
In a MATLAB section, find the convective cooling coefficient h by a crude method
as follows. Use the value of the temperature of the aluminum cylinder at the 3rd
data point in your readings of temperature vs. time, and solve the nonlinear equation
(4a) (do not simplify by hand) to calculate the value of h. Hint: Use the solve
command.
Regress the temperature vs time data to the model
β„Žπ΄π‘‘
πœƒ(𝑑) = πœƒπ‘Ž + (πœƒ0 βˆ’ πœƒπ‘Ž )𝑒 βˆ’ π‘šπΆ
to find the convective cooling coefficient h of the regression model.
Page 5 of 9
You are not allowed to transform the data. You should not do any part of this
problem by hand.
6. In a MATLAB section, regress the temperature vs. time data to the model
β„Žπ΄π‘‘
πœƒ(𝑑) = πœƒπ‘Ž + (πœƒ0 βˆ’ πœƒπ‘Ž )𝑒 βˆ’ π‘šπΆ .
to find the convective cooling coefficient h of the regression model by transforming
the data for this exercise.
Hint: Rewrite the regression model given above in the form of equation (4b), and
then take the natural log of both sides. You will end up using the linear regression
formulas of the 𝑦 = π‘Ž1 π‘₯ straight-line model.
The derivation of the model for the transformed data needs to be done manually
The derivation needs to be professional, typed on a separate sheet(s) of paper, and
should be complete including defining all the variables, using appropriate equation
editors of your word processor, writing appropriate sentences to explain steps, etc.
See any derivation given in Chapter 06.04 as an example of the expected format.
Use the final derived formula directly then in a MATLAB section of the program
to find the convective cooling coefficient h.
7. In 100 words or so, do the following. The work needs to be professional, typed on
a separate sheet(s) of paper, with all the variables defined, and with appropriate
equation editors of your word processor used.
a. Type the values of convective cooling coefficient h obtained from problems
#4, #5, and #6 with an appropriate description.
b. Type this question and type the answer: Before running the program, what
did you expect in the comparison of the three convection coefficient values
and why?
c. Type this question and type the answer: If these values turned out or did not
turn out as expected, what are the possible reasons?
8. Plot in one figure the temperature vs. time data that shows individual data points
and the temperature vs. time curves using the values of convective cooling
coefficient h from the problems #4, #5 and #6. Use axes labels with names, symbols
and units, figure title, and legends.
9. Find the 2nd order polynomial regression model of thermal expansion coefficient vs
temperature by setting up equations in matrix form and then solving the three
simultaneous linear equations. Show the answer as a polynomial of temperature.
Hint: Given 𝑛 data pairs (π‘₯1 , 𝑦1 ), (π‘₯2 , 𝑦2 ), . . . . . . , (π‘₯𝑛 , 𝑦𝑛 ), 2nd order polynomial
𝑦 = π‘Ž0 + π‘Ž1 π‘₯ + π‘Ž2 π‘₯ 2 , 𝑛 > 2, regression constants are given by solving these
equations.
βˆ‘π‘›π‘–=1 𝛼𝑖
(βˆ‘π‘›π‘–=1 𝑇𝑖 ) (βˆ‘π‘›π‘–=1 𝑇𝑖2 ) π‘Ž0
𝑛
[ (βˆ‘π‘›π‘–=1 𝑇𝑖 ) (βˆ‘π‘›π‘–=1 𝑇𝑖2 ) (βˆ‘π‘›π‘–=1 𝑇𝑖3 )] [π‘Ž1 ] = [ βˆ‘π‘–=1 𝑇𝑖 𝛼𝑖 ]
βˆ‘π‘›π‘–=1 𝑇𝑖2 𝛼𝑖
(βˆ‘π‘›π‘–=1 𝑇𝑖2 ) (βˆ‘π‘›π‘–=1 𝑇𝑖3 ) (βˆ‘π‘›π‘–=1 𝑇𝑖4 ) π‘Ž2
𝑛
Page 6 of 9
10. Compare your answer from problem#9 with the MATLAB polyfit command by
showing the thermal expansion coefficient as a polynomial function of temperature.
Help
If you need assistance, some resources are listed below.
β€’ Instructor office hours
β€’ TA office hours
β€’ Make an appointment outside of office hours with the instructor or TA.
β€’ How do I do that in MATLAB:
http://mathforcollege.com/nm/blog_entries.html#How_do_do_that_in_MATLAB
(go to the end of the webpage).
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’s a little bit like connecting the dots. You cannot connect the dots until you
have put some down.
o
Look at the information you’re given.
o
Look at the applicable equations.
β–ͺ
o
Be methodical in your approach.
β–ͺ
β€’
β€’
What are the restrictions on these equations?
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 dimensional analysis as a hint.
o
If you can’t find a mistake in your work, check the unit consistency in the
problem.
o
If you don’t 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.
Don’t cut corners! This WILL hurt you sooner or later.
How to approach programming
β€’ Start with what you know.
o
If you’re having trouble programming a problem, start by working through
the problem on paper.
Page 7 of 9
o
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.
o
If you’re looking for syntax examples, click the “example” links on the right
side of MathWorks sections for a sample program.
Common mistakes in programming
β€’ Hard coding
β€’ Incorrect format
β€’ Misunderstanding the conceptual (paper) solution
β€’ Inefficient program debugging
β€’ The printer cuts off published file lines.
β€’ Unit errors/no units
Look at the checklist on the next page that needs to be attached to the hard copy of
your submission.
Page 8 of 9
Checklist for submission
ο‚  I followed the general format as given in the sample project.
ο‚  I uploaded the mfile.
ο‚  I attached any handwritten or typed pages if asked for.
ο‚  I followed the section format as given in the sample project.
ο‚  I published the mfile in published format – HTML 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 CLEARLY identified my methods for each problem.
ο‚  I suppressed all statements.
ο‚  I showed input and output variables using fprintf and disp statements for all
exercises unless specified otherwise.
ο‚  I checked for cut off errors in the hard copy of the published file.
ο‚  I avoided all hard-coding (i.e., the program should still work if ANY of the
input data is changed).
Page 9 of 9
Time (s)
O 5
10
15 20 25
30 60
Temperature
22 18.3 15.2 13.4 12 10.9 10.3 8.6
(Β°C)
Temperature of iced water = 2.8 Β°C

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER