Contents

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel\(\rightarrow\)Restart) and then run all cells (in the menubar, select Cell\(\rightarrow\)Run All).

Make sure you fill in any place that says YOUR CODE HERE or “YOUR ANSWER HERE”, as well as your name and collaborators below:

NAME = ""
COLLABORATORS = ""

Polynomials are often used to fit data. Look up the function np.polyfit and use it to fit the following data with a 4th order polynomial.

vol = [324.85990899, 253.43999457, 234.03826687, 231.12159387, 228.40609504, 
       225.86490337, 223.47556626, 221.21992353, 219.08319566, 217.05369547, 
       215.12089909, 213.27525144, 211.51060823, 203.66743321, 197.07888649, 
       191.39717952, 186.40163591, 181.9443551, 177.92077043, 174.2538009, 
       170.88582166, 167.76711189, 164.87096104, 159.62553397, 154.9700546, 
       150.78475335, 146.97722201, 143.49380641]

energy =  [-399.973168847, -400.0172393178, -400.0256270548, -400.02656907,
           -400.027355112, -400.0280030862, -400.028531345, -400.0289534593,
           -400.0292800709, -400.029522497, -400.0296863867, -400.0297809256, 
           -400.029811, -400.0291665573, -400.0275017142, -400.0250998136,
           -400.0221371852, -400.0187369863, -400.0149820198, -400.0109367042, 
           -400.00664951, -400.0021478258, -399.9974753449, -399.9876885136, 
           -399.9774175487, -399.9667603369, -399.9557686286, -399.9445262604]

Use the numpy polynomial functions to write a function that you can use with minimize to find the volume that minimizes the energy in the data above.

Use the numpy polynomial functions to calculate the derivative dE/dV at the minimum you found above.

When you are done, download a PDF and turn it in on Canvas. Make sure to save your notebook, then run this cell and click on the download link.

%run ~/f23-06623/f23.py
%pdf