You are on page 1of 11

Ministry of Education of Republic of Moldova

Technical University of Moldova

Faculty of Computers, Informatics and Microelectronics

Physics Department

Raport
For Theoretical Mechanics made in MATLAB
Laboratory work 3

Varient 5

Calculation of characteristics kinematics of


the movement of the point

Author: Verified:
Burduja Adrian dr., conf. univ. Sanduleac,
std. gr. FAF-231 Ion
Chis, inău 2023

2
FAF-231 Burduja Adrian; Laboratory Work №-s 2

I. To declare the function from the table below in a


file-function and to construct the graph on the given
segment using plot(step of 0.05) and fplot.

II. To write two file-functions. The first (for example,


named xy) has the input parameter - t (time), and the
output parameters the values coordinates of the ma-
terial point during movement (x and y) for that time.
The second (for example, with the name figpas) has
input parameters the number of the graphic window
(fig) and the calculation step of x and y coordinates
(step), and at the output it displays the trajectory of
the point in the given time interval and position of
the point on the trajectory for a moment of time cho-
sen randomly from the given interval. The figpas file
function is called from the Windows Command.
a) To construct the planar trajectory graph of the material point with using the comet and
plot commands. To show the position of the point on the trajectory for a randomly chosen
time instant from the given interval. Experiment with different step values calculation.
b) To calculate speed, acceleration, tangential acceleration, the normal acceleration and
the radius of curvature of trajectory at the chosen time point.
c) To show on the trajectory graph all the vectors from the point previous, using the
window tools for this graphs.
d) To build a table with all the results obtained.
FAF-231 Burduja Adrian; Laboratory Work №-s 3

III. To write two file-functions. The first (for example,


with the name xyz) has the input parameter - t (time),
and the output parameters material point coordinate
values during movement (x,y and z) for that time. The
second (for example, with the name figpas) has the
input parameters the number of the graphic window
(fig) and the step of calculation of x and y coordinates
(step), and at the output it displays the trajectory of
the point in the given time interval and the position
of the point on the trajectory for a moment of time
chosen randomly from the given interval. call tab-
function figpas is done from Windows Command.
a) To build the graph of the spatial trajectory of the material point with the help of
comet3 and plot3 commands. To show the position point on the trajectory for a chosen
moment of time randomly from the given interval. To experiment with different values
of the ace of calculation.
b) To calculate speed, acceleration, tangential acceleration, normal acceleration and ra-
dius of curvature of the trajectory for the chosen time point.
c) To build a table with all the results obtained.

1 LL3.m

% 1.

x = [0:0.05:1]
y = f(x);

figure (1)

subplot (1 ,2 ,1)
fplot ( ’f ’ , [0 ,1])
grid on
FAF-231 Burduja Adrian; Laboratory Work №-s 4

grid minor
legend ( ’f ( x ) ’)
xlabel ( ’ Axa ␣ x ’)
ylabel ( ’ Axa ␣ y ’)

subplot (1 ,2 ,2)
plot (x , y )
grid on
grid minor
legend ( ’f ( x ) ’)
xlabel ( ’ Axa ␣ x ’)
ylabel ( ’ Axa ␣ y ’)

% 2.

figpas (2 ,0.05)

% 3.

grafpas (3.005)

2 iIfferent file functions:


% f.m

function y = f ( x )
y = cos ( 1 ./ ( 2.* pi ./11 - atan ( x .^ x ) ) )
endfunction

% f2 . m

function [x , y ] = f2 ( t )
x = exp ( - t ) .* cos ( t )
y = sin ( t )
endfunction

% xyz . m
FAF-231 Burduja Adrian; Laboratory Work №-s 5

function [x ,y , z ] = xyz ( t )
x = e .^ - t .* cos ( t )
y = e .^ t .* sin ( t )
z = 2 .* sqrt ( t )
endfunction

% figpas . m

function figpas ( fignumber , pass )


% a)
t = [0: pass :2* pi ]
[ x , y ] = f2 ( t )
figure ( fignumber )
subplot (1 ,2 ,1)
comet (x , y )
xlabel ( ’ Axa ␣ X ’) ; ylabel ( ’ Axa ␣ Y ’)

hold on

t1 = 2* pi * rand
[ x1 , y1 ] = f2 ( t1 )
plot ( x1 , y1 , ’ro - ’)
title ([ ’ comet ␣ of ␣ f ( x ) ,␣ t ␣ = ␣ ’ , num2str ( t1 ) ])
xlabel ( ’ Axa ␣ X ’) ; ylabel ( ’ Axa ␣ Y ’)
grid on

