下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、產(chǎn)生碳納米管坐標(biāo)的Matlab程序 以下是一個(gè)產(chǎn)生任意(m,n)碳管坐標(biāo)的一個(gè) Matlab程序。只需把下面的程序 copy ,存成 creatCNT.m,即可用 Matlab直接運(yùn)行。比如在 Matlab提示符下輸入 creatCNT(8,0) 則產(chǎn)生(8,0)碳納米管的坐標(biāo),輸出文件為 nanotube.xyz 和nanotube.pdb 格式??梢杂闷?他的可視化軟件打開。 % function X TransVec NumAtom Diameter ChiralAngle=createCNT(n,m) %This function creates the coordinates of
2、a (n,m) nanotube, with nm %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 % ChiralA
3、ngle - chiral angle of the nanotube % by bshan 2005 %change order if nm if(n0)&(j1=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
4、*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 betwe
5、en 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*s
6、in(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=t-0.0001) z1=z1-t*kk2; elseif(z10) z1=z1+t*kk2; else end ii=ii+1; x(ii)=x1; y
7、(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=0)&(z3=t-0.0001) z2 =z2-t*kk; elseif(z20) 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 Tran
8、sVec=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,%dn,size(X,1); fprintf(fid,created by GUI_TB programn); 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);
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度個(gè)人房產(chǎn)抵押擔(dān)保貸款保險(xiǎn)合同范本2篇
- 二零二五年度車輛運(yùn)輸水工鵝卵石運(yùn)輸協(xié)議3篇
- 2025年個(gè)人股東股權(quán)增資擴(kuò)股合同模板4篇
- 設(shè)計(jì)思維解鎖創(chuàng)意潛能的鑰匙
- 2025年度大學(xué)生實(shí)習(xí)實(shí)訓(xùn)基地實(shí)習(xí)崗位合作協(xié)議
- 2025年度個(gè)人戶外運(yùn)動(dòng)裝備過橋資金借款合同3篇
- 網(wǎng)絡(luò)安全實(shí)訓(xùn)室的應(yīng)急預(yù)案制定及實(shí)施
- 2025年度工傷賠償協(xié)議范本發(fā)布通知3篇
- 二零二五年度車牌號(hào)碼拍賣合同書4篇
- 2025版新型材料研發(fā)項(xiàng)目施工保密協(xié)議書3篇
- 焊接機(jī)器人在汽車制造中應(yīng)用案例分析報(bào)告
- 合成生物學(xué)在生物技術(shù)中的應(yīng)用
- 中醫(yī)門診病歷
- 廣西華銀鋁業(yè)財(cái)務(wù)分析報(bào)告
- 無違法犯罪記錄證明申請(qǐng)表(個(gè)人)
- 電捕焦油器火災(zāi)爆炸事故分析
- 大學(xué)生勞動(dòng)教育PPT完整全套教學(xué)課件
- 繼電保護(hù)原理應(yīng)用及配置課件
- 《殺死一只知更鳥》讀書分享PPT
- 蓋洛普Q12解讀和實(shí)施完整版
- 2023年Web前端技術(shù)試題
評(píng)論
0/150
提交評(píng)論