- Details
- Parent Category: Mathematics Assignments' Solutions
We Helped With This Machine Learning Homework: Have A Similar One?
SOLVED

Assignment Image
![Machine Learning Assignment Description Image [Solution]](/images_solved/9053118/1/im.webp)
Il vodafone AU WiFi
Q1b
In the cumultrap.m file, complete the function file to perform cumulative integration using the trapezoidal
rule given two input vectors. The function should return the cumulative integrated values at the nominated
independent values. You may only use the following built-in functions for your function file: zeros() and
length().
Note: The integral of a set of data returns a scalar result. In contrast, the cumulative integral returns a vector,
whose values represent the integral values from the start of the integration to its current point. Also, note
that integral value of a single point is zero. Read the documentation for cumtrapz() for further details and
use that function to verify your answers.
*You should still have one figure window by the end of this task.
Q1c
In the Q1c.m file, integrate the following equations to obtain the longitudinal and latitudinal velocities V
and displacements D of the race car:
●
●
In a new figure with a 1x2 subplot arrangement, plot the following:
●
●
10:22 PM
mcpl.moodlesites.com
Also, determine the length of the track. You must use a for loop to complete this task. Use fprintf to print
the length of the track: E.g. Track length: ???m
*You should have two figure windows by the end of this task.
**Use imread () to read the images
Q1d
A strong left turn is identified as when the race car experiences lateral G-forces greater than 0.4g. A strong
right turn is identified as when the car experiences lateral G-forces less than -0.4g.
VLONG = ALONG dt
DLONG = f ALONG dtdt
In the Q1d.m file, determine the left and right-turning corners. In a new figure with a 1x2 arrangement, plot
the following:
On both panels, mark the following:
Satellite image (track_map.png) of the track using imshow(). [left panel]
Latitude displacements against longitude displacements with the grid on and set the axes to be equal
(option for axis). [right panel]
● Left-turning corners as blue dots
Right-turning corners as red dots
MCD4140 Assignment
●
●
VLAT = | ALAT dt
DLAT = ff ALAT dtdt
G-force lateral acceleration against time [left panel]
Latitude displacements against longitude displacements with the grid on [right panel]
Dots on the left panel are sized 5, and dots on the right panel are sized 15. Remember to include a legend.
*You should have three figure windows by the end of this task.
Q1e
Acceleration and deceleration zones are identified as follows:
●
90%
●
On both panels, mark the following:
Acceleration zones - where race car experiences G-forces less than -0.1g.
Deceleration zones - where the race car experiences G-forces greater than 0.1g.
In the Q1e.m file, create a new figure with a 1x2 subplot arrangement containing 2 subplots and plot the
following:
G-force due to total acceleration/deceleration against time [left panel]
Latitude displacements against longitude displacements with the grid on [right panel]
Accelerating zones as green dots
Decelerating zones as magenta dots
Page 4 of 9
Dots on the left panel are sized 5, and dots on the right panel are sized 15. Remember to include a legend.
*You should have four figure windows by the end of this task.
Assignment Image
![Machine Learning Assignment Description Image [Solution]](/images_solved/9053118/2/im.webp)
l vodafone AU WiFi
QUESTION 1
Background
[3 MARKS]
Accelerometers are small electronic devices that measure acceleration from moving objects. As a trainee
engineer on a racing team, you have been given accelerometer data from a test run at the Watkins Glen
International Racetrack. An image of the racetrack is shown in figure 1.
●
Figure 1: Satellite view of the Watkins Glen International racetrack.
The data you collected from the accelerometer during a test run is output to a csv file named "race_data.csv",
which contains:
•
●
●
Note that 1g = 9.81 ms².
10:22 PM
mcpl.moodlesites.com
Time, t (s)
Longitudinal acceleration, ALONG (ms²)
Latitudinal acceleration, ALAT (ms²)
G-force lateral acceleration, GLAT (g)
G-force acceleration/deceleration, GAD (g)
●
You have been asked to analyse the data and prepare a graphical presentation of the results by performing
the following tasks:
Q1a
In the Q1a.m file, use the importdata() function to import values from the race_data.csv. Create variables for
the time (t), longitudinal acceleration (ALONG), latitudinal acceleration (ALAT), G-force lateral acceleration (GLAT),
and G-force due to total acceleration/deceleration (GAD).
In a 2x2 subplot arrangement, plot the following:
● ALONG against t
[top left panel]
[top right panel]
●
ALAT against t
GLAT against t
GAD against t
[bottom left panel]
[bottom right panel]
*You should have one figure window by the end of this task.
90%
MCD4140 Assignment
Q1b
In the cumultrap.m file, complete the function file to perform cumulative integration using the trapezoidal
rule given two input vectors. The function should return the cumulative integrated values at the nominated
independent values. You may only use the following built-in functions for your function file: zeros() and
length().
Page 3 of 9
Note: The integral of a set of data returns a scalar result. In contrast, the cumulative integral returns a vector,
whose values represent the integral values from the start of the integration to its current point. Also, note
that integral value of a single point is zero. Read the documentation for cumtrapz() for further details and
use that function to verify your answers.
*You should still have one figure window by the end of this task.
VLONG ALONG dt
DLONG =
ALONG dtdt
Q1c
In the Q1c.m file, integrate the following equations to obtain the longitudinal and latitudinal velocities V
and displacements D of the race car:
VLAT = ALAT dt
[[ ALAT dtdt
DLAT =
Assignment Image
![Machine Learning Assignment Description Image [Solution]](/images_solved/9053118/3/im.webp)
.vodafone AU WiFi
6 of 9
QUESTION 2
ment
8:54 PM
mcpl.moodlesites.com
Background
Monte Carlo methods are a broad class of computational algorithms that rely on repeated random sampling
to obtain numerical results. You have been asked to estimate the value of rt using the Monte Carlo method.
Itz
A number of randomised points is generated within the box of unit width, as shown in figure 2. Some of the
points lie within the circle, while others lie outside the circle. The value of it is calculated using the following
expression:
4Nc
Ng
Page 5 of 9
[3 MARKS]
Figure 2: Randomised points generated inside a box containing a unit circle.
The procedure to perform the Monte Carlo method is listed below:
1. Generate a randomised point within a square containing a circle of unit radius
2. Determine N, and N₁, and calculate the estimate of r
3. Repeat steps 1 and 2 for a specified number of points
MCD4140 Assignment
where Nc represents the number of points inside the unit circle, and Ns is the number of dots within the
square. In figure 1, there are 17 points inside the circle and 20 points inside the square (i.e. 3 points outside
the circle). Therefore, 4x17 3.4. This estimated value of should become more accurate with an
increasing number of points.
20
Complete the following tasks to perform the Monte Carlo procedure described above.
2%
Q2a
In the Q2a.m file, generate a 2x1 subplot arrangement where the top panel contains a circle of unit radius and
a square with a width of 2 units, both centred at (x,y) = (0,0) (see figure 3 for an example). Plot these shapes
as black lines and set the axes to be square (option for axis). Details of the bottom panel are described in Q2b.
Page 6 of 9
Q2b
In the Q2b.m file, prompt the user for a specified number of points to estimate using the input() function.
Generate your first randomised point by randomising its x and y-coordinates. The limits for the x and y-
coordinates should be limited to the bounds of the square (i.e. from 1 to 1 in both directions). Plot this
randomised point in the top panel of the figure as a red dot if it lies on or within the circle, or as a blue dot
if it is outside the circle. Use a marker size of 15. After plotting your first randomised point, calculate the
estimate of and plot the result as a black dot in the bottom panel of the figure (see figure 3). The current