diff --git a/README.md b/README.md index 0cefcb6..85fd7cb 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Implicit Cloth Simulation with Gradient Descent -A gentle introduction to optimization-based implicit time integration for [CSCI 5611](https://umtc.catalog.prod.coursedog.com/courses/8103481). +An introduction to optimization-based implicit time integration for [CSCI 5611](https://umtc.catalog.prod.coursedog.com/courses/8103481). -_This is a work in progress. I released this around 2021 and it hasn't seen many updates. Please let me know if you have suggestions: mattoverby@gmail.com_ +_This is a work in progress and was released around 2021. Please let me know if you have suggestions!_ ## Introduction @@ -20,7 +20,7 @@ Nonetheless, implicit time integration remains a valuable and sometimes necessar Recently, optimization-based methods have grown in popularity. This approach formulates the Eqs. of motion as an [iteratively minimized objective function](https://en.wikipedia.org/wiki/Optimization_problem). These methods provide unparalleled robustness and extensibility, e.g., [state of the art solvers](https://doi.org/10.1145/3450626.3459767) for cloth simulation. -The implementation is often easier to construct piece-by-piece than B&W-style integrators. +The implementation is often easier to construct piece-by-piece than B&W-style integrators. In this tutorial, you'll see why. Below we describe a simple implicit solver for mass-spring systems using gradient descent. This is meant solely as a tutorial to optimization-based time stepping, and not for practical applications. @@ -57,6 +57,8 @@ To compile, execute the following commands: 3. cmake .. 4. make -j +Then press "A" to start the simulation. + ### Energies Whenever I write a new simulator, I start with the most basic elastic energy as the deformable primitives: a Hookean spring with stiffness $k$ and rest length $`\ell`$. The potential energy of a spring is $`(k/2)(\|x_a-x_b\|-\ell)^2`$. diff --git a/src/Solver.hpp b/src/Solver.hpp index a959512..9ad4310 100644 --- a/src/Solver.hpp +++ b/src/Solver.hpp @@ -116,6 +116,8 @@ class Solver x = xk - alpha * grad; } } + + v = (x - x_start) * (1.0 / dt); } };