[关闭]
@355073677 2016-04-17T10:45:14.000000Z 字数 5044 阅读 1388

Chapter 3 Problem 3.4

计算物理


Name: 陈锋
Student Number: 2013301020145
April 16, 2016

Abstract

This page is to solve the general form harmonic equation with and analyze the relationship between the initial value of x and the period.

Introduction

The general form for the equation of motion for harmonic motion is:


When , it becomes the case of simple harmonic oscillation, which has a constant period related to k. When , the situation becomes different, especially for the period which is also related to the initial value of x (we call it amplitude sometimes). This page will focus on how the period depends on the amplitude and the constant k in the differential equation.

Numerical Approach

For the equation:


Then, we can rewrite this as two first-order differential equations:
where is similar to the angular velocity of the pendulum.
Considering the Euler_Crome method, I convert equation (2) into difference equations via using a time step so that rime is discretized with . Letting and be the numerically approximated angular displacement and velocity of the pendulum at time step i, the equations in (2) become:

Also, I will use 2nd-order Runge-Kutta method and 4th-order Runge-Kutta method to solve this equation and make a comparison. Their introduction have showed in ode.Instruction and the algorithms have been programmed in ode.py.

Data Analysis

The case of :

Seting the initial value , time step = 0.04s
Figure_1
Figure 1: In this case, the Euler-Cromer method is as precise as Second-order Runge-Kutta method and Forth-order Runge-Kutta method.

The case of :

Setting time step = 0.04s, and the initial value change from 0.2 to 1.0:
Figure_2
Figure 2: As the figure showed above, the period becomes longer as the amplitude is decreased and I will give a detail discussion in the next section.

Find the period

This section is about how to find the period in the numerical results. Firstly, we have set the inital phase as zero, so the initial value became the ampilitude. Secondly, we should make a pragramme which can read all the datum and find out the first point except the initial point where the value is near the ampilitude. The corresponding time is the period we need to find. Generally, we might find two or even more points satisfying the former requirements, then we should make an average over these points in order to get a precise period. As a matter of fact, when the precision is high enough, which means the time step and the difference between the displacement and the ampilitude is sufficiently small, there are a little difference among these points. Thus, I only select the first two points and make an average over them.
The code are as follows:

  1. def find_period(self):
  2. t_period = []
  3. for i in range(len(self.x)):
  4. if abs(self.x[i] - self.x_0) < 0.000001 and self.t[i] > 20*self.dt:
  5. t_period.append(self.t[i])
  6. else:
  7. pass
  8. s = 0
  9. for j in range (2):
  10. s = s + t_period[j]
  11. print "the period is:%f" %(s/2)
  12. return s/2

Result:
Setting the time step = 0.001s
Figure_3
It seems that there is a relationship between the amplitude and the period and I try to figure out such relation via fitting in the next subsection.

Fitting result:

Figure_4
General model:
f(x) = a/x
Coefficients (with 95% confidence bounds):
a = 7.415 (7.413, 7.416)

Intuitive explantion

For the equation of angular velocity (x is smaller than 1):


We should notice that the initial value of angular veloctiy is zero. Also, according to conservation of energy, the displacement must smaller or equal the initial value (for the initial phase is equal to zero.). Therefore, the change of angular velocity in this case is much smaller than that of simple harmonic. As a direct result, the angular velocity will also smaller than that case.
Since:

A smaller angular velocity means a longer period, so the period becomes longer as the amplitude is decreased.

Analytical method for the period

For the equation:


Setting , then we have:

which means:

Integrating both sides of it:

Then we have:

Therefore, we have:
where T is the period.
when

when

when setting , the coefficient is nearly the same as the numerical fitting result.

Reference

1.Giodano, N.J., Nakanishi, H. Computational Physics. Tsinghua University Press, December 2007.
2.Wikipedia contributors. "Pendulum (mathematics)." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 7 Apr. 2016. Web. 16 Apr. 2016.

Programme Code

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注