You are on page 1of 8

ENG3104 Engineering Simulations and Computations

Assessment:
Due:
Marks:
Value:

Semester 2, 2015

Assignment 3
23 October 2015
300
30%

(worth 40 marks)

1.1

Introduction

To assess how useful the wind power could be as an energy source, use the file ass2data.xls to
calculate the total energy available in the wind for each year of data.

1.2

Requirements

For this assessment item, you must produce MATLAB code which:
1. Calculates the total energy for each of the years.
2. Reports to the Command Window the energy for each year.
3. Briefly discusses whether there is any trend in the results for annual energy production.
4. Has appropriate comments throughout.
You must also calculate the total energy for the first four hours of power data (i.e. over
the first five data entries) by hand to verify your code; submit this working in a pdf file.
Your MATLAB code must test (verify) whether the computed value of energy is the same as
calculated by hand.

1.3

Assessment Criteria

Your code 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 receive full
marks.
Quality
Quality
Quality
Quality
Quality
Quality

of
of
of
of
of
of

the code
header(s) and comments
calculation of the energy for each year
reporting
discussion
verification based on hand calculations

5 marks
5 marks
15 marks
5 marks
5 marks
5 marks

ENG3104 Engineering Simulations and Computations

Semester 2, 2015

(worth 65 marks)

2.1

Introduction

For the wind turbines to operate effectively, they must turn to face into the wind. This could
create large stresses in the structure if the wind changes direction quickly while the wind speed
is high. You are to assess if this is likely to happen using the data in ass2data.xls.

2.2

Requirements

For this assessment item, you must produce MATLAB code which:
1. Calculates the instantaneous rate of change of wind direction using:
(a) backward differences
(b) forward differences
(c) central differences
2. Plots the three sets of derivatives as functions of time.
3. Produces scatter plots of maximum wind gust as functions of each of the derivatives.
4. Displays a message in the Command Window with a brief discussion of the scatter plots.
Discuss which of the derivatives should be used to compare with the wind gust and why.
Discuss whether you think the wind changes direction too quickly while the wind speed
is high and why.
5. Has appropriate comments throughout.
You must also use a backward difference, forward difference and central difference by hand to
determine the rate of change of wind direction for the twelfth data entry; submit this working
in a pdf file. Your MATLAB code must test (verify) whether these values are the same as
computed by the code for the three differences.

2.3

Assessment Criteria

Your code 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 receive full
marks.
Quality
Quality
Quality
Quality
Quality
Quality
Quality

of
of
of
of
of
of
of

the code
header(s) and comments
calculating the differences
plotting the differences as functions of time
plotting the wind gust as functions of the differences
discussion
verification based on hand calculations

5 marks
5 marks
30 marks
5 marks
10 marks
5 marks
5 marks

ENG3104 Engineering Simulations and Computations

3
3.1

Semester 2, 2015

(worth 70 marks)
Introduction

A small non-switching power supply is being designed and the components must be selected
so that the voltage in the circuit never falls below Vmin . The voltage in the circuit, vc , can be
found using Eq. (1) during the charging phase [when Eq. (2) is satisfied]:
C

|vt cos(2f t)| 2Vd vc (t)


dvc (t)
+ ic =
dt
2Rd
vc (t) |vt cos(2f t)| 2Vd

(1)
(2)

and using Eq. (3) during the discharging phase [when Eq. (4) is satisfied]:
C

dvc (t)
+ ic = 0
dt
vc (t) > |vt cos(2f t)| 2Vd .

(3)
(4)

The variables in Eqs. (1)(4) are the capacitance, C, the current through the circuit, ic , the
transformed AC voltage, vt , the frequency of the AC power, f , the voltage across the diode, Vd ,
and the resistance across the diode, Rd .
For your assignment, the values for these quantities are (note that all quantities are in SI
units):
Vmin = 9.9979 V

(5)
5

C = 4.063 10

ic = 6.2732 10

(6)

(7)

vt = 6.0477 2 VAC

(8)

= 4.7216 10 Hz
1

Vd = 6.3897 10

Rd = 1.6748 102 .

(9)
(10)
(11)

