# Chapter3-DC Circuits¶

## Ex1-pg49¶

In [1]:
##Ex:3.1
import math
i1=1.5;
i2=2.7;##in amp.s
i5=i1+i2;
i4=3.3;
i3=i4+i5;
print'%s %.2f %s'%("Current b/w A & B = ",i5," A");
print'%s %.2f %s'%("\n Current I3 = ",i3," A");

Current b/w A & B =  4.20  A

Current I3 =  7.50  A


## Ex2-pg50¶

In [2]:
##Ex:3.2
import math
E1=6.;
E2=3.;
V2=E1-E2;
V1=4.5;
E3=V1-E2;
print'%s %.2f %s'%("Value of V2 = ",V2," A");
print'%s %.2f %s'%("\n Value of E3 = ",E3," A");

Value of V2 =  3.00  A

Value of E3 =  1.50  A


## Ex3-pg50¶

In [3]:
##Ex:3.3
import math
V1=7.5;##in volts
V2=4.5;
V3=4.5;
r1=110.;##in ohms
r2=33.;
r3=22.;
i1=V1/r1;
i2=V2/r2;
i3=V3/r3;
print'%s %.2f %s'%("Current I1 = ",i1," A");
print'%s %.2f %s'%("\n Current I2 = ",i2," A");
print'%s %.2f %s'%("\n Current I3 = ",i3," A");

Current I1 =  0.07  A

Current I2 =  0.14  A

Current I3 =  0.20  A


## Ex4-pg52¶

In [4]:
##Ex:3.4
import math
V_in=5.;##in volts
r1=4000.;
r2=1000.;
r_p=r1*r2/(r1+r2);
V_out=V_in*(r2/(r1+r2));
V_out_p=V_in*(r_p/(r_p+r2));
print'%s %.2f %s'%("output voltage at no load = ",V_out," A");
print'%s %.2f %s'%("\n output voltage when loaded by 10kohms = ",V_out_p,"A");

output voltage at no load =  1.00  A

output voltage when loaded by 10kohms =  2.22 A


## Ex5-pg53¶

In [5]:
##Ex:3.5
import math
I_in=5.;##in mA
R_m=100.;
I_m=1.;
R_s=R_m*I_m/(I_in-1.);
print'%s %.2f %s'%("Value of parallel shunt resistor = ",R_s," A");

Value of parallel shunt resistor =  25.00  A


## Ex6-pg54¶

In [6]:
##Ex:3.6
import math
r1=100.;
r2=1000.;
R_x_1=(r2/r1)*10000.;
R_x_2=(r1/r2)*10.;
print'%s %.2f %s %.2f %s '%("Range extends from ",R_x_2," ohms to" and " ",R_x_1," ohms");

Range extends from  1.00   100000.00  ohms


## Ex7-pg55¶

In [7]:
##Ex:3.7
import math
E=10.;
r1=500.;
r2=600.;
r3=500.;
r4=400.;
V_a=E*(r2/(r1+r2));
V_b=E*(r4/(r3+r4));
V_oc=V_a-V_b;
r=((r1*r2)/(r1+r2))+((r3*r4)/(r3+r4));
i=(V_oc/(r+100.))*1000.;
print'%s %.2f %s'%("Current flow in 100 ohm resistor = ",i," mA" );

Current flow in 100 ohm resistor =  1.70  mA


## Ex8-pg56¶

In [8]:
##Ex:3.8
import math
I_sc=19.;##in uA
R=1000.;
R_m=968.;
V_out=I_sc*(R*R_m/(R+R_m));
print'%s %.2f %s'%("Voltage produced = ",V_out," uV");

Voltage produced =  9345.53  uV


## Ex9-pg59¶

In [9]:
##Ex:3.9
import math
r=3.3*10**6;##in ohms
t=1.;##in sec.
V_s=9.;##in volts
V_c=V_s*(1.-math.e**(-t/(r*c)));
print'%s %.2f %s'%("Voltage produced = ",V_c," V");

Voltage produced =  2.35  V


## Ex10-pg59¶

In [10]:
##Ex:3.10
import math
r=1.*10**3;##in ohms
t1=50.*10**-3;##in sec.
t2=100.*10**-3;##in sec.
V_s=350;##in volts
i1=(V_s/1000.)*(math.e**(-t1/(r*c)));
i2=(V_s/1000.)*(math.e**(-t2/(r*c)));
print'%s %.2f %s %.2f %s '%("Charging current after ",t1," sec" and "",i1,"  A");

print'%s %.2f %s %.2f %s '%("Charging current after ",t2," sec" and "",i2,"  A")

Charging current after  0.05  0.21   A
Charging current after  0.10  0.13   A


## Ex11-pg61¶

In [11]:
##Ex:3.11
import math
r=47.*10**3;##in ohms
V_s=20.;##in volts
V_c=10.;
t=-c*r*math.log(V_c/V_s);
print'%s %.2f %s'%("time taken = ",t," sec.");

time taken =  0.33  sec.


## Ex12-pg61¶

In [12]:
##Ex:3.12
import math
r=2.*10**6;##in ohms
V_s=150.;##in volts
V_c=0.8187*V_s;
print'%s %.2f %s'%("Capacitor voltage = ",V_c," V");

Capacitor voltage =  122.80  V


## Ex13-pg62¶

In [13]:
##Ex:3.13
import math
r=10.*10**3;##in ohms
t=1.*10**-3;
c=(0.1*t/r)*10**9;
print'%s %.2f %s'%("Capacitor = ",c," nF");

Capacitor =  10.00  nF


## Ex14-pg63¶

In [14]:
##Ex:3.14
import math
r=10.*10**3;##in ohms
t=1.*10**-3;
c=(10.*t/r)*10**6;
print'%s %.2f %s'%("Capacitor = ",c," uF");

Capacitor =  1.00  uF


## Ex15-pg64¶

In [15]:
##Ex:3.15
import math
L=6.;##in henry
r=24.;##in ohms
t=0.1;##in sec.
V_s=12.;##in volts
i=(V_s/r)*(1.-math.e**(-t*r/L));
print'%s %.2f %s'%("current = ",i," A");

current =  0.16  A


## Ex16-pg64¶

In [16]:
##Ex:3.16
import math
V_s=5.;##in volts
V_c=0.8647*V_s;
print'%s %.2f %s'%("Inductor voltage = ",V_c," V");

Inductor voltage =  4.32  V