Chapter9-The Ideal Operational Amplifier

Ex5-pg541

In [1]:
import math

##Example 9.5
Zl=0.1;
R1=10.;
R2=1.;
R3=1.;
Rf=10.;
Vt=-5.;
iL=-Vt/R2;
print"%s %.2f %s"%('\nload current= ',iL,' mA\n')
vL=iL*Zl;
print"%s %.2f %s"%('\nvoltage across the load= ',vL,' V\n')
i4=vL/R2;
print"%s %.2f %s"%('\ni4= ',i4,' mA\n')
i3=i4+iL;
print"%s %.2f %s"%('\ni3= ',i3,' mA\n')
Vo=i3*R3+vL;
print"%s %.2f %s"%('\noutput voltage= ',Vo,' V\n')
i1=Vt/R1;
i2=i1;
print"%s %.2f %s"%('\ni1= ',i1,' mA\n')
print"%s %.2f %s"%('\ni2= ',i2,' mA\n')
load current=  5.00  mA


voltage across the load=  0.50  V


i4=  0.50  mA


i3=  5.50  mA


output voltage=  6.00  V


i1=  -0.50  mA


i2=  -0.50  mA

Ex9-pg552

In [1]:
import math
import numpy
import scipy
from scipy import integrate
 
##Example 9.9
##Vo=(-1/R1*C2)*integrate((-1)dt) 
def fun(x):
    y=-1
    return y
Vo=10.;
I=scipy.integrate.quad(fun, 0, 1);
I1=I[0]
##let y=R1*C2
y1=I1/Vo;
print"%s %.2f %s"%('\nR1C2= ',y1,' ms\n')
R1C2=  -0.10  ms