In [2]:

```
import math
#Variables
V = 1.5 #Source Voltage (in volts)
RS = 0.2 #Resistance (in ohm)
RL = 1 #Load Resistance (in ohm)
#Calculation
RT = RS + RL #Total Resistance (in ohm)
I = V / RT #Current (in Ampere)
VAB = I * RL #Voltage drop across AB (in volts)
VR = V - VAB #Voltage drop due to internal resistance (in volts)
#Result
print "Voltage drop across internal resistance is ",VR," volts."
```

In [3]:

```
import math
#Variables
VS = 1.5 #Source Voltage (in volts)
RS = 0.4 #Resistance (in ohm)
RL = 2.0 #Load Resistance (in ohm)
#Calculation
RT = RS + RL #Total Resistance (in ohm)
I = VS/ RT #Current (in Ampere)
VT = I * RL #Terminal Voltage (in volts)
PL = I**2 * RL #Power dissipated by load resistance (in watt)
PS = I**2 * RT #Power Supplied by the voltage source (in watt)
eff = PL / PS #Efficiency of the circuit
#Result
print "Terminal Voltage is ",VT," V.\nPower dissipated by 2 ohm resistor is ",round(PL,2)," W.\nEfficiency of the circuit is ",round(eff,2),"."
```

In [4]:

```
import math
#Case a.1:
#Variables
VS = 6.0 #Source Voltage (in volts)
RS = 2.0 #Resistance (in ohm)
#When RL is 2 ohm
RL = 2.0 #Load Resistance (in ohm)
#Calculation
RT = RS + RL #Total Resistance (in ohm)
I = VS / RT #Current in the Circuit (in Ampere)
VT1 = I * RL #Terminal Voltage (in volts)
#Result
print "Terminal voltage when RL is 2 ohm : ",VT1," V."
#Case a.2:
#Variables
#When RL is 20 ohm
RL = 20.0 #Load Resistance (in ohm)
#Calculation
RT = RS + RL #Total Resistance (in ohm)
I = VS / RT #Current in the Circuit (in Ampere)
VT2 = I * RL #Terminal Voltage (in volts)
#Result
print "Terminal voltage when RL is 20 ohm : ",round(VT,2)," V."
print "Variation in terminal voltage is ",(VT2-VT1)/VT2," V."
#Case b.1:
#Variables
RS = 100.0 #Resistance (in ohm)
#When RL is 10 kilo-ohm
RL = 10.0 * 10**3 #Load Resistance (in ohm)
#Calculation
RT = RS + RL #Total Resistance (in ohm)
I = VS / RT #Current in the circuit (in Ampere)
VT = I * RL #Terminal Voltage (in volts)
#Result
print "Terminal voltage when RL is 100 kilo-ohm is: ",round(VT,2)," V."
#Case b.2:
#Variables
#When RL is 100 kilo-ohm
RL = 100.0 * 10**3 #Load Resistance (in ohm)
#Calculation
RT = RS + RL #Total Resistance (in ohm)
I = VS / RT #Current in the circuit (in Ampere)
VT1 = I * RL #Terminal Voltage (in volts)
#Result
print "Terminal voltage when RL is 100 kilo-ohm is :",round(VT1,3)," V."
print "Variation in terminal voltage is ",round((VT1-VT)/VT1,3)," V."
```

In [5]:

```
import math
#Variables
VS = 12.0 #Source Voltage (in volts)
VT = 10.0 #Terminal Voltage (in volts)
RL = 10.0 #Load resistance (in ohm)
#Calculation
RS = RL*(VS / VT - 1) #Internal Resistance (in ohm)
#Result
print "The internal resistance of the source is ",RS," ohm."
```

In [6]:

```
import math
#Variables
IS = 30.0 #Current (in milli-Ampere)
RS = 15.0 #Source resistance (in kilo-ohm)
#Calculation
RL = RS / 20.0 #Load Resistance (in kilo-ohm)
IL = IS * RS/(RL +RS) #Load Current (in Ampere)
#Result
print "Largest value of load resistance to provide constant current is ",RL*10**3," ohm."
print "Variation of current from the short-cicuit current is ",round((IS-IL)/IS,4),"."
```

In [7]:

```
import math
#Variables
VS = 12.0 #Source Voltage (in volts)
RS = 3.0 #Source resistance (in ohm)
#Calculation
IS = VS / RS #Source current (in Ampere)
#Result
print "Current source value is ",IS," A."
```

In [8]:

```
import math
#Variables
IS = 5.0 #Source current (in milli-Ampere)
RS = 2.0 #Source resistance (in kilo-ohm)
#Calculation
VS = IS * RS #Voltage source (in volts)
#Result
print "Equivalent voltage source is ",VS," V."
```

In [9]:

```
import math
#Variables
IS =1.5 #Source current (in milli-Ampere)
RS = 2 #Source resistance (in kilo-ohm)
#Calculation
RL = 10*40/(10+40) #Load Reistance (in kilo-ohm)
IL = IS * RS/(RL +RS) #Load current (in milli-Ampere)
IL2 = IL * 10/(10 +40) #Current through part 2 (in milli-Ampere)
VS = IS * RS #Souce voltage (in volts)
#Result
print "current through 40 kilo-ohm resistor is ",IL2," mA."
print "Equivalent volage source is ",VS," V."
```