You are on page 1of 2

Final Exam of Computational Methods and Modeling for Engineering Applications (GENG-8030)

Instructor: Dr. Mohammad Sedigh Toulabi


13th of Dec. 2021
12:00 PM to 2:40 PM

Question 1 (8 marks):
It is assumed that there are multiple terrestrial stations in a system and the corresponding data for
analyzing the stations are highlighted in Tables (a) and (b) below.
Table (a): Delay (sec)
Number of Tasks 20 30 40 50 60 70 80 90 100
Non-cooperative, M=3 0.32 0.48 0.61 0.80 0.96 1.10 1.24 1.39 1.55
CCO, M=3 0.25 0.39 0.52 0.62 0.74 0.82 0.99 1.10 1.21
Non-cooperative, M=5 0.20 0.28 0.39 0.42 0.59 0.63 0.72 0.82 0.97
CCO, M=5 0.18 0.20 0.22 0.31 0.41 0.49 0.56 0.60 0.64

Table (b): Energy consumption (joule)


Number of Tasks 20 30 40 50 60 70 80 90 100
Non-cooperative, M=3 7.52 7.88 9.48 10.05 10.30 10.56 14.53 15.06 18.00
CCO, M=3 2.51 4.11 5.15 7.42 9.81 10.04 12.80 14.87 17.12
Non-cooperative, M=5 10.22 10.30 10.56 14.82 15.10 17.60 19.90 22.33 25.10
CCO, M=5 2.40 2.80 5.02 6.88 7.77 9.78 10.23 12.84 15.05

Write a MATLAB script using subplot command with one pane deep and two panes across for
two tables above, and the highlighted directions below. Number of tasks is used for the horizontal
axis label for both plots.
For “Non-cooperative” data: Connect Plus sign (+) markers with solid lines (red for M=3 and
blue for M=5).
For “CCO” data: Connect Circle (o) markers with dashed lines (red for M=3 and blue for M=5).
Use appropriate legends, labels, titles and set the vertical axes of “Delay (sec)” plot between 0
and 1.6 and “Energy consumption (joule)” between 0 to 35.
Question 2 (6 marks):
Matrices A and B are given below. Use the appropriate MATLAB command(s) to find the
summation of the elements located in the 7th row of Matrix M.
2 21 5 17 76 3
9 1 11 13 8 6
𝐴= 0 81 23 4 7 47 B= Identity Matrix (same size of A)
2 21 5 17 76 3
9 1 11 13 8 6
[0 81 23 4 7 47]
𝑀 = [𝐴2 ∗ 𝐵′ ; 𝐴 + 𝐵]
1
Question 3 (8 marks):
Given the following data of frequency and tan 𝛿,
Frequency (in Hz) 3.1 7.53 9.82 21 43 62.5 152
tan 𝛿 1.0 0.7 0.85 0.8 1.1 1.4 4.8
a) Estimate the value of tan 𝛿 at 80 Hz frequency. Use fifth order polynomial curve fitting.
b) Obtain a plot of curve fitted polynomial and the data above for frequencies between 2 Hz
and 200 Hz. Use appropriate legends, markers and labels for axes.
Question 4 (10 marks):
A sensor is designed to monitor the temperature of a server’s CPU and arise an alarm when it is
in the critical range. The sensor measures the temperature in Celsius, but the defined states are
based on Fahrenheit (F).
Write a MATLAB function, named “TemperatureSensor”, and use conditional statements to (i)
take the input temperature in Celsius, (ii) convert it to Fahrenheit (F), (iii) print the status of CPU,
and (iv) output the status ID based on the given table.
Fahrenheit temperature range Status of CPU Status ID
𝐹 < 32 Alarm! The temperature is too low. 1
32 ≤ 𝐹 < 104 Normal. 0
104 ≤ 𝐹 < 140 Alarm! The temperature is high. 1
𝐹 ≥ 140 Failure! The temperature exceeded the critical range. 2

The Celsius to Fahrenheit (F) conversion formula is:


9
𝐹 = 𝐶𝑒𝑙𝑠𝑖𝑢𝑠 × + 32
5
Show the output of the code in an example Celsius=40.
Question 5 (8 marks):
The input u(𝑡) of a dynamic system is a pulse shown using scope below and the initial conditions
for the differential equations of this question are all zeros.
Build and show the state-space Simulink model of the system in the standard form (A, B, C, D)
to plot the solution (y1 and y2) in a same scope for the following equations for 0 ≤ 𝑡 ≤ 10.

𝑥̇ = 𝐴𝑥 + 𝐵𝑢
𝑦 = 𝐶𝑥 + 𝐷𝑢

𝑥̇ 1 = 𝑥2
𝑥̇ 2 = 𝑥3 u(t)
𝑥̇ 3 = −2𝑥1 − 4𝑥2 − 6𝑥3 + 𝑢
𝑦1 = 𝑥1
𝑦2 = 𝑥2

You might also like