本文整理汇总了Python中bspline.Bspline.d方法的典型用法代码示例。如果您正苦于以下问题:Python Bspline.d方法的具体用法?Python Bspline.d怎么用?Python Bspline.d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bspline.Bspline
的用法示例。
在下文中一共展示了Bspline.d方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from bspline import Bspline [as 别名]
# 或者: from bspline.Bspline import d [as 别名]
for i in range(N_intervalos_r+1):
aux_x = 0.5*(knots_r[i+grado+1]-knots_r[i+grado])*x + 0.5*(knots_r[i+grado+1]+knots_r[i+grado]);
aux_w = 0.5*(knots_r[i+grado+1]-knots_r[i+grado])*w;
r_nodos = np.hstack((r_nodos, aux_x));
wr_pesos = np.hstack((wr_pesos, aux_w));
w_pesos = wr_pesos
wr_pesos = np.tile(wr_pesos, (N_splines_r-1, 1));
r_nodos2 = np.tile(r_nodos, (N_splines_r-1, 1));
## B-splines en la coordenada r
basis = Bspline(knots_r, grado);
## Calculo la matriz con los bsplines y sus derivadas en r
bsr = [basis._Bspline__basis(i, basis.p) for i in r_nodos]; # evaluo los bsplines
dbsr = [basis.d(i) for i in r_nodos]; # evaluo las derivadas de los bsplines
bsr = np.array(bsr)
bsr = bsr[:,0:N_splines_r-1]
dbsr = np.array(dbsr)
dbsr = dbsr[:,0:N_splines_r-1]
## Matriz de solapamiento en r
Sr = np.dot(np.transpose(bsr), (np.transpose(r_nodos2)*np.transpose(wr_pesos)*bsr));
# Sr = np.array([[Sr[i][j] for i in range(N_splines_r-1)] for j in range(N_splines_r-1)]);
## Matriz de energia cinetica en r
Tr = 0.5/me*np.dot(np.transpose(dbsr), (np.transpose(r_nodos2)*np.transpose(wr_pesos)*dbsr));
#Tr = np.array([[Tr[i][j] for i in range(N_splines_r-1)] for j in range(N_splines_r-1)]);