Plot a field-effect transistor transfer curve
In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [3]:
df = pd.read_csv('FET_data.csv', header=None)
df.head()
Out[3]:
In [9]:
V = df[0].values
I = df[1].values
logI = np.log10(I)
In [13]:
plt.plot(V,logI)
plt.xlabel('Voltage (V)')
plt.ylabel('Log of Current (logA)')
plt.title('Voltage vs. Current of a FET')
plt.show()
Calculate the on/off ratio and threshold voltage
In [16]:
on_off_ratio = np.max(I)/np.min(I)
on_off_ratio
Out[16]:
In [18]:
loc = np.argwhere(I==min(I))
In [20]:
Vt_array = V[loc]
In [21]:
Vt_flt = float(Vt_array)
In [22]:
Vt_flt
Out[22]:
In [23]:
type(Vt_flt)
Out[23]:
In [35]:
print('The on/off ratio is {0:4.1f} and the threshold voltage is {1:2.1f} V'.format(on_off_ratio,Vt_flt))