visualizing a normal mode vibration of a molecule in mathematica











up vote
9
down vote

favorite
4












How can I visualize the normal mode vibrations of a molecule in Mathematica?
Something like the gif shown in the following link.benzene b_2u vibrational mode.
I have the XYZ fileben-xyz-file of the benzene molecule and the normal mode coordinates normal-mode.










share|improve this question






















  • What software makes the .mode file? Is there a standard file format for vibrational modes?
    – Jason B.
    Nov 30 at 21:26















up vote
9
down vote

favorite
4












How can I visualize the normal mode vibrations of a molecule in Mathematica?
Something like the gif shown in the following link.benzene b_2u vibrational mode.
I have the XYZ fileben-xyz-file of the benzene molecule and the normal mode coordinates normal-mode.










share|improve this question






















  • What software makes the .mode file? Is there a standard file format for vibrational modes?
    – Jason B.
    Nov 30 at 21:26













up vote
9
down vote

favorite
4









up vote
9
down vote

favorite
4






4





How can I visualize the normal mode vibrations of a molecule in Mathematica?
Something like the gif shown in the following link.benzene b_2u vibrational mode.
I have the XYZ fileben-xyz-file of the benzene molecule and the normal mode coordinates normal-mode.










share|improve this question













How can I visualize the normal mode vibrations of a molecule in Mathematica?
Something like the gif shown in the following link.benzene b_2u vibrational mode.
I have the XYZ fileben-xyz-file of the benzene molecule and the normal mode coordinates normal-mode.







graphics3d






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 30 at 19:42









sravankumar perumalla

823




823












  • What software makes the .mode file? Is there a standard file format for vibrational modes?
    – Jason B.
    Nov 30 at 21:26


















  • What software makes the .mode file? Is there a standard file format for vibrational modes?
    – Jason B.
    Nov 30 at 21:26
















What software makes the .mode file? Is there a standard file format for vibrational modes?
– Jason B.
Nov 30 at 21:26




What software makes the .mode file? Is there a standard file format for vibrational modes?
– Jason B.
Nov 30 at 21:26










1 Answer
1






active

oldest

votes

















up vote
20
down vote



accepted










Using a few undocumented functions that have been discussed here on the stack exchange before,



{atoms, coords} = Import[
"https://www.dropbox.com/s/q3rwpedngv5wbqi/ben.xyz?dl=1",
{"XYZ", {"VertexTypes", "VertexCoordinates"}}
];
mode = Most @ Import[
"https://www.dropbox.com/s/3pjxams7ndr0l7h/19.mode?dl=1", "Table"
];
mode = 100 * mode;
bonds = Graphics`MoleculePlotDump`InferBonds[atoms, coords, 40, 25];
range = Range[-0.5, 0.5, 0.025];
range = Join[range, Reverse @ range];
plot[v_] := ImportExport`MoleculePlot3D[
{
"VertexCoordinates" -> (coords + v * mode),
"VertexTypes" -> atoms, "EdgeRules" -> bonds
}
];
ListAnimate @ Map[plot, range]


enter image description here



When importing the mode file, it returns an empty list as the last element so I need to use Most to make it a matrix. Then I multiplied it by 100 to convert to picometers. Finally I had to precompute the bonds, because as the molecule moves along the normal coordinate, the atoms could get far enough apart that the bonds wouldn't be detected by MoleculePlot3D.



Sources:




  1. Connectivity in a molecule and permutations

  2. How can I access the internal function that plots a molecule from a formatted XYZ file?

  3. Visualizing .xyz file in Mathematica






share|improve this answer























  • Is there any way to make the List Animate window larger so the image is larger in the simulation?
    – Moo
    Dec 1 at 13:24






  • 1




    You should be able to give an ImageSize option to the plotting function.
    – Jason B.
    Dec 1 at 14:36











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f187054%2fvisualizing-a-normal-mode-vibration-of-a-molecule-in-mathematica%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
20
down vote



accepted










Using a few undocumented functions that have been discussed here on the stack exchange before,



{atoms, coords} = Import[
"https://www.dropbox.com/s/q3rwpedngv5wbqi/ben.xyz?dl=1",
{"XYZ", {"VertexTypes", "VertexCoordinates"}}
];
mode = Most @ Import[
"https://www.dropbox.com/s/3pjxams7ndr0l7h/19.mode?dl=1", "Table"
];
mode = 100 * mode;
bonds = Graphics`MoleculePlotDump`InferBonds[atoms, coords, 40, 25];
range = Range[-0.5, 0.5, 0.025];
range = Join[range, Reverse @ range];
plot[v_] := ImportExport`MoleculePlot3D[
{
"VertexCoordinates" -> (coords + v * mode),
"VertexTypes" -> atoms, "EdgeRules" -> bonds
}
];
ListAnimate @ Map[plot, range]


enter image description here



When importing the mode file, it returns an empty list as the last element so I need to use Most to make it a matrix. Then I multiplied it by 100 to convert to picometers. Finally I had to precompute the bonds, because as the molecule moves along the normal coordinate, the atoms could get far enough apart that the bonds wouldn't be detected by MoleculePlot3D.



Sources:




  1. Connectivity in a molecule and permutations

  2. How can I access the internal function that plots a molecule from a formatted XYZ file?

  3. Visualizing .xyz file in Mathematica






share|improve this answer























  • Is there any way to make the List Animate window larger so the image is larger in the simulation?
    – Moo
    Dec 1 at 13:24






  • 1




    You should be able to give an ImageSize option to the plotting function.
    – Jason B.
    Dec 1 at 14:36















up vote
20
down vote



accepted










Using a few undocumented functions that have been discussed here on the stack exchange before,



