给定位移和离散时间的等速减速的最大可停止速度。

问题描述 投票:0回答:1

我想知道,在速度为0的情况下,达到位移0,能够刹车的最大速度是多少,我需要一个能用离散时间的方程。

我是如何更新和移动身体的?第一,更新速度 第二,更新位置。NewPosition = LastPosition + Velocity(速度)

因此,例如,下面是一个预期结果的表格。

MaxStoppableVelocity ( Displacement = 0m, Deceleration = -2m/s² ) should be 2m/s  
MaxStoppableVelocity ( Displacement = 1m, Deceleration = -2m/s² ) should be 3m/s  
MaxStoppableVelocity ( Displacement = 2m, Deceleration = -2m/s² ) should be 4m/s  
MaxStoppableVelocity ( Displacement = 3m, Deceleration = -2m/s² ) should be 4.5m/s  
MaxStoppableVelocity ( Displacement = 4m, Deceleration = -2m/s² ) should be 5m/s  
MaxStoppableVelocity ( Displacement = 5m, Deceleration = -2m/s² ) should be 5.5m/s  
MaxStoppableVelocity ( Displacement = 6m, Deceleration = -2m/s² ) should be 6m/s  
MaxStoppableVelocity ( Displacement = 7m, Deceleration = -2m/s² ) should be 6.33m/s  
MaxStoppableVelocity ( Displacement = 8m, Deceleration = -2m/s² ) should be 6.66m/s  
MaxStoppableVelocity ( Displacement = 9m, Deceleration = -2m/s² ) should be 7m/s  
MaxStoppableVelocity ( Displacement = 10m, Deceleration = -2m/s² ) should be 7.33m/s  
MaxStoppableVelocity ( Displacement = 11m, Deceleration = -2m/s² ) should be 7.66m/s  
MaxStoppableVelocity ( Displacement = 12m, Deceleration = -2m/s² ) should be 8m/s  
MaxStoppableVelocity ( Displacement = 13m, Deceleration = -2m/s² ) should be 8.25m/s  
MaxStoppableVelocity ( Displacement = 14m, Deceleration = -2m/s² ) should be 8.5m/s  
MaxStoppableVelocity ( Displacement = 15m, Deceleration = -2m/s² ) should be 8.75m/s  
MaxStoppableVelocity ( Displacement = 16m, Deceleration = -2m/s² ) should be 9m/s  
MaxStoppableVelocity ( Displacement = 17m, Deceleration = -2m/s² ) should be 9.25m/s  
MaxStoppableVelocity ( Displacement = 18m, Deceleration = -2m/s² ) should be 9.5m/s  
MaxStoppableVelocity ( Displacement = 19m, Deceleration = -2m/s² ) should be 9.75m/s  
MaxStoppableVelocity ( Displacement = 20m, Deceleration = -2m/s² ) should be 10m/s

表中的所有数据都是用我做的模拟测试出来的 但我想找到一个方程来给出这些值。

记住我模拟的时间是离散的,所以连续时间的方程是行不通的。

有什么问题请告诉我,先谢谢了

math game-physics physics motion kinematics
1个回答
0
投票

让我们考虑这个问题在时间上反过来。

假设你有dt--模拟的时间步长。而它是恒定的.假设迭代总次数为N.假设当前迭代次数为i.A-加速度,D-位移,V-速度。

因此

V[i] = (i+1) * A * dt
D[N] = D = SUM (V[i] * dt) From i = 0 To N-1
D = (N-1)^2 / 2 * dt^2 * A
N = sqrt(2* D / A) / dt + 1

但N - 1是一个整数,因此四舍五入。

N = floor(sqrt(2D/A)/dt + 1)

所以

V = floor(sqrt(2D/A)/dt + 1) * A * dt 

如果你不知道dt的值,你可以从你的例子中找到它。

© www.soinside.com 2019 - 2024. All rights reserved.