Chapter 1 , Introductory Concepts

Example 1.4 , Page Number 23

In [1]:
#Variables

IS = 4.0              #Current (in Ampere)
Rin = 25.0            #Resistance (in ohm)

#Calculation

Voc = IS * Rin        #Voltage (in volts) 

#Result

print "Equivalent voltage source is ",Voc," V."
Equivalent voltage source is  100.0  V.

Example 1.5 , Page Number 23

In [2]:
#Variables

R1 = 4.0             #Resistance (in ohm)
R2 = 8.0             #Resistance (in ohm)
RS = 28.0            #Resistance (in ohm)
V1 = 40.0            #Voltage (in volts)
V2 = 40.0            #Voltage (in volts)

#Calculation

Rnet = R1 + R2 + RS  #Net resistance (in ohm)
Vnet = V1 + V2       #Net voltage (in volts) 
I = Vnet / Rnet      #Current (in Ampere)

#Result

print "Current in 28 ohm resistor is ",I," A."
Current in 28 ohm resistor is  2.0  A.