Chapter 3 : Circuit Laws

Example 3.3 Page No : 45

In [1]:
import math 

# Given
#Equivalent resistance of three resistors is 750 ohm")
#values of two resistors are 40 ohm and 410 ohm")
Req = 750;
R1 = 40;
R2 = 410;

#For series resistance 
#Req = R1+R2+R3")
#On solving for R3
R3 = Req-R1-R2
print "Value of third ohmic resistor is %d ohm"%(R3)
Value of third ohmic resistor is 300 ohm

Example 3.4 Page No : 49

In [2]:
import math 
#Example 3.4")
# Given
#values of two capacitors are 2uF and 10uF")
C1 = 2*10**-6;
C2 = 10*10**-6;
#For two capacitors in series
#Ceq = (C1*C2)/(C1+C2)")
#On solving for Ceq
Ceq = ((C1*C2)/(C1+C2))*10**6
print "Value of equivalent capacitance is %3.2fuF"%(Ceq)

#If C2 = 10pF")
C2 = 10*10**-12;

Ceq = ((C1*C2)/(C1+C2))*10**12
print "Value of equivalent capacitance is %3.2fpF"%(Ceq)
Value of equivalent capacitance is 1.67uF
Value of equivalent capacitance is 10.00pF

Example 3.5 Page No : 53

In [3]:
import math 
#Example 3.5")
# Given
#a)")
#values of two resistors are 60 ohm and 60 ohm")
R1 = 60;
R2 = 60.;
#If resistors are parallel")
Req = (R1*R2)/(R1+R2)
print "Value of equivalent resistance is %d ohm"%(Req)

#b)")
#values of three equal resistors are 60 ohm")
R1 = 60.;
R2 = 60.;
R3 = 60.;
#If resistors are parallel")
x = 1/R1+1/R2+1/R3
Req = 1/x;
print "Value of equivalent resistance is %d ohm"%(Req)
Value of equivalent resistance is 30 ohm
Value of equivalent resistance is 20 ohm

Example 3.6 Page No : 55

In [4]:
import math 
#Example 3.6")

# Given
#values of two inductors are 3mH and 6 mH")
L1 = 3*10**-3;
L2 = 6*10**-3;
#If inductors are parallel")
Leq = ((L1*L2)/(L1+L2))*10**3
print "Value of equivalent inductance is %3.1f mH"%(Leq)
Value of equivalent inductance is 2.0 mH

Example 3.7 Page No : 60

In [5]:
import math 
#Example 3.7")

# Given
#Total resistance of three resistors is 50 ohm")
R = 50;
#Output voltage is 10 percent of the input voltage")
#Let v be input voltage and v1 be output voltage
#Let v1/v = V
V = 0.1;
#As V = R1/(Total resistance)

#Solving for R1
R1 = V*R;
#As R = R1+R2
#Solving for R2
R2 = R-R1;

# Results
print "R1 = %dohm R2 = %dohm"%(R1,R2)
R1 = 5ohm R2 = 45ohm

Example 3.8 Page No : 65

In [6]:
import math 
#Example 3.8")

# Given
#Total current is 30mA")
#Branch currents are 20mA and 10mA")
#Equivalent resistance is equal to or greater than 10 ohm")

#From Fig 3.6
#Current flowing through R1 be i1 and let it be equal to 10mA
#Current flowing through R2 be i2 and let it be equal to 20mA
i1 = 10*10**-3;
i2 = 20*10**-3;
i = 30*10**-3;

# Calculation
#Let R1/(R1+R2) = X1        (1)
#Let R2/(R1+R2) = X2        (2)
X1 = i1/i;
X2 = i2/i;
#Let R1*R2(R1+R2) = Y        (3)

# Results
#Given that 
print " Given"
#R1*R2(R1+R2)> = 10")
#Solving (1),(2) and (3) we get
print "R1> = %dohmR2> = %dohm"%(15,30)
 Given
R1> = 15ohmR2> = 30ohm