<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Double clik to put your name(s) here
Instructions
Run the code in each cell by holding down the shift key and pushing Return (Enter)
DOWNLOAD A COPY OF THIS NOTEBOOK when you are done!
Step1:  The cell below defines the potential
Step2:  Double click here to edit, and describe this potential in words
Step4:  YOU NEED TO ADD THE CODE BELOW TO CALCULATE PSI
Step5:  The cell below calculates $\psi$ and graphs it
Change the upper and lower energies until you get a valid solution.
<ASSISTANT_TASK:>
Python Code:
from __future__ import division, print_function
import numpy as np
from ipywidgets import interact
import matplotlib.pyplot as plt
%matplotlib nbagg
Explanation: Double clik to put your name(s) here
Instructions
Run the code in each cell by holding down the shift key and pushing Return (Enter)
DOWNLOAD A COPY OF THIS NOTEBOOK when you are done!
End of explanation
def potential(x, V0=20.0):
    if x < 0 or x > 1:
        return V0
    else:
        return 0
        
Explanation: The cell below defines the potential
End of explanation
# Smallest position for which we will calculate psi
x_min = -1
# Largest position for which we will calculate psi
x_max = 2
# Number of points
n_points = 1000
# Create a list of all points at which we will calculate psi, and the spacing
# between those points.
all_x, delta_x = np.linspace(x_min, x_max, num=n_points, retstep=True)
Explanation: Double click here to edit, and describe this potential in words
End of explanation
def wave_function(E, all_x, delta_x, psi_0=0.0001, dpsi_dx_0=0):
    
    Calculate the wave function at the positions all_x.
    
    Parameters
    ----------
    
    E : float
        Energy to use in calculating psi. Most Energies do *not* lead to physical
        solutions.
        
    all_x : numpy array
        Positions at which psi should be calculated.
        
    delta_x: float
        Spacing between those positions.
    
    psi_0: float, optional
        Value of the wave function at the first position.
    
    dpsi_dx_0: float, optional
        Value of the derivative of psi at the first position.
    
    Returns
    -------
    
    psi: numpy array
        Wave function at all positions.
        
    
    ## FILL THIS IN WITH REAL CODE (which will include a loop)
    return np.array(psi)
Explanation: YOU NEED TO ADD THE CODE BELOW TO CALCULATE PSI
End of explanation
plt.figure(figsize=(12,10))
E_min = 2.0
E_max = 10.0
for E in np.linspace(E_min, E_max, num=7):
    plt.plot(all_x, wave_function(E, all_x), label=str(E))
    
plt.legend(loc='lower left')
Explanation: The cell below calculates $\psi$ and graphs it
Change the upper and lower energies until you get a valid solution.
End of explanation
<END_TASK>