@zhongwei1234
2017-12-13T14:08:05.000000Z
字数 1790
阅读 43
==
钟伟 2015301020164
一. 课题
Calculate Poincare sections for the pendulum as it undergoes the period-doubling route to chaos. Plot versus θ, with one point plotted for each drive cycle. Do this for F =1.4, 1.44, and 1.465, using the other parameters as given in connection with Figure 3.10. You should find after removing the points corresponding to the initial transient the attractor in the period-1 regime will contain only a single point. Likewise, if the behavior is period n, the attractor will contain n discrete points.
如书上3.10 的图一样, F=1.35 时摆的共振频率与驱动力同步,当值变为1.44时,周期变长了一倍,即频率缩短为原来的;同理, 继续增大驱动力到F=1.465, 有周期变为1.35时的四倍。根据题目,画出的相空间的庞加莱截面的θ值应该分别是1,2,4个点。
我先用程序画出书上FIGURE.3.10的图
q=0.5l=g=9.8Ω_d=2/3Δt=0.0001w_list=[]θ_list=[]t_list=[]t=0w=0θ=0.2F=1.44while t<100:w=w-((g/l)*math.sin(θ)+q*w-F*math.sin(Ω_d*t))*Δtθ=θ+w*Δtif θ>=math.pi:θ=θ-2*math.pielif θ<-math.pi:θ=θ+2*math.pit=t+Δtθ_list.append(θ)t_list.append(t)plt.figure(figsize=(10,10))plt.title('θ-t')plt.xlabel('t/s')plt.ylabel('θ(rad)')plt.plot( t_list,θ_list,'-',lw=2,color='black')plt.show()
再者画出相空间图以及加上循环结构运行出庞加莱截面。天真以为能出结果
for n in range(5,21):if abs(t-2*math.pi*n/Ω_d)<0.005 and t>2*math.pi*n/Ω_d :theta_list.append(θ)omiga_list.append(w)
先看三个w-t的图取前一百秒 并画出相空间图

周期很明显
然后看看我的庞家莱截面

完全不按预计出牌
一气之下画一下相空间图




后面三个图与前面三个的不同是去掉tranisent前的点,于是少了之前阻力起作用不规则的点,剩下的点是有规律的周期运动
1.先看
缩小精度变0.001 删掉 and t>2*math.pi*n/Ω_d 语句
这就是精度step太高,误差太大,多了几个点
现加上 t<2*math.pi*n/Ω_d 语句
很明显 这都是取值离散造成的 一点偏差对θ取值影响挺大的θ-t图斜率有的地方很大
这可以认为只有一个点了
2.

还是比较完美 无论用t<2*math.pi*n/Ω_d 还是t>2*math.pi*n/Ω_d语句
注意语句
plt.ylim(1,3)
plt.xlim(-3,3)
的作用,要不然确实很多有微小差距的点


真正的挑战在
没有出现预期的四个点 哪怕是四群点 事实是只有三群
果断把观察周期延长到200s
果然四群点
现在加上t<2*math.pi*n/Ω_d 语句
效果不佳增加step精度0.0001 加t<2*math.pi*n/Ω_d
计算了很久
用t>2*math.pi*n/Ω_d或不用


计算机算的离散性导致这个问题图较难画,有必要把一个点的尺度放大并加上t>2*math.pi*n/Ω_d或t>2*math.pi*n/Ω_d语句