Lab 4 Mecanica
Lab 4 Mecanica
Physics Department
Raport
For Theoretical Mechanics made in MATLAB
Laboratory work 4
Variant 5
Author: Verified:
Burduja Adrian dr., conf. univ. Sanduleac,
std. gr. FAF-231 Ion
ω1 n1
b) ω1 ̸= ω2 , ω2
= n2
, n1 , n2 = 1, 2, 3, ..., α1 = α2 = α − π2 ; Write a file-function with the
FAF-231 Burduja Adrian; Laboratory Work №-4 3
Code:
# LL4 file
# L . L . Nr4
% Burduja Adrian FAF231
% EX2
t = 0: pi /20:10* pi
%a)
figure (1)
subplot (2 ,2 ,1)
[ x1 , x2 , x ] = fn ( t )
plot (t ,x , ’k - ’ ,t , x1 , ’k - r ’ ,t , x2 , ’k - g ’)
title ( ’ O s c i l a i i ␣ armonice ␣ necoerente ␣ ( 1 ␣ ␣ 2 ) ’) ;
grid on ;
xlabel ( ’t ’) ; ylabel ( ’f ( t ) ’) ;
legend ( ’ fn ’ , ’ x1 ’ , ’ x2 ’)
axis ([0 30 -50 50])
%b)
subplot (2 ,2 ,2)
[ x1 , x2 , x ] = fc ( t )
plot (t ,x , ’k - ’ ,t , x1 , ’k - r ’ ,t , x2 , ’k - g ’)
title ( ’␣ O s c i l a i i ␣ armonice ␣ coerente ␣ ( 1 ␣ = 2 ) ’) ;
grid on ;
xlabel ( ’t ’) ; ylabel ( ’f ( t ) ’) ;
legend ( ’ fn ’ , ’ x1 ’ , ’ x2 ’)
axis ([0 30 -50 50])
%c)
subplot (2 ,1 ,2)
t = 0: pi /20:100* pi
FAF-231 Burduja Adrian; Laboratory Work №-4 4
[ x1 , x2 , x ] = fan ( t )
plot (t ,x , ’k - ’ ,t , x1 , ’k - r ’ ,t , x2 , ’k - g ’)
title ( ’ O s c i l a i i ␣ armonice ␣ necoerente ␣ ( 1 ~= ␣ 2 ␣ ) ’)
grid on ;
xlabel ( ’t ’) ; ylabel ( ’f ( t ) ’) ;
legend ( ’ fn ’ , ’ x1 ’ , ’ x2 ’)
axis ([0 300 -50 50])
%d)
figure (2)
alpha = [0 , pi /6 , pi /4 , pi /3 , pi /2 ,2* pi /3 ,3* pi /4 ,5* pi /6 , pi ]
for n = 1:9
subplot (3 ,3 , n )
t = [0: pi /20:100* pi ]
[ x1 , x2 , x ] = fac (t , alpha ( n ) )
plot (t ,x , ’k - ’ ,t , x1 , ’k - r ’ ,t , x2 , ’k - g ’)
title ( ’ O s c i l a i i ␣ armonice ␣ necoerente ␣ ( 1 ~= ␣ 2 ␣ ) ’)
grid on ;
xlabel ( ’t ’) ; ylabel ( ’f ( t ) ’) ;
legend ( ’ fn ’ , ’ x1 ’ , ’ x2 ’)
axis ([0 300 -50 50])
end
% EX 3
% a)
omega1 (3)
% b)
omega2 (4)
function [ x1 , x2 , x ] = fn ( t )
x1 = 18* cos ( t )
x2 = 20 * cos ( t )
x = x1 + x2 ;
endfunction
t = [0:0.05:10]
alpha = [0 , pi /6 , pi /4 , pi /3 , pi /2 ,2* pi /3 , 3* pi /4 , 5* pi /6 , pi ]
for n = 1:9
ax = 0.5
ay = 5
subplot (3 ,3 , n )
x = ax .* cos ( 5 .* t )
y = ay .* cos ( 5 .* t + alpha ( n ) )
plot (x , y )
grid on
title ([ ’ alpha ␣ = ␣ ’ , num2str ( alpha ( n ) ) ])
end
endfunction
FAF-231 Burduja Adrian; Laboratory Work №-4 6
t = [0:0.05:10]
alpha = [0 , pi /6 , pi /4 , pi /3 , pi /2 ,2* pi /3 , 3* pi /4 , 5* pi /6 , pi ]
for n = 1:9
ax = 0.5
ay = 5
subplot (3 ,3 , n )
x = ax .* cos ( 5 .* t + alpha ( n ) - pi /2)
y = ay .* cos ( ( n +1) *5 .* t + alpha ( n ) - pi /2)
plot (x , y )
grid on
title ([ ’ alpha ␣ = ␣ ’ , num2str ( alpha ( n ) ) , ’␣ n ␣ = ␣ ’ , num2str ( n ) ])
end
endfunction
Obtained figures:
FAF-231 Burduja Adrian; Laboratory Work №-4 7
FAF-231 Burduja Adrian; Laboratory Work №-4 8
Conclusions
In this laboratory I have studied cinematic characteristics of harmonic oscillations and
their composition in different conditions. To visualise them I used octave to write the
scripts that draw them onto the graphic window. Working with these oscillations, in-
putting different values I observed how the image changed.