(Note that these values are indicative of the order of magnitude that these variables might take
and are not necessarily within the limited range that is used in practice.)
(a) Your task is to simulate the system for three cycles to determine whether vc is always larger
than Vmin , in which case the components have been satisfactorily selected. Your initial
condition should be chosen so that the equality is satisfied in Eq. (2). Use the following
methods to simulate the system:
(i) Eulers method in MATLAB. You must report to the Command Window the value
used for t.
(ii) ode45 in MATLAB
(iii) ode23 in MATLAB
(b) Your task is to see how long it takes for vc to charge to Vmin , starting with an initial
condition of vc = 0 and assuming that the system never enters the discharging phase. Use
the following methods to simulate the system:
(i) Eulers method in Simulink
(ii) ode45 in Simulink
(iii) ode23 in Simulink
Note that for part (a), only moderate accuracy is required for the simulation (it is not necessary
to precisely simulate vc unless its smallest value is very close to Vmin ).
3

ENG3104 Engineering Simulations and Computations

3.2

Semester 2, 2015

Requirements

For this assessment item, you must produce MATLAB code and Simulink modules which:
1. Simulate Eqs. (1)(4) using the three methods listed in MATLAB.
2. Plots the simulated vc (t) for each method, clearly indicating the value of Vmin on each
graph. Non-dimensionalise the value of time by multiplying by f ; non-dimensionalise the
voltage using (vt 2Vd ). Non-dimensionalisation allows you to compare cases of different
scale directly because the results are proportional to the non-dimensionalising parameter.
3. Displays a message in the Command Window stating whether vc (t) is always greater than
Vmin for each of the methods.
4. Simulates Eq. (1) using Simulink.
5. Produces a plot using Simulink showing when vc (t) reaches Vmin .
6. Displays within Simulink when vc (t) reaches Vmin .
7. Produces output to MATLAB so that MATLAB can report to the Command Window
the simulated times for vc (t) to reach Vmin .
8. Has appropriate comments throughout.
You must also verify your simulation using Eulers method in MATLAB for the first two
timesteps of part (ai); submit this working in a pdf file. Your MATLAB code must test (verify)
whether the value of vc after two timesteps is the same as computed by the code.

3.3

Assessment Criteria

Your code 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 receive full
marks.
Quality
Quality
Quality
Quality
Quality
Quality
Quality

of
of
of
of
of
of
of

the code
header(s) and comments
the MATLAB simulations
the Simulink simulations
plots (e.g. axis labels, titles)
reporting of results
verification based on hand calculations

5 marks
5 marks
20 marks
20 marks
5 marks
10 marks
5 marks

ENG3104 Engineering Simulations and Computations

Semester 2, 2015

(worth 70 marks)

4.1

Introduction

A smoke alarm sounds at 1 kHz and PL = 75 dB. You are to determine whether these specifications are satisfactory for the chosen application of a corridor of length L. The propagation
of sound is based on the sound pressure p (the pressure increase from ambient pressure in Pa),
where the appropriate transport equation is:

2p
1 2p
1 
dx/10 p

10
.
x2 c2 t2
2dx
x

The speed of sound, c, in air is a function of temperature T (in K):

c = kRT

(12)

(13)

where the ratio of specific heats for air is k = 1.400 and the ideal gas constant for air is
R = 287.0 J/kg.K. The sound pressure level (units of dB) is related to the sound pressure:
PL = 10 log

p2rms
p2ref

pref = 2 105 Pa

(14)
(15)

For the purposes of Eq. (12), you can assume that p = prms .
The attenuation on the rhs of Eq. (12) represents the conversion of sound energy into heat
and causes a constant decrease in dB per unit length. The value of in the atmosphere is in
Table 1 (ignore the acoustic effects of the walls, ceiling and floor).
Table 1: Value of attenuation factor (dB/km). The relative humidity is .
Frequency (Hz)
T ( C) (%)
125 250 500 1000 2000 4000 8000
10
70
0.4 1.0 1.9
3.7
9.7
33
117
20
70
0.3 1.1 2.8
5.0
9.0
23
77
15
50
0.5 1.2 2.2
4.2
11
36
129
15
80
0.3 1.1 2.4
4.1
8.3
24
83
For your assignment, the following value is to be used:
L = 1.2348 m .

