当前位置: 首页>>代码示例>>Python>>正文


Python scipy.pi方法代码示例

本文整理汇总了Python中scipy.pi方法的典型用法代码示例。如果您正苦于以下问题:Python scipy.pi方法的具体用法?Python scipy.pi怎么用?Python scipy.pi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scipy的用法示例。


在下文中一共展示了scipy.pi方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: volumen

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def volumen(self, cabeza):
        """
        cabeza: tipo de cabeza del recipiente
            0   -   Ellipsoidal
            1   -   Hemispherical
            2   -   Bumped
            3   -   Flat
        """
        V_carcasa=pi/4*self.Di**2*self.L

        if cabeza==0:
            V_cabeza=4./3*pi/8*self.Di**3
        elif cabeza==1:
            V_cabeza=4./3*pi/8/2*self.Di**3
        elif cabeza==2:
            V_cabeza=0.215483/2*self.Di**3
        else:
            V_cabeza=0.

        self.Volumen=Volume(V_carcasa+V_cabeza) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:22,代码来源:tank.py

示例2: volumen

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def volumen(self):
        self.Di = unidades.Length(0)
        self.L = unidades.Length(0)
        self.reborde = 0
        self.espesor = 0
        self.espesor_cabeza = 0

        V_carcasa = pi/4*self.Di**2*self.L

        if self.kwargs["cabeza"] == 0:
            V_cabeza = 4./3*pi/8*self.Di**3
        elif self.kwargs["cabeza"] == 1:
            V_cabeza = 4./3*pi/8/2*self.Di**3
        elif self.kwargs["cabeza"] == 2:
            V_cabeza = 0.215483/2*self.Di**3
        else:
            V_cabeza = 0.

        self.V = unidades.Volume(V_carcasa+V_cabeza) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:21,代码来源:distillation.py

示例3: _hAnnulli

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def _hAnnulli(self, fluidAnnulli):
        """Calculate convection heat transfer coefficient in annulliside"""
        a = self.Dee/self.De
        dh = self.Dee-self.De

        rho = fluidAnnulli.Liquido.rho
        mu = fluidAnnulli.Liquido.mu
        k = fluidAnnulli.Liquido.k
        v = fluidAnnulli.Q*4/pi/(self.Dee**2-self.De**2)
        re = Re(D=dh, V=v, rho=rho, mu=mu)
        self.VAnnulli = unidades.Speed(v)
        self.rhoAnnulli = rho
        self.ReAnnulli = unidades.Dimensionless(re)
        pr = fluidAnnulli.Liquido.Prandt

        if re <= 2300:
            Nu = h_anulli_Laminar(re, pr, a)
        elif re >= 1e4:
            Nu = h_anulli_Turbulent(re, pr, a)
        else:
            Nu = h_anulli_Transition(re, pr, a)

        return unidades.HeatTransfCoef(Nu*k/self.Di) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:25,代码来源:heatExchanger.py

示例4: h_tube_Condensation_Traviss

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def h_tube_Condensation_Traviss(fluid, Di, X):
    """ref Pag 558 Kakac: Boiler..."""
    G = fluid.caudalmasico*4/pi/Di**2
    Re = Di*G*(1-fluid.x)/fluid.Liquido.mu
    F1 = 0.15*(1/X+2.85*X**-0.476)
    if Re < 50:
        F2 = 0.707*fluid.Liquido.Prandt*Re
    elif Re < 1125:
        F2 = 5*fluid.Liquido.Prandt+5*log(1+fluid.Liquido.Prandt*(0.0964*Re**0.585-1))
    else:
        F2 = 5*fluid.Liquido.Prandt+5*log(1+5*fluid.Liquido.Prandt)+2.5*log(0.0031*Re**0.812)

    return fluid.Pr*Re**0.9*F1/F2


# Heat Exchanger design methods 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:18,代码来源:heatTransfer.py

示例5: return_data

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def return_data():

    X = []
    y = []
    features = []

    with open(TRAIN_FILE) as fp:
        for line in islice(fp, LIMIT):
            path, angle = line.strip().split()
            full_path = os.path.join(DATA_FOLDER, path)
            X.append(full_path)
            # using angles from -pi to pi to avoid rescaling the atan in the network
            y.append(float(angle) * scipy.pi / 180)

    for i in range(len(X)):
        img = plt.imread(X[i])
        features.append(preprocess(img))

    features = np.array(features).astype('float32')
    labels = np.array(y).astype('float32')

    with open("features", "wb") as f:
        pickle.dump(features, f, protocol=4)
    with open("labels", "wb") as f:
        pickle.dump(labels, f, protocol=4) 
