title: Projectile Motion in Python: How to generate list giving vertical velocity over time?
body: <p>I'm trying to find how the vertical velocity Vy of a spherical particle falling vertically with drag changes as a function of time t. I would like to generate a list of values that state what Vy is for several points in time from the time at which is is released to some t_max as well as plot Vy vs time.</p>
  
  <p>The equation I've been given to solve for ∆Vy is:</p>
  
  <pre><code>dVy = -g*dt - (b/m)*Vy*dt
  </code></pre>
  
  <p>and I've been given a suggested algorithm for finding the values<a href="https://i.stack.imgur.com/9Gb5O.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Gb5O.jpg" alt=""></a></p>
  
  <p>"The code should ask for the values of m, g, b and ∆t. Once these values are defined, the code should provide a series of values of Vy for each time t."</p>
  
  <p>Here's my attempt so far:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import math
  
  g = 9.81 #acceleration due to gravity
  b = 1.6*10**-8 #linear drag coefficient
  m = 1.04*10**-9 #mass of particle
  dt = 10**-3 #time step
  t_max = 10 #final time
  t = 0 #initial time
  Vy = 0 #initial velocity
  
  t_list = [t]
  Vy_list = [Vy]
  dVy = -g*dt - (b/m)*Vy*dt
  
  while t &lt;= t_max:
  
      t += dt
      Vy += dVy
      t_list.append(t)
      Vy_list.append(Vy)
      print(t, Vy)
  
  
  plt.plot(t_list, Vy_list)
  plt.show()
  </code></pre>
  
  <p>I'm not sure that the values it generates are quite right considering that no matter what size I set the mass to the change in velocity remains the same when I'd expect it to affect the velocity quite a bit for infinitesimally smaller masses.</p>
  
  <p>I'll admit that I'm replicating a solution that was given to me for a completely different problem, but am I right in thinking that a while loop is the way to go? </p>