如何在Python中计算变形梯度。(在三维立方体上)

2024-06-25 23:50:31 发布

您现在位置:Python中文网/ 问答频道 /正文

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

enter image description here

非变形立方体:

non deformed cube

变形立方体:

deformed cube

立方体坐标为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。在

旁注/问题:

在这个网站上,他生成了定义点在(x,y,z)中移动的方程,然后与(x,y,z)微分得到F。有没有一个库可以用来得到这些方程?(还是坡度?)在


Tags: new定义矩阵greencoordsglobal人工gc
1条回答
网友
1楼 · 发布于 2024-06-25 23:50:31

变形梯度,F

变形梯度描述为:

Deformation Matrix

所以F的解是:

F=dX\dX

其中“\”是左矩阵除法,大致相当于inv(A)*B

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

绿色菌株

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

Green strain equations

在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.   ]])

相关问题 更多 >