subplot (1 ,2 ,2)
plot (x , y )
grid on
title ( ’f ( x ) ’)
xlabel ( ’ Axa ␣ X ’) ; ylabel ( ’ Axa ␣ Y ’)

% b ) calcularea vitezei , acceleratiei , acceleratiei


tangentiale ,
% acceleratiei normale si raza curburii pentru t1
pkg load symbolic

clear t
FAF-231 Burduja Adrian; Laboratory Work №-s 6

syms t
vx = diff ( exp ( - t ) * cos ( t ) ,t )
vy = diff ( sin ( t ) ,t )

% viteza
v = sqrt ( vy ^ 2 + vx ^ 2)
% evaluating v
ev_v = double ( subs (v ,t , t1 ) )

ax = diff ( vx , t )
ay = diff ( vy , t )

% acceleratia
a = sqrt ( ay ^ 2 + ax ^ 2)
ev_a = double ( subs (a ,t , t1 ) )

% acceleratia tangentiala
at = diff ( v )
ev_at = double ( subs ( at ,t , t1 ) )

% acceleratia normala
an = sqrt ( ax ^2 + ay ^2 - at ^2)
ev_an = double ( subs ( an ,t , t1 ) )

% raza curburii :
cross_product = vx * ay - vy * ax ;

r = v ^3 / abs ( cross_product )
ev_r = double ( subs (r ,t , t1 ) )
endfunction

% grafpas . m

function retval = grafpas ( fignumber , pass )


% a)
t = [0: pass :2* pi ]
[x ,y , z ] = xyz ( t )
FAF-231 Burduja Adrian; Laboratory Work №-s 7

figure ( fignumber )
subplot (1 ,2 ,1)
comet3 (x ,y , z ) ;
xlabel ( ’ Axa ␣ X ’) ; ylabel ( ’ Axa ␣ Y ’) ; zlabel ( ’ Axa ␣ Z ’) ;
hold on

t1 = 2* pi * rand
[ x1 , y1 , z1 ] = xyz ( t1 )
plot3 ( x1 , y1 , z1 , ’ro - ’)
title ([ ’ comet ␣ of ␣ f ( x ) ,␣ t ␣ = ␣ ’ , num2str ( t1 ) ])
xlabel ( ’ Axa ␣ X ’) ; ylabel ( ’ Axa ␣ Y ’) ; zlabel ( ’ Axa ␣ z ’)
grid on

subplot (1 ,2 ,2)
plot3 (x ,y , z )
grid on
title ( ’f ( x ) ’)
xlabel ( ’ Axa ␣ X ’) ; ylabel ( ’ Axa ␣ Y ’) ; zlabel ( ’ Axa ␣ z ’)

% b ) calcularea vitezei , acceleratiei , acceleratiei


tangentiale ,
% acceleratiei normale si raza curburii pentru t1
pkg load symbolic

clear t
syms t
vx = diff ( e ^ - t * cos ( t ) ,t )
vy = diff ( e ^ t * sin ( t ) ,t )
vz = diff ( 2 * sqrt ( t ) ,t )

% viteza
v = sqrt ( vy ^ 2 + vx ^ 2 + vz ^2)
% evaluating v
ev_v = double ( subs (v ,t , t1 ) )

ax = diff ( vx , t )
ay = diff ( vy , t )
az = diff ( vz , t )
FAF-231 Burduja Adrian; Laboratory Work №-s 8

% acceleratia
a = sqrt ( ay ^ 2 + ax ^ 2 + az ^2)
ev_a = double ( subs (a ,t , t1 ) )

% acceleratia tangentiala
at = diff ( v )
ev_at = double ( subs ( at ,t , t1 ) )

% acceleratia normala
an = sqrt ( ax ^2 + ay ^2 + az ^2 - at ^2)
ev_an = double ( subs ( an ,t , t1 ) )

% raza curburii :
cross_product = [ vy * az - vz * ay , vz * ax - vx * az , vx * ay - vy *
ax ];
r = v ^3 / norm ( cross_product ) ;

ev_r = double ( subs (r ,t , t1 ) )

whos ev_v ev_a ev_at ev_an ev_r

endfunction

Figure 1
FAF-231 Burduja Adrian; Laboratory Work №-s 9

Figure 2

Figure 3
FAF-231 Burduja Adrian; Laboratory Work №-s 10

Conclusions
In conclusion, during my time working on this laboratory, I learnt how to use the plot-
ting tool to display the trajectory of a point based on its movement. I learned about
the mobility of a material point over a given interval by creating a planar trajectory
graph with both the comet and plot commands. Experimenting with different compu-
tation step numbers allowed me to see how the graph’s resolution affects the trajectory
representation.

You might also like