Following is the data captured from an experimental setup involving spring , mass and damper system. Accelerometer was used to capture the vibrations generated by disturbing spring-mass-damper system. To capture the data Lab-Jack i.e. data acquisition system was used. Following csv file was created from the .dat file given as output of Lab-Jack system. Save following sample data of first 100 lines as a .csv file in the same folder where program file is saved.
#Python Program to process above csv data file and print Amplitude v/s Time plot on the output screen
import pandas
import numpy as np
import matplotlib.pyplot as plt
import statistics as st
#read the csv data file and assign df as the object to access the same
df = pandas.read_csv("expt6.csv")
#as per the column heads assign them to two different lists
t = df['Time']
y = df['v0']
#using stats module find the mean of amplitude
m0 = st.mean(y)
#print the value of time and amplitude
print(t)
print(y)
#plot the amplitude v/s time plot
plt.plot(t,y,color='brown')
plt.axhline(y=m0,color='black',ls='-.')
plt.xlabel('Time in Seconds')
plt.ylabel('Amplitude')
plt.title('Amplitude v/s Time Plot')
plt.show()