Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Report General Physic 1 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY

FACULTY OF APPLIED SCIENCE



Report
GENERAL PHYSIC 1

Topic 12 | Study of oscillations | Date: 5th December of 2023

Professor: Nguyễn Thị Minh Hương

Class: PH1004 Group:CC05


LIST OF MEMBERS

Ordinal Full Name Email ID


Number
1 Nguyễn Mậu Cường cuong.nguyenbcyanide22@hcmut.edu.vn 2352149

2 Nguyễn Thanh Duyên duyen.nguyen2352203@hcmut.edu.vn 2352203

3 Bùi Huy Minh Đạt dat.bui0602@hcmut.edu.vn 2352219

4 Trần Anh Đức duc.trananh0502@hcmut.edu.vn 2352271

5 Trần Tấn Đức duc.trantanduc@hcmut.edu.vn 2352273

PAGE 1
TABLE OF CONTENTS
Content and Task………………………………………………………………………….3

Chapter 1: Theory…………………………………………………………………………4

Chapter 2: Method………………………………………………………………………...8

Chapter 3: Results……………………………………………………………………….14

Chapter 4: Conclusion…………………………………………………………………...17

Chapter 5: References…………………………………………………………………...18

Appendix…………………………………………………………………………………19

PAGE 2
Content
The oscillation of any body due to elastic force can be described by the differential
equation:

ⅆ2𝑦 ⅆ𝑦
2
+𝑏 + 𝜔02 𝑦 = 𝐹 cos(𝜔𝑡)
ⅆ𝑡 ⅆ𝑡
In which, y is oscillation displacement, b is a damped coefficient, 𝜔0 is the angular
frequency of free oscillation, ꞷ is the angular frequency of stimulating force.

This project requires students to use Matlab to solve the above equation to study harmonic
oscillation (no damped, no stimulated force: b = F = 0), damped oscillation (b ≠ 0, F = 0),
stimulated oscillation (b ≠ 0, F ≠ 0).

Task
Examine the command dsolve to solve differential equation in MATLAB symbolic
calculation.
Write Matlab program to solve and plot the graph depending on time (with initial
conditions y(0) = 5; y’(0) = 0):
a) Harmonic oscillation (𝛼0 = 3; b = F = 0; t = 20s)
b) Damped oscillation (𝛼0 = 10; b = 0.01, 0.1, 1.0, 10.0 ; F = 0; t = 20s) % many values
of b
c) Stimulated oscillation (𝛼0 = 10; b = 0.1 ; F = 10; ꞷ = 10.0, 5.0, 3.0, 0.0; t = 150s ) %
many values of ꞷ
Discuss about the obtained results. Note: Students can use other non-symbolic
approaches. Submitting report has to contain text explaining the content of the program
and the entire code verified to run properly in Matlab.

PAGE 3
Chapter 1: Theory
ⅆ2 𝑦 ⅆ𝑦
The equation + 𝑏 ⅆ𝑡 + 𝜔02 𝑦 = 𝐹 cos(𝜔𝑡) is a second-order linear differential
ⅆ𝑡 2
equation that describes the motion of an oscillating system. Let's break down its
components:

1. y represents the oscillation displacement. It's a function of time, t, and it


describes how the position of the system changes over time.
ⅆ2𝑦
2. is the second derivative of y with respect to time. It represents the
ⅆ𝑡 2
acceleration of the system. In the context of oscillation, this term captures how
the system's acceleration depends on its position.
3. b is the damping coefficient. It accounts for the damping or resistance in the
system. Damping reduces the amplitude of oscillation over time.
ⅆ𝑦
is the first derivative of y with respect to time, which represents the system's
ⅆ𝑡
velocity. It shows how the system's velocity changes over time.
4. 𝜔0 is the angular frequency of free oscillation, representing the system's natural
or intrinsic frequency of oscillation when there are no external forces or damping.
It's related to the stiffness and mass of the system.
5. F is the amplitude of the stimulating force. This force can be applied externally to
the system and may vary with time.
6. cos(ꞷ𝑡) represents a cosine function of angular frequency ⍵ and time t. It
models a periodic external force acting on the system.

The equation combines these components to describe the behavior of a system


ⅆ2 𝑦 ⅆ𝑦
undergoing oscillatory motion. The left-hand side + 𝑏 ⅆ𝑡 + 𝜔02 𝑦 represents the
ⅆ𝑡
system's response to its position, velocity, and intrinsic frequency. The right-hand side
𝐹 cos(ꞷ𝑡) represents the effect of the external force applied to the system.

