- The simulation started out as a purely accurate gravitational simulation,
- but, with constant simulation step size, I quickly realized the field being
- simulated while grossly gravitational was, in fact, non-conservative. It
- also had the rather annoying behavior of dealing very badly with colliding
- orbs. Therefore, I implemented a negative-gravity region (with two
- thresholds; as I read your code, you only implemented one) to prevent orbs
- from every coming too close together, and added a viscosity factor if the
- speed of any orb got too fast. This provides a nice stable system with
- interesting behavior.
-
- I had experimented with a number of fields including the van der Waals
- force (very interesting orbiting behavior) and 1/r^3 gravity (not as
- interesting as 1/r^2). An even normal viscosity (rather than the
- thresholded version to bleed excess energy) is also not interesting.
- The 1/r^2, -1/r^2, -10/r^2 thresholds proved not only robust but also
- interesting -- the orbs never collided and the threshold viscosity fixed
- the non-conservational problem.
- */
+ The simulation started out as a purely accurate gravitational
+ simulation, but, with constant simulation step size, I quickly
+ realized the field being simulated while grossly gravitational
+ was, in fact, non-conservative. It also had the rather annoying
+ behavior of dealing very badly with colliding orbs. Therefore,
+ I implemented a negative-gravity region (with two thresholds; as
+ I read your code, you only implemented one) to prevent orbs from
+ every coming too close together, and added a viscosity factor if
+ the speed of any orb got too fast. This provides a nice stable
+ system with interesting behavior.
+
+ I had experimented with a number of fields including the van der
+ Waals force (very interesting orbiting behavior) and 1/r^3
+ gravity (not as interesting as 1/r^2). An even normal viscosity
+ (rather than the thresholded version to bleed excess energy) is
+ also not interesting. The 1/r^2, -1/r^2, -10/r^2 thresholds
+ proved not only robust but also interesting -- the orbs never
+ collided and the threshold viscosity fixed the
+ non-conservational problem.
+
+ Philip sez:
+ > An even normal viscosity (rather than the thresholded version to
+ > bleed excess energy) is also not interesting.
+
+ unless you make about 200 points.... set the viscosity to about .8
+ and drag the mouse through it. it makes a nice wave which travels
+ through the field.
+
+ And (always the troublemaker) Joe Keane <jgk@jgk.org> sez:
+
+ Despite what John sez, the field being simulated is always
+ conservative. The real problem is that it uses a simple hack,
+ computing acceleration *based only on the starting position*,
+ instead of a real differential equation solver. Thus you'll
+ always have energy coming out of nowhere, although it's most
+ blatant when balls get close together. If it were done right,
+ you wouldn't need viscosity or artificial limits on how close
+ the balls can get.
+
+ Matt <straitm@carleton.edu> sez:
+
+ Added a switch to remove the walls.
+
+ Added a switch to make the threshold viscosity optional. If
+ nomaxspeed is specified, then balls going really fast do not
+ recieve special treatment.
+
+ I've made tail mode prettier by eliminating the first erase line
+ that drew from the upper left corner to the starting position of
+ each point.
+
+ Made the balls in modes other than "balls" bounce exactly at the
+ walls. (Because the graphics for different modes are drawn
+ differently with respect to the "actual" position of the point,
+ they used to be able to run somewhat past the walls, or bounce
+ before hitting them.)
+
+ Added an option to output each ball's speed in the form of a bar
+ graph drawn on the same window as the balls. If only x or y is
+ selected, they will be represented on the appropriate axis down
+ the center of the window. If both are selected, they will both
+ be displayed along the diagonal such that the x and y bars for
+ each point start at the same place. If speed is selected, the
+ speed will be displayed down the left side. */