跳至主要內容
01-Homework 01

Notes: Refer to the Lennard-Jones (L-J) pair potential for solid Argon. You need to know the form of this potential along with the smooth cut-off to zero that is needed for modeling studies.

Both the potential and the cut-off are described in Prof. Vitek’s notes in a separate file titled the L-J potential. Please read this before attempting the homework or wait until Sep 12 class lecture to know more. In the meantime, you may look up or convince yourself what close-packed crystal structures are in one, two and three dimensional space. You may search the web if you are not familiar with this concept. Once you know how a close-packed structure is defined, you should be able to figure out the close-packed lattice in two dimensions. Draw a rough sketch by hand or make a plot using a code and identify how many neighbors an atom has in this lattice. Make a table of the nearest neighbors, next-nearest neighbors, etc., at least up to the fourth neighbor shell along with their distances in terms of a lattice parameter ‘a’ for the lattice. The pair potential only depends on the distance between the atoms and not their orientation. Such potentials are called “central” potentials in physics. With this background, you may proceed to do the homework. Please prepare your answers in the form of a report (in pdf format) where you explain your thinking and procedure in words briefly before solving the problem.


AI悦创原创...大约 15 分钟1v1Python一对一辅导留学生Python辅导Python 1v11v1Python一对一辅导留学生Python辅导Python 1v1
Java数组排序「冒泡排序」

Java 数组冒泡排序

你好,我是悦创。

对数组进行排序是程序中非常基本的需求。常用的排序算法有冒泡排序、插入排序和快速排序等。

我们来看一下如何使用冒泡排序算法对一个整型数组从小到大进行排序:

冒泡排序的特点是,每一轮循环后,最大的一个数被交换到末尾,因此,下一轮循环就可以“刨除”最后的数,每一轮循环都比上一轮循环的结束位置靠前一位。

另外,注意到交换两个变量的值必须借助一个临时变量。像这么写是错误的:

int x = 1;
int y = 2;

x = y; // x现在是2
y = x; // y现在还是2

AndersonHJB原创...大约 5 分钟Python一对一答疑帖留学生Python辅导留学生Java辅导Java辅导Java一对一数据结构与算法一对一辅导冒泡排序Python一对一答疑帖留学生Python辅导留学生Java辅导Java辅导Java一对一数据结构与算法一对一辅导冒泡排序
python 的 return 详解

你好,我是悦创。

  1. return 语句用于退出函数,向调用方返回一个表达式。执行到 return 语句时,会退出函数,return 之后的语句不再执行。如:
def my_print(x):
    if x == 1:
        return False
    print('i am xiaotao')
    return True


a = my_print(1)   # 满足if,执行return False,不再执行之后的语句,跳出函数。
print(a)

# 输出:False

AndersonHJB原创...大约 2 分钟Python一对一答疑帖留学生Python辅导Python一对一答疑帖留学生Python辅导
Python 中 return 和 print 的作用及区别

一图胜千里

img

print 的作用是输出数据到控制端,就是打印在你能看到的界面上

  • print 的作用还是比较容易理解的
print (1)
print('asdfghj')
 
输出结果
1
asdfghj

AndersonHJB原创...大约 3 分钟Python一对一答疑帖留学生Python辅导Python一对一答疑帖留学生Python辅导