[关闭]
@oliver1995 2016-11-14T13:50:44.000000Z 字数 2346 阅读 629

Exercise 08:Oscillatory and Motion and Chaos (2)

冯文龙

Abstract

Use python to study the oscillatory motion and chaos and complete the homework 3.18

Background

Poincare section Poincare section is preferred When we need to plot and analyse the behavior of a dynamical system. To construct Poincare section, we plot points only when the phases of the driven force are fixed, to be more specific, we plot only at times that are in phase with the driving force. The time can be determined by

where n is an integer.

Bifurcation diagram helps to analyze the transition to chaos. It can show us lines for as a function of drive amplitude, which was constructed in the following manner. For each value of F_D we have calculated \theta as a function of time. After waiting for 300 driving periods so that the initial transients have decayed away, we plotted \theta at times that were in phase with the driving force as a function of F_D. Here we plotted points up to the 428th driving period. the Feigenbaum parameter can be calculate:

Main body

code:

  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. self.w_n=[init_omega]
  16. self.theta_n=[init_theta]
  17. def run(self):
  18. while self.t[-1] < 10000:
  19. self.w.append(self.w[-1] + (-self.g/ self.l * math.sin(self.theta[-1]) \
  20. -self.q * self.w[-1] + self.fd * math.sin(self.omega_d * self.t[-1])) *\
  21. self.dt)
  22. self.theta.append(self.theta[-1] + self.dt * self.w[-1])
  23. if self.theta[-1]> math.pi :
  24. self.theta[-1]=self.theta[-1] - 2*math.pi
  25. if self.theta[-1]< -math.pi :
  26. self.theta[-1]=self.theta[-1] + 2*math.pi
  27. self.t.append(self.t[-1] + self.dt)
  28. if abs( self.t[-1]% (2 * math.pi /self.omega_d)) < self.dt /2:
  29. self.w_n.append(self.w[-1])
  30. self.theta_n.append(self.theta[-1])
  31. def show_results(self):
  32. pl.plot(self.theta_n, self.w_n,'go')
  33. pl.xlabel(r'$\omega(radians)$')
  34. pl.ylabel(r'$\theta(radians)$')
  35. pl.legend(['Fd=1.2'],loc="best")
  36. pl.show()
  37. a = pendulum()
  38. a.run()
  39. a.show_results()

For

For


For


For

Conclusion

  • It turns out that the pendulum exhibits transitions to chaotic behavior at several different values of the driving force.
  • when , we can see from the picture that the period is now twice the drive period. when , the period is four time the drive period.
  • The key property is that it contains frequencies that are equal to or greater than the drive frequency.

Acknowledgement

Thanks to cai's PPT

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