Supplementary Matlab Assignment -
Basic details - You are asked to submit your MATLAB solution to the problems specified below. For this INDIVIDUAL assignment, a professional presentation of your solution is required.
Question 1: Figure 1 shows the speed (mph) against time (s) graph of a vehicle in motion, starting at t=1, where Speed ≠ 0.
Equation (1) reproduces the speed from time inputs as in figure 1.
Speed (t) = 0.0011(t6)-0.02928(t5) + 0.2807(t4) - 1.1837(t3) - 0.8283(t2) + 41.234t - 3.3549 (Eqn. 1)
To determine the distance travelled by the car, numerical integration is to be used on the reproduced speed vs. time data, calculated using the area under the curve.
Use the composite trapezoidal rule to obtain an approximation of the distance travelled by the vehicle in metres, with a relative error of less than 0.00002%. During the numerical integration calculations, if the relative error is not reached, double the number of separations used over the timespan in the calculations for the following calculation.
(i) In the command window, display the integral value calculated for distance, the number of sections used in the numerical integration, and the relative error produced for each looped calculation using 'fprintf' and associated commands.
(ii) Produce a single figure with two subplots, (1) showing the speed (m/s) vs. time (t) of the combined speed equations in one plot at a reasonable accuracy, and (2) a cumulative distance (m) graph of the vehicle over time(s) in the second subplot.
(iii) Produce a figure showing the total distance calculated against the number of separations used in each numerical integration calculation; use a logarithmic x-axis scale on the resulting plot.
Question 2: An undamped system is harmonically excited using an external forcing frequency ω, which produces vibration of the system. The displacement of the system over time (x(t)) can be calculated using Equation 4, when using the parameter values detailed in Table 1.
x(t) = (2f0/(ωn2- ω2))sin((ωn-ω/2)t)sin((ωn+ω/2)t) (Eqn. 4)
where: f0 = F0/m
Table 1: Parameter definitions, values and units of measure
Definition
|
Parameter
|
Value
|
Units
|
Stiffness
|
k
|
2000
|
N/m
|
Mass
|
m
|
0.405
|
kg
|
Applied Force Magnitude
|
F0
|
4.05
|
N
|
Time
|
t
|
2.077
|
s
|
Displacement
|
x
|
0.010343
|
m
|
Driving Frequency
|
ω
|
Unknown
|
Rad/s
|
Natural Frequency
|
ωn
|
ωn = √(k/m)
|
Rad/s
|
The acting driving frequency ?? however is unknown.
(i) Use the bisection method to determine an approximation of the value of ω, with an absolute error of less than 1 × 10-6 ; when the displacement x = 0.010343m, at time t = 2.077s, limiting the useable values of ω between: 77 < ω (rad/s) < 80. Display the resulting value of ω, and the absolute error obtained.
(ii) Produce a plot of the displacement x(t), between 0 < t < 3s, using the driving frequency ω calculated in part (i), and mark the displacement at t = 2.077s.
Note - For this assignment need m files, graphs and a report.
Attachment:- Assignment File And Example Report.rar