Monday, November 30, 2009

convert protein data bank files into Ansys nodes, key points and lines

Here are two small python scripts I wrote that will read in a PDB file and output a text file to be used as input for Ansys finite element analysis. They're still kind of rough in that the input directory is hard coded, but they seem to work great at least for carbon nanotubes and other fullerenes.

convert PDB file to Ansys key points and lines

convert PDB file to Ansys nodes



To use these scripts:

1. create a protein data bank file of your structure
2. name it test.pdb and save it in a folder: C:\xyz
3. make sure you have python installed
4. and to make things easier for development and use, grab the free version of Wingware IDE 101
5. download the two scripts and open them in Wing
6. run the scripts


The output file will be in the xyz directory. To load them in Ansys: File > Read input from...

Sunday, August 23, 2009

carbon nanotube NEM animated in Blender

This is a version that won't be used, so I decided to post it here. I'll post a flow chart on how to visualize actual dynamics data in Blender when I get back. It has all the steps, but not all the steps are finished yet on my end. Maybe it will be a good stroy arc.

Saturday, August 22, 2009

molecular rotor animation rendered in Blender

I think blender can be a very useful tool for scientific visualizations, particularly with respect to visualizations of molecular dynamics simulations. There's a couple of missing steps as far as I can tell, but I'm working on them and will save that for the next post. However if you just want to make some eye candy, you can pretty much dive right in. This is a good example of something I've come to understand: modeling stuff is easy, the tricky part is making those models represent something relevant.

Sunday, August 16, 2009

free stickers!


I came up with this a while ago as a purposed emblem of a certain sub-culture that, if you're reading this, you may belong to. I don't want it to go to waste, and I'm not even a bumper sticker guy. Email me a mailing address, and when I get a good collection I will send them out. Or you could always make your own, but that's not really the same, is it?

Monday, June 22, 2009

molecular gear published in Nature Materials


Step-by-step rotation of a molecule-gear mounted on an atomic-scale axis
C. Manzano1*,W.-H. Soe1*, H. S.Wong, F. Ample, A. Gourdon, N. Chandrasekhar and C. Joachim1,2

compared to the small bearing (disassembled) of old:

Saturday, June 13, 2009

Monday, June 1, 2009

MATLAB function to calculate the energy of double wall carbon nanotubes

function [U dr dt]=DWNT(n1, m1, n2, m2)
% this function uses the chiral vectors of two carbon nanotubes as inputs
%(n1 m1)-inner & (n2 m2)-outer and returns the energy of the tube in kcal
%mol^-1 atom^-1 using an empirical equation found in
%"Double-Wall carbon nanotubes...",
%Bakalis & Zerbetto, Chemical Physics Letters 463 (2008) 139-140
%function written by Tom Moore

%define energy constants
a= 1665.51; %kcal A^6 mol^-1 atom^-1
b= -92.85; %kcal A^3 mol^-1 atom^-1
c= 2.50; %kcal A^1 mol^-1 atom^-1
d= 17.24 ; %kcal A^4 mol^-1 atom^-1
f= -58.56; %kcal A^5 mol^-1 atom^-1

%define graphene lattice constant in A
k= 2.49;

% calculate the chiral angles of both tubes in radians
t1_rad=acos((2*n1+m1)/(2*(n1^2+m1^2+n1*m1)^.5));
t2_rad=acos((2*n2+m2)/(2*(n2^2+m2^2+n2*m2)^.5));

dt=t1_rad-t2_rad %may need to do a <1 check here

% calculate the radius of both tubes
r1=(2.49*(n1^2+m1^2+n1*m1)^.5)/(2*pi);
r2=(2.49*(n2^2+m2^2+n2*m2)^.5)/(2*pi);
dr= r2-r1;

%find the energy of the tube
A= (a/dr^6)+(b/dr^3)+(c/dr);
B=sin(dt)*cos(dt);
C=(d/dr^4)+(f/dr^5);
U=A+B*C