1

Here is some background : I'm taking part in a programming challenge in which you control a racing pod that has to go from checkpoints to checkpoints to win a race. You are allowed to specify the thrust (in [0;100] ) of the pod and a target point.

I would like to know more about how the physic aspect of the pod is modeled inside the challenge.

So I did a first experiment : for the first 25 frames I set the thrust to 100, and the next 25 frames I set it to 0.

Here are the graphs :

Position

Speed

I think one of the most interesting thing is the speed going negative shortly after stopping the thrust.

So from this data, with my limited knowledge of physics, I deduced that acceleration might be of the form acceleration = thrust - k.speed.

My question to you guys is, first do you recognize an obvious model to this ( considering the model simulating the pod physic shouldn't be very complex ) and secondly, can you suggest me a method to deduce the model from the data ?

If you think I should do another experiment with different conditions please let me know.

Thanks a lot.

PS : I can't post more than two links, I'll try and add acceleration graph and raw data file in a following reply.

Furrane
  • 113

1 Answers1

1

Your guess is correct. If you solve $\dot{v}=T-kv$ you get $v(t)=\frac{T}{k}(1-e^{-kt/m})$ which indeed reproduces your velocity-time plot.

The reason the velocity becomes negative is purely a numerical error. If they used a smaller integration time-step then this wouldn't happen; the velocity would decay exponentially.

lemon
  • 13,220
  • Thanks a lot for your answer comfirming my first thought.But I can't really figure out why once thrust goes to 0 the speed almost instantly drops. Maybe the friction term is in kv² ? – Furrane May 26 '16 at 12:44
  • @Furrane The friction is definitely linear in $v$. But on second thought, I agree that this probably isn't simply a numerical error. The physics changes when the thrust is removed. If you repeat your experiment but reduce the thrust to 10 (instead of 0) in the second period, what does the velocity-time plot look like? – lemon May 26 '16 at 13:03
  • I'm on it, results soon =) – Furrane May 26 '16 at 13:15
  • Ok here are the results for 25 frames at thrust=100 and 25 next frames at thrust=10 : speed graph and raw datas This is clearly something I would expect from our hypothesis, maybe they coded thrust=0 as a special case ? – Furrane May 26 '16 at 13:28
  • @Furrane Yes, there's certainly some thrust=0 case hard-coded. Curiously, the exponential decay in the v<0 (t>28) region is obeying the same $\dot{v}=T-kv$ law as before. So it looks like they're imposing some huge force only at the instant that you first release the thrust, and then it returns to the normal physics... – lemon May 26 '16 at 14:53
  • I'm guessing it's meant to provide brake functionality without adding an extra input parameter. Not a bad choice I think, for a race. – Previous May 26 '16 at 15:49
  • You helped me a lot lemon. Thanks. Since I now got the equation figured out, and I understand this is a completly different question, but now I need to figure out the shortest route that pass through two point A and B given the pod instant position and velocity, any hints on this ? – Furrane May 26 '16 at 16:47
  • @Furrane So the pod is not necessarily at A or B to start with, but at some third point C, right? And you need to visit both A and B as quickly as possible? – lemon May 26 '16 at 16:57
  • That's exactly true lemon. There's another aspect I didn't mention, the thrust got a power and a direction ( so for example the quickest way from point A to point B would be thrust 100 in the direction of vect(AB) ). – Furrane May 26 '16 at 17:08