def IG(self, beta, ReNm): if not (self.bdFname == '0'): self.ReList = [] self.beta = beta tree = ET.parse(self.bdFPath + '/' + self.bdFname, OrderedXMLTreeBuilder()) root = tree.getroot() Re = root[1][1][5].text.split('=')[-1] self.ReList.append(int(Re) - 0.3 * int(Re)) ReNew = float(Re) + float(Re) * 4 * (abs(beta - 0.4)) self.ReList.append(int(ReNew)) self.CritRe() [a, b] = ipVar.poptDir(self.RePath) self.temp = Re while (all(i < 0 for i in a)): self.ReList = [] ReNew = float(ReNew) + 0.5 * (float(ReNew)) self.ReList.append(ReNew) self.CritRe() [a, b] = ipVar.poptDir(self.RePath) while (all(i > 0 for i in a)): self.ReList = [] Re = float(Re) - 0.5 * (float(Re)) self.ReList.append(Re) self.CritRe() [a, b] = ipVar.poptDir(self.RePath) else: self.ReList = [] self.ReList.append(ReNm) ReNew = ReNm**(abs(beta - 0.4) + 1) self.ReList.append(ReNew) return self.ReList
def IG(self,beta,ReNm): if not (self.bdFname=='0'): self.ReList=[]; self.beta=beta; tree=ET.parse(self.bdFPath+'/'+self.bdFname,OrderedXMLTreeBuilder()); root=tree.getroot(); Re=float(root[1][1][5].text.split('=')[-1]); self.ReList.append(int(Re)-0.4*int(Re)); ReNew=float(Re)+float(Re)*4*(abs(beta-0.4)); self.ReList.append(int(ReNew)); self.CritRe(100); [a,b]=ipVar.poptDir(self.RePath); self.temp=Re; while(all(i<0 for i in a)): self.ReList=[]; ReNew=float(ReNew)+0.5*(float(ReNew)); self.ReList.append(ReNew); self.CritRe(100); [a,b]=ipVar.poptDir(self.RePath); while(all(i>0 for i in a)): self.ReList=[]; Re=float(Re)-0.5*(float(Re)); self.ReList.append(Re); self.CritRe(100); [a,b]=ipVar.poptDir(self.RePath); else: self.ReList=[]; self.ReList.append(ReNm); ReNew=ReNm**(abs(beta-0.4)+1); self.ReList.append(ReNew); return self.ReList;
def ReIter2(self,FT): [a,b]=ipVar.poptDir(self.RePath); z=np.where(np.diff(np.sign(a)))[0]; r1=b[z[0]];r2=b[z[0]+1]; while(abs(r1-r2)>11): [a,b]=ipVar.poptDir(self.RePath); ReCr=funcs.calcReC(a,b); self.ReList.append(ReCr+5); self.ReList.append(ReCr-5); self.CritRe(FT); [a,b]=ipVar.poptDir(self.RePath); ReCr=funcs.calcReC(a,b); z=np.where(np.diff(np.sign(a)))[0]; r1=b[z[0]];r2=b[z[0]+1]; if(abs(r1-r2)< 11): [a,b]=ipVar.poptDir(self.RePath); ReCr=funcs.calcReC(a,b); self.ReList.append(ReCr); self.CritRe(FT); [a,b]=ipVar.poptDir(self.RePath); if(len(a)>3):func=InterpolatedUnivariateSpline(b,a,k=3); ReC=func.roots(); return ReC;
def ReIter(self): [a, b] = ipVar.poptDir(self.RePath) z = np.where(np.diff(np.sign(a)))[0] i = z[0] r1 = b[i] r2 = b[i + 1] print(r1) print(r2) print("the value of the ") while (abs(r1 - r2) > 20): self.ReList = [] ReCr = funcs.calcReC(a, b) self.ReList.append(ReCr + 0.3 * abs(r1 - r2)) self.ReList.append(ReCr - 0.3 * abs(r1 - r2)) self.CritRe() print(r1) print(r2) [a, b] = ipVar.poptDir(self.RePath) z = np.where(np.diff(np.sign(a)))[0] r1 = b[z[0]] r2 = b[z[0] + 1] [a, b] = ipVar.poptDir(self.RePath) if (len(a) > 3): func = InterpolatedUnivariateSpline(b, a, k=3) ReC = func.roots() return ReC
def ReIter2(self, FT): [a, b] = ipVar.poptDir(self.RePath) z = np.where(np.diff(np.sign(a)))[0] r1 = b[z[0]] r2 = b[z[0] + 1] while (abs(r1 - r2) > 11): [a, b] = ipVar.poptDir(self.RePath) ReCr = funcs.calcReC(a, b) self.ReList.append(ReCr + 5) self.ReList.append(ReCr - 5) self.CritRe(FT) [a, b] = ipVar.poptDir(self.RePath) ReCr = funcs.calcReC(a, b) z = np.where(np.diff(np.sign(a)))[0] r1 = b[z[0]] r2 = b[z[0] + 1] if (abs(r1 - r2) < 11): [a, b] = ipVar.poptDir(self.RePath) ReCr = funcs.calcReC(a, b) self.ReList.append(ReCr) self.CritRe(FT) [a, b] = ipVar.poptDir(self.RePath) if (len(a) > 3): func = InterpolatedUnivariateSpline(b, a, k=3) ReC = func.roots() return ReC
def ReIter(self): [a,b]=ipVar.poptDir(self.RePath); z=np.where(np.diff(np.sign(a)))[0]; i=z[0]; r1=b[i];r2=b[i+1]; print(r1);print(r2); print("the value of the "); while(abs(r1-r2)>20): self.ReList=[]; ReCr=funcs.calcReC(a,b); self.ReList.append(ReCr+0.3*abs(r1-r2)); self.ReList.append(ReCr-0.3*abs(r1-r2)); self.CritRe(); print(r1);print(r2); [a,b]=ipVar.poptDir(self.RePath); z=np.where(np.diff(np.sign(a)))[0]; r1=b[z[0]];r2=b[z[0]+1]; [a,b]=ipVar.poptDir(self.RePath); if(len(a)>3):func=InterpolatedUnivariateSpline(b,a,k=3); ReC=func.roots(); return ReC;
def ReIter(self, FT): [a, b] = ipVar.poptDir(self.RePath) while (all(i > 0 for i in a)): self.ReList = [] ReNew = float(b[0]) - 0.2 * float(b[0]) self.ReList.append(ReNew) self.CritRe(FT) [a, b] = ipVar.poptDir(self.RePath) while (all(i < 0 for i in a)): self.ReList = [] ReNew = float(b[-1]) + 0.3 * float(b[-1]) self.ReList.append(ReNew) self.CritRe(FT) [a, b] = ipVar.poptDir(self.RePath) [a, b] = ipVar.poptDir(self.RePath) z = np.where(np.diff(np.sign(a)))[0] i = z[0] r1 = b[i] r2 = b[i + 1] print(r1) print(r2) print("the value of the ") temp = [0] ReCr = funcs.calcReC(a, b) temp.append(ReCr) while (abs(temp[-1] - temp[-2]) > 1): self.ReList = [] ReCr = funcs.calcReC(a, b) self.ReList.append(ReCr + 0.1 * abs(r1 - r2)) self.ReList.append(ReCr - 0.1 * abs(r1 - r2)) self.CritRe(FT) print(r1) print(r2) ReCr = funcs.calcReC(a, b) temp.append(ReCr) [a, b] = ipVar.poptDir(self.RePath) z = np.where(np.diff(np.sign(a)))[0] r1 = b[z[0]] r2 = b[z[0] + 1] [a, b] = ipVar.poptDir(self.RePath) if (len(a) > 3): func = InterpolatedUnivariateSpline(b, a, k=3) ReC = func.roots() return ReC
def ReIter(self,FT): [a,b]=ipVar.poptDir(self.RePath); while(all(i > 0 for i in a)): self.ReList=[]; ReNew=float(b[0])- 0.2*float(b[0]); self.ReList.append(ReNew); self.CritRe(FT); [a,b]=ipVar.poptDir(self.RePath); while(all(i < 0 for i in a)): self.ReList=[]; ReNew=float(b[-1])+0.3*float(b[-1]); self.ReList.append(ReNew); self.CritRe(FT); [a,b]=ipVar.poptDir(self.RePath); [a,b]=ipVar.poptDir(self.RePath); z=np.where(np.diff(np.sign(a)))[0]; i=z[0]; r1=b[i];r2=b[i+1]; print(r1);print(r2); print("the value of the "); temp=[0]; ReCr=funcs.calcReC(a,b); temp.append(ReCr); while(abs(temp[-1]-temp[-2])>1): self.ReList=[]; ReCr=funcs.calcReC(a,b); self.ReList.append(ReCr+0.1*abs(r1-r2)); self.ReList.append(ReCr-0.1*abs(r1-r2)); self.CritRe(FT); print(r1);print(r2); ReCr=funcs.calcReC(a,b); temp.append(ReCr); [a,b]=ipVar.poptDir(self.RePath); z=np.where(np.diff(np.sign(a)))[0]; r1=b[z[0]];r2=b[z[0]+1]; [a,b]=ipVar.poptDir(self.RePath); if(len(a)>3):func=InterpolatedUnivariateSpline(b,a,k=3); ReC=func.roots(); return ReC;
from glob import glob import os import sys sys.path.append('/home/nyadav/pyscr/') import ipVar pathS = glob("*/") cwd = os.getcwd() aa = [] bb = [] for i in pathS: pathBeta = cwd + "/" + i os.chdir(pathBeta) [a, b] = ipVar.poptDir(os.getcwd()) if (ipVar.calcReC(a, b)): c = ipVar.calcReC(a, b) aa.append(c) print(aa)
from glob import glob; import os; import sys; sys.path.append('/home/nyadav/pyscr/'); import ipVar; pathS=glob("*/"); cwd=os.getcwd() aa=[]; bb=[]; for i in pathS: pathBeta=cwd+"/"+i; os.chdir(pathBeta); [a,b]=ipVar.poptDir(os.getcwd()); if(ipVar.calcReC(a,b)): c=ipVar.calcReC(a,b); aa.append(c); print(aa);