You are on page 1of 9

Contents

Introduction 4
Theory 4
MATLAB Code and Explanation 6
Results and Discussion 9
Conclusion 10
References 11
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

Project 1:
Determining Trajectory and Angular Momentum of Kinetic Motion
Group information
Group 7 Class: CC12 Completion day: January 20, 2022
1. Trần Đình Thái, Student ID: 2153794
2. Huỳnh Minh Hiển, Student ID: 2153349
3. Nguyễn Hữu Hậu, Student ID: 2154014

I. Introduction:
Kinetic motion is the fundamental concept of mechanics. It includes the movement of objects around us
such as spinning motion of the disk or the rigid bodies in general. In physics, angular momentum is the
rotational equivalent of linear momentum. It is an important quantity in physics because it is a conserved
quantity – the total angular momentum of a closed system remains constant. This project considers three
– dimension rotational motion of a rigid body as an illustration for the theory ¿figure 1¿[1]

Figure 1. Rotational motion [1]


II. Theory:
1. Kinetic motion relating to time is usually being expressed by a system of

{
x=f ( t )
y=g(t )
where f (t) and g(t ) are two functions representing the x -coordinates and y -coordinates in the Cartesian
plane. In order to obtain the motion equation of y= y (x), we need to interchange the position of x and t
to get the function of t=f −1 ( x) and substituting this to the second equation. Finally, we have the
equation of y=g ( f −1 ( x )) = y (x ). Thereby, we have the orbital equation.
But in this case, to simplify the calculation and plotting the graph of the trajectory, we will express the
kinetic motion by an equation of vector position r⃗ , such that:
r⃗ =x ( t ) i⃗ + y ( t ) ⃗j
2. Let us look into the definition of the momentum of motion. In Newtonian mechanics, linear
momentum, translational momentum, or simply momentum is the product of the mass and velocity of an

2
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

object. It is a vector quantity, possessing a magnitude and a direction. If m is an object's mass and ⃗v is its
velocity vector, then the object's momentum vector ⃗p is defined as
⃗p=m⃗v
d r⃗ dx dy
where ⃗v = = i⃗ + ⃗j ,∈Cartesian coordinate system, we can express ⃗v as
dt dt dt

{
dx
v x=
⃗v = dt
dy
v y=
dt
So the magnitude of velocity is |⃗v|= √ v2x +v 2y .
3. Before investigating the angular momentum, let us define the cross product of two vectors.
The Cross Product ¿or Vector Product¿ of two vectors ⃗ A and ⃗B is a multiplication of vectors where the
result is a vector quantity C with a direction perpendicular to both vectors ⃗
⃗ A and ⃗B, and the magnitude
equal to AB sin ϕ, the image of the cross product is display in ¿figure 2¿.

Figure 2.Cross Product


C =⃗ A×⃗ B ⟹C= AB sin ϕ
where A is the magnitude of the first vector, B is the magnitude of the second vector and ϕ is the angle
between the two vectors.
4. The instantaneous angular momentum ⃗ L of a particle
relative to the origin O is defined by the cross product of the
particle’s instantaneous position vector r⃗ and its
instantaneous linear momentum ⃗p:

L=⃗r × ⃗p =⃗r × ( m ⃗v )
So we have the angular momentum ⃗ L determined by the
equation:

L=m ( ⃗r × ⃗v )
Then finally the magnitude of ⃗
L is
L=mrv sin ϕ
where ϕ is the angle between r⃗ and ⃗p, r is the magnitude of instantaneous position vector r⃗ and v is the
magnitude of instantaneous velocity ⃗v.

3
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

III. MATLAB Code and Explanation:


 Index: MATLAB commands list
Command Description
function Create the function.
clear Remove. all variables from memory.
clc Clear command window.
syms Declare symbolic variable.
input Display prompts and waits for input.
sqrt Square root of x.
diff Differentiate symbolic expression.
disp Display contents or the value of variables.
sin Sine of x.
acos Arccos of x.
cross Cross product.
while While loop.
if - else If – else condition.
subplot Create plots in subwindows.
plot Draw a plot.
subs Substitute variable in expression.
title Add a title.
x/ylabel Add x/y axis label.
break Terminate execution of a loop.
end Finish a loop or a function.

 Step 1: To begin, create the function and enter expressions for x (t), y (t ) and the mass.
function KineticMotion
clear
clc
syms t;
% Input the coordinates equation and the mass
x = input('Input x-coordinate x(t) = ');
y = input('Input y-coordinate y(t) = ');
m = input('Input mass m = ');
r = sqrt(x^2+y^2);

 Step 2: Calculate the velocity and position vector.


% Finding the velocity vector and position vector
vx = diff(x,t);

4
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

vy = diff(y,t);
v = sqrt(vx^2+vy^2);
vector_r = [x y 0];
vector_v = [vx vy 0];
disp('Vector r = ');
disp(vector_r);
disp('Vector v = ');
disp(vector_v);

 Step 3: Calculate the momentum vector and magnitude of angular momentum.


% Finding momentum vector and magnitude of angular momentum
L = m*r*v*sin(acos((x*vx+y*vy)/(r*v)));
vector_L = m*cross(vector_r,vector_v);
disp('Momentum vector L is ');
disp(vector_L)
disp('Magnitude of angular momentum: ');
disp(L);

 Step 4: Plot the trajectory and the change of angular momentum with time.
% Sketch the graph
while 1
T0 = input('Input the time to sketch the graph: ');
if T0 > 0
t = 0:1:T0;
subplot(1,2,1);plot(subs(x),subs(y));
title('Trajectory');xlabel('x');ylabel('y');
subplot(1,2,2);plot(t,subs(sqrt(vector_L*vector_L')));
title('L(t)');xlabel('t'); ylabel('L');
break
else
disp('T0 must be greater than 0, re-input T0: ');
end
end

 Full MATLAB Code of this project:


function KineticMotion
clear
clc
syms t;
% Input the coordinates equation and the mass

5
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

x = input('Input x-coordinate x(t) = ');


y = input('Input y-coordinate y(t) = ');
m = input('Input mass m = ');
r = sqrt(x^2+y^2);
% Finding the velocity vector and position vector
vx = diff(x,t);
vy = diff(y,t);
v = sqrt(vx^2+vy^2);
vector_r = [x y 0];
vector_v = [vx vy 0];
disp('Vector r = ');
disp(vector_r);
disp('Vector v = ');
disp(vector_v);
% Finding momentum vector and magnitude of angular momentum
L = m*r*v*sin(acos((x*vx+y*vy)/(r*v)));
vector_L = m*cross(vector_r,vector_v);
disp('Momentum vector L is ');
disp(vector_L)
disp('Magnitude of angular momentum: ');
disp(L);
% Sketch the graph
while 1
T0 = input('Input the time to sketch the graph: ');
if T0 > 0
t = 0:1:T0;
subplot(1,2,1);plot(subs(x),subs(y));
title('Trajectory');xlabel('x');ylabel('y');
subplot(1,2,2);plot(t,subs(sqrt(vector_L*vector_L')));
title('L(t)');xlabel('t'); ylabel('L');
break
else
disp('T0 must be greater than 0, re-input T0: ');
end
end

IV. Results and Discussion:


Example: The position vector of a particle of mass 3.00 kg is given as a function of time by the system
of coordinates equation:

6
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

{
3
x=2t
y=4 t 2 +5
Determine the angular momentum of the particle about the origin as a function of time and plot the
graph of the trajectory and the variation of angular momentum with time.

Solution:
According to the theory, we obtain the vector position
⃗ ( 4 t 2+5 ) ⃗j
r⃗ =2t 3 i+
and vector velocity
d r⃗ dx dy
v⃗ = = i⃗ + ⃗j =6 t i⃗ + 8 t ⃗j
2
dt dt dt
So we can determine the angle between two vectors r⃗ and ⃗v is
r⃗ . ⃗v
cos ϕ=
|⃗r|.|⃗v|
Then the angle is

(√ 2 t . 6 t + ( 4 t +5 ) .8 t
) (√ )
3 2 2
12 t 5+ 32t 3+ 4 0 t
ϕ =arccos =arccos
( 2t 3 ) + ( 4 t2 +5 ) . √( 6 t2 ) + ( 8 t )2 144 t 10 +832 t 8+ 2464 t 6 +3460 t 4 +16 00 t 2
2 2 2

Finally we have the magnitude of the vector angular momentum is

L=6 √ 144 t + 832t +2464 t +3460 t + 16 00t sin arccos


10 8 6 4 2
( (√ 12t 5 +32t 3 +4 0 t
144 t 10+832 t 8+ 2464 t 6+ 3460t 4 +16 00 t 2 ))
Now, using MatLab with the code programed above to calculate the angular momentum:

The graphs of the trajectory and the variation of angular momentum with time interval of 20 seconds are
plotted below:

7
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

We can use the calculator to calculate some value of the point and see if the coordinates in the graph of
L ( t ) and the value are consistent.
Finally, we have performed some calculation manually and the results from our calculation matched
with the calculation plotting from the MatLab program. Therefore, the results indicated the required
trajectory and the angular momentum.

V. Conclusion:
The project has completed the solution of the trajectory and the angular momentum of the kinetic motion
problem using MATLAB symbolic calculation. With this tool we can solve more complex motion
situations that cannot be solved by the analytical method.
From what we have gathered, solving the kinetic motion on Matlab provides a instant and more accurate
answer, resources can be searched easily on the Internet, and the commands can be reused with other
inputs. However, the command lines and expressions can be confusing, and it is finnicky to set up,
putting quotation marks and parentheses on both sides for examples, and the collected resources can be
misleading.
VI. References:
[1] Physics for Scientists and Engineers ( 6 th Edition ), Raymond A. Serway and John W. Jewett, 2004.
[2] A. L. Garcia and C. Penland, MATLAB Projects for Scientists and Engineers, Prentice Hall, Upper
Saddle River, NJ, 1996.
[3] Problems and Solutions in Introductory Mechanics, David Morin, 2014.

8
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

[4] Giáo trình Vật Lý Đại Cương, Lương Duyên Bình, NXB Giáo Dục Việt Nam, 2005.
[5] Vật Lý Đại Cương A1, Nguyễn Thị Bé Bảy, Huỳnh Quang Linh và Trần Thị Ngọc Dung, NXB Đại
Học Quốc Gia, 2005.

You might also like