Solving this equation allows you to study how the system responds to different
parameters (such as b, F, and ⍵) and initial conditions, and it can help you understand the
behavior of oscillatory systems in various physical contexts, including mechanical
vibrations, electrical circuits, and more.

The equation is derived from Hooke’s law, which states that the force required to extend
or compress a spring by some distance is proportional to that distance 12. The elastic
force is the force that restores the spring to its original length when it is stretched or
compressed 2. The differential equation describes the motion of any body that oscillates
due to an elastic force, such as a mass attached to a spring 1. The equation is used to
model the behavior of many physical systems, including mechanical oscillators, electrical
circuits, and chemical reactions 2.

PAGE 4
1.1 Harmonic oscillation:
Periodic motion: In harmonic oscillation, the motion repeats itself in equal
intervals of time. The system returns to its initial state after a fixed period. This
repeating pattern is known as one complete cycle or period.

Restoring force: The motion occurs as a result of a restoring force that brings the
system back toward its equilibrium or central position when it is displaced from
that position. The restoring is directly proportional to the displacement from
equilibrium, and it acts in the opposite direction to the displacement.

Constant Frequency: The oscillation occurs at a constant and specific frequency


(⍵). The system’s characteristics determine this frequency and is independent of
the amplitude of the oscillation.

Sinusoidal (Sine or Cosine) Motion: The displacement of the system as a function


of time is described by a sinusoidal function, typically a sine or cosine function.
The displacement varies sinusoidally, resulting in a smooth, back-and-forth
motion. In the differential equation of the oscillation of any body, the term ꞷ20 𝑦,
represents the restoring force that is characteristic of harmonic oscillation. The
angular frequency 𝜔0 is associated with the natural or intrinsic frequency of the
oscillation when there is no damping or external forcing. That is why b=F=0. The
term 𝜔02 𝑦 captures the behavior of the system when it oscillates around its
equilibrium position.

1.2 Damped oscillation:

Damped oscillation is a type of oscillatory motion exhibited by physical systems


where the amplitude of the oscillations gradually decreases over time due to the
presence of a damping force or resistance. In damped oscillation, the system's
motion eventually comes to rest, reaching an equilibrium position.
Key characteristics of damped oscillation include:

1. Restoring Force: Similar to undamped harmonic oscillation, damped


oscillation is characterized by a restoring force that acts on the system and
pulls it back toward its equilibrium position when it is displaced. This
restoring force is proportional to the displacement from equilibrium and is
responsible for the oscillatory behavior.
2. Damping Force: In damped oscillation, there is an additional force called
ⅆ𝑦
the damping force, represented by the term 𝑏 ⅆ𝑡 in the differential
equation. This force opposes the motion of the system and is proportional

PAGE 5
ⅆ𝑦
to the velocity of the system . It is directed opposite to the velocity of
ⅆ𝑡
the system and results in energy dissipation. The damping force is
responsible for reducing the amplitude of the oscillations.
3. Decay in Amplitude: Due to the damping force, the amplitude of the
oscillations gradually decreases over time. The system loses energy to the
surroundings through the damping process. As a result, the oscillations
become smaller and eventually come to a stop, reaching equilibrium.
4. Exponential Decay: The displacement of the system as a function of time
in damped oscillation often follows an exponential decay pattern. The
exponential decay is influenced by the damping coefficient b, and the
larger the damping coefficient, the faster the oscillations decay.
ⅆ2 𝑦 ⅆ𝑦
In summary, the equation +𝑏 + 𝜔02 𝑦 = 𝐹 cos(𝜔𝑡) is a representation of
ⅆ𝑡 2 ⅆ𝑡
damped oscillation, where the oscillatory behavior (harmonic oscillation) is
affected by both damping (damping term) and external forcing (external force
term). It allows for the analysis of systems that exhibit oscillations that decrease
in amplitude due to damping while being influenced by an external driving force.
Damped oscillation is a common phenomenon in various physical systems and is
important in engineering, physics, and other fields for understanding the behavior
of systems with resistance or energy dissipation.

1.3 Forced Oscillation:


1. Definition: Forced oscillation is a phenomenon where an external periodic
force is applied to a system that is already undergoing oscillation. The
system oscillates with a frequency that is different from its natural
frequency. The amplitude of this oscillation depends on the frequency of
the external force and the damping factor of the system.
2. Driving force: 𝐹(𝑡) = 𝐹0 cos(ꞷ𝑡)
3. Equation:
ⅆ𝑥 ⅆ2 𝑥
∑𝐹𝑥 = 𝑚𝑎𝑥 → 𝐹0 sin ꞷ 𝑡 − 𝑏 ⅆ𝑡 − 𝑘𝑥 = 𝑚 ⅆ𝑡 2
4. Characteristic: After a sufficiently long time, when the energy input per
cycle from the driving force equals the amount of mechanical energy
transformed to internal energy for each cycle, a steady-state condition is
reached in which the oscillations proceed with constant amplitude. In this
situation, the solution for the equation is:
𝑥 = 𝐴 cos(ꞷ𝑡 + 𝜙)
Where:
𝐹0
𝐴= 𝑚
2
√(ꞷ2 − ꞷ20 )2 + (𝑏ꞷ)
𝑚

