1
$\begingroup$

Is there a formula I can use as an approximation to the following equation for velocity of a projectile when $\sigma$ is very small?

$\dot{x}[n] =v_0\prod_{i=0}^{n}(1-\sigma i)$ $\sigma\approx\frac{C_1}{1,000,000};C_1\in[0,100]$

I am trying to compute the distance travelled (programmatically) when it is shot with initial velocity $v_0$.

The sum would be:

$x[n]=\sum_{j=0}^{n}\dot{x}$

or $x[n]=v_0\sum_{j=0}^{n}\prod_{i=0}^{j}(1-\sigma i).$

The solution for the sum according to a wolfram alpha computation is very complicated and computationally expensive. I derived this formula from the following function which updates the velocity every tick (10 milliseconds).

fire() {    frictiontimer = 1000000; }  // This is called every 10ms update() {    if (xspeed) {       int workfriction = frictiontimer / 1000;       xspeed = xspeed * workfriction / 1000;        frictiontimer -= FRICTION_CONSTANT;       if (frictiontimer < 0)          frictiontimer = 0;    } } 

Is there is a simplification I can use somewhere?

  • 0
    Added, sorry about that.2012-04-12

1 Answers 1

3

When $\sigma i$ is small, $1 - \sigma i \approx \exp(-\sigma i)$, so $\prod_{i=0}^n (1 - \sigma i) \approx \exp \left( - \sum_{i=0}^n \sigma i \right) = \exp(- \sigma n (n+1)/2)$