{atoms, coords} = Import[
"https://www.dropbox.com/s/q3rwpedngv5wbqi/ben.xyz?dl=1",
{"XYZ", {"VertexTypes", "VertexCoordinates"}}
];
mode = Most @ Import[
"https://www.dropbox.com/s/3pjxams7ndr0l7h/19.mode?dl=1", "Table"
];
mode = 100 * mode;
bonds = Graphics`MoleculePlotDump`InferBonds[atoms, coords, 40, 25];
range = Range[-0.5, 0.5, 0.025];
range = Join[range, Reverse @ range];
plot[v_] := ImportExport`MoleculePlot3D[
{
"VertexCoordinates" -> (coords + v * mode),
"VertexTypes" -> atoms, "EdgeRules" -> bonds
}
];
ListAnimate @ Map[plot, range]


enter image description here



When importing the mode file, it returns an empty list as the last element so I need to use Most to make it a matrix. Then I multiplied it by 100 to convert to picometers. Finally I had to precompute the bonds, because as the molecule moves along the normal coordinate, the atoms could get far enough apart that the bonds wouldn't be detected by MoleculePlot3D.



Sources:




  1. Connectivity in a molecule and permutations

  2. How can I access the internal function that plots a molecule from a formatted XYZ file?

  3. Visualizing .xyz file in Mathematica






share|improve this answer























  • Is there any way to make the List Animate window larger so the image is larger in the simulation?
    – Moo
    Dec 1 at 13:24






  • 1




    You should be able to give an ImageSize option to the plotting function.
    – Jason B.
    Dec 1 at 14:36













up vote
20
down vote



accepted







up vote
20
down vote



accepted






Using a few undocumented functions that have been discussed here on the stack exchange before,



{atoms, coords} = Import[
"https://www.dropbox.com/s/q3rwpedngv5wbqi/ben.xyz?dl=1",
{"XYZ", {"VertexTypes", "VertexCoordinates"}}
];
mode = Most @ Import[
"https://www.dropbox.com/s/3pjxams7ndr0l7h/19.mode?dl=1", "Table"
];
mode = 100 * mode;
bonds = Graphics`MoleculePlotDump`InferBonds[atoms, coords, 40, 25];
range = Range[-0.5, 0.5, 0.025];
range = Join[range, Reverse @ range];
plot[v_] := ImportExport`MoleculePlot3D[
{
"VertexCoordinates" -> (coords + v * mode),
"VertexTypes" -> atoms, "EdgeRules" -> bonds
}
];
ListAnimate @ Map[plot, range]


enter image description here



When importing the mode file, it returns an empty list as the last element so I need to use Most to make it a matrix. Then I multiplied it by 100 to convert to picometers. Finally I had to precompute the bonds, because as the molecule moves along the normal coordinate, the atoms could get far enough apart that the bonds wouldn't be detected by MoleculePlot3D.



Sources:




  1. Connectivity in a molecule and permutations

  2. How can I access the internal function that plots a molecule from a formatted XYZ file?

  3. Visualizing .xyz file in Mathematica






share|improve this answer














Using a few undocumented functions that have been discussed here on the stack exchange before,



{atoms, coords} = Import[
"https://www.dropbox.com/s/q3rwpedngv5wbqi/ben.xyz?dl=1",
{"XYZ", {"VertexTypes", "VertexCoordinates"}}
];
mode = Most @ Import[
"https://www.dropbox.com/s/3pjxams7ndr0l7h/19.mode?dl=1", "Table"
];
mode = 100 * mode;
bonds = Graphics`MoleculePlotDump`InferBonds[atoms, coords, 40, 25];
range = Range[-0.5, 0.5, 0.025];
range = Join[range, Reverse @ range];
plot[v_] := ImportExport`MoleculePlot3D[
{
"VertexCoordinates" -> (coords + v * mode),
"VertexTypes" -> atoms, "EdgeRules" -> bonds
}
];
ListAnimate @ Map[plot, range]


enter image description here



When importing the mode file, it returns an empty list as the last element so I need to use Most to make it a matrix. Then I multiplied it by 100 to convert to picometers. Finally I had to precompute the bonds, because as the molecule moves along the normal coordinate, the atoms could get far enough apart that the bonds wouldn't be detected by MoleculePlot3D.



Sources:




  1. Connectivity in a molecule and permutations

  2. How can I access the internal function that plots a molecule from a formatted XYZ file?

  3. Visualizing .xyz file in Mathematica







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 30 at 21:59

























answered Nov 30 at 20:05









Jason B.

47.4k387185




47.4k387185












  • Is there any way to make the List Animate window larger so the image is larger in the simulation?
    – Moo
    Dec 1 at 13:24






  • 1




    You should be able to give an ImageSize option to the plotting function.
    – Jason B.
    Dec 1 at 14:36


















  • Is there any way to make the List Animate window larger so the image is larger in the simulation?
    – Moo
    Dec 1 at 13:24






  • 1




    You should be able to give an ImageSize option to the plotting function.
    – Jason B.
    Dec 1 at 14:36
















Is there any way to make the List Animate window larger so the image is larger in the simulation?
– Moo
Dec 1 at 13:24




Is there any way to make the List Animate window larger so the image is larger in the simulation?
– Moo
Dec 1 at 13:24




1




1




You should be able to give an ImageSize option to the plotting function.
– Jason B.
Dec 1 at 14:36




You should be able to give an ImageSize option to the plotting function.
– Jason B.
Dec 1 at 14:36


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f187054%2fvisualizing-a-normal-mode-vibration-of-a-molecule-in-mathematica%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AnyDesk - Fatal Program Failure

How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

QoS: MAC-Priority for clients behind a repeater