diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3682/CH4 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3682/CH4')
-rw-r--r-- | 3682/CH4/EX4.1/Ex4_1.sce | 18 | ||||
-rw-r--r-- | 3682/CH4/EX4.2/Ex4_2.sce | 38 | ||||
-rw-r--r-- | 3682/CH4/EX4.3/Ex4_3.sce | 59 | ||||
-rw-r--r-- | 3682/CH4/EX4.4/Ex4_4.sce | 80 | ||||
-rw-r--r-- | 3682/CH4/EX4.5/Ex4_5.sce | 31 | ||||
-rw-r--r-- | 3682/CH4/EX4.6/Ex4_6.sce | 21 | ||||
-rw-r--r-- | 3682/CH4/EX4.7/Ex4_7.sce | 23 | ||||
-rw-r--r-- | 3682/CH4/EX4.8/Ex4_8.sce | 19 | ||||
-rw-r--r-- | 3682/CH4/EX4.9/Ex4_9.sce | 19 |
9 files changed, 308 insertions, 0 deletions
diff --git a/3682/CH4/EX4.1/Ex4_1.sce b/3682/CH4/EX4.1/Ex4_1.sce new file mode 100644 index 000000000..9820129f7 --- /dev/null +++ b/3682/CH4/EX4.1/Ex4_1.sce @@ -0,0 +1,18 @@ +// Exa 4.1
+
+clc;
+clear;
+
+// Given data
+
+// To design an adder circuit as shown in Fig. 4.2(a)
+// Vo = -(0.1*V1+V2+10*V3);
+// V1,V2,V3 are the inputs
+
+// Solution
+
+printf(' The output in Fig. 4.2(a) is - \n Vo = -[(Rf/R1)*V1 + (Rf/R2)*V2 + (Rf/R3)*V3].');
+printf('\n The desired output is -\n Vo = [(0.1)*V1 + (1)*V2 + (10)*V3].');
+printf('\n\n Comparing above two equations,');
+printf('\n We can say, Let Rf = 10 kΩ, R1 = 100 kΩ and R2 = 10 kΩ and R3 = 1 kΩ.\n');
+printf('\n Thus, the desired output expression is obtained.');
diff --git a/3682/CH4/EX4.2/Ex4_2.sce b/3682/CH4/EX4.2/Ex4_2.sce new file mode 100644 index 000000000..7d389fe27 --- /dev/null +++ b/3682/CH4/EX4.2/Ex4_2.sce @@ -0,0 +1,38 @@ +// Exa 4.2
+
+clc;
+clear;
+
+// Given data
+
+// Added-subtractor as shown in fig. 4.4(a).
+R1=40*10^3; // Ω
+R2=25*10^3; // Ω
+R3=10*10^3; // Ω
+R4=20*10^3; // Ω
+R5=30*10^3; // Ω
+Rf=50*10^3; // Ω
+V1=2; // Volts
+V2=3; // Volts
+V3=4; // Volts
+V4=5; // Volts
+
+// Solution
+
+printf('The negative sum is obtained by setting V3=V4=0. Thus,\n ');
+ Vo1=-(Rf/R1)*V1-(Rf/R2)*V2;
+printf(' Vo1 = %.1f Volts. \n ',Vo1);
+printf('\n Now set V1=V2=0 to find the output voltage due to V3 and V4. \n The voltage Vo2 at the positive terminal due to V3 and V4 can be found by using superposition theorem as shown in Fig. 4.4(b) as \n ');
+
+Rllel=( 1/R4 + 1/R5)^-1;
+Rllel1=(1/R3+1/R5)^-1;
+Vo2= (Rllel/(R3+Rllel))*V3+ (Rllel1/(Rllel1+R4))*V4;
+printf(' Vo2 = %.3f Volts. \n ',Vo2 );
+printf('\n The output voltage Vo3 due to V3 and V4 now can be determined from the equivalent circuit of Fig. 4.4(c) as \n ');
+Rllel2=(1/R1+1/R2)^-1;
+Vo3=(1+(Rf/Rllel2))*Vo2;
+printf(' Vo3 = %.3f Volts. \n ',Vo3);
+printf('\n The total output voltage V0 is given as sum of Vo1 + Vo3.\n ');
+Vout=Vo1+Vo3;
+printf(' The output voltage = %.3f Volts. \n ',Vout);
+printf('\n\n The equivalent circuit at various in between steps are shown in Fig. 4.4(b-c).');
diff --git a/3682/CH4/EX4.3/Ex4_3.sce b/3682/CH4/EX4.3/Ex4_3.sce new file mode 100644 index 000000000..28d325d92 --- /dev/null +++ b/3682/CH4/EX4.3/Ex4_3.sce @@ -0,0 +1,59 @@ +// Exa 4.3
+
+clc;
+clear;
+
+// Given data
+
+// An op-amp differentiator
+fa = 100; // Hz
+Vpp = 1; // Volts
+
+// Solution
+
+printf('Select, Fa = fmax = 100 Hz.\n');
+printf(' Let, C1 = 0.1 µF.\n');
+C1 = 0.1*10^-6; // Farads
+// since Fa = 1/(2*%pi*Rf*C1);
+// Therefore,
+Rf = 1/(2*%pi*fa*C1);
+printf(' Therefore, the calculated value of Rf = %.1f kΩ. \n',Rf/1000);
+
+printf(' Select, fb = 10*Fa = 1000 Hz.\n');
+fb = 1000; // Hz
+// Therefore
+R1 = 1/(2*%pi*fb*C1);
+printf(' The calculated value of R1 = %.2f kΩ. \n',R1/1000);
+// Since, RfCf = R1C1
+// Therefore we get,
+Cf = R1*C1/Rf;
+printf(' The calculated value of Cf = %.2f µF. \n',Cf*10^6);
+
+printf('\n\n For a sinusoidal input - \n\n');
+disp("since, vi = sin(2*%pi*100*t), ");
+disp("From Eq. 4.69, vo = -Rf*C1* d/dt(vi), ");
+disp("Above equation yield following result once solved- vo = -cos(2*%pi*100*t).");
+printf('\n The input and output waveforms are shown in Graphic window 0 ans 1 respectively. \n\n');
+// plotting wave forms
+
+t = [0:%pi:13*%pi];
+figure(0);
+
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+plot2d(t,sin(2*%pi*100*t));
+title('Sine-wave-input',"color","Red","fontsize",3);
+figure(1);
+
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+plot2d(t,-cos(2*%pi*100*t));
+title('Cosine-wave-output',"color","blue","fontsize",3);
+
+printf('\n For a square wave input -\n\n');
+printf('\n For a square wave input, say 1 V peak and 1 KHz,\n The output waveform will consist of positive and negative spikes of magnitude Vsat\n which is approximately 13 V for ± 15 V op-amp power supply.\n\n');
+printf(' During the timeperiods for which input is constant at ± 1V, the differentiated output will be zero. \n However, when input transits between ±1V levels, \n the slope of the input is infinite for an ideal square wave. \n\n The output, therefore, gets clipped to about ± 13V for a ± 15 V op-amp power supply.');
+
+printf('\n\n The output of a square wave input is a spike output as shown in Fig. 4.22(b). \n');
diff --git a/3682/CH4/EX4.4/Ex4_4.sce b/3682/CH4/EX4.4/Ex4_4.sce new file mode 100644 index 000000000..3956686b7 --- /dev/null +++ b/3682/CH4/EX4.4/Ex4_4.sce @@ -0,0 +1,80 @@ +// Exa 4.4
+
+clc;
+clear;
+
+// Given data
+
+// Refering integrator circuit in Fig. 4.23(c)
+R1 = 10*1000; // Ω
+Rf = 100*10^3; // Ω
+Cf = 10*10^-9; // Farads
+
+
+// Solution
+
+printf('For the given component values, the lower frequency limit of integration fa is ');
+fa = 1/(2*%pi*Rf*Cf);
+printf('%d Hz \n\n',fa);
+printf(' For 99 percent accuracy, the input frequency should be at least one decade above fa. \n However, there is an limit up to which circuit will integrate and is determined by the frequency response of op-amp.\n However, as input frequency is increased, the output amplitude reduces as the gain of the integration falls\n at a rate of 6 dB/octave.\n\n' );
+
+// case(1): Sine wave input
+printf(' case(1) : For sine Wave Input \n');
+printf('\n\n For a input of 1 V peak sine wave at 5 kHz, the integral of vi(t)=1*sin(2*pi*5000*t) is cosine function.\n');
+t1 = 0:%pi:100*%pi;
+disp("Input Function - vi = sin(2*%pi*5000*t);");
+disp("Output Function - vo = 0.318*cos(2*%pi*5000*t);");
+printf(' The input and output waveforms are depicted in Graphic window # 0\n');
+
+vi = sin(2*%pi*5000*t1); // Input
+vo = 0.318*cos(2*%pi*5000*t1); // Output
+
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+plot(t1,vi,'ro-');
+plot(t1,vo,'o-b');
+legend(["Input Function","Output Function"]);
+xlabel("time ");
+ylabel("Vi,Vo");
+title("Sine wave plot");
+
+// case(2): Step input
+printf('\n\n case(2) : Step input\n');
+printf('\n\n If input is a step voltage vi = 1V for 0<t<=0.3msec, then the output voltage at t = 0.3 ms is ');
+vos = (-1/(R1*Cf))*integrate('1','x',0,0.3*10^-3);
+printf('%d V \n',vos);
+printf('\n The output voltage is a ramp function with a slope of 10V/ms and is shown in graphic window #1\n');
+yi = [1,1,1,1,1,1,1,1,1,1,1];
+t2 = 0:0.1:1; // time in milli sec
+yo = -10*t2;
+figure(1);
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+plot(t2,yi,'ro-');
+plot(t2,yo,'o-b');
+legend(["Input Function","Output Function"]);
+xlabel("Time in millisec");
+ylabel("Vi,Vo");
+title("Step plot");
+
+// case(3): square wave input
+printf('\n\n case(3): Square wave input \n');
+printf('\n\n The output waveform for an input of 5 kHz, 1 V peak square wave. \n It can be seen that input is of constant amplitude of 1 V from 0 to 0.1 msec and -1 V from 0.1 ms to 0.2 ms.\n Thus, the expected output waveform will be a triangular wave.');
+vosq = -(1/(R1*Cf))*integrate('1','x',0,0.1*10^-3);
+printf('\n The peak value of the output for first half cycle is %.1f V \n',vosq);
+printf('\n Both input and output waveforms are depicted in graphic window #3\n');
+t3 = 0:0.1*10^-3:10^-3;
+zi = [1,-1,1,-1,1,-1,1,-1,1,-1,1];
+zo = [0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5];
+figure(2);
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+plot2d2(t3,zi,2);
+plot2d(t3,zo,4);
+legend(["Input Function","Output Function"]);
+xlabel("Time in sec");
+ylabel("Vi,Vo");
+title("Square wave plot");
diff --git a/3682/CH4/EX4.5/Ex4_5.sce b/3682/CH4/EX4.5/Ex4_5.sce new file mode 100644 index 000000000..ebc5a17ab --- /dev/null +++ b/3682/CH4/EX4.5/Ex4_5.sce @@ -0,0 +1,31 @@ +// Exa 4.5
+
+clc;
+clear;
+
+// Given data
+
+App = 20; // peak gain in dB
+A = 17; // Actual gain in dB
+w = 10000; // Angular Frequancy in rad/sec
+C = 0.01*10^-6; // Farads
+
+// Solution
+
+printf('From Eq.(4.84) , we see that gain is at its peak when w = 0.\n Therefore, 20*log(Rf/R1) = 20.\n');
+
+// Therefore,
+// Rf = 10 R1; ............Eq. (1)
+z = 10; // z is ratio of Rf/R1
+printf(' i.e Rf/R1 = %d. \n',z );
+printf(' At w = 10^4 rad/sec, gain in dB is down from its peak of 20 dB. \n Therefore, convering gain to dB in Eq.(4.84) and sub situting for w,C, and Rf/R1 we can get value of Rf.\n\n');
+// 20*log10 10 = 17 dB
+ // --------------------------
+ // sqrt(1 + [10^4*10^-8*Rf]^2)
+
+deff('y=f(x)','y = 20*log10( 10 / sqrt(1+[10^-4*x]^2))-17');// x is Rf(Ω)
+ [x,v,info] = fsolve(10,f);
+ printf(' The calculated value of Rf is %d Ω. Rounding off to nearest possible value i.e 10 kΩ. \n',x);
+ Rf = 10000; // Ω
+ printf(' Since we have ratio of Rf by R1 so, \n The value of R1 can be given as R1 = %d kΩ. \n',0.1*(Rf/1000)); //as R1/Rf = 0.1
+
diff --git a/3682/CH4/EX4.6/Ex4_6.sce b/3682/CH4/EX4.6/Ex4_6.sce new file mode 100644 index 000000000..fadae8942 --- /dev/null +++ b/3682/CH4/EX4.6/Ex4_6.sce @@ -0,0 +1,21 @@ +// Exa 4.6
+
+clc;
+clear;
+
+// Given data
+
+//Referring circuit in Fig. 4.26
+// An op amp integrator and a low pass Rc circuit)
+
+// Solution
+
+printf(' Figure (4.26) is a simple op-amp integrator where Millers theorem is applied across the feedback capacitor Cf. \n The input time constant T = R1*Cf*(1-Av). \n Therefore, vi = V*(1-e^(-t/T));');
+printf(' \n Therefore, vo = Av*Vi = Av* V*(1-e^(-t/R1*Cf*(1-Av))); ');
+printf(' \n By expanding e^(-t/..) series by Taylors Expansion method we will reach to following approximation');
+printf('\n vo ≈ (-V*t/R1*Cf) * [1- t/(2*R1*Cf*(1-Av))]; if Av>>1 ...eq (1) ');
+printf('\n\n');
+printf(' Also, we know that for a low pass RC integrating circuit network(without op-amp) the output vo for a step input of V becomes \n');
+printf(' For a large Rc, vo ≈ (V*t)/R*C) * (1 - t/(2*R*C) .. eq(2)'); //Eq(2)
+printf('\n\n');
+printf(' It can be seen that the output voltages of both circuits varies aproximately linearly with time(for large RC) and \n for either case, derivative(vo) = V/RC. \n However, the second term in both the expression represent deviation from the linearity. \n we see that op-amp integrator is more linear than the simple RC circuit by a factor of 1/(1-Av).\n');
diff --git a/3682/CH4/EX4.7/Ex4_7.sce b/3682/CH4/EX4.7/Ex4_7.sce new file mode 100644 index 000000000..60e6d13f3 --- /dev/null +++ b/3682/CH4/EX4.7/Ex4_7.sce @@ -0,0 +1,23 @@ +// Exa 4.7
+
+clc;
+clear;
+
+// Given data
+
+// Referring Circuit in Fig. 4.27
+
+// Solution
+
+printf(' The transfer gain of the cirucuit is - \n');
+printf(' Vo(s) = -Zf = (R2+R3)+s*C*R2*R3 \n');
+printf(' ---- ---- -----------------\n');
+printf(' Vi(s) = R1 = R1*(1+s*C*R3)\n');
+
+printf('\n i.e R1(1+s*C*R3)*Vo(s)+[(R2+R3)+s*C*R2*R3]*Vi(s) = 0.\n');
+printf('\n\n Writing above equation in time domain (s→d/dt), we get,\n');
+printf('\n R1 + C*R3*R1(d/dt Vo(t))+ [(R2+R3)+c*R2*R3]*(d/dt Vi(t)) = 0 ...eq(1)\n\n');
+
+printf(' Since, vi(t) = V, \n Therefore, d/dt Vi(t) = 0.\n\n');
+printf(' Therefore eq(1) becomes- \n C*(d/dt vo) + vo/R3 + V/R1 + (R2/R1*R3)*V = 0.\n');
+printf(' \n Thus, output vo(t) is given by a differential equation as shown above. \n');
diff --git a/3682/CH4/EX4.8/Ex4_8.sce b/3682/CH4/EX4.8/Ex4_8.sce new file mode 100644 index 000000000..ca36731f0 --- /dev/null +++ b/3682/CH4/EX4.8/Ex4_8.sce @@ -0,0 +1,19 @@ +// Exa 4.8
+
+clc;
+clear;
+
+// Given data
+
+// Referring Fig. (4.28) -Non- inverting terminal integrator
+
+// Solution
+
+printf(' The voltage at the (+) input terminal of the op-amp due to potential divider is,\n');
+printf(' V(+) = 1/ s*C * Vi(s)\n');
+printf(' ----------\n');
+printf(' R+ 1/ s*C \n\n');
+printf(' The output voltage Vo(s) fot the non-inverting amplifier is - \n');
+printf(' Vo(s) = (1 + 1/(s*C*R))*V(+) = Vi(s) / (s*R*C)).\n\n');
+printf(' Hence in time domain, we get, vo = (1/(R*C)) ∫ vi dt .\n');
+printf(' Hence proved. \n');
diff --git a/3682/CH4/EX4.9/Ex4_9.sce b/3682/CH4/EX4.9/Ex4_9.sce new file mode 100644 index 000000000..f7d26fe77 --- /dev/null +++ b/3682/CH4/EX4.9/Ex4_9.sce @@ -0,0 +1,19 @@ +// Exa 4.9
+
+clc;
+clear;
+
+// Given data
+
+// To generate a sinusoidal signal 10 sin 3t.
+
+// Solution
+
+printf('Let us first obtain a differential equation whose solution is 10 sin 3t.\n');
+printf(' Let x(t) = 10 sin 3t ------eq(1)\n');
+printf(' The first derivative of this i.e. dx(t) = 30 cos 3t ----eq(2)\n');
+printf(' The second derivative of this i.e. d2x(t) = -90 sin 3t = -9*x(t) \n');
+printf('\n Therefore, required differential equation is d2x(t)+9*x(t)=0. \n\n');
+
+printf(' The initial condition is obtained by putting t=0 in eq(1&2), \n x(0)=0 and dx(0) = 30. \n' );
+printf(' Assuming that d2x(t) is available, x(t) can be obtained by integrating x twice.\n The complete setup is shown in Fig. 4.31-Simulation of 10 sin 3t.\n');
|