[关闭]
@whuyyf 2016-06-01T11:43:18.000000Z 字数 2231 阅读 1259

homework10(Lorenz Model)

作业


name:姚逸飞
student number:2013301020096

Homework

Abstract

The Lorenz system is a system of ordinary differential equations (the Lorenz equations, note it is not Lorentz) first studied by Edward Lorenz. It is notable for having chaotic solutions for certain parameter values and initial conditions. In particular, the Lorenz attractor is a set of chaotic solutions of the Lorenz system which, when plotted, resemble a butterfly or figure eight.
————by wikipedia

a

Passage

In this passage will still discuss about the famous and distinct chaos:
Lorenz model.
From the text book ,we can get the equation as follow:


To simple the equation ,we usually take the,and .Here is the temperature , is the density of the liquid, and is the velocity of the liquid.
We still use the **Euler-Cromer Method**to caculate this equation.
First we caculate the Z versus t,and see the case of the oscillation.Here ,,.

  1. class lorenze:
  2. def __init__(self, r = 5,et = 0.01, x = 1, y = 0, z = 0, dt = 0.01 ):
  3. self.x = [x]
  4. self.y = [y]
  5. self.z = [z]
  6. self.t = [0]
  7. self.r = r
  8. self.dt = dt
  9. self.et = et
  10. self.n = int(self.et / self.dt)
  11. def update(self):
  12. for i in range(self.n):
  13. self.t.append(self.t[-1] + self.dt)
  14. self.x.append(self.x[-1] + sig * (self.y[-1] -self.x[-1]) * self.dt)
  15. self.y.append(self.y[-1] + (-self.x[-1] * self.z[-1] + self.r * self.x[-1] - self.y[-1]) * self.dt)
  16. self.z.append(self.z[-1] + (self.x[-1] * self.y[-1] - b * self.z[-1]) * self.dt)
  17. def plzt(self, pic):
  18. pic.plot(self.t, self.z, label = 'n=' + str(self.n))
  19. pic.legend(loc = 'best')
  20. def plzx(self, pic):
  21. pic.plot(self.x, self.z, '.', label ='r=' + str(self.r))
  22. pic.set_title('Z versus X')
  23. pic.legend(loc = 'best')
  24. pic.set_xlabel('X')
  25. pic.set_ylabel('Z')


1

Then ,we will caculate the phase relation of the lorenz model.Here we first see the influence of different steps.n from 1000 to 10000.Here we choose the .And z versus x.

1

for further discussion, we put the picture in the phase space .And here we choose the z-y,z-x,and y-x.
And .We can see the chaos from different way.

1

At last ,we plot the lorenz model in the 3-D space. it's prominently beautiful.

1

And the total code is Here

Conclusion

The lorenz model is classic and easy.But it's a very good example to stuy the chaos .But I didn't discuss r in different range. And the picture is doll in some degree.

Reference

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