#finding voltage
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Rf=1;
Ri=10;
Vi=0;
Ip=500;
#calculation
Vrf=Ip*Rf;
#result
print "output voltage is",round(Vrf,2), "mV"
#finding frequency
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vi=300.0;
P=35.0;
R=8.0;
S=10000.0;
fh=20.0;
#calculation
Vl=(P*R)**.5;
Vp=Vl*2**.5;
Il=Vl/R;
f=S/(2*pi*Vp);
Ao=Vl/Vi;
G=Ao*fh;
#result
print "frequency of OPA548 is",round(f,2), "KHz"
print "slew rate of OPA548 is",round(G,2), "Mhz"
print('the OPA548 can be used')
#finding power
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Rl=10.0;
V=12.0;
Vl=5.0;
#calculation
Pl=Vl**2/Rl;
I=Vl/Rl;
Ps=V*I;
Pic=Ps-Pl;
#result
print "power delivered is",round(Pic,2), "watt"
#finding Vload vs Pic graph
#initialisation of variable
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
Vload=[0.0, 0.2, 0.4, 0.6, 0.8, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 11.4, 11.6, 11.8, 12.0];
Iload=[0.0, 0.0, 0.0, 0.1, 0.1, 0.5, 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.6, 0.6, 1.1, 1.2, 1.2, 1.2];
Pload=[0.00, 0.00, 0.02, 0.04, 0.06, 2.30, 2.50, 2.70, 2.92, 3.14, 3.36, 3.60, 3.84, 4.10, 13.00, 13.46, 13.92, 14.40];
Ps=[0.00, 0.24, 0.48, 0.72, 0.96, 5.76, 6.00, 6.24, 6.48, 6.72, 6.96, 7.20, 7.44, 7.68, 13.68, 13.92, 14.16, 14.40];
Pic=[0.00, 0.24, 0.46, 0.68, 0.90, 3.46, 3.50, 3.54, 3.56, 3.58, 3.60, 3.60, 3.60, 3.58, 0.68, 0.46, 0.24, 0.00];
#result
print('Vload Iload Pload Ps Pic');
for i in range(0,18):
print Vload[i]," ",Iload[i]," ",Pload[i]," ",Ps[i]," ", Pic[i]
plt.plot(Vload,Pic);
plt.xlabel('load voltage (V)')
plt.ylabel('IC Power(W)')
plt.title('load voltage vs IC Power')
plt.show()
#finding different power and current
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=12.0;
Vp=5.0;
R=10.0;
#calculation
Ip=Vp/R;
Il=Ip/2**.5;
Pl=(Vp*Ip)/2;
Id=Ip/pi;
Pt=2*V*Ip/pi;
Pic=Pt-Pl;
#result
print "IC power is",round(Pic,2), "W"
print "total power is",round(Pt,2), "W"
print "dc supply current is",round(Id*1000,3), "mA"
print "power delivered is",round(Pl,2), "watt"
#finding thermal resistance
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Ts=40.0;
P=2.92;
Qj=2.5;
Qc=2.0;
Tj=125.0;
#calculation
Qs=(Tj-Ts)/P-Qj-Qc;
#result
print "thermal resistance is",round(Qs,2),"C/W"
#finding power
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=24.0;
R=10.0;
Qs=4.0;
Tj=125.0;
Ta=40.0;
Qj=2.5;
Qc=2.0;
Vload=[9.4, 9.6];
Iload=[.94, .96];
Pload=[4.42, 4.61];
Ps=[14.36, 14.67];
Pic=[9.94, 10.06];
#calculation
P=(Tj-Ta)/(Qj+Qc+Qs);
#result
print('Vload Iload Pload Ps Pic');
for i in range(0,2):
print Vload[i]," ",Iload[i]," ",Pload[i]," ",Ps[i]," ", Pic[i]
print round(P,2),"power delivered by IC in watt"
#finding current and voltage
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Rf=22.0;
Ri=1.0;
Rs=15.0;
I=4.75;
Rc=4.0;
Vp=2.0;
Rl=8.0;
Im=4.0;
#calculation
Av=1+(Rf/Ri);
Il=(Rs*I)/(Rc+13.75);
Vo=Vp*Av;
V=Im*Rl;
#result
print "gain is",round(Av,2)
print "limit current is",round(Il,2), "A"
print "output voltage is",round(Vo,2), "V"
print "maximum output voltage is",round(V,2), "V"
#finding loudness
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
D=8.0;
d=1.0;
I=90.0;
#calculation
Is=20*log(d/D,10);
Ir=I-Is;
#result
print "loudness ofsound is",round(Ir,2), "dB"
#finding power
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
D=1.0;
I1=108.0;
I2=95.0;
P=1.0;
#calculation
I=I1-I2;
Pr=P*10**(I/10);
#result
print "power provided is",round(Pr,2), "watt"
#finding output voltage and gain
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
P=20;
R=8;
Vi=1.23;
#calculation
V=(P*R)**.5;
G=V/Vi;
#result
print "output voltage is",round(V,2), "V"
print "gain is",round(G,2)
#finding resistor and capacitor
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
G=40.0;
f=80.0;
R1=15000.0;
R2=150.0;
#calculation
R=2*(R1/G)-R2;
R11=620;
C=1/(2*pi*f*R11/7);
#result
print "resistor b/w pins 1&8 is",round(R,2),"ohm"
print('thus pick a 620 ohm resistor')
print "capacitor b/w pins 1&8 is",round(C*1e6,2), "microF"
print('thus pick a 27 microF capacitor')
#finding thermal resistance and power
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
R=8.0#resistance
V=5.0#voltage
Tm=150.0#temperature
Ta=50.0#temperature
Qa=107.0;
Qc=37.0;
Ps=299.0;
#calculation
Vd=V/2;
Vm=V-1;
Vp=Vm-Vd;
Vr=Vp/2**.5;
Pl=1000*Vr**2/R;
Pl=140;
Pic=Ps-Pl;
Q=(Tm-Ta)/Pic;
#result
print "power dissipated is",round(Pl,2), "mW"
print "thermal resistance is",round(Q*1000,2),"degree C/W"
#finding power delivered
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
R=8.0#resistance
V=5.0#voltage
#calculation
Vl=V-1;
Vp=Vl-1;
Vr=Vp/2**.5;
P=Vr**2/R;
#result
print "power deliverd is",round(P*1000,2), "mwatt"
#finding thermal resistance and power
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,log
R=8.0#resistance
Ts=35.0#temperature
Ta=150.0#temperature
Vm=42.0#voltage
#calcuation
Vp=Vm-5;
Vr=Vp/2**.5;
Pm=Vr**2/R;
P=45;
Qs=(Ta-Ts)/P-1.2;
#result
print "power delivered is",round(Pm,2), "watt"
print "thermal resistance is",round(round(Qs*10)/10,2), "degreeC/W"