Skip to content

Commit 5290a6b

Browse files
committed
增加了第九章
1 parent 811b16d commit 5290a6b

File tree

10 files changed

+45251
-1
lines changed

10 files changed

+45251
-1
lines changed

energy.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
1.89371657371521 -19.389835357666016
21
330.47662 -3223.9067
32
328.1825 -3221.6094
43
330.06717 -3223.4932

src/09-atomic/a.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
import numpy as np
3+
4+
a = np.random.rand(3,10)
5+
a = a.tolist()
6+
b = [3,4,2]
7+
for i in range(len(b)):
8+
print('\t'.join(map(lambda x:str(x), a[i][0:b[i]])))

src/09-atomic/bonds.m

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
clear;
2+
clf;hold on;
3+
xy=load('xy.txt');
4+
neighbor = load('neighbor_atomic.txt');
5+
bands = zeros(sum(neighbor(:,1))*3,2);
6+
i = 1;
7+
for n = 1:size(xy,1)
8+
for k=1:neighbor(n,1)
9+
bands(i,:) = xy(n,:); i=i+1;
10+
bands(i,:) = xy(neighbor(n,1+k)+1,:); i=i+1;
11+
bands(i,:) = [NaN,NaN]; i=i+1;
12+
end
13+
end
14+
plot(bands(:,1),bands(:,2),'-k')
15+
plot(xy(:,1),xy(:,2),'.');
16+
axis equal;
17+
box on
18+
xlim([60,180]);
19+
ylim([60,180]);
20+
xlabel('x (angstrom)');
21+
ylabel('y (angstrom)');

0 commit comments

Comments
 (0)