HW1: Mass-spring cloth simulation

Explicit vs Implicit:


[view code on GitHub]

This is a mass-spring simulator, both implicit&explicit method available, rendered using my extension library Taichi THREE.

Fixed arguments:

  1. arch = x64
  2. damp = 1.6

Varying arguments:

method dt step stiff fps
explicit 5e-4 8000 15 + rough jumping
explicit 1e-3 8000 die in kernel
middle 5e-4 8000 1.2
middle 1e-3 8000 1.3
implicit 5e-4 8000 1.4 + smooth
implicit 1e-3 8000 1.5 + blow on touch
explicit 1e-2 100 die in kernel
explicit 5e-3 100 15 + relatively smooth
middle 1e-2 100 1.3 + blow on touch
middle 5e-3 100 1.3 + less rough lines
implicit 1e-2 100 blow on start up
implicit 5e-3 100 1.4 + rough lines

It seems that implicit doesn’t have many profit on dt but a huge degression on fps…
Not sure if it’s due to the poorness of using jacobi solver.
Or it’s this specific application scene - mass spring - caused the result?

4 Likes

Falling from another direction:

2 Likes

效果不错啊。
你给的Taichi THREE的链接好像是错的,应该是这个:https://github.com/taichi-dev/taichi_three

1 Like

效果很棒!stiffness可能得调大点,现在cloth看起来有点软 :slight_smile:

No, stiffness doesn’t work much for force in tangent direction when N is high, it only cause the solver to blow up. We need another parameter tangent_stiffness and tangent_damping to make cloth resist being curved.

After a talk with @yuanming-hu, we set the links to be 8-directional, and the result looks better now:

3 Likes

It seems that implicit doesn’t have many profit on dt but a huge degression on fps…

No. Implicit methods can keep stable when time step / stiffness is large, but explicit methods can’t.

Not sure if it’s due to the poorness of using jacobi solver.

Yes. Jacobi method converges if and only if the spectral radius is less than 1.
When dt=1e-2, the spectral radius is larger than 1, thus Jacobi method doesn’t converge. You can use conjugate gradient method instead.

Convergence of Jacobi Method

1 Like