~gcg/splithopkinsontools/trunk

« back to all changes in this revision

Viewing changes to measure_time_gap.py

  • Committer: gcg
  • Date: 2017-10-06 12:29:59 UTC
  • Revision ID: gcg-20171006122959-ppqs0y22z341ezbb
shtb tools

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        
29
29
    def plotData(self):
30
30
        
 
31
        shift = 0 -0.5
 
32
        self.sx0 += shift
 
33
        self.fx += shift
 
34
        
 
35
        
31
36
        sx = self.sx0
32
37
        sy = self.sy0
33
38
        
34
 
        tck = interpolate.splrep(sx, sy, s=0.001)
 
39
        tck = interpolate.splrep(sx, sy, s=0.01)
35
40
        velocity = interpolate.splev(sx, tck, der=1)
36
41
        
37
42
        stress = -self.rho * self.c0 * velocity
38
43
        force2 = stress * self.area
39
44
        
40
45
        #plt.plot(sx, sy)
41
 
        plt.plot(sx, force2, label="velocity from diff")
42
 
        plt.plot(self.fx - 0.0, self.fy, label="force")
43
 
        plt.xlim(0.0, 1.2)
 
46
        
 
47
        plt.plot(self.fx - 0.0, self.fy, linewidth=2, label="strain gauge")
 
48
        plt.plot(sx, force2, "r--", linewidth=2, label="optical measurement  via line scan camera")
 
49
        plt.xlim(-0.2, 0.6)
44
50
        plt.ylim(0.0, 30)
45
51
        plt.legend()
 
52
        plt.grid()
 
53
        plt.xlabel("time / msec", fontsize=14)
 
54
        plt.ylabel("force / kN", fontsize=14)
 
55
        
46
56
        plt.show()
47
57
        
48
58