Re: Molecular simulations in Breve

[email protected] Wed, 24 Nov 2004 04:48:50 -0500 (EST)
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
On Mon, 22 Nov 2004, Cindy Chan wrote:

> We just recently began using the Breve program here at our research lab. We 
> are trying to write a simulation based on protein interactions. Basically, 
> what we are trying to do is simulate the formation of  a lipid bilayer 
> protein on a 2-dimensional surface. Currently we are having problems with 
> the collisions of the spheres (molecules), we want them to be able to bounce 
> off each other rather than merge. We were looking at modifying the default 
> included demos to suit our needs, however it is proving unsuccessful.  Do 
> you have anymore literature or documentation regarding the simulations? Or 
> how about a tutorial on how to create a molecule based simulation.

There are two ways you could have spheres bounce off each other: using physical 
simulation, or using your own collision handler to detect collisions and 
changing velocities manually when two particles collide.  I would highly 
recommend the collision handler approach, since physical simulation can be 
rather costly.  To setup a collision handler, you should add a line like this 
in your object's init method:

	self handle-collisions with-type "Particle" with-method "collide".

And then later on, you'll need to implement the "collide" method, something 
like this:

+ to collide with otherParticle (object):
	newVelocity (vector).

		... code to compute a newVelocity vector ...

	self set-velocity to newVelocity.


You'd of course use the relative positions and velocities of the colliding 
objects to compute the newVelocity vector.

Hope this helps!

- jon klein

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve