Question: Use only random and mathplot lib packages.DO not use numpy. calculate _ LJ function that includes parameters for setting sigma and epsom.After writing the function,

Use only random and mathplot lib packages.DO not use numpy.
calculate_LJ function that includes parameters for setting sigma
and epsom.After writing the function, perform a set of calculations with sigma
and both equal to one. Using these values, calculate the Lennard Jones potential energy for a range of distances, r, from r =0.1 to r =5 in increments of 0.1. Save your results in a list.
Next, perform a set of calculations where sigma
is equal to 2 and epsom is equal to one. Then set sigma to equal to 1 and
epsom equal to two. For each set of calculations, save your result in a list.
Visualize all three results on a graph using matplotlib.
At least five sentences explain the steps and their importance.
Write a Python time code as example below and caluclate how much it takes to calculate module above to compare performance for n_samples=100 and n_samples=10000000.
Change the code to calculate the total energy for every step. Compare timings for 1,000 steps.
import time
start = time.time()
# put code you want to time here.
end = time.time()
elapsed_time = end - start
print(elapsed_time)

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!