[关闭]
@LiuYongJie 2016-10-30T15:43:01.000000Z 字数 7263 阅读 478

Ex_07 (3.12 chaos)

刘永杰 2014301020094


content

In constructing the Poincare section in Figure 3.9 we plotted points only at times that were in phase with the drive force; that is, at times , where n is an integer. At these values of t the driving force passed through zero. However, we could just as easily have chosen to make the plot at times corresponding to a maximum of the drive force, or at times π/4 out-of-phase with this force, etc. Construct the Poincare sections for these cases and compare them with Figure 3.9.

Abstract

As we have investigatd the linear driven pendulum in the last section, this time, we will research on something more complicated as the nonliear system, or refered to chaorotic system.

Introduction

Chaos theory is the field of study in mathematics that studies the behavior of dynamical systems that are highly sensitive to initial conditions—a response popularly referred to as the butterfly effect.Small differences in initial conditions (such as those due to rounding errors in numerical computation) yield widely diverging outcomes for such dynamical systems, rendering long-term prediction impossible in general. This happens even though these systems are deterministic, meaning that their future behavior is fully determined by their initial conditions, with no random elements involved. In other words, the deterministic nature of these systems does not make them predictable. This behavior is known as deterministic chaos, or simply chaos.

Theory and results

Now that we have a numerical method that is suitable for various of the simple pendulum, and armed with some understanding of what might or might not happen when dissipation, an external force, and/or nonlinearity is present, we are ready to take on a slightly more complicated and also more interesting situation. that is, we add all three ingredients which were previously discussed separately. Put all these ingredients together, we have the equation of motion

we call this model for a nonlinear, dapmped, driven pendulum, the physical pendulum. It contains some very rich and interesting behaviors. However, as the equation can not be solved analytically, we have to turn to a numerical method. Under that case, the relevent differentlial equations are



given properiate initial value, we can easily simulate the process. Here, we have shown several pictures of interest.

code

最初编写的代码,用于测试程序的基本功能

  1. import matplotlib.pyplot as plt
  2. from math import *
  3. print 'Exercise 3.12 test V1.0'
  4. print 'Designed by roach'
  5. Constant_g=9.8
  6. Constant_l=9.8
  7. Constant_q=0.5
  8. Constant_Omegad=2.0/3.0
  9. dt = 0.001
  10. c_t = []
  11. c_theta = []
  12. c_omega = []
  13. def Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega):
  14. c_theta.append(Initial_theta)
  15. c_omega.append(Initial_omega)
  16. c_t.append(0.0)
  17. print 'Initial_theta =',c_theta[0],'rad ',
  18. print 'Initial_omega =',c_omega[0],'rad/s ',
  19. print 'F_d =',F_d,'N ',
  20. for i in range(100000):
  21. c_omega.append(c_omega[i]-(sin(c_theta[i])+Constant_q*c_omega[i]+F_d*sin(Constant_Omegad*c_t[i]))*dt)
  22. c_theta.append(c_theta[i] + c_omega[i+1]*dt)
  23. c_t.append(c_t[i]+dt)
  24. if c_theta[-1]>pi:
  25. c_theta[-1]=c_theta[-1]-2*pi
  26. if c_theta[-1]<-pi:
  27. c_theta[-1]=c_theta[-1]+2*pi
  28. print 'Total steps =',i,' ',
  29. print 'dt =',dt
  30. return 0
  31. Initial_theta=0.2
  32. Initial_omega=0.0
  33. F_dlist=[0,0.5,1.2]
  34. for m in range(3):
  35. c_t = None
  36. c_theta = None
  37. c_omega = None
  38. c_t = []
  39. c_theta = []
  40. c_omega = []
  41. F_d=F_dlist[m]
  42. F_dstr=str(F_d)
  43. Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega)
  44. plt.plot(c_t,c_theta,label='F_D = '+F_dstr+' (N)')
  45. plt.title('3.12 test')
  46. plt.xlabel('t (s)')
  47. plt.ylabel('theta (rad)')
  48. plt.legend()
  49. plt.show()

clink to view reasult

  1. import matplotlib.pyplot as plt
  2. from math import *
  3. print 'Exercise 3.12 test V1.0'
  4. print 'Designed by roach'
  5. Constant_g=9.8
  6. Constant_l=9.8
  7. Constant_q=0.5
  8. Constant_Omegad=2.0/3.0
  9. dt = 0.01
  10. c_t = []
  11. c_theta = []
  12. c_omega = []
  13. def Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega):
  14. c_theta.append(Initial_theta)
  15. c_omega.append(Initial_omega)
  16. c_t.append(0.0)
  17. print 'Initial_theta =',c_theta[0],'rad ',
  18. print 'Initial_omega =',c_omega[0],'rad/s ',
  19. print 'F_d =',F_d,'Force unit ',
  20. for i in range(100000):
  21. c_omega.append(c_omega[i]-(sin(c_theta[i])+Constant_q*c_omega[i]+F_d*sin(Constant_Omegad*c_t[i]))*dt)
  22. c_theta.append(c_theta[i] + c_omega[i+1]*dt)
  23. c_t.append(c_t[i]+dt)
  24. if c_theta[-1]>pi:
  25. c_theta[-1]=c_theta[-1]-2*pi
  26. if c_theta[-1]<-pi:
  27. c_theta[-1]=c_theta[-1]+2*pi
  28. print 'Total steps =',i,' ',
  29. print 'dt =',dt
  30. return 0
  31. Initial_theta=0.2
  32. Initial_omega=0.0
  33. F_dlist=[1.2,0.5,1.2]
  34. for m in range(1):
  35. c_t = None
  36. c_theta = None
  37. c_omega = None
  38. c_t = []
  39. c_theta = []
  40. c_omega = []
  41. F_d=F_dlist[m]
  42. Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega)
  43. plt.scatter(c_theta,c_omega,color='blue',s=1)
  44. plt.title('3.12 test')
  45. plt.xlabel('theta (rad)')
  46. plt.ylabel('omega (rad/s)')
  47. plt.text(3,2,'F_D = 1.2(N)')
  48. plt.show()

