[关闭]
@oliver1995 2016-11-20T22:56:23.000000Z 字数 2356 阅读 797

Exercise 09:the Lorentz model

未分类

Abstract

  • understand the chaos in the lorentz model by solving this set of ODE numerically. Building model to deal with the extending billiard problem with various boundary shape.

Background

Lorentz was studying the basic equations of fluid mechanics, which are known as the Navier-Stokes equations and which can be regarded as Newton’s law written in a form appropriate to a fluid. The specific situation he considered was the Rayleigh-Benard problem, which concerns a fluide in a container whose top and bottom surfaces are held at different temperatures. Indeed, he grossly simplified the problem as he reached to the so-called Lorentz equations, or equivalently, the Lorentz model, which provided a major contribution to the modern field of physics.

Main body

code

  1. import matplotlib.pyplot as plt
  2. from matplotlib import animation
  3. def loren(x0,y0,z0,r,sigma,b,dt,T):
  4. location=[[]for i in range(4)]
  5. location[0].append(x0)
  6. location[1].append(y0)
  7. location[2].append(z0)
  8. location[3].append(0)
  9. while location[3][-1]<=T:
  10. location[0].append(location[0][-1]+sigma*(location[1][-1]-location[0][-1])*dt)
  11. location[1].append(location[1][-1]+(-location[0][-2]*location[2][-1]+r*location[0][-2]-location[1][-1])*dt)
  12. location[2].append(location[2][-1]+(location[0][-2]*location[1][-2]-b*location[2][-1])*dt)
  13. location[3].append(location[3][-1]+dt)
  14. return location#x,y,z,time
  15. sigma,b,dt,T=10,8./3,0.0001,50
  16. d=loren(1,0,0,25,sigma,b,dt,T)
  17. # first set up the figure, the axis, and the plot element we want to animate
  18. fig = plt.figure()
  19. ax = plt.axes(xlim=(-21, 21), ylim=(-1,45))
  20. line, = ax.plot([], [],lw=1)
  21. plt.title('Fig. Lorentz Model')
  22. plt.xlabel('x')
  23. plt.ylabel('z')
  24. note = ax.text(10,5,'',fontsize=12)
  25. # initialization function: plot the background of each frame
  26. def init():
  27. line.set_data([], [])
  28. note.set_text('')
  29. return line,note
  30. # animation function. this is called sequentially
  31. def animate(j):
  32. line.set_data(d[0][:1000*j],d[2][:1000*j])
  33. note.set_text(r'$x_0=1,y_0=0,z_0=0$'+'\n$\sigma=10,b=8/3,r=25$')
  34. return line,note
  35. anim1=animation.FuncAnimation(fig, animate, init_func=init, frames=int(len(d[0])/1000), interval=10)
  36. #anim1.save('/home/shangguan/computationalphysics_N2013301020076/ex10/animr=25/haha.png')
  37. plt.show()

first is the phase gragh is the different regime(in this result we let the sigma equals to 10.0,b=8/3 and r=25.0)

we can say the deviation of cross section of y-z is opposite to x-z.

then we consider the circular stadium (r=1):

then the more realistic situation with a little separarion (r=1,l=0.02):

Acknowledgement

senior student
Computational Physics, Nicholas J. Giordano & Hisao Nakanishi

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