[关闭]
@zhongwei1234 2017-12-13T11:28:43.000000Z 字数 1760 阅读 46

第三次做业

《计算物理》第一章课后习题3


一. 课题
It is often the case that the frictional force on an object will increase as object moves faster. A fortunate example of this is a parachutist; the role of the parachute is to produce a frictional force due to air drag, which is narmally larger than would normally be the case without the parachute. Here we consider a very simple examle in which the frictional force depends on the velocity. Assume that the velocity of a object obeys the equation of the form


Where a and b are constants. You could think of a as coming from an applied force, such as gravity, while b arises from friction. Note that the frictional force is negative(we asume that b>0), so that it opposes the motion. Use the Euler method to solve for v as a function of time. A convenient choice of parameters is a=10 and b=1. You should find that v apporaches a as a constant value at long times; This is called the terminal velocity.


二.实验目的

1 用欧拉法拟合出速度随时间的变化,并用mathplotile在python上绘出
2 该速度微分方程可以轻松算出解析解,同样地绘出解析解的速度随时间变化的曲线
3 观察收尾速度
4 改变a与b的设定值,观察变化


三.源代码

*本有四段代码,但区别是改变a与b的设定值, 故不重复粘贴

  1. @author: 钟伟
  2. """
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. a = 10
  6. b = 1
  7. """设置初始条件"""
  8. vi = int(input("please input the initial velovity:"))
  9. """输入初始速度"""
  10. t = 0
  11. delt_t = 0.1
  12. process_v = vi
  13. """设定两个列表储存数据"""
  14. list_v=[process_v,]
  15. list_t=[t,]
  16. """进行计算,并将计算结果储存在列表中"""
  17. while t<4:
  18. process_v = process_v + (a-b*process_v)*delt_t
  19. """欧拉法计算"""
  20. t=t+delt_t
  21. list_v.append(process_v)
  22. list_t.append(t)
  23. """解析解的方程由积分法求出"""
  24. c=a-b*vi
  25. t=np.linspace(0,4,1000)
  26. v=(a-c*np.exp(-b*t))/b
  27. """画出图像"""
  28. plt.figure(figsize=(50,25))
  29. plt.plot(list_t,list_v,label="$v(t)$",marker='s')
  30. plt.plot(t,v,linewidth=2,color="yellow")
  31. plt.xlabel("Time(s)")
  32. plt.ylabel("velocity(m/s)")
  33. plt.title("velocity variation")
  34. plt.ylim(0,11)
  35. plt.legend()
  36. plt.show()

创建时间
Sep 28 15:46:29 2017


三.调试及结果

*均为v=1 a=10 模拟业余跳伞刚一跳就迫不及待打开伞 重力加速度为10m/s

1.当b=1时 有接近对数曲线的图像。时间越大拟合的越好。可认为在一定时间后达到了收尾速度。收尾速度为大约10m/s, 人可以承受。
1.png

2.当b=0.1 几乎是自由落体,相当于无伞降落,是很危险的
2.png

3.当b=5或10 很快收尾 如果降落伞能这样,那么低空跳伞就好玩了。。

3.png

4.png


感谢观看!!!

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