Lab 1+2 Report
Lab 1+2 Report
Lab 1+2 Report
RMIT Vietnam
"I declare that in submitting all work for this assessment I have read, understood and agree to the
content and expectations of the Assessment declaration ."
Table of Contents
1 Introduction to Experiment 1 .................................................................................. 3
2.1 Task 1: Problem Statement and Determine the Input / Output ........................................ 3
2.2 Task 2: Calculate the Simple Physics for the Scenario ....................................................... 4
3.2 Task 5a: Calculate the Initial height of the 45° launch angle ............................................. 7
3.3 Task 5b: Calculate the Displacement for 35° and 55° launch angle ................................... 7
Reference ........................................................................................................................ 19
2
RMIT Classification: Trusted
Laboratory Exercise 1
1 Introduction to Experiment 1
The laboratory exercise focused on utilizing MATLAB to solve a physics problem
related to projectile motion, inspired by the legendary daredevil Evel Knievel's Eve
world records in motorcycle jumping which was over 19 cars on February 28th, 1971.
[1] The objective was to calculate the initial velocities and heights required for
hypothetical motorcycle jumps over the Grand Canyon. Furthermore, there will be
exercises regarding to the change of Initial height and how it affects the outcome of
the same problem mentioned above. Through this exercise, we aimed to gain
proficiency in using basic MATLAB functions for problem-solving and visualizing data.
A motorcycle jumps over the Grand Canyon, with the assumption of a flat ground
surface, the task lies in accurately calculates the distance the motorcycle will travel
during the jump. This necessitates a thorough consideration of factors like velocity,
acceleration, launch angle and potential wind resistance (which in this case will not
3
RMIT Classification: Trusted
Laboratory Exercise 1
count), all pivotal in ensuring the outcome in which the rider land his bike on the other
edge of the cliff successfully.
Input:
Some of the information taken from the Laboratory 1 Guild, the point was where the
Grand Canyon is at its narrowest is at Marble Canyon, air resistant is negligible, and
the centre of gravity remains the same for the whole trajectory. [1]
- Angle of launch q = 45°
- Acceleration due to gravity g = 9.8 (m/s2)
- Displacement: d = 183 (Meters)
Output:
- Utilize the Range formula to determine the minimum velocity required for the
motorcycle to successfully traverse the gap at a launch angle of 45 degrees. The result
should yield a positive value, converted to km/h and that number indicates the lowest
speed needed for a successful crossing.
4
RMIT Classification: Trusted
Laboratory Exercise 1
In analysing the initial velocity for a motorcycle's jump, MATLAB and manual
calculation yielded subtly different results: 152.45 km/h and 152.46 km/h respectively.
In the manual calculation method, rounding the initial velocity to 42.35 m/s before
converting it to km/h introduces a slight difference in the final result, contributing to the
observed discrepancy.
5
RMIT Classification: Trusted
Laboratory Exercise 1
When considering projectile motion with an initial height different from zero, the
equations governing the motion become slightly modified. Here are two of the key
equations for the displacement:
&
Vertical Displacement y = H + v0 ´ t ´ Sin (q) - ) ´ g ´ t2
6
RMIT Classification: Trusted
Laboratory Exercise 1
should be positive numbers, converted into seconds and meters for variables “t” and
“d, H” respectively.
3.2 Task 5a: Calculate the Initial height of the 45° launch angle
Note: Initial velocity reduced to 125 km/h
Step 1 - Add the Horizontal Displacement equation:
x = v0 ´ t ´ Cos (q)
Step 2 - Plug in the given information and find variable Time:
+ Change Initial velocity from km/h to m/s (125 / 3.6 = 34.72 m/s)
!" × %
+ Change q from Degrees to Radians ( &'(
= π/4)
ó t = 7.45 (Seconds)
Step 3 - Add the Vertical Displacement equation:
&
=> y = H + v0 ´ t ´ Sin (q) - ) ´ g ´ t2
Step 4 - Plug in the given information and variable Time to find Initial
height:
0 = H + 34.72 ´ 7.45 ´ Sin (π/4) - &) ´ 9.8 ´ 7.452
=> H = 89.06 (Meters)
3.3 Task 5b: Calculate the Displacement for 35° and 55° launch angle
Note: Keep the Initial velocity at 125 km/h and Initial height at 89.06 meters
Step 1 - Add Vertical Displacement equation:
!
y = H + v0 ´ t ´ Sin (q) - ´ g ´ t2
"
Step 2 - Plug in the information and find all the necessary numbers (at a
launch angle of 35°):
+ Change Initial velocity from km/h to m/s (125 / 3.6 = 34.72 m/s)
*" × %
+ Change q from Degrees to Radians ( &'(
= 7π/36)
&
=> 0 = 89.06 + 34.72 ´ t ´ Sin (7π/36) - ) ´ 9.8 ´ t2
7
RMIT Classification: Trusted
Laboratory Exercise 1
+ The equation above is quadratic equation in the form at2 + bt + c = 0, where a = -4.9,
b = 34.72 ´ Sin (7π/36), c = 89.06. Therefore, a quadratic formula can be used:
45 ± √ 5^)4 !9:
t= )9
+ Calculate b at 35°:
b = 34.72 ´ Sin (7π/36)
=> b = 19.92
Step 3 - Utilize the quadratic formula above and the flight time of the 35°
angle:
45 ± √ 5^)4 !9:
t= )9
Step 4 - Apply the same method to find the flight time of the 55° angle:
Note: b = 34.72 ´ Sin (11π/36)
t1 = 8.059 (Seconds)
t2 = - 2.255 (Seconds) (Invalid because time must be positive)
8
RMIT Classification: Trusted
Laboratory Exercise 1
9
RMIT Classification: Trusted
Laboratory Exercise 1
Conclusion
In summary, Experiment 1 dive into the complex physics of projectile motion,
specifically exploring the effects of changes in initial altitude on projectile trajectory.
Through meticulous hand calculation MATLAB testing, we discovered the profound
This experiment not only deepened our comprehension of fundamental physics
principles but also highlighted the practical implications for various real-world
applications.
10
RMIT Classification: Trusted
Laboratory Exercise 1
RMIT Vietnam
"I declare that in submitting all work for this assessment I have read, understood and agree to the
content and expectations of the Assessment declaration ."
11
RMIT Classification: Trusted
Laboratory Exercise 1
Introduction to Experiment 2
In the field of photography, colour substitution techniques play an important role in the
creative process. One of the most used methods for representing colour in digital
media is the RGB (Red, Green, Blue) colour space. In this system, colours are created
by combining different intensities of red, green, and blue light. Each pixel on a digital
display is composed of these three primary colours in different proportions, create a
spectrum of colours. From changing the colour of objects in photos to performing
chroma keying in video, the versatility of colour replacement methods will be
demonstrated through MATLAB.
Figure 6 “coloredChip.png”
The requirement settled for the program was mentioned:
b. Iterates through the image and changes all pixels of that colour to black
12
RMIT Classification: Trusted
Laboratory Exercise 1
6.2.1 Input
- The input required for solving the problem is the 'coloredChips.png' image which as
aforementioned above, could be found in the MATLAB Image Processing Toolbox
library.
- As we import the image to the workspace using ‘imread’ function the matrix
representing the image in the Workspace is of type 'uint8'. [4]
- The matrix has three dimensions, where the first two dimensions represent the height
and width of the image, and the third dimension represents the RGB channels. Each
pixel in the image is represented by three values corresponding to the intensity of
red, green, and blue channel. [4]
- The data cursor in MATLAB is a helpful function. It enables us to get the RGB values
of a single pixel, which is helpful in determining the conditional statement's value
range.
6.2.2 Output
- The output is the modified image where all pixels of the specified colour are
changed to black.
- The modified image should be displayed in a new figure window.
13
RMIT Classification: Trusted
Laboratory Exercise 1
14
RMIT Classification: Trusted
Laboratory Exercise 1
During the colour-changing test, we tried altering colours to see if the script accurately turned
the right pixels black or white. We tested it with all the colour option to ensure it worked. By
examining the resulting images, we could confirm whether the script successfully changed the
colours as expected. The tested screenshot of other color will be provide in the Appendix.
15
RMIT Classification: Trusted
Laboratory Exercise 1
In the error handling test, we examined how the script dealt with mistakes. We purposely gave
it incorrect inputs, such as selecting a colour that does not exist. Our goal was to make sure
that the script handled errors smoothly without crashing.
Prompt the user for the colour to change Perform the search and colour-changing
process
16
RMIT Classification: Trusted
Laboratory Exercise 1
Displaying the image Output the resultant image back to the main
script
The program is working effectively. The main script and the function script is well connected
to provide a corrected result. As a comparison to the Part 1 program, since both program
have the same parameter of value in the conditional statement and make use of the same
while loop for error handling, the function is exactly the same, which conclude a successful
incorporated user-defined function.
- Strength:
o User-friendly interface: The program provides clear instruction and a menu of
colour.
o Successful incorporated user-defined function separates the main
functionality into a user-defined function and the main script, enhancing
readability and maintainability.
o Error handling: The program includes a default case to handle invalid colour
selections, ensuring smooth operation even in unexpected situations.
o Visual feedback: It displays the modified image in real-time, allowing users to
see the effects of their selections immediately.
- Weakness:
o Inefficiency: Despite generate the correct result however the program shows
imperfection. As the colour changing function is hardcoded by condition the
result is not cover all variations and shade of the selected colour. For
instance: the rim of the chips was not change.
o Inefficiency: The program iterates through each pixel in nested loops for each
colour change operation, which could be computationally expensive for large
images. A more efficient algorithm could be applied.
18
RMIT Classification: Trusted
Laboratory Exercise 1
To conclude, despite our program show some positive aspect, however, due to the limitation
of time and knowledge, there are still room for improvement in future work. Nonetheless, the
completion of the program fulfills the course requirements and learning objectives, marking it
as a successful learning experience.
Reference
[5] Tutoroot, “What is Projectile Motion? – Types, Derivation, Formulae 2024,” 22 10 2022.
[Online]. Available: https://www.tutoroot.com/blog/what-is-projectile-motion-types-
derivation-formulae/. [Accessed 2024].
19
RMIT Classification: Trusted
Laboratory Exercise 1
Appendix
20