PAGE 6
5. Resonance: the dramatic increase in amplitude near the natural frequency
is called resonance. That means, when the frequency of the driving force is
near the natural frequency of oscillation, or 𝜔 = 𝜔0 , the amplitude is
large. At resonance, the applied force is in phase with the velocity and the
power transferred to the oscillator is a maximum.
The syntax used in code:

variable_name = value;: Assigns a value to a variable.


‘dydt=@(t, y)’ : Defines an anonymous function taking ‘t’ and ‘y’ as input arguments.
‘[y(2); -w0^2 * y(1)]’: Represents the system of differential equations.
‘initial_conditions’ : Creates a vector with initial conditions.
‘[t , y]= ode45(.....)’: Calls the ODE45 to solve the system of differential equations.
‘y(:, 1)’: Extracts the first column of the ‘y’ matrix.
‘plot(t , y_values)’ : Plots the graph of the displacement against time.
‘title’ , ‘xlabel’, and ‘ylabel’: Set the title and axis labels for the plot.
‘for’ loop to iterate over different damping stored in the array ‘b_values’.
‘legend’:Adds a legend to the plot, indicating the different damping coefficients.
‘grid on’ adds a grid to the plot.
‘hold off’ releases the hold state, allowing subsequent plots to replace the current plot.
dsolve(ode, initial_conditions) solves the differential equation with the specified initial
conditions and stores the solution in the cell array.
cell(1, length(w_values)) initializes a cell array to store solutions for different values of
w.
linspace(0, t_end, 1000) generates 1000 evenly spaced time values from 0 to t_end.
syms t y(t) declares symbolic variables t and y.

PAGE 7
Chapter 2: Method
2.1 Method of Harmonic Oscillation
Step 1: Define symbolic variables and input the parameters
t is time
y(t) is displacement function
𝜔0 = 3 is the angular frequency of free oscillation
Step 2: Define the differential equation
ode = diff (y, t, t) + 𝜔02 . 𝑦 == 0 is
the syntax of second-order linear homogeneous ODE:
ⅆ2 𝑦
+ 𝜔02 𝑦 = 0. This ODE represent harmonic oscillation.
ⅆ𝑡 2

Step 3: Set initial conditions


y (0) = 5 is the initial displayment
y’ (0) = 0 is the initial velocity
Step 5: Solve the differential equation
Use the ‘dsolve’ function to find the symbolic solution to the differential equation with
the specified initial conditions
solution = dsolve (ode, initial_conditions)
Step 6: Generate time value
t_values = 0:0.01:20 to create an array of time values from 0 to 20 with a step of 0.01
seconds
Step 7: Evaluate the solution
y_values = subs (solution, t, t_values) is evaluate the symbolic equation at each time
point specified in t_values
Step 8: Plot the graph
plot (t_values, y_values) is visualize the solution by plotting the displacement y against
time (t_values)

PAGE 8
2.2 Method of damping oscillation
Step 1: Input the parameters:

w_0 = 10: angular frequency of free oscillation

b = [0.01 0.1 1 10.0] : different values damping coefficient

F = 0 : magnitude of the stimulating force (since there is no stimulating force, we set F =


0)

t_end = 20: Total time recorded since the beginning

Step 2: Generate time values

The linspace function in MATLAB

y = linspace(x1,x2,n) generates n points. The spacing between the points is (x2-x1)/(n-1)..

Application: we use linspace to generate time value of the oscillation from the beginning
(0s) to end (20s) with the step of around 0.02s

t_values = linspace(0, t_end, 1000)

Step 3: Initialize a cell array to store a solution for each value of b

Cell array in MATLAB

A cell array is a data type with indexed data containers called cells, where each cell can
contain any type of data. Cell arrays commonly contain either lists of text, combinations
of text and numbers, or numeric arrays of different sizes. Refer to sets of cells by enclosing
indices in smooth parentheses, (). Access the contents of cells by indexing with curly
braces, {}.

The cell function in MATLAB

C = cell(sz1,...,szN) returns a sz1-by-...-by-szN cell array of empty matrices where


