# Chapter 9 , Voltage and Current Sources¶

## Example 9.1 , Page Number 158¶

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."

Voltage drop across internal resistance is  0.25  volts.


## Example 9.2 , Page Number 159¶

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),"."

Terminal Voltage is  1.25  V.
Power dissipated by 2 ohm resistor is  0.78  W.
Efficiency of the circuit is  0.83 .


## Example 9.3 , Page Number 160¶

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."

Terminal voltage when RL is 2 ohm :  3.0  V.
Terminal voltage when RL is 20 ohm :  1.25  V.
Variation in terminal voltage is  0.45  V.
Terminal voltage when RL is 100 kilo-ohm is:  5.94  V.
Terminal voltage when RL is 100 kilo-ohm is : 5.994  V.
Variation in terminal voltage is  0.009  V.


## Example 9.4 , Page Number 163¶

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."

The internal resistance of the source is  2.0  ohm.


## Example 9.5 , Page Number 165¶

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),"."

Largest value of load resistance to provide constant current is  750.0  ohm.
Variation of current from the short-cicuit current is  0.0476 .


## Example 9.6 , Page Number 168¶

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."

Current source value is  4.0  A.


## Example 9.7 , Page Number 169¶

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."

Equivalent voltage source is  10.0  V.


## Example 9.8 , Page Number 169¶

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."

current through 40 kilo-ohm resistor is  0.06  mA.
Equivalent volage source is  3.0  V.