Homework 1: mass spring

github(第一次用 :grinning:) GitHub - hakic/GAME201_HW1
把大部分 README.md复制过来

Implemented explicit and implicit euler of mass spring .

Explicit euler, implemented

  • Forward euler
  • RK2
  • RK3
  • RK4

Implicit euler, implemented

  • Backward euler with jacobi iteration (#iteration=20)

More details:

  • Code was based on mass_spring_explicit.py example.
  • Moved “Collide with ground” to after “Compute new position” because my explicit code updates x and v at the same time (I didn’t know whether this was acceptable or not)
  • Didn’t know how to compute gradient in implicit euler. Used auto-grad in taichi to compute the gradient.
  • Settings:
    • #particles = 10
    • damping = 20.0
    • dt = 1e-3

Comparsion
表格复制有格式问题,请前往github查看

Observation

  • When damping exists, energy stableness of implicit euler is better; otherwise, all methods are great.
  • When damping exists, all simulation looks similar; otherwise, all looks different (please check the following GIFs)
  • RK3 / RK4 / implicit euler provide good max spring stiffness.
  • Implicit euler provides much better max dt.
2 个赞