本文整理汇总了Python中scipy.log10方法的典型用法代码示例。如果您正苦于以下问题:Python scipy.log10方法的具体用法?Python scipy.log10怎么用?Python scipy.log10使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy
的用法示例。
在下文中一共展示了scipy.log10方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _visco0
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def _visco0(self, rho, T, fase=None):
a = [17.67484, -2.78751, 311498.7, -48826500, 3938774000, -1.654629e11,
2.86561e12]
Tr = T/0.29944
y = 0.68321*(a[0] + a[1]*log10(Tr) + a[2]/Tr**2 + a[3]/Tr**3 +
a[4]/Tr**4 + a[5]/Tr**5 + a[6]/Tr**6)
nt = 266.93*(T*self.M)**0.5/y
om = rho/1673.0
c = [1.03010, -0.99175, 2.47127, -3.11864, 1.57066]
b = [0.48148, -1.18732, 2.80277, -5.41058, 7.04779, -3.76608]
sum1 = sum([ci*om**i for i, ci in enumerate(c)])
sum2 = sum([bi*om**i for i, bi in enumerate(b)])
sigma = 3.05e-10*(sum1-sum2*log10(T/122.1))
br = 2.0/3.0*pi*Avogadro*sigma**3
brho = rho/self.M*1000*br
d = [1, 0.27676, 0.014355, 2.6480, -1.9643, 0.89161]
nd = sum([di*brho**i for i, di in enumerate(d)])
return unidades.Viscosity(nd*nt/100, "muPas")
示例2: w_Korsten
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def w_Korsten(Tb, Tc, Pc):
"""Calculate petroleum fractions acentric factor with the Korsten (2000)
correlation
Parameters
------------
Tb : float
Normal boiling temperature, [K]
Tc : float
Critical temperature, [K]
Pc : float
Critical pressure, [Pa]
Returns
-------
w: float
Acentric factor, [-]
"""
tbr = Tb/Tc
# Eq 29
w = 0.5899*tbr**1.3/(1-tbr**1.3)*log10(Pc/101325)-1.
return {"w": unidades.Dimensionless(w)}
示例3: Viscosidad_ASTM
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def Viscosidad_ASTM(self, T, T1=unidades.Temperature(100, "F"), T2=unidades.Temperature(210, "F"), mu1=0, mu2=0):
"""Cálculo de la viscosidad cinemática a cualquier temperatura, conociendo otros dos valores de viscosidad a otras temperaturas, API procedure 11A4.4, pag 1063
Parámetros:
T:Temperatura a la que se quiere calcular la viscosidad
T1,T2:opcional, temperatura a la que se conoce la viscosidad
mu1,mu2:opcionales, valores de viscosidad conocidos
Si no se suministran los parámetros opcionales se consideran los valores a 100 y 210ºF
"""
if mu1==0:
mu1=self.v100.cSt
if mu2==0:
mu2=self.v210.cSt
t=unidades.Temperature(T)
Z1=mu1+0.7+exp(-1.47-1.84*mu1-0.51*mu1**2)
Z2=mu2+0.7+exp(-1.47-1.84*mu2-0.51*mu2**2)
B=(log10(log10(Z1))-log10(log10(Z2)))/(log10(T1.R)-log10(T2.R))
Z=10**(10**(log10(log10(Z1))+B*(log10(t.R)-log10(T1.R))))
return unidades.Diffusivity(Z-0.7-exp(-0.7487-3.295*(Z-0.7)+0.6119*(Z-0.7)**2-0.3191*(Z-0.7)**3), "cSt")
示例4: addqqplotinfo
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def addqqplotinfo(qnull,M,xl='-log10(P) observed',yl='-log10(P) expected',xlim=None,ylim=None,alphalevel=0.05,legendlist=None,fixaxes=False):
distr='log10'
pl.plot([0,qnull.max()], [0,qnull.max()],'k')
pl.ylabel(xl)
pl.xlabel(yl)
if xlim is not None:
pl.xlim(xlim)
if ylim is not None:
pl.ylim(ylim)
if alphalevel is not None:
if distr == 'log10':
betaUp, betaDown, theoreticalPvals = _qqplot_bar(M=M,alphalevel=alphalevel,distr=distr)
lower = -sp.log10(theoreticalPvals-betaDown)
upper = -sp.log10(theoreticalPvals+betaUp)
pl.fill_between(-sp.log10(theoreticalPvals),lower,upper,color="grey",alpha=0.5)
#pl.plot(-sp.log10(theoreticalPvals),lower,'g-.')
#pl.plot(-sp.log10(theoreticalPvals),upper,'g-.')
if legendlist is not None:
leg = pl.legend(legendlist, loc=4, numpoints=1)
# set the markersize for the legend
for lo in leg.legendHandles:
lo.set_markersize(10)
if fixaxes:
fix_axes()
示例5: tdft
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def tdft(audio, srate, windowsize, windowshift,fftsize):
"""Calculate the real valued fast Fourier transform of a segment of audio multiplied by a
a Hamming window. Then, convert to decibels by multiplying by 20*log10. Repeat for all
segments of the audio."""
windowsamp = int(windowsize*srate)
shift = int(windowshift*srate)
window = scipy.hamming(windowsamp)
spectrogram = scipy.array([20*scipy.log10(abs(np.fft.rfft(window*audio[i:i+windowsamp],fftsize)))
for i in range(0, len(audio)-windowsamp, shift)])
return spectrogram
示例6: h_anulli_Turbulent
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def h_anulli_Turbulent(Re, Pr, a, dhL=0, boundary=0):
"""VDI Heat Atlas G2 Pag.703"""
if boundary == 0: #Inner surface heated
Fann = 0.75*a**-0.17
elif boundary == 1: #Outer surface heated
Fann = (0.9-0.15*a**0.6)
elif boundary == 2: #Both surfaces heated
Fann = (0.75*a**-0.17+(0.9-0.15*a**0.6))/(1+a)
Re_ = Re*((1+a**2)*log(a)+(1-a**2))/((1-a)**2*log(a))
Xann = (1.8*log10(Re_)-1.5)**-2
k1 = 1.07+900/Re-0.63/(1+10*Pr)
Nu = Xann/8*Re*Pr/(k1+12.7*(Xann/8)**0.5*(Pr**(2./3.)-1))*(1+dhL**(2./3.))*Fann
return Nu
示例7: _Sublimation_Pressure
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def _Sublimation_Pressure(cls, T):
"""Special sublimation pressure correlation"""
# Use decimal logarithm
P = 10**(-43.39/T+2.5*log10(T)+2.047)
return unidades.Pressure(P, "mmHg")
示例8: Z_Brill_Beggs
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def Z_Brill_Beggs(Tr, Pr):
"""Calculate gas compressibility factor using the correlation of Brill-
Beggs (1974)
Parameters
------------
Tr : float
Reduced temperature [-]
Pr : float
Reduced pressure [-]
Returns
-------
Z : float
Gas compressibility factor [-]
Notes
-----
Raise :class:`NotImplementedError` if input pair isn't in limit:
* 1.15 ≤ Tr ≤ 2.4
* 0.2 ≤ Pr ≤ 15
"""
# Check input in range of validity
if Tr < 1.15 or Tr > 2.4 or Pr < 0.2 or Pr > 15:
raise NotImplementedError("Incoming out of bound")
A = 1.39*(Tr-0.92)**0.5 - 0.36*Tr - 0.101
B = (0.62-0.23*Tr)*Pr + (0.066/(Tr-0.86)-0.037)*Pr**2 + \
0.32/10**(9*(Tr-1))*Pr**6
C = 0.132 - 0.32*log10(Tr)
D = 10**(0.3016-0.49*Tr+0.1824*Tr**2)
Z = A + (1-A)/exp(B) + C*Pr**D
return unidades.Dimensionless(Z)
示例9: pb_Vazquez_Beggs
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def pb_Vazquez_Beggs(self, T, ts=350, ps=10):
"""Vázquez, M.E. and Beggs, H.D.: "Correlations for Fluid Physical Property Prediction," J.Pet. Tech. (June 1980), 968-970"""
t=unidades.Temperature(T)
ts=unidades.Temperature(ts)
ps=unidades.Pressure(ps, "atm")
if self.API<=30:
C1, C2, C3=0.0362, 1.0937, 25.724
else:
C1, C2, C3=0.0178, 1.187, 23.931
gravity_corr=self.gas.SG*(1.+5.912e-5*self.API*ts.F*log10(ps.psi/114.7))
return unidades.Pressure((self.Rgo.ft3bbl/C1/gravity_corr/exp(C3*self.API/T.R))**(1./C2), "psi")
示例10: pb_Kartoatmodjo_Schmidt
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def pb_Kartoatmodjo_Schmidt(self, T, ts=350, ps=10):
"""Kartoatmodjo, T. and Schmidt, Z.: "Large Data Bank Improve Crude Physical Property Correlations," Oil and Gas J. (July 4, 1994) 51-55"""
t=unidades.Temperature(T)
ts=unidades.Temperature(ts)
ps=unidades.Pressure(ps, "atm")
if self.API<=30:
C1, C2, C3, C4=0.05958, 0.7972, 13.1405, 0.9986
else:
C1, C2, C3, C4=0.0315, 0.7587, 11.2895, 0.9143
gravity_corr=self.gas.SG*(1.+0.1595*self.API**0.4078*ts.F**-0.2506*log10(ps.psi/114.7))
return unidades.Pressure((self.Rgo.ft3bbl/C1/gravity_corr**C2/10**(C3*self.API/t.R))**C4, "psi")
示例11: B_Vazquez_Beggs
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def B_Vazquez_Beggs(self, T, ts=350, ps=10):
"""Vázquez, M.E. and Beggs, H.D.: "Correlations for Fluid Physical Property Prediction," J.Pet. Tech. (June 1980), 968-970"""
t=unidades.Temperature(T)
ts=unidades.Temperature(ts)
ps=unidades.Pressure(ps, "atm")
if self.API<=30:
C1, C2, C3=4.667e-4, 1.751e-5, -1.8106e-6
else:
C1, C2, C3=4.67e-4, 1.1e-5, 1.337e-9
gravity_corr=self.gas.SG*(1.+5.912e-5*self.API*ts.F*log10(ps.psi/114.7))
return 1.+C1*self.Rgo.ft3bbl+C2*(t.F-60)*self.API/gravity_corr+C3*self.Rgo.ft3bbl*(t.F-60)*self.API/gravity_corr
示例12: B_Glaso
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def B_Glaso(self, T):
"""Glaso, O.: "Generalized Pressure-Volume-Temperature Correlations," J. Pet. Tech. (May 1980), 785-795"""
t=unidades.Temperature(T)
F=self.Rgo.ft3bbl(self.gas.SG/self.SG)**0.526*+0.968*t.F
return 1.+10**(-6.58511+2.91329*log10(F)-0.27683*log10(F)**2)
示例13: B_Kartoatmodjo_Schmidt
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def B_Kartoatmodjo_Schmidt(self, T, ts=350, ps=10):
"""Kartoatmodjo, T. and Schmidt, Z.: "Large Data Bank Improve Crude Physical Property Correlations," Oil and Gas J. (July 4, 1994) 51-55"""
t=unidades.Temperature(T)
ts=unidades.Temperature(ts)
ps=unidades.Pressure(ps, "atm")
gravity_corr=self.gas.SG*(1.+0.1595*self.API**0.4078*ts.F**-0.2506*log10(ps.psi/114.7))
F=self.Rgo.ft3bbl**0.755*gravity_corr**0.25*self.SG**-1.5+0.45*t.F
return 0.98496+1e-4*F**1.5
示例14: Mu_Glaso
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def Mu_Glaso(self, T):
"""Glaso, O.: "Generalized Pressure-Volume-Temperature Correlations," J. Pet. Tech. (May 1980), 785-795"""
t=unidades.Temperature(T)
mu=3.141e10*t.F**-3.444*log10(self.API)**(10.313*log10(t.F)-36.447)
return unidades.Viscosity(mu, "cP")
示例15: Mu_Kartoatmodjo_Schmidt
# 需要导入模块: import scipy [as 别名]
# 或者: from scipy import log10 [as 别名]
def Mu_Kartoatmodjo_Schmidt(self, T):
"""Kartoatmodjo, T. and Schmidt, Z.: "Large Data Bank Improve Crude Physical Property Correlations," Oil and Gas J. (July 4, 1994) 51-55"""
t=unidades.Temperature(T)
mu=16e8*t.F**-2.8177*log10(self.API)**(5.7526*log10(t.F)-26.9718)
return unidades.Viscosity(mu, "cP")