开发者ID:akshaybahadur21,项目名称:Autopilot,代码行数:27,代码来源:LoadData_V2.py

示例6: main

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def main(argv):
    C = read_file.read_file(argv[0])
    C.pop(0)
    C = sp.array(C,float)
    density,natoms,molmass = read_file.read_file(argv[1])[0]
    density = float(density)  # kg/m**3
    natoms = int(natoms)
    molmass = float(molmass)  # kg/mol
    integral = spherical_integral(C,density)  # (s/m)**3
    mean_vel = (integral/12./sp.pi)**(-1/3.)
    debeye_temp = PLANCKCONST/BOLTZCONST*(3.*natoms*AVONUM*
                      density/4./sp.pi/molmass)**(1/3.)*mean_vel
    print debeye_temp,mean_vel 
开发者ID:wolverton-research-group,项目名称:qmpy,代码行数:15,代码来源:sound_waves.py

示例7: rellenarDiametros

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def rellenarDiametros(self, indice):
        filas = len(self.diametros[indice])
        self.TablaDiametro2.setRowCount(filas)
        for i in range(filas):
            di = self.diametros[indice][i][4]-self.diametros[indice][i][3]*2
            V = pi/4*di**2*100/1e6
            S = pi*self.diametros[indice][i][4]*100/1e3
            self.TablaDiametro2.setRowHeight(i, 20)
            self.TablaDiametro2.setItem(i, 0, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 0).setText(self.diametros[indice][i][2])
            self.TablaDiametro2.setItem(i, 1, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 1).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
            self.TablaDiametro2.item(i, 1).setText(str(round(di, 2)))
            self.TablaDiametro2.setItem(i, 2, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 2).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
            self.TablaDiametro2.item(i, 2).setText(str(self.diametros[indice][i][3]))
            self.TablaDiametro2.setItem(i, 3, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 3).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
            self.TablaDiametro2.item(i, 3).setText(str(self.diametros[indice][i][4]))
            self.TablaDiametro2.setItem(i, 4, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 4).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
            self.TablaDiametro2.item(i, 4).setText(
                str(round(self.diametros[indice][i][5], 3)))
            self.TablaDiametro2.setItem(i, 5, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 5).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
            self.TablaDiametro2.item(i, 5).setText(str(round(V, 3)))
            self.TablaDiametro2.setItem(i, 6, QtWidgets.QTableWidgetItem(""))
            self.TablaDiametro2.item(i, 6).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
            self.TablaDiametro2.item(i, 6).setText(str(round(S, 3))) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:37,代码来源:UI_pipe.py

示例8: calculo

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def calculo(self):
        Gas = self.kwargs["entradaGas"]
        Liquido = self.kwargs["entradaLiquido"]
        sigma = Liquido.sigma
        rhoL = Liquido.Liquido.rho
        muL = Liquido.Liquido.mu

        self.Dt = Length(self.kwargs["diametro"])
        self.Lt = Length(self.kwargs["Lt"])

        if self.kwargs["k"]:
            self.k = Dimensionless(self.kwargs["k"])
        else:
            self.k = Dimensionless(1000.)
        if self.kwargs["f"]:
            self.f = Dimensionless(self.kwargs["f"])
        else:
            self.f = Dimensionless(0.5)

        self.At = Area(pi/4*self.Dt**2)
        self.Vg = Speed(Gas.Q/self.At)
        self.R = Liquido.Q/Gas.Q
        self.dd = Length(58600/self.Vg*(sigma/rhoL)**0.5+597*(
            muL/sigma**0.5/rhoL**0.5)**0.45*(1000*self.R)**1.5)

        self.rendimiento_parcial = self._Efficiency()
        self.rendimiento = self._GlobalEfficiency(self.rendimiento_parcial)

        if self.statusDeltaP:
            self.deltaP = self._deltaP()
        else:
            self.deltaP = DeltaP(0)

        self.CalcularSalidas(Gas)
        self.Pin = min(Gas.P, Liquido.P) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:37,代码来源:gas_solid_liquid.py

示例9: _Efficiency

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def _Efficiency(self):
        Gas = self.kwargs["entradaGas"]
        Liquido = self.kwargs["entradaLiquido"]
        rhoS = Gas.solido.rho
        muG = Gas.Gas.mu
        rhoL = Liquido.Liquido.rho

        rendimiento_fraccional = []
        if self.kwargs["modelo_rendimiento"] == 0:
            # Modelo de Johnstone (1954)
            l = sqrt(pi/8)*Gas.Gas.mu/0.4987445/sqrt(Gas.Gas.rho*Gas.P)
            for dp in Gas.solido.diametros:
                Kn = l/dp*2
                C = Cunningham(l, Kn)
                kp = C*rhoS*dp**2*self.Vg/9/Gas.Gas.mu/self.dd
                penetration = exp(-self.k*self.R*kp**0.5)
                rendimiento_fraccional.append(1-penetration)

        elif self.kwargs["modelo_rendimiento"] == 1:
            # Modelo de Calvert (1972)
            l = sqrt(pi/8)*muG/0.4987445/sqrt(Gas.Gas.rho*Gas.P)
            for dp in Gas.solido.diametros:
                Kn = l/dp*2
                C = Cunningham(l, Kn)
                kp = C*rhoS*dp**2*self.Vg/9/muG/self.dd
                b = (-0.7-kp*self.f+1.4*log((kp*self.f+0.7)/0.7)+0.49 /
                     (0.7+kp*self.f))
                penetration = exp(self.R*self.Vg*rhoL*self.dd/55/muG*b/kp)
                if penetration > 1:
                    penetration = 1
                elif penetration < 0:
                    penetration = 0
                rendimiento_fraccional.append(1-penetration)

        return rendimiento_fraccional 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:37,代码来源:gas_solid_liquid.py

示例10: peso

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def peso(self):
        """Cálculo del peso de la carcasa"""
        return unidades.Mass(pi*self.kwargs["Di"]*(self.kwargs["h"]+0.8116*self.kwargs["Di"])*0.5*(self.kwargs["Wb"]+self.kwargs["W"])*self.densidad) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:5,代码来源:distillation.py

示例11: h_tubeside_laminar_condensation_Kern

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def h_tubeside_laminar_condensation_Kern(self):
        return 0.815*(k**3*rho_l*(rho_l-rho_g)*g*l/(pi*mu_l*Do*(T-Tw)))**0.25 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:4,代码来源:heatExchanger.py

示例12: h_tube_Condensation_Cavallini

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def h_tube_Condensation_Cavallini(fluid, Di):
    """ref Pag 557 Kakac: Boiler..."""
    Ge = fluid.caudalmasico*4/pi/Di**2*((1-fluid.x)+fluid.x*(fluid.Liquido.rho/fluid.Vapor.rho)**0.5)
    Re = Di*Ge/fluid.Liquido.mu
    return 0.05*Re**0.8*fluid.Liquido.Prandt**(1./3) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:7,代码来源:heatTransfer.py

示例13: h_tube_Condensation_Boyko

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def h_tube_Condensation_Boyko(fluid, Di):
    """ref Pag 557 Kakac: Boiler..."""
    G = fluid.caudalmasico*4/pi/Di**2
    Re = Di*G/fluid.Liquido.mu
    return 0.021*Re**0.8*fluid.Liquido.Prandt**0.43*(1+fluid.x*(fluid.Liquido.rho/fluid.Vapor.rho-1))**0.5 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:7,代码来源:heatTransfer.py

示例14: h_tube_Condensation_Shah

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def h_tube_Condensation_Shah(fluid, Di):
    """ref Pag 557 Kakac: Boiler..."""
    G = fluid.caudalmasico*4/pi/Di**2
    Re = Di*G/fluid.Liquido.mu
    Nul = 0.023*Re**0.8*fluid.Liquido.Prandt**0.4
    return Nul*((1-fluid.x)**0.8+3.8*fluid.x**0.76*(1-fluid.x)**0.04/fluid.Pr**0.38) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:8,代码来源:heatTransfer.py

示例15: _ThCondCritical

# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import pi [as 别名]
def _ThCondCritical(self, rho, T, fase):
        # Custom Critical enhancement

        # The paper use a diferent rhoc value to the EoS
        rhoc = 235

        t = abs(T-405.4)/405.4
        dPT = 1e5*(2.18-0.12/exp(17.8*t))
        nb = 1e-5*(2.6+1.6*t)

        DL = 1.2*Boltzmann*T**2/6/pi/nb/(1.34e-10/t**0.63*(1+t**0.5)) * \
            dPT**2 * 0.423e-8/t**1.24*(1+t**0.5/0.7)

        # Add correction for entire range of temperature, Eq 10
        DL *= exp(-36*t**2)

        X = 0.61*rhoc+16.5*log(t)
        if rho > 0.6*rhoc:
            # Eq 11
            DL *= X**2/(X**2+(rho-0.96*rhoc)**2)
        else:
            # Eq 14
            DL = X**2/(X**2+(0.6*rhoc-0.96*rhoc)**2)
            DL *= rho**2/(0.6*rhoc)**2

        return DL 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:28,代码来源:NH3.py


注:本文中的scipy.pi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。