-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload_line1.py
More file actions
41 lines (33 loc) · 850 Bytes
/
Copy pathload_line1.py
File metadata and controls
41 lines (33 loc) · 850 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
38
39
40
41
import matplotlib.pyplot as plt
import numpy as np
# Given values
VCC = 30 # Volts
RC = 2_000 # Ohms
RE = 1_000 # Ohms
RB = 300_000 # Ohms
beta = 100
VBE = 0.7 # Volts
# Calculated values
R_total = RC + RE
IC_sat = VCC / R_total # Saturation current (V_CE ~ 0)
# Base current
IB = (VCC - VBE) / RB
IC = beta * IB # Active region collector current
# Create points for load line
IC_points = np.linspace(0, IC_sat, 100)
VCE_points = VCC - IC_points * R_total
# Plotting
plt.figure(figsize=(8,6))
plt.plot(VCE_points, IC_points, label='Load Line', color='blue')
# Mark Q-point
VCE_Q = VCC - IC * R_total
plt.plot(VCE_Q, IC, 'ro', label='Q-Point (Operating Point)')
# Labels and Title
plt.title('BJT DC Load Line')
plt.xlabel('VCE (V)')
plt.ylabel('IC (A)')
plt.grid(True)
plt.legend()
plt.xlim(0, VCC)
plt.ylim(0, IC_sat * 1.2)
plt.show()