You are on page 1of 2

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

Instructor: Dr. Mohammad Sedigh Toulabi


14th of Dec. 2020
7:00 PM to 9:30 PM

Question 1 (5 marks):
If a certain combinations of Red color light (r), Blue color light (b) and Green color light (g),
form certain luminous intensity in lumens as per the given set of 2 equations: 2r+5b+g=15 and
3r+9b+7g=21, then:
a) Write a MATLAB code to find r, b and g obtained by pseudo-inverse method and left
division method.
b) Find the difference in value of r+b+g obtained by pseudo-inverse method and left division
method.

Question 2 (7 marks):
Plot the projectile trajectories using equations below for the ideal projectile motion:
1
𝑦 𝑡 𝑦 𝑔𝑡 𝑣 sin 𝜃 𝑡 ,
2
𝑥 𝑡 𝑥 𝑣 cos 𝜃 𝑡 ,
where 𝑦 𝑡 is the vertical distance and 𝑥 𝑡 is the horizontal distance traveled by the projectile in
metres, 𝑔 is the acceleration due to Earth’s gravity = 9.8 𝑚/𝑠 and t is time in seconds. Let the
initial velocity of the projectile 𝑣 = 50.75 m/s and the projectile’s launching angle 𝜃
𝑟𝑎𝑑. The initial vertical and horizontal positions of the projectile are given 𝑦 0 𝑚 ,𝑥
0𝑚.
Plot 𝑦 𝑡 versus time (t) and 𝑥 𝑡 versus (t) in a same window using subplot with the vector: t =
0:0.1:10 representing time in seconds. Give appropriate titles to the graphs and label the axes.

Question 3 (7 marks):
By looking at the figure below, write a MATLAB function which inputs the value of radius of
circle (OP) and calculates the following parameters. (Note: Calculate the parameters for radius
OP =5)
a) Length PQ which is twice of length OP.
b) Length OQ. ∆𝑂𝑃𝑄 𝑖𝑠 𝑎 𝑟𝑖𝑔ℎ𝑡 𝑎𝑛𝑔𝑙𝑒𝑑 𝑡𝑟𝑖𝑎𝑛𝑔𝑙𝑒).
c) ∠𝑃𝑂𝑆 ∅ sin where, ∅ is in degrees.

d) 𝐴𝑟𝑒𝑎 𝑜𝑓 𝑠𝑒𝑐𝑡𝑜𝑟 𝑃𝑂𝑆 ∗ 𝜋𝑟
1
 
Question 4 (7 marks):
Consider the iteration 𝑥 𝑘 1 1.2𝑥 𝑘 0.2 𝑎𝑛𝑑 𝑧 𝑘 𝑥 𝑘 0.5 .
a) Write a MATLAB script to compute the first 10 values of this iteration 𝑘
1,2 . . 10 starting with 𝑥 1 3 𝑎𝑛𝑑 𝑧 1 5.
b) Plot x(k) and z(k) on the same graph using hold command with proper axes labels and
legends (X-axis: iteration number, Y-axis: x(k), z(k)).

Question 5 (6 marks):
Given the following data of frequency and tan 𝛿,
a) Predict the value of tan 𝛿 at 100 Hz frequency. Use Order=4 for the curve fitting purposes.

Frequency (in Hz) 2.09 6.53 9.41 20 40 60 150


tan 𝛿 1.0 0.7 0.85 0.8 1.1 1.4 4.8
b) Obtain a plot of curve fitted polynomial and the data above.

Question 6 (8 marks):
The relation between the output (Y(s)) and the input (U(s)) is determined by the following
equation:
𝑌 𝑠 0.25𝑠 5𝑠 0.75
𝑈 𝑠 2𝑠 4𝑠 8𝑠 1
a) Plot the output (Y) and the input (U) on the same scope (the scope has only one port) when
a step input of step time = 1s and amplitude = 5 is applied. 0 𝑡 15
b) Show the Simulink model used to determine the output (Y).
c) Add a PID controller to enhance the output. It is required to choose the PID controller
parameters (p, I, and D) so that the output follows the input and reaches its steady-state
value in less than 4 seconds. Show the Simulink model and the output response. 0 𝑡 8
Hint: all the parameters (p, I, and D) are in the range between 0 and 15. Note that, as p
increases the output reaches its steady-state faster, increasing I reduces the steady-state
error, while increasing D reduces the oscillation.
2
 

You might also like