Report General Physic 1 1
Report General Physic 1 1
Report General Physic 1 1
Report
GENERAL PHYSIC 1
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:
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.
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.
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:
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
PAGE 8
2.2 Method of damping oscillation
Step 1: Input the parameters:
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
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, {}.
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
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)
We defines the second-order linear homogenous ordinary differential equation (ODE) with
damping term
syms t y(t)
PAGE 10
Step 8: Evaluate the solution for each time point
PAGE 11
2.3 Method of Stimulated Oscillation
Step 1: Input the parameters
w_values = [10.0, 5.0, 3.0, 0.0]: Different values of stimulating force angular frequency
t_values = linspace (0, t_end, 1000) : Time ranges from 0 to 150s with the step of 0.01s
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
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.
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)
PAGE 13
Chapter 3: Result
3.1 Harmonic Oscillation:
PAGE 14
3.2 Damped Oscillation:
PAGE 15
3.3 Stimulated Oscillation:
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:
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;
PAGE 20