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 :



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.

  • $\begingroup$ acceleration graph and raw data ( .csv ) $\endgroup$ – Furrane May 26 '16 at 12:11
  • $\begingroup$ I assume this is the "Coders strike back" challenge at Codingame? $\endgroup$ – Previous May 26 '16 at 15:04
  • $\begingroup$ Absolutly, I just didn't want to look like I was advertising anything. $\endgroup$ – Furrane May 26 '16 at 17:08

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.

  • $\begingroup$ 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² ? $\endgroup$ – Furrane May 26 '16 at 12:44
  • $\begingroup$ @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? $\endgroup$ – lemon May 26 '16 at 13:03
  • $\begingroup$ I'm on it, results soon =) $\endgroup$ – Furrane May 26 '16 at 13:15
  • $\begingroup$ 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 ? $\endgroup$ – Furrane May 26 '16 at 13:28
  • $\begingroup$ @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... $\endgroup$ – lemon May 26 '16 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.