小编Ale*_*tto的帖子

多维数组上的Numpy,dot产品

我对numpy.dot产品有些怀疑.

我定义了一个矩阵6x6,如:

C=np.zeros((6,6))
C[0,0], C[1,1], C[2,2] = 129.5, 129.5, 129.5
C[3,3], C[4,4], C[5,5] = 25, 25, 25
C[0,1], C[0,2] = 82, 82
C[1,0], C[1,2] = 82, 82
C[2,0], C[2,1] = 82, 82
Run Code Online (Sandbox Code Playgroud)

然后我通过使用多维数组以4级张量重新制作它

def long2short(m, n):
    """
    Given two indices m and n of the stiffness tensor the function
    return i the index of the Voigt matrix
    i = long2short(m,n)
    """
    if m == n:
        i = m
    elif (m == 1 and n == 2) or (m == 2 …
Run Code Online (Sandbox Code Playgroud)

python arrays numpy matrix

5
推荐指数
1
解决办法
9019
查看次数

标签 统计

arrays ×1

matrix ×1

numpy ×1

python ×1