View Single Post
  #18   Spotlight this post!  
Unread 31-07-2011, 20:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Has anyone ever used a Computer Mouse to locate themselves on the field

Quote:
Originally Posted by rahilm View Post
...you're going to be 1 processor cycle behind (time wise) on position.

Edit: This is what I mean by being 1 processor cycle behind. To integrate, you basically have to use Reimann sums in this case. For best accuracy, you'd want trapezoidal sums, so for 1 position value, you need 2 velocity values, so 3 acceleration values. This means you'd have to integrate acceleration for 2 cycles to get the two velocity values required for a single position value, putting you 1 cycle behind realtime.

Assuming that X0 and V0 are given, and assuming that the update period dt is short enough that the acceleration is accurately approximated as a linear function of time, then the position is given by:

X1 = X0 + dt*V0 + dt2*(a1 + 2*a0)/6

X2 = X1 + dt*V1 + dt2*(a2 + 2*a1)/6

.
.
.


Xn = Xn-1 + dt*Vn-1 + dt2*(an + 2*an-1)/6