[关闭]
@whuyyf 2016-06-14T09:20:51.000000Z 字数 1839 阅读 903

homework14(the fluctuate model)

作业

name:姚逸飞
student number:2013301020096

Homework

Abstract

This passage will discuss about the fluctuate model.In physics, a wave is an oscillation accompanied by a transfer of energy that travels through medium (space or mass). Frequency refers to the addition of time. Wave motion transfers energy from one point to another, which displace particles of the transmission medium — that is, with little or no associated mass transport. Waves consist, instead, of oscillations or vibrations (of a physical quantity), around almost fixed locations.
——wikipedia


1

Passage

First, we should write down the wave function as follow:


We just consider that the string has a small dislocation., then we can simplify the above equation as follow:

We can use the approximation to simplify the equation:


Then we can get the equation as follow:

We can get the final equation :

This picture is about that the two waves encounter.

1

1

1
This picture is about that the wave after encounter.
1

  1. def __init__(self):
  2. self.x=np.linspace(0,1,n)
  3. self.y0=np.exp(-k*(self.x-x0)**2)+np.exp(-k*(self.x-x1)**2)
  4. self.y=[self.y0]
  5. self.temp_y=np.linspace(0,0,n)
  6. for j in range(n-2):
  7. self.temp_y[j+1]=2*(1-r**2)*self.y0[j+1]-self.y0[j+1]+r**2*(self.y0[j+2]+self.y0[j])
  8. self.y.append(self.temp_y)
  9. #print self.y0
  10. def update(self):
  11. self.new_y=np.linspace(0,0,n)
  12. for j in range(n-2):
  13. self.new_y[j+1]=2*(1-r**2)*self.y[-1][j+1]-self.y[-2][j+1]+r**2*(self.y[-1][j+2]+self.y[-1][j])
  14. def fire(self):
  15. while (len(self.y)<=(N+1)):
  16. self.update()
  17. self.y.append(self.new_y)

Conclusion

From the stable picture,we can find that the waves have the quality of addtion.
The total cods are here

Reference

Thanks for wikipedia
Thanks for matplotlib

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