Comments (2)
hi peter,
i'd definitely be interested in seeing your verlet patch. the thing
that stopped me when i toyed with the idea a year ago was figuring out
how to repurpose the euler state variables (since each particle under
verlet just has a velocity and no acceleration, right?). was it tough
to bolt another integrator on top of the existing one?
One compensation for this is heavy amounts of friction
something that's been in the back of my mind for a while now is that a
lot of the jumpiness in arbor's current behavior is probably due to
its dead-simple hooke's law implementation. if the springs had a
damping term i'm sure everything would be much less prone to
exploding:
http://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator
don't suppose you'd be interested in tackling that would you?
in any case, looking forward to seeing your code,
christian
from arbor.
Hi Christian,
Thanks for the quick reply back. In terms of the euler state variables, velocity verlet integration only requires one extra variable - the acceleration at the previous time step. The rest is just making sure you update your position, velocity, and acceleration in the right order.
Verlet integration is really important for gravity simulators, for there is no friction in outer space so the energy of your system can blow up quite rapidly. I wrote an n-body simulator last semester for a course project. The overall loop (with comments) for Verlet integration can be seen here:
https://github.com/pcottle/gsim/blob/master/glut_example.cpp#L1666
I've only toyed around the idea right now; since there's interest, I'll crank out a patch this weekend to see the performance differences.
Springs with dampening is a good idea, but that's essentially just another way to strip energy out of the system. That might be a bit harder to implement as well, because you would need to know the velocity for each spring in the system relative to the nodes it is connected to. This might reduce the simplicity of the code.
Finally, a video of the project is here if you're interested. Several thousand timesteps later, the particles have the same orbits as they do initially:
http://www.youtube.com/watch?v=r_68uPETMJk
Regardless, I'll hopefully have a patch this weekend to show.
Thanks again,
Peter
from arbor.
Related Issues (20)
- Problems with the JS structure HOT 1
- i had a question
- not working in IE10 HOT 4
- Tweening of Edges
- Tweaking the stiffness of individual edges in a Graph.
- [Feature] Support Retina Resolution HOT 3
- Arbor fires twice on stock android browser 4.2.2
- node.fixed doesn't work
- arbor_path fails when script element has no path
- Allow for setting random seed
- TypeError: Cannot use 'in' operator to search for
- Is this project dead? HOT 3
- [enhancement] Add missing bower.json.
- hi HOT 1
- Error physics: ErrorEvent
- Excuse me !!!!
- Can I improve the README? HOT 1
- <deleted issue>
- "that" is undefined here
- Uncaught DOMException: Failed to construct 'Worker': HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arbor.