[关闭]
@whuyyf 2016-05-29T22:51:46.000000Z 字数 2184 阅读 996

Homework 9(chaos pendulum)

作业

name:姚逸飞
student number:2013301020096

Homework

Abstract

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.


chaos pendulum


(Here is a beautiful picture of chaos system)

Passage

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:


And it's easy to get the fake code:

  1. for i in range(self.n):
  2. if self.theta[-1] > pi:
  3. self.theta[-1] += -2 * pi
  4. elif self.theta[-1] < -pi:
  5. self.theta[-1] += 2 * pi
  6. self.t.append(self.t[-1] + self.dt)
  7. 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)
  8. self.theta.append(self.theta[-1] + self.omg[-1] * self.dt)
  9. if (self.omgd * self.t[-1] % (2 * pi)) / pi <= 0.01:
  10. self.sp_t.append(self.t[-2])
  11. self.sp_theta.append(self.theta[-2])
  12. self.sp_omg.append(self.omg[-2])
  13. else:
  14. pass

These picture are in different steps :


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:

  1. if (self.omgd * self.t[-1] % (2 * pi)) / pi <= 0.01:
  2. self.sp_t.append(self.t[-2])
  3. self.sp_theta.append(self.theta[-2])
  4. self.sp_omg.append(self.omg[-2])
  5. else:
  6. pass


drag

The total code is Here

Conclusion

We can see it must in and,the system can become chaos.
So we should try some different parameters to achieve the best parameters.

Reference

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