@whuyyf
2016-05-29T22:51:46.000000Z
字数 2184
阅读 996
作业
name:姚逸飞
student number:2013301020096
This passage is mainly discuss about the chaos pendulum.
The chaos phenomenon are very general in physics.But it dosen't mean that it's very easy to make a system to be chaos.So this pasage mainly discuss about how to creat a chaos system.And we can see that a chaos system needs very strict parameter.And we will run the pendulum as an example.We will try to see the pendulum in different driven force.
The last passage is mainly discussing about the simple pendulum .But in this passage, the loss of the system and the driven force will be considered.So we can get the equation as follows:
for i in range(self.n):
if self.theta[-1] > pi:
self.theta[-1] += -2 * pi
elif self.theta[-1] < -pi:
self.theta[-1] += 2 * pi
self.t.append(self.t[-1] + self.dt)
self.omg.append(self.omg[-1] - ( (self.g / self.l) * sin(self.theta[-1]) + self.q * self.omg[-1] - self.F * sin(self.omgd * self.t[-1]) ) * self.dt)
self.theta.append(self.theta[-1] + self.omg[-1] * self.dt)
if (self.omgd * self.t[-1] % (2 * pi)) / pi <= 0.01:
self.sp_t.append(self.t[-2])
self.sp_theta.append(self.theta[-2])
self.sp_omg.append(self.omg[-2])
else:
pass
These picture are in different steps :
When ,we can get the branches.
But it's hard for the euation to be strict,So in the program ,I use the different method. When is very small,we can say the equation is right.The code is as follows:
if (self.omgd * self.t[-1] % (2 * pi)) / pi <= 0.01:
self.sp_t.append(self.t[-2])
self.sp_theta.append(self.theta[-2])
self.sp_omg.append(self.omg[-2])
else:
pass
The total code is Here
We can see it must in and,the system can become chaos.
So we should try some different parameters to achieve the best parameters.