import numpy as np import matplotlib.pyplot as plt def frittfall(s, g=9.81): v = np.sqrt(2*g*s) #da v0 = 0 return v s = np.linspace(0, 10, 100) hastighet = frittfall(s) plt.close('all') plt.plot(s, hastighet) plt.xlabel('s [m]') plt.ylabel('v [m/s]') plt.grid() # plt.savefig('plott_fall.pdf') plt.show() M = np.array([s, hastighet]).T np.savetxt('fritt_fall.txt', M, fmt='%.3f',delimiter=' ')