[关闭]
@OrionPaxxx 2019-03-25T11:03:53.000000Z 字数 1431 阅读 908

computationalphysics

exercise07:problem3.13

abstract

solution to problem3.13 of computational physics

key point:

1.plot the trajectory of two nearly identical pendulums
2.plot versus time
3.make a qualitative estimate of the corresponding Lyapunov exponent

background

physical equations


Euler_cromer calculation



if is out of the range [-,],add or subtract to keep it in this range.

parameters


main body

click here to check the main code

1.plot the trajectory of two nearly identical pendulums

  1. a=chaotic_pendulums()
  2. a.pendulum()
  3. a.show_result()
here is the plot


the picture was uploaded to github,if failed loading,click here

2.plot versus

  1. b=chaotic_pendulums()
  2. b.pendulum1()
  3. b.show_result1()
here is the plot


the picture was uploaded to github,if failed loading,click here

3.make a qualitative estimate of the corresponding Lyapunov exponent

  1. c=chaotic_pendulums()
  2. c.cal_d_theta()
  3. c.show_result2()
  4. z=np.polyfit(a.t,a.d_theta,1)
  5. p=np.poly1d(z)
  6. print(z)
  7. print(p)

the linear equation:


thus,the Lyapunov exponent is:

conclusion

while ,it is a chaotic pendulum,and the lyapunov exponent is about 0.085.

acknowledgement

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