visualizing a normal mode vibration of a molecule in mathematica
up vote
11
down vote
favorite
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
add a comment |
up vote
11
down vote
favorite
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
What software makes the.mode
file? Is there a standard file format for vibrational modes?
– Jason B.
Nov 30 at 21:26
add a comment |
up vote
11
down vote
favorite
up vote
11
down vote
favorite
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
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
graphics3d
asked Nov 30 at 19:42
sravankumar perumalla
924
924
What software makes the.mode
file? Is there a standard file format for vibrational modes?
– Jason B.
Nov 30 at 21:26
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
up vote
22
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]
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:
- Connectivity in a molecule and permutations
- How can I access the internal function that plots a molecule from a formatted XYZ file?
- Visualizing .xyz file in Mathematica
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 anImageSize
option to the plotting function.
– Jason B.
Dec 1 at 14:36
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
22
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]
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:
- Connectivity in a molecule and permutations
- How can I access the internal function that plots a molecule from a formatted XYZ file?
- Visualizing .xyz file in Mathematica
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 anImageSize
option to the plotting function.
– Jason B.
Dec 1 at 14:36
add a comment |
up vote
22
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]
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:
- Connectivity in a molecule and permutations
- How can I access the internal function that plots a molecule from a formatted XYZ file?
- Visualizing .xyz file in Mathematica
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 anImageSize
option to the plotting function.
– Jason B.
Dec 1 at 14:36
add a comment |
up vote
22
down vote
accepted
up vote
22
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]
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:
- Connectivity in a molecule and permutations
- How can I access the internal function that plots a molecule from a formatted XYZ file?
- Visualizing .xyz file in Mathematica
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]
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:
- Connectivity in a molecule and permutations
- How can I access the internal function that plots a molecule from a formatted XYZ file?
- Visualizing .xyz file in Mathematica
edited Nov 30 at 21:59
answered Nov 30 at 20:05
Jason B.
47.6k387185
47.6k387185
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 anImageSize
option to the plotting function.
– Jason B.
Dec 1 at 14:36
add a comment |
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 anImageSize
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
What software makes the
.mode
file? Is there a standard file format for vibrational modes?– Jason B.
Nov 30 at 21:26