| ²é¿´: 1886 | »Ø¸´: 12 | ||||
| ¡¾½±Àø¡¿ ±¾Ìû±»ÆÀ¼Û9´Î£¬×÷ÕßzzgybÔö¼Ó½ð±Ò 8.5 ¸ö | ||||
| µ±Ç°Ö÷ÌâÒѾ´æµµ¡£ | ||||
zzgybÈÙÓþ°æÖ÷ (ÎÄ̳¾«Ó¢)
|
[×ÊÔ´]
²úÉú̼ÄÉÃ×¹Ü×ø±êµÄMatlab³ÌÐò
|
|||
|
ëÖ÷ϯ˵ÁË£¬»ØÌû¸øÆÀ¼ÛµÄͬ־ÊǺÃͬ־£¡ ÒÔÏÂÊÇÒ»¸ö²úÉúÈÎÒâ(m,n)̼¹Ü×ø±êµÄÒ»¸öMatlab³ÌÐò¡£Ö»Ðè°ÑÏÂÃæµÄ³ÌÐòcopy£¬´æ³ÉcreatCNT.m£¬¼´¿ÉÓÃMatlabÖ±½ÓÔËÐС£±ÈÈçÔÚMatlabÌáʾ·ûÏÂÊäÈë >>creatCNT(8,0) Ôò²úÉú(8,0)̼ÄÉÃ׹ܵÄ×ø±ê£¬Êä³öÎļþΪnanotube.xyzºÍnanotube.pdb¸ñʽ¡£¿ÉÒÔÓÃGaussViewµÈÆäËûµÄ¿ÉÊÓ»¯Èí¼þ´ò¿ª¡£ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [X TransVec NumAtom Diameter ChiralAngle]=createCNT(n,m) %This function creates the coordinates of a (n,m) nanotube, with n>m %Usage: % [X TransVec NumAtom Diameter ChiralAngle]=createCNT(8,0); % X -- coordinates of atoms in the nanotube unit cell % TransVec -- Translational Vector T of the nanotube % NumAtom -- Number of atoms in one unit cell of nanotube % Diamter -- diameter of the nanotube % ChiralAngle -- chiral angle of the nanotube % by bshan 2005 %change order if n n=m; m=temp; end nk=6000; acc=1.44; %acc is the C-C bond length % a: the lengh of the unit vector % pi =3.1415926 % sq3=1.732 sq3=sqrt(3.0d0); a=sq3*acc; l2 = n*n+m*m+n*m; l = sqrt(l2); dt = a*l/pi; nd = gcd(n,m); %nd is the greatest common dividor of n,m if(mod((n-m),3*nd)==0) ndr = 3*nd; else ndr = nd; end nr = (2*m+n)/ndr; %first component of T ns = -(2*n+m)/ndr; %second component of T nt2 = 3*l2/ndr/ndr; nt = floor(sqrt(nt2)); nn = 2*l2/ndr; %nn is number of haxagonals per unit cell %start searching the symmetry vector.The search range is set from %-abs(n60) to abs(n60) ichk=0; if(nr==0) n60=1; else n60=nr*4; end for i=-abs(n60):abs(n60) for j=-abs(n60):abs(n60) j2 = nr*j-ns*i; if(j2==1) j1= m*i-n*j; if((j1>0)&&(j1 nnp(ichk)=i; nnq(ichk)=j; end end end end %symmetry vector is not found. Probably the search range is not large %enough. if(ichk==0) error('not found p,q strange!!') end %more than one symmetry vector found. if(ichk>=2) error('more than 1 pair p,q strange!!') end %symmetry vector (np,nq) np = nnp(1); nq = nnq(1); %msg=sprintf('the symmetry vector is %d %d',np,nq); %disp(msg); % % r:|R| , c:|C_h|, t:|T| % lp = np*np + nq*nq + np*nq; r=a*sqrt(lp); c=a*l; t=sq3*c/ndr; % nn: the number of hexagon in the unit cell N % rs: radius of the tube if((2*nn)>nk) error('parameter nk is too small!') end rs=c/(2.0d0*pi); %msg=sprintf('radius=%f ,t=%f',rs,t); %disp(msg); % q1: the chiral angle for C_h % q2: the chiral angle for R % q3: the chiral between C_h and R q1=atan((sq3*m)/(2*n+m)); q2=atan((sq3*nq)/(2*np+nq)); q3=q1-q2; % q4: a period of an angle for the A atom % q5: the difference of the angle between the A and B atom q4=2.0*pi/nn; q5=acc*cos((pi/6.0d0)-q1)/c*2.0*pi; % h1: % h2: Delta z between the A and B atom h1=abs(t)/abs(sin(q3)); h2=acc*sin((pi/6.0)-q1); % The A atom ii=0; for i=0:nn-1 x1=0; y1=0; z1=0; k=floor(i*abs(r)/h1); x1=rs*cos(i*q4); y1=rs*sin(i*q4); z1=(i*abs(r)-k*h1)*sin(q3); kk2=abs(floor((z1+0.0001)/t)); % Check the A atom is in the unit cell 0<=z1 % boundary concition if(z1>=t-0.0001) z1=z1-t*kk2; elseif(z1<0) z1=z1+t*kk2; else end ii=ii+1; x(ii)=x1; y(ii)=y1; z(ii)=z1; % The B atom z3=(i*abs(r)-k*h1)*sin(q3)-h2; ii=ii+1; % Check the B atom is in the unit cell 0<=z3 if((z3>=0)&&(z3 y2 =rs*sin(i*q4+q5); z2 =(i*abs(r)-k*h1)*sin(q3)-h2; x(ii)=x2; y(ii)=y2; z(ii)=z2; else x2 =rs*cos(i*q4+q5); y2 =rs*sin(i*q4+q5); z2 =(i*abs(r)-(k+1)*h1)*sin(q3)-h2; kk=abs(floor(z2/t)); if(z2>=t-0.0001) z2 =z2-t*kk; elseif(z2<0) z2 =z2+t*kk; else end x(ii)=x2; y(ii)=y2; z(ii)=z2; end end %total number of atoms ntotal=2*nn; for i=1:ntotal X(i,: )=[x(i) y(i) z(i)]; end TransVec=t; NumAtom=ntotal; Diameter=rs*2; ChiralAngle=atan((sq3*n)/(2*m+n))/pi*180; %write coordinates to xyz file format fid=fopen('nanotube.xyz','w'); fprintf(fid,'%d\n',size(X,1)); fprintf(fid,'created by GUI_TB program\n'); for i=1:ntotal fprintf(fid,'C %f %f %f \n',X(i,1),X(i,2),X(i,3)); end fclose(fid); %write coordinates to pdb file format(for visualization using rasmol) fid=fopen('nanotube.pdb','w'); for i=1:ntotal fprintf(fid,'ATOM %6d C ADE A 1 %8.3f%8.3f%8.3f 1. 0.\n',i,X(i,1),X(i,2),X(i,3)); end fprintf(fid,'TER\n'); fclose(fid); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [ Last edited by csfn on 2008-12-29 at 20:11 ] |
» ÊÕ¼±¾ÌûµÄÌÔÌûר¼ÍƼö
×ÊÔ´ÊÕ¼¯ | µÚÒ»ÐÔÔÀí¼ÆË㸨Öú¹¤¾ß |
» ²ÂÄãϲ»¶
293Çóµ÷¼Á
ÒѾÓÐ14È˻ظ´
0703»¯Ñ§336·ÖÇóµ÷¼Á
ÒѾÓÐ6È˻ظ´
304Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
281Çóµ÷¼Á£¨0805£©
ÒѾÓÐ8È˻ظ´
»·¾³ÁìÓòÈ«¹úÖØµãʵÑéÊÒÕÐÊÕ²©Ê¿1-2Ãû
ÒѾÓÐ3È˻ظ´
²ÄÁÏר˶306Ó¢Ò»Êý¶þ
ÒѾÓÐ10È˻ظ´
301Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
Ò»Ö¾Ô¸Ìì½ò´óѧ»¯Ñ§¹¤ÒÕרҵ£¨081702£©315·ÖÇóµ÷¼Á
ÒѾÓÐ7È˻ظ´
302Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
26²©Ê¿ÉêÇë
ÒѾÓÐ3È˻ظ´
» ±¾Ö÷ÌâÏà¹ØÉ̼ÒÍÆ¼ö: (ÎÒÒ²ÒªÔÚÕâÀïÍÆ¹ã)
2Â¥2007-10-16 13:14:29
3Â¥2007-12-04 11:06:23
4Â¥2007-12-25 02:24:20
5Â¥2007-12-25 02:24:53
6Â¥2007-12-25 02:30:31
7Â¥2007-12-25 09:26:57
8Â¥2007-12-27 21:04:43
9Â¥2008-03-03 02:53:27













»Ø¸´´ËÂ¥

