Skip to content

Turtlely/solver-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solver-demo

Demonstration of various differential-equation solving algorithms.

The model being studied is the undamped spring-mass oscillator.

Algorithms

Currently, four algorithms are implemented.

  1. Naive Euler, also known as Euler's method
  2. Symplectic Euler
  3. Verlet Integration
  4. Velocity Verlet Integration

Energy Drift Analysis

Energy drift of the system after 100 seconds with a step size of 0.01

  • Naive Euler: 172% error
  • Symplectic Euler: 0.44% error
  • Verlet Integration: -25% error
  • Velocity Verlet Integration: -0.00064% error

Velocity Verlet integration is the best algorithm in this case, with minimal error several orders of magnitude better than others.

Verlet algorithms also prevent energy growth over time, as they always have a negative error.

However, this means that systems using Verlet integration algorithms will suffer from energy damping over time.

Time evolution of the system when solved with each algorithm

Runtime of 100 seconds and step size of 0.01 seconds image

Runtime of 7 seconds and step size of 0.1 seconds (to emphasize differences in algorithm performance) image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages