## jmol-users

 [Jmol-users] a treat for you -- Jmol in motion From: Bob Hanson - 2007-02-28 08:57:57 ```Hot off the press -- Q: What do you get when you combine the following? wide-ranging variable capability, including arrayed variables program flow control with if/else/endif and message/loop relative motion Take a look at http://www.stolaf.edu/people/hansonr/molecules.htm in particular the link "Water Liquid" followed by "Jmol 11.2 motion ON" This is not a movie. This is not a set of frames. It's just a file full of water molecules. Then look at the script that drives the animation: http://www.stolaf.edu/people/hansonr/water.spt This script runs through the molecules, setting them moving in independent directions. It tracks what direction they are going and how many atoms are within 1.6 angstroms of a given molecule. When nearby atoms are found, the program reverses a molecule's direction, but if a molecule wander too far afield, we can spot that and turn it around again. The code that controls this neighbor-sensing and reversal is just a few lines long: tooclose = not {mol_set} and within(1.6, {mol_set}) if (tooclose > 0) set @vm = mxyz - {tooclose_set}.xyz else if (centerpt.distance(mxyz) > maxradius) set @vm = {0 0 0} - @vm endif endif motion = @vm / @vm * rate select {mol_set} translateSelected @motion Pretty straightforward! The setup is interesting as well: centerpt = {*}.xyz nMolecules = {*}[{*}].molecule message _start # this is the loop start m = m + 1 if (m > nMolecules) m = 1 endif mol = {molecule=m} mxyz = {mol_set}.xyz vm = "v"+m # this is the "array" - v1, v2, v3, etc. set @vm mxyz # this sets the appropriate variable, v1, v2, etc. Fun, eh? -Bob ```
 Re: [Jmol-users] a treat for you -- Jmol in motion From: C Anthony Lewis - 2007-02-28 16:17:19 ```Bob, Funky! I found that with both hydrogen bonds and movement on the H-bonds just got longer and longer but if the H-bonds were turned off and then on again another set formed. I'm wondering if its possible to update the H-bonds as the individual molecules move, i.e. breaking and forming them on the fly? Just a thought, Anthony Lewis -----Original Message----- From: jmol-users-bounces@... [mailto:jmol-users-bounces@...] On Behalf Of Bob Hanson Sent: 28 February 2007 08:58 To: jmol-users@... Subject: [Jmol-users] a treat for you -- Jmol in motion Hot off the press -- Q: What do you get when you combine the following? wide-ranging variable capability, including arrayed variables program flow control with if/else/endif and message/loop relative motion Take a look at http://www.stolaf.edu/people/hansonr/molecules.htm in particular the link "Water Liquid" followed by "Jmol 11.2 motion ON" This is not a movie. This is not a set of frames. It's just a file full=20 of water molecules. Then look at the script that drives the animation: http://www.stolaf.edu/people/hansonr/water.spt This script runs through the molecules, setting them moving in=20 independent directions. It tracks what direction they are going and how=20 many atoms are within 1.6 angstroms of a given molecule. When nearby=20 atoms are found, the program reverses a molecule's direction, but if a=20 molecule wander too far afield, we can spot that and turn it around=20 again. The code that controls this neighbor-sensing and reversal is just a few lines long: tooclose =3D not {mol_set} and within(1.6, {mol_set}) if (tooclose > 0) set @vm =3D mxyz - {tooclose_set}.xyz else if (centerpt.distance(mxyz) > maxradius) set @vm =3D {0 0 0} - @vm endif endif motion =3D @vm / @vm * rate select {mol_set} translateSelected @motion Pretty straightforward! The setup is interesting as well: centerpt =3D {*}.xyz nMolecules =3D {*}[{*}].molecule message _start # this is the loop start m =3D m + 1 if (m > nMolecules) m =3D 1 endif mol =3D {molecule=3Dm} mxyz =3D {mol_set}.xyz vm =3D "v"+m # this is the "array" - v1, v2, v3, etc. set @vm mxyz # this sets the appropriate variable, v1, v2, etc. Fun, eh? -Bob ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDE V _______________________________________________ Jmol-users mailing list Jmol-users@... https://lists.sourceforge.net/lists/listinfo/jmol-users ```
 Re: [Jmol-users] a treat for you -- Jmol in motion From: Richard Steane - 2007-02-28 20:02:13 ```Couldn't help noticing a matrimonial theme on following the DNA link! Is this intentional? Keep up the good work! Best wishes Richard Steane Near Guildford, Surrey, UK Website http://www.BioTopics.co.uk dedicated to teaching and learning Biology ----- Original Message ----- From: "Bob Hanson" To: Sent: Wednesday, February 28, 2007 8:57 AM Subject: [Jmol-users] a treat for you -- Jmol in motion > Hot off the press -- > > Q: What do you get when you combine the following? > > wide-ranging variable capability, including arrayed variables > program flow control with if/else/endif and message/loop > relative motion > > > Take a look at http://www.stolaf.edu/people/hansonr/molecules.htm > in particular the link "Water Liquid" followed by "Jmol 11.2 motion ON" > > This is not a movie. This is not a set of frames. It's just a file full > of water molecules. > > Then look at the script that drives the animation: > > http://www.stolaf.edu/people/hansonr/water.spt > > This script runs through the molecules, setting them moving in > independent directions. It tracks what direction they are going and how > many atoms are within 1.6 angstroms of a given molecule. When nearby > atoms are found, the program reverses a molecule's direction, but if a > molecule wander too far afield, we can spot that and turn it around > again. The code that controls this neighbor-sensing and reversal is just > a few lines long: > > tooclose = not {mol_set} and within(1.6, {mol_set}) > if (tooclose > 0) > set @vm = mxyz - {tooclose_set}.xyz > else > if (centerpt.distance(mxyz) > maxradius) > set @vm = {0 0 0} - @vm > endif > endif > > motion = @vm / @vm * rate > select {mol_set} > translateSelected @motion > > > Pretty straightforward! > > The setup is interesting as well: > > centerpt = {*}.xyz > nMolecules = {*}[{*}].molecule > > message _start # this is the loop start > > m = m + 1 > if (m > nMolecules) > m = 1 > endif > > mol = {molecule=m} > mxyz = {mol_set}.xyz > vm = "v"+m # this is the "array" - v1, v2, v3, etc. > set @vm mxyz # this sets the appropriate variable, v1, v2, etc. > > > > > > Fun, eh? > > -Bob > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jmol-users mailing list > Jmol-users@... > https://lists.sourceforge.net/lists/listinfo/jmol-users > ```