Professional Documents
Culture Documents
al Republicii Moldova
Universitatea Tehnică a Moldovei
Departamentul Fizică
Raport
asupra lucării de laborator Nr.4.
Varianta 26
Chișinău -2024
1
Sarcina Lucrării Nr.4
Rezolvare:
I.
m = 1;
k = 1;
omega = sqrt(k/m);
subplot(2,1,1)
plot(t, x_same_direction, 'b')
title('Oscillations in the Same Direction')
xlabel('Time')
ylabel('Displacement')
grid on
subplot(2,1,2)
plot(t, x_perpendicular_directions, 'r')
title('Oscillations in Perpendicular Directions')
xlabel('Time')
ylabel('Displacement')
grid on
2
3
II.
x1 = A1 * cos(omega1 * t + alpha1);
x2 = A2 * cos(omega2 * t + alpha2);
figure;
subplot(2,2,1);
plot(t, x1, 'b', t, x2, 'r', t, x1 + x2, 'g');
title('Incoherent Harmonic Oscillations');
xlabel('Time');
ylabel('Displacement');
legend('x1', 'x2', 'x = x1 + x2');
grid on;
subplot(2,2,2);
plot(t, x1, 'b', t, x2, 'r', t, x1 + x2, 'g');
title('Coherent Harmonic Oscillations');
xlabel('Time');
ylabel('Displacement');
legend('x1', 'x2', 'x = x1 + x2');
grid on;
alphas = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi];
4
for i = 1:length(alphas)
x_combined = A1 * cos(omega1 * t + alpha1) + A2 * cos(omega2 * t +
alpha2 + alphas(i));
subplot(3,3,i);
plot(t, x_combined);
title(['\alpha = ' num2str(alphas(i))]);
xlabel('Time');
ylabel('Displacement');
grid on;
5
III.
function lissajous_same_frequency(alpha_values)
t = linspace(0, 10, 1000);
omega = 2*pi;
A1 = 1;
A2 = 1;
figure;
for i = 1:length(alpha_values)
x = A1 * cos(omega * t + alpha_values(i));
y = A2 * cos(omega * t);
subplot(3,3,i);
plot(x, y);
title(['\alpha = ' num2str(alpha_values(i))]);
xlabel('x');
ylabel('y');
grid on;
end
end
function lissajous_different_frequency(alpha_values)
6
t = linspace(0, 10, 1000);
A1 = 1;
A2 = 1;
figure;
for i = 1:length(alpha_values)
x = A1 * cos(2*pi*t);
y = A2 * cos((2+alpha_values(i)) * pi * t);
subplot(3,3,i);
plot(x, y);
title(['\alpha = ' num2str(alpha_values(i))]);
xlabel('x');
ylabel('y');
grid on;
end
end
7
Concluzii
In the framework of Laboratory Work Nr.4, we explored the functionalities of the Octave
graphics package, familiarizing ourselves with basic commands and working with m-files.
We learned to work in 2D and 3D spaces, define and use functions to calculate and display
trajectories in the plane and in space. Through this work, we gained skills in drawing graphs
in different ways and understood the importance of visualizing data in analyzing and
interpreting results. This experience will be useful in future activities related to numerical
analysis, mathematical modeling, and data visualization in fields such as engineering,
physics, and computational sciences.