Professional Documents
Culture Documents
Physics Department
Raport
For Theoretical Mechanics made in MATLAB
Laboratory work 3
Varient 5
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
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)
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
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 ’)
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
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 ’)
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 ) ;
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.