sz1,...,szN indicate the size of each dimension. For example, cell(2,3) returns a 2-by-3 cell
array.

The length function in MATLAB

PAGE 9
L = length(X) returns the length of the largest array dimension in X. For vectors, the length
is simply the number of elements. For arrays with more dimensions, the length is
max(size(X)). The length of an empty array is zero.

Application: By using both the cell function and the length function as in the code below,
we can store the solution for each value of b during the simulation

solutions = cell(1, length(b_values))

Step 4: Create a loop over different values of damping coefficient b

We use the function for to initiate a loop that will allow us to solve the differential equation
with each value of b

for i = 1:length(b_values)

b = b_values(i)

Step 5: Define the differential equation:

We defines the second-order linear homogenous ordinary differential equation (ODE) with
damping term

syms t y(t)

ode = diff(y, t, t) + b*diff(y, t) + w_0^2*y - F*cos(w_0*t) == 0

Since F=0, this ODE represents a damped oscillation

Step 6: Set up the initial condition

y(0) = 5 : initial displacement

y’(0) = 0 : initial velocity

Step 7: Use the dsolve function to solve the differential equation

solutions{i} = dsolve(ode, initial_conditions)

PAGE 10
Step 8: Evaluate the solution for each time point

We uses the sub

y_values = subs(solutions{i}, t, t_values)

Step 9: Plot the graph

plot(t_values, y_values, 'DisplayName', ['b = ' num2str(b)])

PAGE 11
2.3 Method of Stimulated Oscillation
Step 1: Input the parameters

w0 = 10: Angular frequency of free oscillation

b= 0.1: Damping coefficient

F= 10: Stimulating Force

w_values = [10.0, 5.0, 3.0, 0.0]: Different values of stimulating force angular frequency

t_end = 150s: Total time for stimulation

Step 2: Generate time values

t_values = linspace (0, t_end, 1000) : Time ranges from 0 to 150s with the step of 0.01s

Step 3: Initialize a cell array to store a solution for each value of 𝜔

solutions = cell(1, length(w_values)): This step’s purpose is to store the solutions for
each value of angular frequency (w) during the simulation

Step 4: Loop over different values of angular frequency

for i = 1:length(w_values)
w = w_values(i)
Initiating a loop to go through each value of angular frequency in the array w_values and
solve the differential equation for each case
Step 5: Define the differential equation
syms t y(t)
ode = diff(y, t, t) + 2*b*w_0*diff(y, t) + w_0^2*y - F*cos(w*t) == 0;
Defining the second-order linear homogeneous ordinary differential equation (ODE) with
damping and external force terms
𝑑2 𝑦
𝑑𝑡2
+𝑏
𝑑𝑦
𝑑𝑡
+ 𝜔02 𝑦 − 𝐹𝑐𝑜𝑠(𝜔𝑡) = 0 . This ODE represents forced oscillation.

Step 6: Set initial conditions

y (0) = 5 is the initial displayment

y’ (0) = 0 is the initial velocity

Step 7: Solve the differential equation

Use the ‘dsolve’ function to find the symbolic solution to the differential equation with
the specified initial conditions

PAGE 12
solutions{i} = dsolve(ode, initial_conditions)

Step 8: Evaluate the solution for each time point

y_values = subs(solutions{i}, t, t_values) is evaluate the symbolic equation at each time


point specified in t_values

Step 9: Plot the graph

plot(t_values, y_values, 'DisplayName', ['\omega = ' num2str(w)])is plotting the


displacement over time for the current angular frequency on the same figure, with a
legend indicating the value of the angular frequency

PAGE 13
Chapter 3: Result
3.1 Harmonic Oscillation:

Figure 1: The graph of oscillation over time of harmonic oscillation


Comment:
The graph depicts harmonic oscillation, where y changes over time t in a regular
manner and according to the laws of harmonic oscillation.
Because there is no damping coefficient (b=0) and no stimulated forces, this
graph illustrates a simple harmonic oscillation that has a stable period, frequency,
and amplitude.
In general, this graph is the result of a simple harmonic oscillation, no damping
coefficient as well as stimulated forces. It clearly shows the fluctuation and
stability of the system under this condition.

PAGE 14
3.2 Damped Oscillation:

Figure 2: The graph of oscillation over time of damped oscillation


Comment:
The graph shows a significant decrease over time when the damping coefficient b
increases. The gradual decrease leads to the decline of the amplitude of oscillation
over time.
The graph lines correspond to different b values, and they describe how the
damping (b) affects the damping oscillation. When b is large, the decay is
stronger and the oscillation easily decays to zero.
For smaller b-values, oscillations can maintain the amplifier and frequency for a
longer period of time before gradually decreasing to zero. On the contrary, for
larger values of b, oscillations will rapidly decrease and converge to zero.
In general, the graph illustrates an overview of the decreasing oscillation and the
way it depends on the damping coefficient.

