Exemple #1
0
#!/usr/bin/env python3.7
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

imgFolder = "../Imagens/Exercicio2/"

#######################################################################
##     Item A                                                        ##
#######################################################################
read1 = cla.MultisimCSV("../raw_files/ex12.csv")
read1.GetNChannels()

# Le os dados salvos no csv
ie_1, ic4_1 = read1.GetChannel(0)
ie_1 = list(map(lambda f: f * 1e3, ie_1))  # em mA
ic4_1 = list(map(lambda f: f * 1e3, ic4_1))  # em mA
iPow = []
for i in range(0, len(ie_1)):
    iPow.append((ie_1[i]**2) / 50e-3)

plt.figure(0)
#plt.subplot(121)
plt.plot(ie_1, ic4_1, label="$I_{C4}$ (Multisim)")
plt.plot(ie_1, iPow, label="$I_{C4}$ (Python)")
plt.grid()
plt.legend()
plt.ylabel('$I_C$ [mA]')
Exemple #2
0
#!/usr/bin/env python3.7
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

imgFolder = "../Imagens/pyImg/Exercicio3/"

#######################################################################
##     Item A                                                        ##
#######################################################################
read1 = cla.MultisimCSV("../raw_files/DE6_ex3_3Sweep5754.csv")

read1.GetNChannels()

# Le os dados salvos no csv
vdd_1, ic_1 = read1.GetChannel(0)

plt.figure(0)
plt.subplot(121)
plt.plot(vdd_1,
         ic_1,
         label="$I_{C_{Q3}}$",
         linestyle="",
         marker="o",
         markersize="2")
plt.grid()
plt.legend()
plt.ylabel('$I_C$ [A]')
#!/usr/bin/env python3.7
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

#######################################################################
##     Item A                                                        ##
#######################################################################
print("+++++++++ Item A +++++++++")
read1 = cla.OsciloscopioCSV("../raw_files/scope_14.csv")
read1.GetNChannels()

# Le os dados salvos no csv
time_1 = read1.GetVoltageArray(0)
v1_1 = read1.GetVoltageArray(1)
v2_1 = read1.GetVoltageArray(2)

# Plota e printa os graficos
plt.figure(0)
plt.plot(time_1, v1_1, label="Canal 1")
plt.plot(time_1, v2_1, label="Canal 2")
plt.grid()
plt.legend()
plt.xlabel('tempo [s]')
plt.ylabel('tensão [V]')

plt.savefig("../Imagens/Ex1itemA.png")

#######################################################################
##     Item B                                                        ##
#!/usr/bin/env python3.7
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

imgFolder = "../img/Exercicio1/"

#######################################################################
##     Item A                                                        ##
#######################################################################
print("Item A: 1 kOhms")
read1 = cla.OsciloscopioCSV("../raw_files/scope_27.csv")

read1.GetNChannels()

# Le os dados salvos no csv
time_1 = read1.GetVoltageArray(0)
vFonte_1 = read1.GetVoltageArray(1)
vDiodo_1 = read1.GetVoltageArray(2)

# Define a resistencia
R = 1.001

plt.figure(0)
plt.plot(time_1, vFonte_1, label="Canal 1")
plt.plot(time_1, vDiodo_1, label="Canal 2")
plt.grid()
plt.legend()
Exemple #5
0
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys

sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt
import numpy as np

imgFolder = "../img/Exercicio3/"

#######################################################################
##     Item A                                                        ##
#######################################################################
print("+++++++++ Item A +++++++++")
read_1 = cla.OsciloscopioCSV("../raw_files/scope_19.csv")

read_1.GetNChannels()

# Le os dados salvos no csv
time_1 = read_1.GetVoltageArray(0)
vFonte_1 = read_1.GetVoltageArray(1)
vDiodo_1 = read_1.GetVoltageArray(2)

plt.figure(0)
plt.plot(time_1, vFonte_1, label="$V_e$")
plt.plot(time_1, vDiodo_1, label="$V_o$")
plt.grid()
plt.legend()
plt.ylabel('tensão [V]')
plt.xlabel('tempo [s]')
Exemple #6
0
#!/usr/bin/env python3.7
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys

sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

imgFolder = "../img/Exercicio2/"

#######################################################################
##     Item A                                                        ##
#######################################################################
read1 = cla.OsciloscopioCSV("../raw_files/scope_17.csv")

read1.GetNChannels()

# Le os dados salvos no csv
time_1 = read1.GetVoltageArray(0)
vFonte_1 = read1.GetVoltageArray(1)
vDiodo_1 = read1.GetVoltageArray(2)
vFunc = []
for i in range(0, len(time_1)):
    if (vFonte_1[i] == 0):
        vFunc.append(0.00)
    else:
        vFunc.append(vDiodo_1[i] / vFonte_1[i])

plt.figure(0)
plt.plot(time_1, vFonte_1, label="$V_e$")
Exemple #7
0
#!/usr/bin/env python3.7
import sys

sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

#######################################################################
##     Item A                                                        ##
#######################################################################
print("+++++++++ Item A +++++++++")
read1 = cla.OsciloscopioCSV("../raw_files/scope_42.csv")
read1.GetNChannels()

# Le os dados salvos no csv
time_1 = read1.GetVoltageArray(0)
v1_1 = read1.GetVoltageArray(1)
v2_1 = read1.GetVoltageArray(2)

# Plota e printa os graficos
plt.figure(0)
plt.plot(time_1, v1_1, label="Canal 1")
plt.plot(time_1, v2_1, label="Canal 2")
plt.grid()
plt.legend()
plt.xlabel('tempo [s]')
plt.ylabel('tensão [V]')

plt.savefig("../Imagens/Ex5_1kHz.png")

