Study of oscillations
Group information
Group No: 9 Class: CC14 Completion day: 29/10/2022
1. Nguyễn Vũ Hà Student ID: 2252175
2. Ngô Bảo Ngọc Student ID: 2252536
3. Tcheng Tân Triết Student ID: 2252837
1. Introduction:
Oscillation is the repetitive variations of any quantity or measure about its equilibrium value
in time or it can also be defined as a periodic variations of a matter between two values or
about its central value. A single oscillation is considered to be a completed movement over a
period of time whether it is a side to side movement or an up and down movement. Every
oscillatory motion is periodic but every periodic motion is not oscillatory.
2. Theory:
When the acceleration of an object is proportional to its position and is in the direction
opposite the displacemnt from equilibrium, the object moves with simple harmonic motion.
The position x of a simple harmonic oscillator varies peridiocally in time according to the
function:
x ( t )= A cos (ωt +φ)
Where A is the amplitude of the motion, ω is the angular frequency, and φ is the phase
constant. The value of φ depends on the initial position and initial velocity of the oscillator.
We can also obtain the velocity and acceleration of a particle undergoing simple harmonic
motion:
dx
v ( t )=−ωA sin ( ωt +φ )=
dt
d2 x
a ( t )=−ω2 A cos ( ωt+ φ )= 2
dt
v=± ω √ A 2−x 2
Thus, the maximum speed is ωA , and the maximum acceleration is ω 2 A . The speed is zero
when the oscillator is at its turning points x = ±A and is a maximum when the oscillator is at
the equilibrium position x = 0. The magnitude of the acceleration is a maximum at the turning
points and zero at the equilibrium positon.
If an oscillator experiences a damping force R = −b . v , its position for small damping is
described by the fucntion:
−b
t
x= Ae 2 m cos (ωt +φ)
√
2
Where: ω= k −( b )
m 2m
If an oscillator is subject to sinusoidal driving force F ( t )=F 0 sin (ωt +φ), it exhibits
resonance, in which the amplitude is largest when the driving frequency matches the natural
frequency of the oscillaor.
Using the symbolic calculation of MATLAB, we can solve differential equations of the
oscillation motion and plot the graph depending on time for harmonic, damped and
stimulated oscillation.
3. MATLAB Code and Explanation:
clc; %Clear texts from the command window
figure('name', 'Studies of oscillation','NumberTitle', 'off', 'color', 'white') %Name the figure
syms y(t), %Assign symbolic variables
Dy = diff(y, t); %Differentiate y with respect to the variable t
D2y = diff(Dy, t); %Differentiate Dy with respect to the varible t
% Damped oscillation
w0 = 10; b = [0.01, 0.1, 1.0, 10.0]; F = 0; %Create variables
subplot(3,1,2); %Divide the figure into an m-by-n grid
for i = 1:numel(b) %Set the value of i to each value of the array b
SOL2 = dsolve(D2y==F*cos(w0*t)-b(i)*Dy-y*w0^2, y(0)==5, Dy(0)==0); %Solve the equation with the initial
conditions
[time1, y1] = fplot(SOL2,[0, 20]); %Plot the graph over the specific interval of time
plot(time1, y1), hold on %Generate the graph and retain plots
end
xlabel('t'), ylabel('y(t)'), title('Damped oscillation graph'), grid on; %Name the x and y-axis, name the title of the
graph and display grid lines
legend('b = 0.01', 'b = 0.1', 'b = 1', 'b = 10') %Set the labels for each line
disp('Damped oscillation equation: '); SOL2 %Represent the results in the Command Window
% Forced oscillation:
w0 = 10; b = 0.1; F = 10; w = [10.0, 5.0, 3.0, 0.0]; %Create variables
subplot(3,1,3); %Divide the figure into an m-by-n grid
for ii = 1:numel(w) %Set the value of ii to each value of the array w
SOL3 = dsolve(D2y==F*cos(w(ii)*t)-b*Dy-y*w0^2, y(0)==5, Dy(0)==0); %Solve the equation with the initial
conditions
[time2, y2] = fplot(SOL3, [0, 150]); %Plot the graph over the specific interval of time
plot(time2, y2), hold on %Generate the graph and retain plots
end
xlabel ('t'), ylabel('y(t)'), title('Forced oscillation graph'), grid on; %Name the x and y-axis, name the title of the
graph and display grid lines
legend('w = 10', 'w = 5', 'w = 3', 'w = 0') %Set the labels for each line
disp('Forced oscillation equation: '); SOL3 %Represent the results in the Command Window
% Harmonic oscillation (No damped, no stimulated force)
w0 = 3; F = 0; b = 0; %Create variables
subplot(3,1,1); %Divide the figure into an m-by-n grid
SOL1 = dsolve(D2y==F*cos(w0*t)-b*Dy-y*w0^2, y(0)==5, Dy(0)==0); %Solve the equation with the initial
conditions
[time, y] = fplot(SOL1,[0, 20]); %Plot the graph over the specific interval of time
plot(time, y); %Generate the graph
xlabel('t'), ylabel('y(t)'), title('Harmonic oscillation graph'), grid on; %Name the x and y-axis, name the title of
the graph and display grid lines
disp('Harmonic oscillation equation: '); SOL1 %Represent the results in the Command Window
4. Results and discussion:
Above results exactly match the results manually calculated. With Matlab calculations, we
can replace appropriately many other values of quantities to study other special cases.
5. Conclusion:
The project has successfully calculated and graphed the oscillation motion in different
instances using symbolic calculation with the help of Matlab. With this tool we can solve
complex motion situations that cannot be solved by the analytical method and observe them
more accurately.
6. References:
[1] https://en.wikipedia.org/wiki/Oscillation
[2] Physics for scientists and engineers, Serway Jewett, 6th edition:
https://e-learning.hcmut.edu.vn/pluginfile.php/217730/mod_resource/content/0/
PhysicsforEng_Serway2004.pdf
[3] University physics with Modern Physics, Hugh D.Young, Roger A.Freedman, 15th
edition:
https://e-learning.hcmut.edu.vn/pluginfile.php/214541/mod_resource/content/0/Hugh%20D.
%20Young%2C%20Roger%20A.%20Freedman%20-%20University%20Physics%20with
%20Modern%20Physics_1stBook.pdf
[4] https://www.mathworks.com/matlabcentral/fileexchange/2268-projects-for-scientists-and-
engineers