def exampleSimExp(): plotAt = [3, 5, 7, 9, 11, 13] #keep track of count #start count at 0 #when plotAt[count] < x: # plotPlume() # save plot as titled "flow, plotAt[count] # destroy plot # count +=1 # continue #this when developed (if the plot, save, destroy/continue works) should #give me all the plots I need #and i'll only have to click a button once... param = auxiliary.Parameters() plum = plumeExperimentClass.plumeExpC(param) begifn = int(plum.param.steps * 0.65) end = int(plum.param.steps * 0.85) count = 0 for x in linspace(0, param.T, param.steps, endpoint=True): print x count += 1 plum.tickSoA() return plum
def main(argv): param = auxiliary.Parameters() fileName = "%s_%s"%(argv[1], int(param.den)) plum = plumeClass.plume(param, fileName, False) #fileName = "npSaveExperiment.bin" np.random.seed(1) plum = generateData(plum) print "Finished generating data."
def exampleSim(): param = auxiliary.Parameters() plum = plumeClass.plume(param, "none", False) plum.puffSoA.addPuffs(plum.param.yi, plum.param.xi, 1) for x in xrange(int(param.T / param.dt)): #for x in linspace(0, param.T, param.steps, endpoint=True): #print x plum.movePuffs() if plotMe: updatePoints(plum) print "finished" return plum
def plumeIntermitency(): """ this is the framework for generating a statistic about the spontaneity of the plume. It takes periodic measurements of the concentration at specified points along the plume as it progresses, and then plots them This can be used to characterize the instantaneous plume. """ param = auxiliary.Parameters() plum = plumeExperimentClass.plumeExpC(param) cList = [] #hardcode points - p = (12, 20) margin = 0.03 for x in linspace(0, param.T, param.steps, endpoint=True): print x plum.tickSoA() xp, yp = plum.getPointsSoA() c = len([x for x, y in zip(xp,yp) \ if (x-margin)<p[1]<(x+margin) \ and (y-margin)<p[0]<(y+margin)]) print "c: %s" % c cList.append(c) spon = len([x for x in cList if x == 0]) / float(len(cList)) figure(8) plt.plot(linspace(0, param.T, param.steps, endpoint=True), cList) title("Margin Size: %s Location (%s, %s)\nDensity:%s Sponaneity: %s" % (margin, p[0], p[1], plum.param.den, spon)) #plum.plotPlume() show() print "end spontaneity test" return plum
def plumeExpPDF(): print "Find the probability density function at certain steps down from the plume source" #first step is to generate the points #second, plot all those points after the simulation runs. param = auxiliary.Parameters() plum = plumeExperimentClass.plumeExpC(param) #plum = auxiliary.setupPlumeExp(100, 75, 'mit', 1, 0.12, 12, 26) nearEnd = param.T * 0.8 check = 0 for x in linspace(0, param.T, param.steps, endpoint=True): #if x%1 == 0: #print x plum.tickSoA() if (x - nearEnd) > 0 and (x - nearEnd) < 1: if check % 55 == 0: plum.gatherPointsSoA() #print "collect" check += 1 plum.plotPDF() return plum
import step reload(step) import plumeClass reload(plumeClass) import auxiliary reload(auxiliary) import flowField reload(flowField) np.random.seed(1) param = auxiliary.Parameters() plum = plumeClass.plume(param) plum.puffSoA.addPuffs(plum.param.yi, plum.param.xi, 1) plum.kinzelbach1990SoA() x = np.array([12.0]) y = np.array([26.0]) flow = flowField.flowField('simple') x, y = step.kinzelbach1990SoA(flow, y, x)