def calculate(self):
i = 0
while(True):
self.B_2 = 0.0039 + 0.0058 / (1 + math.exp((self.v - 35) / 5))
self.C = math.pow(1 - 0.0065 * self.y[i] / 273, 2.5)
self.x.append(self.x[i] + self.v_x[i] * self.dt)
self.y.append(self.y[i] + self.v_y[i] * self.dt)
self.v_x.append(self.v_x[i] - self.C * self.B_2 * self.v_rel_module * self.v_rel_x * self.dt)
self.v_y.append(self.v_y[i] - self.g * self.dt - self.C * self.B_2 * self.v_rel_module * self.v_rel_y * self.dt)
self.v = math.hypot(self.v_x[i + 1], self.v_y[i + 1])
self.v_rel_x = self.v_x[i + 1] - self.v_w_x
self.v_rel_y = self.v_y[i + 1] - self.v_w_y
self.v_rel_module = math.hypot(self.v_rel_x, self.v_rel_y)
i += 1
if self.y[i] <= -100:
break
self.x[-1]=((-100 - self.y[-1])*(self.x[-1] - self.x[-2]) / (self.y[-1] - self.y[-2])) + self.x[-1]
self.y[i] = -100
global a
a = self.x[-1]
6 code.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录