| 1 | === Creating Arbitrary Alkanes === |
| 2 | |
| 3 | This can also be used (in a somewhat unusual way) to generate alkanes of arbitrary length from a given one. Assume, we have a propane as given. We cut off the terminal hydrogens at either end and place them in files ''buildingblock_upper.xyz'' |
| 4 | {{{ |
| 5 | ./molecuilder -i buildingblock_upper.xyz --select-all-atoms -t "-8.3885,-1.5127,-0.89" |
| 6 | }}} |
| 7 | where we translate the position such that its carbon bond partner would be at "0,5,5". |
| 8 | |
| 9 | In the same way we proceed with the hydrogen at the other end stored in ''buildingblock_lower.xyz''. |
| 10 | {{{ |
| 11 | ./molecuilder -i buildingblock_lower.xyz --select-all-atoms -t "-12.1362,-0.6293,-0.89" |
| 12 | }}} |
| 13 | where we again translate the position such that its carbon bond partner would be at "0,5,5". |
| 14 | |
| 15 | Furthermore, we cut out the first pair of carbon atoms along with the four hydrogens (not the terminal one) and store it in ''buildingblock_center.xyz''. Then we may proceed as follows to produce a decane. |
| 16 | {{{ |
| 17 | ./molecuilder -i decane.xyz --change-box "2.4985,0,10,0,0,10" -l buildingblock_center.xyz --repeat-box "5,1,1" |
| 18 | }}} |
| 19 | where we obtained the box length from the distance of one carbon atom to its next-nearest neighbor. |
| 20 | |
| 21 | That is: |
| 22 | * first, we use ''-i'' to store everything in a new file ''decane.xyz''. |
| 23 | * Next, we set the box dimensions (''--change-box'') to fit with the periodicity of the alkanes, here in the x direction. |
| 24 | * Then, we load (''-l'') the atoms into this domain. |
| 25 | * Finally, we call ''--repeat-box'' the create five copies from the given segment containing two carbons. |
| 26 | |
| 27 | At last, we need to re-attach the terminal hydrogen atoms. First the lower part, which is easier |
| 28 | {{{ |
| 29 | ./molecuilder -i decane.xyz -l buildingblock_lower.xyz |
| 30 | }}} |
| 31 | Then the upper part which has to be translated to its destination |
| 32 | {{{ |
| 33 | ./molecuilder -i decane.xyz -l buildingblock_upper.xyz --select-molecule-by-order -1 --select-molecules-atoms -t "11.24325,0,0" |
| 34 | }}} |
| 35 | where the translation factor is 4.5 times the above periodicity in the x direction. |
| 36 | |
| 37 | And finally, we have a complete decane molecule. |
| 38 | |
| 39 | Now, one may ask: Why not do this in a text editor? Of course, the duplication along with the translation of the periodic section is nice. Moreover this approach can easily be placed in a script and arbitrary alkanes can be produced. |