Please name your file “Firstname Lastname Homework 09.pdf” (see below for more details).
IMPORTANT: Remember that I encourage you to work in groups, but each student must submit his/her own homework. Every student’s homework assignment should look significantly different from all other students (i.e., each student’s work should be a representation of their own work).
Solve the following problems in Matlab. Please use the Snipping Tool (Start menu → Snipping Tool) to document your input/output in Matlab. Paste the snips into a Microsoft Word (.doc or .docx) file or a Google doc but your final product must be a .pdf file! MS Word and Google Docs can both produce .pdf files (Google this if you don’t know how!). Fully show all input and output in Matlab, sufficient to explain/show how you arrive at an answer for each problem. You may also wish to add text commentary in your file.
The file upload for this assignment must be a .pdf file (no other file extensions will be accepted – this is to preserve the formatting of figures and code).
1. The wind chill factor (Twc, °C) is given as a function of ambient temperature (Ta, °C) and wind speed (V, km/h):
Twc = 13.12 + 0.62157. – 11.3770.16 + 0.39657,70.16
Create an m-file called windchill that can be run and a table of wind chill factors will be displayed. You should use ambient temperatures between 0°C and 40°C in increments of 10°C and velocities from 0
km/h to 40 km/h in increments of 5 km/h in your table.
This is what you are trying to create:
>> windchill
-4.4162
7.9141
2.03
6295
13.1200
19.3350
25.5500
31.7650
37.9800
-1.5894
9.7551
21.0997
32.4442
43.7887
-3.3147
3.6315
20.5777
32.5239
44.4700
20.2
4
-5.2422 -5.9097 -6.4730
7.3761 6.9415 6.5746
19.9945 19.7926 19.6221
32.612932.643732.6697
45.2312 45.4948 45.7172
-6.9622
6.2560
19.4741
32.6923
45.9104
Non
-7.3959
5.9735
19.3429
32.7123
46.0817
32.5747
44.9050
(HINT: See the screencast “Vectorization in Matlab, Part 1”.)
2. We have a vertical tank that has a hemispherical bottom, hemispherical top, and cylindrical middle section (see diagram on the next page).
a. Create a user-defined function in Matlab called “tank(R,H,d)” that will calculate the volume in the tank as a function of the tank radius (R), tank height (H), and depth of fluid in the tank (d). The piecewise functions that follow will allow one to calculate the volume as a function of d.
b. In Matlab, make a single plot of volume (V) as a function of depth (d) ranging from 0 to H for one
scenario of your choosing (e.g., R = 1 and H = 3). The plot must be color-coded based on the piecewise function: the first part (d 3. A pint glass has the following dimensions (see below). Use Matlab (document each step of your work!) to determine the difference in depth between when the glass contains 16 oz. and when the glass contains 12 oz. This is a somewhat open-ended, “real world” engineering problem that will require you to think outside the box, perform unit conversions, and use solving functions. 16 H = 5.5″ 75 HINT #1: The volume of a container like this can be thought of as a smaller cone subtracted from a larger cone. If you don’t know the volume of a cone, Google it! HINT #2: I would recommend coming up with a function of volume in terms of depth: Homework #9 Page 3 V = f(h) then you can set that function equal to 12 oz. [f(h) = 12 oz.), redefine a new function, g(h), that is formed by subtracting 12 oz. from both sides [9(h) = f(h) – 12), then use a solving function to find the zero of g(h), which is the depth at which the volume is 12 oz. Do something similar for 16 oz., then compare the two depths. Easy, peasy! HINT #3: Your function above will most likely involve trigonometry (similar triangles)! HINT #4: I guess I’ll give you some hints on the trigonometry part: HTh This is the pint glass portion H +a Some equations we can set up, using similar triangles: A) a Hua =?b a= H(rb/rt) 1-rb/rt B) = 1 +b = “hta) TE h+a Hua Hta a and b are just intermediates and should not appear in your final volume equation. On Canvas I have a file called “pintglasssymbolics.m” and you can download and complete it to find a final volume equation in terms of h, H, Tt, and th, and you can use the resulting expression in your calculations above. It is important to document your process/solution with text, explaining the steps and showing the code for how you determine your final answer (difference in depths for 12 OZ. Vs. 16 oz. of fluid in the glass).