Professional Documents
Culture Documents
1
Group Information:
Group No: 12 Class: CC16
Completion day: December 20th, 2022
Name ID
1. Nguyễn Minh Hoàng 2252232
2. Dương Thanh Phước 2252659
3. Mai Quốc Thăng 2252761
2
Table of Contents
I. Introduction..........................................................4
II. Theory.................................................................5
V. Conclusion.........................................................17
VI. References........................................................17
3
I. Introduction
Oscillatory Motion is defined as a periodic motion in which the
particles move from one place to another on a particular
predetermined path within equal time intervals.
Examples of oscillation motions are all around us: The motion of the
swings, the motion of the pendulum, our heartbeats, etc.
4
II. Theory
The oscillation of any body due to elastic force can be described by the
differential equation:
Where:
y: Oscillation displacement,
b: Damped coefficient,
0: Angular frequency of free oscillation,
: Angular frequency of stimulating force.
5
III. MATLAB code and explanation
figure
syms y t
clc
disp('enter value');
omega0 = input('enter omega: omega0(rad/s) = ');
b = input('enter damping coefficient: b = ');
F = input('enter force: F(N) = ');
t0 = input('enter time to start: t(s) = ');
if F == 0
disp('Function of oscillation displacement: ')
y = collect(dsolve(['D2y +',num2str(b),'*Dy +
(',num2str(omega0),'^2)*y = 0'],['y(0) = 5'],['Dy(0) = 0'],['t']),t)
else
omega = input('enter omega of stimulus force: omega(rad/s) = ');
disp('Function: ')
y = collect(dsolve(['D2y +',num2str(b),'*Dy +
(',num2str(omega0),'^2)*y = ',num2str(F),'*cos(',num2str(omega),'*t)'],
['y(0) = 5'],['Dy(0) = 0'],['t']),t)
end;
6
Plot the graph depending on time (with given initial conditions y(0) =
5; y’(0) = 0):
7
IV. Result and analysis
a) Harmonic oscillation (0 = 3; b = F = 0; t = 20s)
8
0 = 10; b = 0.1; F = 0; t = 20s
9
0 = 10; b = 1.0; F = 0; t = 20s
10
0 = 10; b = 10; F = 0; t = 20s
11
c) Stimulated oscillation (0 = 10; b = 0.1; F = 10; = 10.0, 5.0, 3.0, 0.0; t
= 150s) % many values of
0 = 10; b = 0.1; F = 10; = 10.0; t = 150s
12
0 = 10; b = 0.1; F = 10; = 5.0; t = 150s
13
0 = 10; b = 0.1; F = 10; = 3.0; t = 150
14
0 = 10; b = 0.1; F = 10; = 0.0; t = 150s
15
All the above results match the results calculated manually,
proving other values can be replaced in and special situations can be
easily plotted and studied through MATLAB symbolic calculation
and graphical interpretation.
16
V. Conclusion
The project has successfully computed the solution of the
oscillatory motion using MATLAB’s symbolic calculation. With this
tool we can solve complex motion cases that cannot be solved by the
analytical method.
VI. References
A. L. Garcia and C. Penland, MATLAB Projects for Scientists and
Engineers, Prentice Hall, Upper Saddle River, NJ, 1996.
http://www.algarcia.org/fishbane/fishbane.html.
https://www.mathworks.com/matlabcentral/fileexchange/2268-
projects-for-scientists-and-engineers
17