#MSc Python
#Tutorial 1 - Debugging Functions & Things
## Department of Computing - Imperial College London ##
## Author: William Hunter ##

import matplotlib.pyplot as plt
import math
import numpy as np
from scipy.optimize import curve_fit
from matplotlib import colors
import csv


###
###
### MEDIUM HOT ### 2-D SPACE
###
###
###

### Here we start the medium level debugging - you might have to write your own function in order to fix this one!
resolution = 10**2

### spelling?
x_1 = np.linspace(1, 10, resolutionn)
x_2 = np.linspace(5, 50, resolutionn)


### 2-diamentions - complicated?
x_matrix = (x_1, x_2) #setting up 2-D vector space

### do you want to check it's running properlly?
#print(x_matrix) #checking

#I've given you the basic equaiton - now you need to turn this into your own function in order for it work. Use the template from the lectures OR the Garlic and Herb as a guideline - don't forget to incldue the variables!
y = np.sin(x_1) * np.cos(x_2) * x_1/x_2

y_values = []
# Same as the function - but can you write a for loop in order to get the values form the function into the right array? Use the example from the previous problem. You're adding th final values into the y_values empty array.
    
### This indep_range is simply a x-array that is identical to x_1 and x_2, but we just use this for plotting.
indep_range = np.linspace(1, 10, resolution)
#plotting the values
#slightly more challenening now, can you figure out what arrays need to be plotted??
plt.figure(dpi = 100)
plt.title('MEDIUM LEVEL')
plt.xlabel('x')
plt.ylabel('y')
plt.plot(????????, '--', color = 'blue', label= 'y')
plt.legend(loc = 'best')#legend location = best 

#plt.show()












