2023-03-04 区分纳米颗粒核壳原子
创始人
2024-05-28 18:39:00

声明:未经允许,不得擅自复制、转载。

欢迎引用:

Laser-Assisted Synthesis of Bi-Decorated Pt Aerogel for Efficient Methanol Oxidation Electrocatalysis

Applied Surface Science ( IF 6.707 ) Pub Date : 2022-04-01 , DOI: 10.1016/j.apsusc.2022.153219

Liye Zhu, Ran Zhang, Xuan Liu, Jiayin Zhu, Ziang Guo, Yan Zhao

Click Here!

利用MS构建纳米颗粒R,指定壳厚,可将核原子的坐标和壳原子坐标区分开来。

# /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Liye Zhu
"""from tkinter.filedialog import askopenfilename
import matplotlib.pyplot as plt
from scipy import interpolate
import numpy as npclass xyzReading:def readxyz(self):path_and_name = askopenfilename(title='Select xyz data: ', filetypes=[('TXT', '*.txt')],initialdir='C:\\Users\\Mr. Zhu\\Desktop')x = []y = []z = []with open(path_and_name, 'r') as TXTFile:line = TXTFile.readlines()first_data_line = 9constant = float(line[4].split('     ')[3].lstrip(' '))constant = int(constant)print(constant)# constant = 100for index, row in enumerate(line):if index in range(first_data_line, len(line)):row = row.lstrip('     ')row = row.rstrip('\n')xyz = row.split('         ', 2)xyz = np.array(xyz)xp = float(xyz[0])*constantyp = float(xyz[1])*constantzp = float(xyz[2])*constantx.append(xp)y.append(yp)z.append(zp)x = np.array(x)y = np.array(y)z = np.array(z)return x, y, z, path_and_namefile_output = path_and_name[0:path_and_name.rfind('.', 1) + 1] + 'dat'np.savetxt(file_output, [x, y, z])class xyzProcessing:def __init__(self, x0, y0, z0, path_and_name):self.x0 = x0self.y0 = y0self.z0 = z0self.path_and_name = path_and_namedef findshell(self):xc = (max(self.x0) + min(self.x0)) / 2yc = (max(self.y0) + min(self.y0)) / 2zc = (max(self.z0) + min(self.z0)) / 2r = (max(self.x0) - min(self.x0)) / 2print('xc, yc, zc and radius (脜): ')print(xc, yc, zc, r)thickness = 1num = len(self.x0)Xc = xc*np.ones(num)Yc = yc * np.ones(num)Zc = zc * np.ones(num)dsqure = (self.x0-Xc)**2+(self.y0-Yc)**2 + (self.z0-Zc)**2Xout = self.x0[dsqure > (r-thickness)**2]Yout = self.y0[dsqure > (r-thickness)**2]Zout = self.z0[dsqure > (r-thickness)**2]Xin = self.x0[dsqure < (r - thickness) ** 2]Yin = self.y0[dsqure < (r - thickness) ** 2]Zin = self.z0[dsqure < (r - thickness) ** 2]# Xout = Xout.T# Yout = Yout.T# Zout = Zout.T# Xin = Xin.T# Yin = Yin.T# Zin = Zin.Toutpath = path_and_name[0:path_and_name.rfind('/', 1)]+'/out.dat'inpath = path_and_name[0:path_and_name.rfind('/', 1)]+'/in.dat'np.savetxt(outpath, [Xout, Yout, Zout])np.savetxt(inpath, [Xin, Yin, Zin])print(len(Xout))xyzRead = xyzReading()
[x, y, z, path_and_name] = xyzRead.readxyz()
XYZProcess = xyzProcessing(x, y, z, path_and_name)XYZProcess.findshell()# thickness = input('Please Input a shell thickness: ')

相关内容

热门资讯

北京的名胜古迹 北京最著名的景... 北京从元代开始,逐渐走上帝国首都的道路,先是成为大辽朝五大首都之一的南京城,随着金灭辽,金代从海陵王...
世界上最漂亮的人 世界上最漂亮... 此前在某网上,选出了全球265万颜值姣好的女性。从这些数量庞大的女性群体中,人们投票选出了心目中最美...
苗族的传统节日 贵州苗族节日有... 【岜沙苗族芦笙节】岜沙,苗语叫“分送”,距从江县城7.5公里,是世界上最崇拜树木并以树为神的枪手部落...
长白山自助游攻略 吉林长白山游... 昨天介绍了西坡的景点详细请看链接:一个人的旅行,据说能看到长白山天池全凭运气,您的运气如何?今日介绍...
应用未安装解决办法 平板应用未... ---IT小技术,每天Get一个小技能!一、前言描述苹果IPad2居然不能安装怎么办?与此IPad不...