Question: Please answer Task 2 by importing random function via python code. I submitted task 1 below for reference. Task 2 - Alternate Initial Configuration -

Please answer Task2 by importing random function via python code.
I submitted task1 below for reference.
Task 2- Alternate Initial Configuration - Cubic Lattice
This task is similar to task 1 except that for this function, you should generate points on a simple cubic lattice. Similar to the random configuration generator, the function should accept arguments for the number of atoms and the desired system density.
Task 1- Alternate Initial Configuration - Random Points
So far we have only used an initial configuration from a file. For this task, you will write a function which can generate initial system configurations from a number of particles and a desired system density. Make sure your function includes docstrings!
For density, use the number density. For example, in our sample configuration from NIST, the density is 0.8. This is calculated by dividing the number of atoms by the box volume -800 atoms /(10*10*10), since 10 was our box length. You will need to calculate a box length depending on the number of atoms and the desired density.
Write a function that makes a configuration by randomly placing points in a 3 dimensional box. The function should return coordinates, box_length the same way our read_xyz function does so we can switch out the two without changing our code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!