#######################################################################
Exemple #8
0
#!/usr/bin/env python3.7
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

imgFolder = "../Imagens/Exercicio3/"

#######################################################################
##     Item A                                                        ##
#######################################################################
read1 = cla.OsciloscopioCSV("../raw_files/dados.csv")
'''
Ex do csv
X--Trace 1::[V(vc2)],Y--Trace 1::[V(vc2)],,X--Trace 2::[V(vb2)],Y--Trace 2::[V(vb2)],,X--Trace 3::[V(ve)],Y--Trace 3::[V(ve)]
0,5.00011,,0,0.620702,,0,0
4e-007,4.99942,,4e-007,0.62071,,4e-007,1.6e-005

xc2,yc2,NADA,xb2,yb2,NADA,xve,yve

'''
read1.GetNChannels()

# Le os dados salvos no csv
ie_1 = read1.GetVoltageArray(0)
iref_1 = read1.GetVoltageArray(1)
ic4_1 = read1.GetVoltageArray(2)

iPow = []
def current(x):
    for i in range(0, len(x)):
        x[i] = x[i] / (1000.)

    return x


#######################################################################
##                                                                   ##
#######################################################################
print("+++++++++ Item A +++++++++")
#
# 357mV
#
read_1 = cla.OsciloscopioCSV("../raw_files/scope_1.csv")

read_1.GetNChannels()

# Le os dados salvos no csv
time_1 = read_1.GetVoltageArray(0)
vCh1_1 = read_1.GetVoltageArray(1)
vCh2_1 = read_1.GetVoltageArray(2)
vCh2_1 = invert(vCh2_1)

#
# 601mV
#
read_2 = cla.OsciloscopioCSV("../raw_files/scope_9.csv")
read_2.GetNChannels()
Exemple #10
0
#!/usr/bin/env python3.7
# Esse script corresponde ao primeiro exercício do quarto
# experimento de Dispositivos eletrônicos.
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

imgFolder = "../images/Exercicio1/"

#######################################################################
##     Item A                                                        ##
#######################################################################
read1 = cla.MultisimCSV("../Multisim/DE9_Ex13_withVe.csv")
read1.GetNChannels()

time_10C_1, vc_10C_1 = read1.GetChannel(0)
time_ve_10C_1, ve_10C_1 = read1.GetChannel(1)
time_27C_1, vc_27C_1 = read1.GetChannel(2)
time_ve_27C_1, ve_27C_1 = read1.GetChannel(3)
time_60C_1, vc_60C_1 = read1.GetChannel(4)
time_ve_60C_1, ve_60C_1 = read1.GetChannel(5)

time_10C_2 = []
vc_10C_2 = []
time_ve_10C_2 = []
ve_10C_2 = []
time_27C_2 = []
vc_27C_2 = []
time_ve_27C_2 = []
ve_27C_2 = []
Exemple #11
0
# Esse script corresponde ao primeiro exercício do quarto 
# experimento de Dispositivos eletrônicos.
import sys
sys.path.append("../../Bibliotecas/") 
import ClasseDados as cla
from matplotlib import pyplot as plt


imgFolder = "../Imagens/pyImg/Exercicio1/"


#######################################################################
##     Item A                                                        ##
#######################################################################
read1 =cla.MultisimCSV("../raw_files/DE6_ex1_resIncr_interv0.0001.csv")
read1.GetNChannels()

# Le os dados salvos no csv
v_be, i_c = read1.GetChannel(0)

for i in range(0,10):
	print(v_be[i],i_c[i])
rIncr=[]
rIncrMed=[]
for i in range(1,len(i_c)):
	rIncr.append((v_be[i]-v_be[i-1])/float(i_c[i]-i_c[i-1]))
	if(v_be[i]>0 and v_be[i]<0.04):
		rIncrMed.append((v_be[i]-v_be[i-1])/float(i_c[i]-i_c[i-1]))

avgRINCR = sum(rIncrMed) / float(len(rIncrMed))
Exemple #12
0
#!/usr/bin/env python3.7
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

#######################################################################
##     Item A                                                        ##
#######################################################################
print("+++++++++ Item A +++++++++")
read1 = cla.OsciloscopioCSV("../raw_files/scope_27.csv")
read1.GetNChannels()

# Le os dados salvos no csv
time_1 = read1.GetVoltageArray(0)
v1_1 = read1.GetVoltageArray(1)

# Plota e printa os graficos
plt.figure(0)
plt.plot(time_1, v1_1, label="Canal 1")
plt.grid()
plt.legend()
plt.xlabel('tempo [s]')
plt.ylabel('tensão [V]')
ylim = plt.ylim()

plt.savefig("../Imagens/Ex3itemA.png")

#######################################################################
##     Item B                                                        ##
#######################################################################
Exemple #13
0
#!/usr/bin/env python3.7
import sys
sys.path.append("../../Bibliotecas/")
import ClasseDados as cla
from matplotlib import pyplot as plt

#######################################################################
##     Item A                                                        ##
#######################################################################
print("+++++++++ Item A +++++++++")
read1 = cla.OsciloscopioCSV("../raw_files/scope_52.csv")
read1.GetNChannels()

# Le os dados salvos no csv
time_1 = read1.GetVoltageArray(0)
v1_1 = read1.GetVoltageArray(1)
v2_1 = read1.GetVoltageArray(2)

# Plota e printa os graficos
plt.figure(0)
plt.plot(time_1, v1_1, label="Canal 1")
plt.plot(time_1, v2_1, label="Canal 2")
plt.title("1N4007")
plt.grid()
plt.legend()
plt.xlabel('tempo [s]')
plt.ylabel('tensão [V]')

plt.savefig("../Imagens/Ex6_1N4007.png")

#######################################################################