title: Python Bungee Cord Simulation
body: <p>I am trying to use visual to simulate a bungee jumper (I tried searching for a very similar answer here but it didn't provide an answer). My code is </p>
  
  <pre><code>def animateBungeeJump(mass, deltaT, simulationTime, surfaceArea, unstretchedBungeeLength):
  g = 9.8
  k = 21.7
  vel = 0.0
  accel = 0.0
  distance = unstretchedBungeeLength
  time_start = 0.0
  d = 0.0
  
  while(time_start &lt;= simulationTime):
      Fg = mass * g
      Ff = (-0.65) * surfaceArea * vel * abs(vel)
      Fs = (-1) * k * d
      Ft = Fg + Ff + Fs
  
      accel = Ft / mass
      vel = accel * time_start
      d += vel * time_start
  
      print "Accel", accel
      print "D:", d
      print "Vel:", vel
      print ""
      time_start += deltaT
  animateBungeeJump(60, 0.1, 5.0, 0.2, 30)
  </code></pre>
  
  <p>The result I want to see when debugging this is seeing how acceleration bounces and in general distance (d) should bounce up and down, but while running the code constantly it goes to -inf and inf if I used a simulationTime of 10s or more. I don't know if I'm doing all of the math correctly. Sorry if my code looks stupid, I'm learning.</p>
  
  <p>Example output of the end when it's around 5 seconds:</p>
  
  <p><code>Accel -4.29956602269e+105
  D: -1.07489150567e+107
  Vel: -2.14978301134e+106</code>
  Which I'm pretty sure the velocity shouldn't be THAT low</p>