(16)

The corridor is at 20 C, the smoke alarm is attached to the wall at one end of the corridor and
assume the gradient of pressure at the far end of the corridor is zero (the boundary value takes
the value of the first interior node at the end of the previous timestep). You must determine:
(a) whether the sound level is a minimum of 70 dB at every point in the corridor under steadystate conditions (i.e. p/t = 0).
(b) the sound level at every location in the corridor the instant before the noise from the alarm
first reaches the far end of the corridor (the noise travels at the speed of sound). The initial
conditions are that the corridor is completely quiet (0 dB) except for the wall with the
alarm (it has just turned on) and that the sound level isnt changing anywhere.
Use a backward difference to model the rhs of Eq. (12). Note that only the HD students are
expected to attempt part (b).
5

ENG3104 Engineering Simulations and Computations

4.2

Semester 2, 2015

Requirements

For this assessment item, you must produce MATLAB code which:
1. Does NOT use the Partial Differential Equation Toolbox.
2. Calculates the sound level at all locations for the steady-state case.
3. Plots the steady-state value of PL(x), showing the minimum pressure level on the same
graph. Non-dimensionalise the distance using L.
4. Reports to the Command Window whether the sound level reaches 70 dB everywhere in
the steady-state situation.
5. Simulates the transient case.
6. Visualises the value of PL(x, t) for the entire simulation in one image. Non-dimensionalise
the time using c and L.
7. Plots the value of PL(x) computed in part (b), showing the minimum pressure level on the
same graph. Also show on the same graph the value of PL(x) when the noise is half-way
to the far end of the corridor.
8. Has appropriate comments throughout.

4.3

Assessment Criteria

Your code 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 receive full
marks.
Quality
Quality
Quality
Quality
Quality
Quality
Quality

of
of
of
of
of
of
of

the code
header(s) and comments
calculation of part (a)
plot for part (a)
reporting for part (a)
calculation of part (b)
plots for part (b)

5 marks
5 marks
20 marks
5 marks
5 marks
20 marks
10 marks

ENG3104 Engineering Simulations and Computations

Semester 2, 2015

(worth 5 marks)

You are to write a brief report (about 100 words, excluding any code), which includes:
1. A description of an instance during the writing of your code for this assignment where
there was a problem (e.g. a bug, an error, an unexpected result) or the most challenging
aspect to overcome.
2. What steps you took to overcome the problem or challenge (including any code you wrote
to test the problem/challenge).
3. The code before you resolved the problem or challenge, highlighting the line(s) of code
where the problem or challenge occurred.
4. The code after you resolved the problem/overcame the challenge.
5. Code from the MATLAB editor is to be copied into Word; screenshots should be taken of
the Command window.
The problem report will be assessed using the following scheme:
Description
Excellent description of a difficult problem and effective solution
Good description of a moderate problem and useful solution
Reasonable description of a genuine problem with a pragmatic solution
Poor description or Problem is not very challenging or Solution is not effective/efficient
Problem is trivial or Solution is poor
No report or description does not include a genuine problem

Marks
5
4
3
2
1
0

(worth 50 marks)

Your marks from the SPIDER activities will be added up to contribute to this 50 marks. Note
that you will only be awarded up to 50 marks from the SPIDER activities.

Submission
Submit your code, with the ass2data.xls file that is provided to you (or an equivalent conversion to xlsx), by the due date to the StudyDesk. Submit your problem report as a pdf file that
contains selectable text (your assignment will not be marked if the pdf file does not satisfy this
requirement). Note that:
You may need to convert the ass2data.xls file to another format (e.g. ass2data.xlsx) to
import properly into MATLAB. In that case, you must submit the files that you actually
import using your code.
You do not need to rename your files when uploading: the system automatically segregates
different students submissions.
You can submit all your files in a *.zip file or individually (do not archive in another file
format such as rar or 7z). You do not have to submit your pdf file(s) separately.

ENG3104 Engineering Simulations and Computations

Semester 2, 2015

You will NOT receive any confirmation of receipt. If you can see that the files have
uploaded, then you have successfully submitted your assignment. There is no need to
click a send for marking button, but you will have to click a button confirming that the
submission is your own work.

You might also like