Commit 72a8971c authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

Merge remote-tracking branch 'origin/clusters' into cluster_update_normal

parents 2a0e2eeb fb2d5071
......@@ -546,7 +546,7 @@ static void contact_apply(const Contact *c, ParticleProblem *p) {
result[0] = (c->dv[0]/wnn)*c->basis[0][0] + (c->dv[1]/wtt)*c->basis[1][0];
result[1] = (c->dv[0]/wnn)*c->basis[0][1] + (c->dv[1]/wtt)*c->basis[1][1];
if(omega0)
omega0[0] += c->iinertmom0*(result[0]*c->r0[1] - result[1]*c->r0[0]);
omega0[0] -= c->iinertmom0*(result[0]*c->r0[1] - result[1]*c->r0[0]);
omega1[0] -= c->iinertmom1*(result[0]*c->r1[1] - result[1]*c->r1[0]);
#else
//TODO
......
......@@ -5,27 +5,32 @@ import shutil
import random
import csv
import matplotlib.pyplot as plt
filename = "fric/1output005r=6e-3mu=3171/Drag.csv"
filename = "../../../../../media/coppinn/Maxtor/Hopper/hopper04/2/Drag.csv"
filename = "../../../Latex/ArticleContacts/Drag/noRelaxStressDrag64/2/Drag.csv"
with open(filename) as file1:
reader = csv.reader(file1,delimiter = ";",quoting=csv.QUOTE_NONNUMERIC)
data = [r for r in reader]
data = np.array(data);
react = data[:,1]
prod = np.zeros_like(react)
ranges = 25
startMean=6000
ranges = 500
startMean=7000
endMean = 20000
endMean2 = 4500
print(react)
for i in range(len(react)):
if i <ranges:
prod[i] = np.sum(react[0:i+ranges])/(i+ranges)
elif len(react)-i<ranges:
prod[i] = np.sum(react[i-ranges:])/((len (react)-i)+ranges)
else:
prod[i] = np.sum(react[i-ranges:i+ranges])/(2*ranges)
print("Mean :",np.mean(prod[startMean:]),"\nVelocity :",np.mean(data[startMean:, 4])*1000, "mm/s")
mean = np.ones_like(prod[startMean:])*np.mean(prod[startMean:])
plt.plot(data[:, 3],-prod,color='black')
plt.plot(data[startMean:, 3],-mean,color = 'red')
prod[i] = np.sum(react[i-ranges:i])/(ranges)
#print("Mean :",np.mean(prod[startMean:]),"\nVelocity :",np.mean(data[startMean:, 4])*1000, "mm/s")
mean = np.ones_like(react[startMean:endMean])*np.mean(react[startMean:endMean])
plt.plot(data[:, 3],-prod,color='black',linewidth=2)
plt.plot(data[:, 3],-react,'.',color='black',alpha=0.03,markersize=2.5)
plt.plot(data[startMean:endMean, 3],-mean,color = 'darkorange',linewidth=2.5)
mean2 = np.ones_like(react[:endMean2])*np.mean(react[:endMean2])
plt.plot(data[:endMean2, 3],-mean2,color = 'darkturquoise',linewidth=2.5)
plt.xlabel("Time [s]",size=15)
plt.ylabel("Drag force [N]",size=15)
plt.title("v = %.1f mm/s"%(np.mean(data[startMean:, 4])*1000),size=19)
plt.ylabel("F [N]",size=15,rotation=0)
plt.ylim([0,25])
plt.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment