Loading [MathJax]/jax/output/HTML-CSS/jax.js

P30

Constrained Dynamics

要解决的问题

A critical problem exists: what if constraints/forces are very very stiff? Or infinitely stiff?

✅ 此算法用于处理 very very stiff 的场景即约束必须严格满足,而前面算法需要做很多次迭代才能产生这种效果(计算量大)。
✅ 此算法常用于衣服、刚体、人体。比如人体的关节联结,是一种非常stiff的约束。

根据约束建立模型

Compliant constraint

ϕe(x)=||xeixej||Le

E(x)=e12k(||xeixej||Le)2=12ϕT(x)C1ϕ(x)

E(X)=e12k(ϕe(x))2

f(x)=E=(Eϕϕx)T=JTC1ϕ=JTλ

Let N be the number of vertices and E be the number of constraints,

约束ϕ(x)REϕe=[ϕ0ϕ1ϕE]
Compliant matrixC=[1/k1/k]RE×E✅ C称为软度矩阵、 stiffness:挺度,compliant:软度
JacobianJ=ϕxRE×3N
Dual variables (Lagrangian multipliers)λ=C1ϕREλ 是人为引入的变量,称为拉格朗日算子。

Ef 变成了关于两个变量(xλ)的函数。
✅把能量写成约束的形式
E(x)=12ϕT(x)C1λf(x)=JTλ 根据E(x)f(x)做隐式积分

转化为隐式积分问题

P31

By implicit integration, we get:

MvnewtJTλnew=Mv

✅ 动量守衡公式:MvMv=Ft=冲量
✅ 此处新 λnew来计算 F. 说明是 Implicit

Meanwhile, Cλnew=ϕnewϕJ(xnewx)ϕtJvnew

✅ 对ϕnew 的泰勒展开
J是上页中的Jacobian.

[MtJTtJC][vnewλnew][Mvϕ]

✅ 最后的矩阵公式由上面两个公式整理合并得到。
xnewx=△tv

解隐式积分

P32
Now we have a system with two sets of variables: the primal variable x (or v=x ̇) and the dual variable λ.

✅ 之前的隐式积分只有一个变量,此处的隐式积分有两个变量。需要同时解出两个变量。

  • Method 1: We can solve the two variables by a direct solver together, in a primal-dual fashion:

[MtJTtJC][vnewλnew]=[Mvϕ]

✅ 注意:Method 1 中的矩阵有可能不正定、因此很多数学方法用不了。

  • Method 2: We can reduce the system by Schur complement and solve λnew first.

✅ Method 2 的消元过程不容易构造、尤其是当矩阵比较复杂时。

(t2JM1JT+C)λnew=ϕtJv

vnewv+tM1JTλnew

✅ 用哪种方法取决于应用场景

优点

Infinite stiffness? C0.

✅ 此方法将软硬度量解耦出来,并用矩阵C来表示,使得可以方便控制软硬度,例如让c=0 来表示 infinite stiffness.

应用

Articulated Rigid Bodies (ragdoll animation)

P34

Stable Constrained Dynamics

✅ 没有展开讲,见after reading中的论文

From a mass-spring system, we know spring Hessian (tangent stiffness) is:

H(x)=e=(i,j)[HeHeHeHe]

According to constrained dynamics:f(x)=JTλ and λ=C1ϕ, so:

Je=ϕex=[xTij||xij||xTij||xij||]

P35

Stable Constrained Dynamics

According Lecture 5, Page 16, implicit integration is:

(1t2M+H(x[0]))x=1t2M(tv[0])+f(x[0])

(M+t2H(x[0]))vnew=Mv[0]+tf(x[0])

Missing geometric stiffness matrix here…

P36

After-Class Reading (optional)

Tournier et al. 2015. Stable Constrained Dynamics. TOG (SIGGRAPH).

✅ Method 2 Gauss 消元,如果把λ消掉,会得到一个基本上与隐式积分相似的公式,唯一的区别是H上略有不同 —— 隐式积分多了一项。如果把用这一项加回去,会使constrain dynamic 变得稳定。


本文出自CaterpillarStudyGroup,转载请注明出处。

https://caterpillarstudygroup.github.io/GAMES103_mdbook/