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]:
0 1
0 -40 8.170000e-10
1 -39 1.190000e-09
2 -38 1.070000e-09
3 -37 1.350000e-09
4 -36 1.410000e-09

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]:
855045.87155963306

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]:
4.0

In [23]:
type(Vt_flt)


Out[23]:
float

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))


The on/off ratio is 855045.9 and the threshold voltage is 4.0 V