# ENG3104 Engineering Simulations and Computations-Assignment 1

ENG3104 Engineering Simulations and Computations-Assignment 1

1 Introduction
Recordings from the Bureau of Meteorology of the weather in Dalby have been made [1]. Your
task is to analyse the data to identify the behaviour of the weather for the period of measure-
ments. The data is stored in the le ass1in.zip; each le contains a month of data and is named
according to the year and month of the measurements.
One of the quantities of interest is the air density, which can found using the ideal gas law:

p  =RT (1)

where p is the pressure1, the ideal gas constant for air is R = 286:9 J=kg:K, and T is the
temperature (in SI units).

2 Requirements
For this assessment item, you must perform hand calculations:

1. For the rst 3 days and last 2 days of July 2017, nd how much hotter the maximum
temperature was than the minimum temperature for the same day.
2. For the rst 3 days of July 2017, calculate the air density at 9:00 a.m.
3. Determine when in July the cumulative rainfall for the month exceeds 7 mm.
You must also produce MATLAB code, stored as m- le(s), which:
4. Repeats the calculation of Requirement 1 by creating vectors in MATLAB and typ-
ing/copying the values from the spreadsheet into the vectors. Veri es the answers, in-
cluding a report printed to the Command Window regarding the outcome of the veri -
cation (merely displaying values in the Command Window will not earn any marks for
veri cation).
5. Successfully loads `Dalby 2017-7.csv' into MATLAB (the numbers are not to appear in MATLAB code via copy-and-paste!)2. One possible way of loading the data is using MATLAB's Import Data wizard. If you use MATLAB's Import Data wizard, you must use the \Generate Function" option, otherwise your code will not work on another computer, which will automatically mean a loss of marks. Codes which load an edited version of `Dalby 2017-7.csv’ to that supplied will not receive maximum marks. Veri es that the load
has been successful by using MATLAB to compare the values of minimum and maximum
temperature to those manually entered in Requirement 4.
6. Repeats the calculation of Requirement 1 for the entire month using the data loaded from
Requirement 5. Veri es the answers by checking the results from Requirement 5 with the
relevant days.
7. Simulations and Computations Semester 2, 2018
8. Plots the maximum and minimum temperatures along with the results from Requirement 6
for each day on the same graph. The dates should be represented in some manner on the
x-axis; for maximum marks, these should appear in standard date format (e.g. \15/7″).
9. *Calculates the air density at 9:00 a.m. each day for the entire month using a for-loop.
10. Veri es the answers from Requirement 8 by comparing the relevant days with the answers
from Requirement 2.
11. **Repeats the calculation of Requirement 8 using a fully-vectorised code (i.e. no loops for
this calculation). Veri es the answers with those from Requirement 8.
12. Plots the result from either Requirement 8 or Requirement 10.
13. ***Uses a while-loop to determine when the cumulative rainfall for the month exceeds
7 mm and reports the answer to the Command Window. Also veri es this answer with
Requirement 3.
14. ***Calculates when the cumulative rainfall for the month exceeds 7 mm using a fully-
vectorised code (i.e. no loops for this calculation). Veri es this answer with Requirement 3.
15. *Produces an ASCII le containing two columns: date and density. An acceptable answer
would store the date as just the day of the month (you do not need to include the month).
For top marks, the date and month must be stored in a conventional format.
16. ***Loads all 12 months’ worth of data. Determines the minimum and maximum tempera-
tures for the entire period.3 Plots the minimum and maximum temperature for the entire
12 months with the x-axis each day of the 12 months in order. Also produces two 3-D
surface plots with the date of the month on one axis (go up to 28), the month on another
axis,

3 Assessment Criteria

Your submission will be assessed using the following scheme. Note that you are marked based
on how well you perform for each category, so the correct answer determined in a basic way
will receive half marks and the correct answer determined using an excellent method/code will
Quality of Requirements 1{3 30 marks
Quality of Requirement 4 10 marks
Quality of le load and veri cation 10 marks
Quality of Requirement 6 5 marks
Quality of plot (T) 10 marks
Quality of for-loop calculation and veri cation 25 marks
Quality of vectorisation calculation () and veri cation 10 marks
Quality of plot () 5 marks
Quality of while-loop calculation and veri cation 20 marks
Quality of vectorisation calculation (rainfall) and veri cation 10 marks
Quality of le output 10 marks
Quality of 12-month analysis 15 marks
Quality of function use 10 marks