clink to view reasult
进一步选出同相的点

  1. import matplotlib.pyplot as plt
  2. from math import *
  3. print 'Exercise 3.12 V1.0'
  4. print 'Designed by roach'
  5. Constant_g=9.8
  6. Constant_l=9.8
  7. Constant_q=0.5
  8. Constant_Omegad=2.0/3.0
  9. dt = 0.01
  10. c_t = []
  11. c_theta = []
  12. c_omega = []
  13. def Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega):
  14. c_theta.append(Initial_theta)
  15. c_omega.append(Initial_omega)
  16. c_t.append(0.0)
  17. print 'Initial_theta =',c_theta[0],'rad ',
  18. print 'Initial_omega =',c_omega[0],'rad/s ',
  19. print 'F_d =',F_d,'N ',
  20. for i in range(100000):
  21. c_omega.append(c_omega[i]-(sin(c_theta[i])+Constant_q*c_omega[i]+F_d*sin(Constant_Omegad*c_t[i]))*dt)
  22. c_theta.append(c_theta[i] + c_omega[i+1]*dt)
  23. c_t.append(c_t[i]+dt)
  24. if c_theta[-1]>pi:
  25. c_theta[-1]=c_theta[-1]-2*pi
  26. if c_theta[-1]<-pi:
  27. c_theta[-1]=c_theta[-1]+2*pi
  28. print 'Total steps =',i,' ',
  29. print 'dt =',dt
  30. return 0
  31. Initial_theta=0.2
  32. Initial_omega=0.0
  33. F_dlist=[0,0.5,1.2]
  34. for m in range(2,3):
  35. c_t = None
  36. c_theta = None
  37. c_omega = None
  38. c_t = []
  39. c_theta = []
  40. c_omega = []
  41. F_d=F_dlist[m]
  42. F_dstr=str(F_d)
  43. c_theta1=[]
  44. c_omega1=[]
  45. c_t1=[]
  46. Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega)
  47. for n1 in range(300):
  48. for i in range(1,100000):
  49. if c_t[i-1] < 2*pi*n1/Constant_Omegad and c_t[i] > 2*pi*n1/Constant_Omegad:
  50. c_theta1.append(c_theta[i])
  51. c_omega1.append(c_omega[i])
  52. plt.scatter(c_theta1,c_omega1,label='theta in phase F_D = 1.2(N)')
  53. plt.title('3.12 test')
  54. plt.xlabel('theta (rad)')
  55. plt.ylabel('omega (rad/s)')
  56. plt.legend()
  57. plt.show()

clink to view reasult
3.找出相位超前π/4的点(时间间隔)

  1. import matplotlib.pyplot as plt
  2. from math import *
  3. print 'Exercise 3.12 V1.0'
  4. print 'Designed by roach'
  5. Constant_g=9.8
  6. Constant_l=9.8
  7. Constant_q=0.5
  8. Constant_Omegad=2.0/3.0
  9. dt = pi/300
  10. c_t = []
  11. c_theta = []
  12. c_omega = []
  13. def Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega):
  14. c_theta.append(Initial_theta)
  15. c_omega.append(Initial_omega)
  16. c_t.append(0.0)
  17. print 'Initial_theta =',c_theta[0],'rad ',
  18. print 'Initial_omega =',c_omega[0],'rad/s ',
  19. print 'F_d =',F_d,'N ',
  20. for i in range(3000000):
  21. c_omega.append(c_omega[i]-(sin(c_theta[i])+Constant_q*c_omega[i]+F_d*sin(Constant_Omegad*c_t[i]))*dt)
  22. c_theta.append(c_theta[i] + c_omega[i+1]*dt)
  23. c_t.append(c_t[i]+dt)
  24. if c_theta[-1]>pi:
  25. c_theta[-1]=c_theta[-1]-2*pi
  26. if c_theta[-1]<-pi:
  27. c_theta[-1]=c_theta[-1]+2*pi
  28. print 'Total steps =',i,' ',
  29. print 'dt =',dt
  30. return 0
  31. Initial_theta=0.2
  32. Initial_omega=0.0
  33. F_dlist=[0,0.5,1.2]
  34. for m in range(2,3):
  35. c_t = None
  36. c_theta = None
  37. c_omega = None
  38. c_t = []
  39. c_theta = []
  40. c_omega = []
  41. F_d=F_dlist[m]
  42. F_dstr=str(F_d)
  43. c_theta1=[]
  44. c_omega1=[]
  45. c_t1=[]
  46. Calculate(Initial_theta,Initial_omega,c_t,c_theta,c_omega)
  47. i=225
  48. n=0
  49. while i<3000000:
  50. c_theta1.append(c_theta[i])
  51. c_omega1.append(c_omega[i])
  52. c_t1.append(c_t[i])
  53. i=i+900
  54. n=n+1
  55. print 'Total',len(c_theta1)
  56. plt.scatter(c_theta1,c_omega1,label='theta pi/4 out of phase F_D = 1.2(N)')
  57. plt.title('3.12 test')
  58. plt.xlabel('theta (rad)')
  59. plt.ylabel('omega (rad/s)')
  60. plt.legend()
  61. plt.show()

clink to view reasult

Conclusion

the real physical model is usually a very complicated system, chaos can happend in various system. In this article, we have only shown the chaorotic behaviors in a nonlinear, damping, driveing pendulum, more are still to be seen.

thanks to

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