Last active
July 4, 2020 14:54
-
-
Save sewera/cc8935b00dabd1e7cf41bfb890773d1e to your computer and use it in GitHub Desktop.
Eliul Lab TB - wykresy do zad 1 z danych z LTSpice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from matplotlib import pyplot as plt | |
from os import makedirs | |
from matplotlib import rcParams | |
rcParams.update({'figure.autolayout': True}) | |
def import_csv(filename): | |
data = pd.read_csv(filename, sep='\t', header=0) | |
return data | |
if __name__ == '__main__': | |
# Tutaj zmien nazwe pliku na swoja wyeksportowana z LTSpice: | |
data = import_csv('./zad1.txt') | |
ib_micro = data['ib']*1e6 | |
ic_milli = data['Ic(Q1)']*1e3 | |
makedirs('./out', exist_ok=True) | |
# Pierwszy wykres | |
plt.plot(ib_micro, ic_milli) | |
plt.title(r'$I_C = f(I_B)$') | |
plt.xlabel(r'$I_B$ $[\mu A]$') | |
plt.ylabel(r'$I_C$ $[mA]$') | |
plt.savefig('./out/ic_ib.png') | |
plt.clf() | |
# Drugi wykres | |
plt.plot(data['V(1)'], ib_micro) | |
plt.title(r'$I_B = f(U_{BE})$') | |
plt.xlabel(r'$U_{BE}$ $[V]$') | |
plt.ylabel(r'$I_B$ $[\mu A]$') | |
plt.savefig('./out/ib_ube.png') | |
plt.clf() | |
# Trzeci wykres | |
plt.loglog(ic_milli, data['d(V(1))']) | |
plt.title(r'$h_{11e} = f(I_C)$') | |
plt.xlabel(r'$I_C$ $[mA]$') | |
plt.ylabel(r'$h_{11e}$ $[\Omega]$') | |
plt.savefig('./out/h11e_ic.png') | |
plt.clf() | |
# Czwarty wykres | |
plt.loglog(ic_milli, data['d(Ic(Q1))']) | |
plt.loglog(ic_milli, data['Ic(Q1)/Ib(Q1)']) | |
plt.title(r'$h_{21e} = f(I_C)$ oraz $\beta = f(I_C)$') | |
plt.xlabel(r'$I_C$ $[mA]$') | |
plt.ylabel(r'$[\frac{A}{A}]$') | |
plt.legend([r'$h_{21e}$', r'$\beta$']) | |
plt.savefig('./out/h21e+beta_ic.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment