[关闭]
@oliver1995 2016-11-07T08:58:09.000000Z 字数 3524 阅读 1184

Exercise_07 : Oscillatory and Motion and Chaos

Abstract

Write a program to calculate and compare the behavior of two, nearly identical pendulums. Use it to calculate the divergence of two nearby trajectories in the chaotic regime, as in Figure 3.7, and make a qualitative estimate of the corresponding Lyapunov exponent from the slope of a plot of as a function of .

  • use Euler-Cromer method to solve the oscillatory motion
  • understand the chaos in the driven nonlinear pendulum.

Background

混沌是指现实世界中存在的一种貌似无规律的复杂运动形态。共同特征是原来遵循简单物理规律的有序运动形态,在某种条件下突然偏离预期的规律性而变成了无序的形态。混沌可在相当广泛的一些确定性动力学系统中发生。混沌在统计特性上类似于随机过程,被认为是确定性系统中的一种内禀随机性。

Main body

We first consider a nonlinear, damped, driven pendulum, the physical pendulum.
I choose the parameters are the same as the book :
, , , and
The initial conditions are and .

  1. import pylab as pl
  2. import math
  3. class pendulum:
  4. def __init__(self, init_theta=0.2, init_omega=0,\
  5. length=9.8, g=9.8, time_step=0.04, q=0.5,fd=1.2, omega_d=2.0/3):
  6. self.w = [init_omega]
  7. self.theta = [init_theta]
  8. self.t = [0]
  9. self.dt = time_step
  10. self.g=g
  11. self.l=length
  12. self.q=q
  13. self.fd=fd
  14. self.omega_d=omega_d
  15. def run(self):
  16. while self.t[-1] < 60:
  17. self.w.append(self.w[-1] + (-self.g/ self.l * math.sin(self.theta[-1]) \
  18. -self.q * self.w[-1] + self.fd * math.sin(self.omega_d * self.t[-1])) *\
  19. self.dt)
  20. self.theta.append(self.theta[-1] + self.dt * self.w[-1])
  21. if self.theta[-1]> math.pi :
  22. self.theta[-1]=self.theta[-1] - 2*math.pi
  23. if self.theta[-1]< -math.pi :
  24. self.theta[-1]=self.theta[-1] + 2*math.pi
  25. self.t.append(self.t[-1] + self.dt)
  26. def show_results(self):
  27. pl.plot(self.t, self.theta)
  28. pl.xlabel('time(s)')
  29. pl.ylabel(r'$\theta(radians)')
  30. pl.show()
  31. a = pendulum()
  32. a.run()
  33. a.show_results()

when :
image
when :
image
when :
image

Then we consider the stability of the solution to our pendulum equation of motion. The only difference is that we start them with slightly different initial angles.

  1. import pylab as pl
  2. import math
  3. class pendulum:
  4. def __init__(self, init_theta1=0.2, init_omega=0,init_theta2=0.201,\
  5. length=9.8, g=9.8, time_step=0.04, q=0.5,fd=1.2, omega_d=2.0/3):
  6. self.w1 = [init_omega]
  7. self.theta1 = [init_theta1]
  8. self.w2 = [init_omega]
  9. self.theta2 = [init_theta2]
  10. self.t = [0]
  11. self.dt = time_step
  12. self.g=g
  13. self.l=length
  14. self.q=q
  15. self.fd=fd
  16. self.omega_d=omega_d
  17. self.delta=[0]
  18. def run(self):
  19. while self.t[-1] < 60:
  20. self.w1.append(self.w1[-1] + (-self.g/ self.l * math.sin(self.theta1[-1]) \
  21. -self.q * self.w1[-1] + self.fd * math.sin(self.omega_d * self.t[-1])) *\
  22. self.dt)
  23. self.theta1.append(self.theta1[-1] + self.dt * self.w1[-1])
  24. #theta1
  25. self.w2.append(self.w2[-1] + (-self.g/ self.l * math.sin(self.theta2[-1]) \
  26. -self.q * self.w2[-1] + self.fd * math.sin(self.omega_d * self.t[-1])) *\
  27. self.dt)
  28. self.theta2.append(self.theta2[-1] + self.dt * self.w2[-1])
  29. #theta2
  30. self.t.append(self.t[-1] + self.dt)
  31. self.delta.append ( abs(self.theta1[-1]-self.theta2[-1]))
  32. def show_results(self):
  33. font = {'family': 'serif',
  34. 'color': 'darkred',
  35. 'weight': 'normal',
  36. 'size': 16,}
  37. pl.semilogy(self.t,self.delta)
  38. pl.semilogy(self.t,self.e,'--')
  39. pl.title(r'$\Delta\theta$ versus time', fontdict = font)
  40. pl.xlabel('time(s)')
  41. pl.ylabel(r'$\Delta\theta$(radians)')
  42. pl.legend((['$F_D$=0.5']))
  43. pl.show()
  44. a = pendulum()
  45. a.run()
  46. a.show_results()

When

When

Conclusion

  • We can see that at low drive the motion is a simple osciallation (after the transients have decayed). On the other hand, at high drive the motion is unstable. So we conclude that at low drive the motion is stable and at high drive the motion is chaotic.

  • It turns out that .
    the parameter is known as Lyapunov exponent.
    In the former case , in the latter case .

  • Chaotic means a system can obey certain deterministic laws of physics, but still exhibit behavior that is unpredictable due to an extreme sensitivity to initial conditions.

Acknowledgement

Thanks to The Compulational Physics book.

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