如何计算 Python 中的变形梯度。 (在 3D 立方体上)

How to calculate a deformation gradient in Python. (On a cube in 3D)

我正在尝试在我人工变形的立方体上计算 python 中的 Large(Langrangian/Green) Strains。我在计算变形矩阵时遇到问题,F:

未变形的立方体:

变形立方体:

立方坐标为x1和x2

x1 = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.0, 0.0, 1.0],[0.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
x2 = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.5, 0.0, 1.5],[0.0, 1.5, 1.5], [2.0, 2.0, 2.0]]
global_coords[0] = x1
global_coords[1] = x2

def positions_at_t(global_coords, t):
    gc = np.array(global_coords)
    new_coords = gc[0] + t*(gc[1] - gc[0])
    return list(new_coords)
正如我们在上面看到的,

gc[1]-g[2] 随着时间的推移作为一个梯度。但问题是它是在 8x3 矩阵中定义的,因为我们期望变形梯度为 3x3。

边 note/question:

在这个网站上,他生成了定义点在 (x,y,z) 中移动的方程式,然后相对于 (X,Y,Z) 微分得到 F。有没有我可以使用的库得到这些方程式? (或梯度?)

变形梯度,F

形变梯度描述为:

所以求解 F 将是:

F = dX\dx

其中'\'为左矩阵除法,大致相当于inv(A) * B.

这是一个有 9 个变量和 9 个方程的线性代数问题。

绿色应变,E

来自 http://www.continuummechanics.org/greenstrain.html

在 python 中使用 numpy 实现这个看起来像:

dx = x1
dX = x2
F = np.linalg.solve(dX[5:],dx[5:])
C = F.T @ F
E = .5*(C-np.identity(3))
E
(output:)array([[ 1.5  ,  0.125, -0.125],
       [ 0.125,  1.5  , -0.125],
       [-0.125, -0.125,  0.   ]])