本文整理汇总了Python中mathkit.mfn.mfn_line.mfn_line.MFnLineArray.get_values方法的典型用法代码示例。如果您正苦于以下问题:Python MFnLineArray.get_values方法的具体用法?Python MFnLineArray.get_values怎么用?Python MFnLineArray.get_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mathkit.mfn.mfn_line.mfn_line.MFnLineArray
的用法示例。
在下文中一共展示了MFnLineArray.get_values方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: w_x_results
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def w_x_results( self, w_arr, x ):
epsm = np.zeros( ( len( w_arr ), len( x ) ) )
mu_epsf = np.zeros( ( len( w_arr ), len( x ) ) )
sigma_c = []
for i, w in enumerate( w_arr ):
self.model.w = w
epsm_line = MFnLineArray( xdata = self.x_arr, ydata = self.epsm_arr )
mu_epsf_line = MFnLineArray( xdata = self.x_arr, ydata = self.mu_epsf_arr )
epsm[i, :] = epsm_line.get_values( x )
mu_epsf[i, :] = mu_epsf_line.get_values( x )
sigma_c.append( self.sigma_c )
return epsm, mu_epsf, np.array( sigma_c )
示例2: _get__epsm_arr
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def _get__epsm_arr(self):
if len(self.sorted_reinf_lst[0]) != 0 and len(self.sorted_reinf_lst[1]) != 0:
epsm_cont_interp = MFnLineArray(xdata=self.cont_fibers.x_arr, ydata=self.cont_fibers.epsm_arr)
epsm_short_interp = MFnLineArray(xdata=self.short_fibers.x_arr, ydata=self.short_fibers.epsm_arr)
added_epsm_cont = self.cont_fibers.epsm_arr + epsm_short_interp.get_values(self.cont_fibers.x_arr)
added_epsm_short = self.short_fibers.epsm_arr + epsm_cont_interp.get_values(self.short_fibers.x_arr)
sorted_unique_idx = np.unique(np.hstack((self.cont_fibers.x_arr, self.short_fibers.x_arr)), return_index=True)[1]
return np.hstack((added_epsm_cont, added_epsm_short))[sorted_unique_idx]
elif len(self.sorted_reinf_lst[0]) != 0:
return self.cont_fibers.epsm_arr
elif len(self.sorted_reinf_lst[1]) != 0:
self.short_fibers.w = self.w
return self.short_fibers.epsm_arr
示例3: ppf
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def ppf( self, x ):
self.check()
if len( self.cdf_values ) != 0:
xx, cdf = self.x_values, self.cdf_values
else:
xx, cdf = self.x_values, self.cdf( self.x_values )
ppf_mfn_line = MFnLineArray( xdata = cdf, ydata = xx )
return ppf_mfn_line.get_values( x )
示例4: get_epsf_x
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def get_epsf_x(self, w):
'''
evaluates the mean fiber strain profile at given load
'''
self.CB_model.w = w
if self.CB_model.Ll > self.CB_model.Lr:
epsf_interp = MFnLineArray(xdata=-self.CB_model._x_arr[::-1], ydata=self.CB_model._epsf_arr[::-1])
else:
epsf_interp = MFnLineArray(xdata=self.CB_model._x_arr, ydata=self.CB_model._epsf_arr)
return epsf_interp.get_values(self.x)
示例5: get_epsm_x
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def get_epsm_x(self, w):
"""
evaluates the matrix strain profile at given load
"""
self.CB_model.w = w
if self.CB_model.Ll > self.CB_model.Lr:
epsm_interp = MFnLineArray(xdata=-self.CB_model._x_arr[::-1], ydata=self.CB_model._epsm_arr[::-1])
else:
epsm_interp = MFnLineArray(xdata=self.CB_model._x_arr, ydata=self.CB_model._epsm_arr)
return epsm_interp.get_values(self.x)
示例6: _get_pdf_array
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def _get_pdf_array( self ):
# get the normed histogram implemented in the base class YMBHist
h, b = self.normed_hist
b_cen = ( b[1:] + b[:-1] ) / 2.
mask = ( h != 0. )
h = h[mask]
b_cen = b_cen[mask]
b = hstack( [min( b ), b_cen, max( b )] )
h = hstack( [0, h, 0] )
h = h / trapz( h, b )
p = MFnLineArray( xdata=b, ydata=h )
return p.get_values( self.x_array )
示例7: _get_matrix_strength
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def _get_matrix_strength(self):
# evaluates a random field
# realization and creates a spline representation
rf = self.random_field.random_field
rf_spline = MFnLineArray(xdata=self.random_field.xgrid, ydata=rf)
return rf_spline.get_values(self.x_arr)
示例8: get_sigma_m_x_input
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def get_sigma_m_x_input( self, sigma ):
self.apply_load( sigma )
line = MFnLineArray( xdata = self.x_arr,
ydata = self.epsm_arr )
return line.get_values( self.x_input )
示例9: get_L
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def get_L( self, Ll, Lr ):
self.result_values
BC_line = MFnLineArray( xdata = self.BC_range, ydata = self.BC_range, extrapolate = 'constant' )
return BC_line.get_values( [Ll, Lr] )
示例10: eta
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def eta(self, psi):
psi_line = MFnLineArray(xdata=self.psi_line.ydata,
ydata=self.psi_line.xdata)
return psi_line.get_values(psi, k=1)
示例11: Pw
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_values [as 别名]
def Pw(self, w):
mask = self.cached_pdfs[3] < w
dx2 = (self.x[-1]-self.x[-2])**2
return np.sum(self.cached_pdfs[2] * mask * dx2)
def CDF_w(self, w_arr):
cdfs = []
for w in w_arr:
cdfs.append(self.Pw(w))
return cdfs
if __name__ == '__main__':
ac = AnalyticalCracks(l0=1., d=0.007, tau=0.1, sigma0=2200., s=2.0,
rho=5.0, c=1.0, x=np.linspace(0.0, 5.0, 500))
for s in [1., 3., 5.0]:
ac.s = s
pdf_x = ac.p_x(s, ac.x)
pdf_x = pdf_x / np.trapz(pdf_x, ac.x)
cdf_x = np.hstack((0., cumtrapz(pdf_x, ac.x)))
sf = MFnLineArray(xdata=cdf_x + 1e-12 * ac.x, ydata=ac.x)
rand_vals1 = sf.get_values(np.random.rand(10000))
rand_vals2 = sf.get_values(np.random.rand(10000))
cracks = ac.w_func(rand_vals1, rand_vals2)
plt.hist(cracks, bins=40, normed=True, label=str(s), cumulative=True)
w_arr = np.linspace(0.0,7.0,100)
cdf_w = ac.CDF_w(w_arr)
plt.plot(w_arr, cdf_w, color='black', lw=2)
plt.ylim(0,1.2)
plt.legend()
plt.show()