Created
July 21, 2020 14:22
-
-
Save officialcjunior/e9a3aea6210f1c00921c3e2c137e3719 to your computer and use it in GitHub Desktop.
A simple python script to calculate voltages and currents when using voltage divider bias. Can be useful when trying to find the DC Load Line. Here, I went with hardcoding the values, as passing by arguments can be difficult in unfortunate times.
This file contains hidden or 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
#0.7 for Silicon and 0.3 for Germanium diodes | |
vbe=0.7 | |
vcc= | |
vbb= | |
re= | |
rc= | |
rb= #*10**3 | |
#put rb=0, if rb isn't there. same for all | |
b= | |
#beta ^^ | |
#r1=100 | |
#r2=25 | |
#rth=r1*r2/(r1+r2) | |
#eth=r2*vcc/(r1+r2) | |
#vbb=eth | |
ib=(vbb-vbe)/(rb+(b+1)*re) | |
ic=ib*b | |
ie=ib+ic | |
vce=vcc-ic*(rc+re) | |
vce2=vcc-ie*(rc+re) | |
print("ib =", ib, "\nic=",ic, "\nvce (with ic) = ",vce,"\nvce (with ie) = ", vce2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment