I am trying to study the damping of a horizontal mass-spring system at high velocities. The equation for damping due to a viscous fluid at low velocities is:
$$ma+cv+kx=0$$
I changed the equation to :
$$ma + kx +\frac{\rho A v^2 C}{2} = 0.$$ However, when I graph displacement vs time, I get a weird graph.
Why does this not look like a normal damped sine/cosine wave. How can I make it look so? Have I made a mistake in the formula?
code snippet:
for run in range(runs):
times.append(times[run] + dt)
x = positions[run]
v = velocities[run]
dxdt = v
v2 = (v**3)/abs(v)
dvdt = -(k/m) - (l30*v2)/m
positions.append(x+dxdt*dt)
velocities.append(v+dvdt*dt)
positions, times and velocities are all arrays.