PAGE 15
3.3 Stimulated Oscillation:

Figure 3 The graph of oscillation over time of stimulated oscillation


Comment:
The graphs show how the amplitude and shape of the oscillation change based on
different values of ꞷ. When ꞷ has a non-zero value, the oscillation is excited by a
force of frequency ꞷ and reacts in a complex way.
The damping coefficient (b) is still a major influencing factor for oscillation.
Damping affects both the amplitude and phase shift of the oscillation.
The plots provide information about the phase difference between the excitation
force and the transformation. This phase shift can be varied based on the
excitation frequency and the damping factor.
Overall, the plots provide information about the phase difference between the
excitation force and the transformation. This phase shift can be varied based on
the excitation frequency and the damping factor.

PAGE 16
Chapter 4: Conclusion
In conclusion, the oscillation of objects affected by elastic forces can be divided into
three forms. The first type of oscillation is harmonic oscillation, this kind of oscillation
has the zero-damped coefficient and stimulated force. This results in the stable periodic
and frequency. It also has an unchanged amplitude and a sinusoidal oscillation graph.
Furthermore, if the damped coefficient is different from 0 and the stimulated force is still
zero, the object’s oscillation is damping oscillation. The damped coefficient significantly
affects the amplitude of the object. The bigger the damped coefficient, the smaller the
amplitude. As a result, its oscillation does not have a sinusoidal shape and stable periodic
as well as frequency. Finally, when the damping coefficient and stimulated force are both
different from zero, the oscillation will be stimulating oscillation. The amplitude of this
motion is increasing over time when w is bigger than the damping coefficient. It leads to
the complication of the graph.

PAGE 17
Chapter 5: Reference

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. Or
https://www.mathworks.com/matlabcentral/fileexchange/2268-projects-for-scientists-
and-engineers

PAGE 18
Appendix:

Full code:

**a) Harmonic Oscillation (No Damping, No Stimulating Force: \(b = F = 0\)):**


syms t y(t)
w0 = 3;
ode = diff(y, t, t) + w0^2 * y == 0;
initial_conditions = [y(0) == 5, subs(diff(y, t), t, 0) == 0];
solution = dsolve(ode, initial_conditions);
t_values = 0:0.01:20;
y_values = subs(solution, t, t_values);
figure;
plot(t_values, y_values);
title('Harmonic Oscillation (Symbolic Solution)');
xlabel('Time (s)');
ylabel('Displacement (y)');
grid on;

**b) Damped Oscillation (with varying damping coefficients \(b\)):**


w_0 = 10;
F = 0;
t_end = 20;
b_values = [0.01, 0.1, 1.0, 10.0];
t_values = linspace(0, t_end, 1000);
solutions = cell(1, length(b_values));
for i = 1:length(b_values)
b = b_values(i);
syms t y(t)
ode = diff(y, t, t) + b*diff(y, t) + w_0^2*y - F*cos(w_0*t) == 0;
initial_conditions = [y(0) == 5, subs(diff(y, t), t, 0) == 0];
solutions{i} = dsolve(ode, initial_conditions);
y_values = subs(solutions{i}, t, t_values);
hold on;
plot(t_values, y_values, 'DisplayName', ['b = ' num2str(b)]);
end
legend('show');
xlabel('Time (s)');
ylabel('Displacement (y)');
title('Damped Oscillation for Different b Values');
grid on;
hold off;

PAGE 19
**c) Stimulated Oscillation (with varying stimulating frequencies \(w\)):**

w_0 = 10;
b = 0.1;
F = 10;
w_values = [10.0, 5.0, 3.0, 0.0];
t_end = 150;

t_values = linspace(0, t_end, 1000);


solutions = cell(1, length(w_values));
for i = 1:length(w_values)
w = w_values(i);
syms t y(t)
ode = diff(y, t, t) + b*diff(y, t) + w_0^2*y - F*cos(w*t) == 0;
initial_conditions = [y(0) == 5, subs(diff(y, t), t, 0) == 0];
solutions{i} = dsolve(ode, initial_conditions);
y_values = subs(solutions{i}, t, t_values);
hold on;
plot(t_values, y_values, 'DisplayName', ['\omega = ' num2str(w)]);
end
legend('show');
xlabel('Time (s)');
ylabel('Displacement (y)');
title('Stimulated Oscillation for Different \omega Values');
grid on;
hold off;

PAGE 20

You might also like