-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVoltageDividerOfBJT.py
More file actions
37 lines (36 loc) · 836 Bytes
/
VoltageDividerOfBJT.py
File metadata and controls
37 lines (36 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Aula
def VoltageDividerBJT(vcc,R1,R2,RE,RC,B,VBE,VCEsat):
Rth=R1*R2/(R1+R2)
vth=vcc*R2/(R1+R2)
IB=(vth-VBE)/(Rth+(1+B)*RE)
ICsat= (vcc-VCEsat) /(RC+RE)
IC=B*IB
if ((IC < ICsat) and (IC > 0)):
IC=B*IB
VCE=vcc-IC*(RE+RC)
print('The transistor is in the Active mode')
elif( IC>=ICsat):
IC=ICsat
VCE=VCEsat
print('The transistor is in the Saturation mode')
else:
IB=0
IC=0
VCE=vcc
print('The transistor is in the cut-off mode')
Pc=IC*VCE
return (IB,IC,VCE,Pc)
#Example ^_^
vcc = 20 #v
RB1 = 100 # Kohm
RB2 = 10 # Kohm
RC = 3 # Kohm
RE = 1 # Kohm
B = 100
VBE = 0.7 #v
VCEsat=0 #v
IB,IC,VCE,Pc = VoltageDividerBJT(vcc,RB1,RB2,RE,RC,B,VBE,VCEsat)
print('IB=',IB)
print('IC=',IC)
print('VCE=',VCE)
print('Pc=',Pc)