[8735fe]: Examples / FunkyPythonPostproc / correlatePressureAndPlaceExecute.py Maximize Restore History

Download this file

correlatePressureAndPlaceExecute.py    17 lines (15 with data), 565 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
times.append(runTime)
r=scipy.stats.linregress(positions.x,pressure)
slopes.append(r[0])
offsets.append(r[1])
f=pyplot.figure()
pyplot.title("Pressure drop at t=%f" % runTime)
pyplot.xlabel('x-direction [m]')
pyplot.ylabel('pressure [Pa]')
data=pyplot.plot(positions.x,pressure,'b.',label="Data")
xLine=numpy.array([min(positions.x),max(positions.x)])
line=pyplot.plot(xLine,r[1]+r[0]*xLine,'r',label="Fit")
a=line[0].get_axes()
pyplot.text(0.1,0.1,"p = %f * x + %f" % r[:2],transform=a.transAxes)
pyplot.legend()
pyplot.savefig("pressuredrop_t=%f.png" % runTime)