$ cd ~/projects Integration Methods Compare numerical integration in a Unity spring system ──────────────────────────────────────────────────── A spring system implemented in Unity to compare the commonly used integration methods. tags: Unity Engine, Game Development, Research, Simulation, C# ──────────────────────────────────────────────────── ## Move a spring system and compare its response This Unity project grew out of the Game Physics lecture at the Technical University of Munich. Open the Demo scene and move the cube in the editor, or move the sphere with the arrow or WASD keys in the game view, to perturb the spring system. Change the integration method in the Simulator component to compare how the system evolves. The project exposes Euler, implicit Euler, Heun, leapfrog, and midpoint methods, with their implementations kept together in Assets/Scripts/Integration. Integration Methods on GitHub https://github.com/michidk/Spring-System-Integration-Method-Comparison ──────────────────────────────────────────────────── ## Run the simulation and inspect the comparison The README specifies Unity 2019.3. Open Assets/Scenes/Demo and enter Play mode to explore the mass points, elastic forces, and damping in the example. The Simulator component computes spring forces and advances registered mass points through the selected integrator. A separate CodePen linked by the README compares numerical approximations to an exponential function. It provides another way to study integration error, distinct from the methods available in the Unity selector. Unity setup and usage https://github.com/michidk/Spring-System-Integration-Method-Comparison/blob/master/README.md Exponential-function comparison on CodePen https://codepen.io/michidk/pen/VymawG ──────────────────────────────────────────────────── $ ls ~/pages > about curl -L lohr.dev > projects curl -L lohr.dev/projects > blog curl -L lohr.dev/blog > stats curl -L lohr.dev/stats > contact curl -L lohr.dev/contact ──────────────────────────────────────────────────── https://lohr.dev