summaryrefslogtreecommitdiff
path: root/Basic_Electronics_by_R_K_Garg/6-Operational_Amplifiers.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Basic_Electronics_by_R_K_Garg/6-Operational_Amplifiers.ipynb')
-rw-r--r--Basic_Electronics_by_R_K_Garg/6-Operational_Amplifiers.ipynb1108
1 files changed, 1108 insertions, 0 deletions
diff --git a/Basic_Electronics_by_R_K_Garg/6-Operational_Amplifiers.ipynb b/Basic_Electronics_by_R_K_Garg/6-Operational_Amplifiers.ipynb
new file mode 100644
index 0000000..a964b3c
--- /dev/null
+++ b/Basic_Electronics_by_R_K_Garg/6-Operational_Amplifiers.ipynb
@@ -0,0 +1,1108 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: Operational Amplifiers"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.10: R1_and_Rf.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.10\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Ao = 10;\n",
+"// Ao = (1+(R_F/R1));\n",
+"//Given that maximum value of resistor should not exceed 30 kΩ, so we select\n",
+"R_F= 27;// in k ohm\n",
+"R1= R_F/(Ao-1);// in k ohm\n",
+"disp(R_F,'The value of R_F in k ohm is');\n",
+"disp(R1,'The value of R1 in k ohm is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.11: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.11\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Va = 0.2;// in V\n",
+"Vb = -0.5;// in V\n",
+"Vc = 0.8;// in V\n",
+"Ra = 33;// in k ohm\n",
+"Rb = 22;// in k ohm\n",
+"Rc = 11;// in k ohm\n",
+"R_F = 66;// in k ohm\n",
+"// Using Superposition theorm, the output voltage\n",
+"Vo = (-((R_F/Ra)*Va)) -(((R_F/Rb)*Vb)) -(((R_F/Rc)*Vc));// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.13: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.13\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Va = 6;// in V\n",
+"Vb = -3;// in V\n",
+"Vc = -0.75;// in V\n",
+"Ra = 10;// in k ohm\n",
+"Rb = 2.5;// in k ohm\n",
+"Rc = 4;// in k ohm\n",
+"R_F = 10;// in k ohm\n",
+"// The output voltage \n",
+"Vo = (-((R_F/Ra)*Va)) -(((R_F/Rb)*Vb)) -(((R_F/Rc)*Vc));// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.14: Closed_loop_differential_gain_and_output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.14\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 100;// in ohm\n",
+"R2 = R1;// in ohm\n",
+"R3 = 3.9;// in k ohm\n",
+"R3 = R3 * 10^3;// in ohm\n",
+"R_F = R3;// in ohm\n",
+"Vx = -3.2;// in V\n",
+"Vy = -3;// in V\n",
+"// output voltage due to Vx, Vox = -(R_F/R1)*Vx and due to Vy, Voy = (R3/(R2+R3)) * (1+(R_F/R1))*Vy\n",
+"// Vo = Vox + Voy = -(R_F/R1)*Vx + (R_F/R1)*Vy (as R1=R2 and R3=Rf)\n",
+"//So, Aod = Vo/(Vx-Vy) = -R_F/R1;\n",
+"Aod = -R_F/R1;\n",
+"disp(Aod,'The closed loop differential gain is');\n",
+"Vo = (-R_F/R1)*(Vx-Vy);// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1: Common_mode_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.1\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"CMRR = 10^5;\n",
+"Ad = 10^5;\n",
+"// CMRR = Ad/A_CM;\n",
+"// The common mode gain of the op-amp \n",
+"A_CM = Ad/CMRR;\n",
+"disp(A_CM,'The common mode gain of the op-amp is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2: Slew_rate.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.2\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"del_V = 20;//change in voltage in V\n",
+"del_t = 4;//change in time in µS\n",
+"SR = del_V/del_t;//slew rate in V/µS\n",
+"disp(SR,'The slew rate in V/µS is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.3: Slew_rate.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.3\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"del_V = 0.75;//chagne in voltage in V\n",
+"del_t = 50;//change in time in ns\n",
+"// The slew rate \n",
+"SR = del_V/(del_t*10^-3);// in µs\n",
+"disp(SR,'The slew rate in V/µ-sec is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4: Closed_loop_voltage_gain_and_input_impedance.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.4\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 1;// in k ohm\n",
+"R_F = 4.7;// in k ohm\n",
+"//The closed loop voltage gain, Ao = Vo/Vin = -R_F/R1;\n",
+"Ao = -R_F/R1;\n",
+"disp(Ao,'The closed loop voltage gain is');\n",
+"// The input impedance \n",
+"Ri = R1;// in k ohm\n",
+"disp(Ri,'The input impedance in k ohm is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.5: R1_and_R2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.5\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Ao = -20;\n",
+"Ri = 5;// in k ohm\n",
+"R1 = Ri;// in k ohm\n",
+"disp(R1,'The value of R1 in k ohm is');\n",
+"// Closed loop voltage gain for inverting amplifier, Ao = -R_F/R1 or\n",
+"R_F = -Ao*R1;// in k ohm\n",
+"disp(R_F,'The value of R_F in k ohm is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.6: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.6\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 20;// in k ohm\n",
+"R_F = 300;// in k ohm\n",
+"Vin = 1.25;// in V\n",
+"// Ao = Vo/Vin = -R_F/R1;\n",
+"Ao = -R_F/R1;\n",
+"// Output voltage,\n",
+"Vo = Ao*Vin;// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.7: R1_and_Rf.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.7\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Ao = -4;// in V/V\n",
+"R_T= 100;// total resistance in k ohm\n",
+"// R1+R_F= R_T (i)\n",
+"// Ao= -R_F/R1 (ii)\n",
+"R_F= R_T/(1-1/Ao);// in k ohm (From eq (i) and (ii))\n",
+"R1= -R_F/Ao;// in k ohm\n",
+"disp(R1,'The value of R1 in k ohm is');\n",
+"disp(R_F,'The value of R_F in k ohm is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.8\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 15;// in k ohm\n",
+"R_F = 450;// in k ohm\n",
+"Vin = -0.25;// in V\n",
+"// Vo = Ao*Vin\n",
+"Vo = (1+R_F/R1)*abs(Vin);// in V (on putting, Ao = 1+(R_F/R1))\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.9: R1_and_Rf.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 6.9\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Ao = 1.5;// in V/V\n",
+"R = 10;// in k ohm\n",
+"// Ao = (1+(R_F/R1))\n",
+"disp('The relation of R1 and R_F can be implemented in two ways : ');\n",
+"disp('(i) : When R_F= R || R, in this condition')\n",
+"// When R_F= R || R\n",
+"R1= R;//in k ohm\n",
+"R_F= R1*(Ao-1);// in k ohm\n",
+"disp(R1,'The value of R1 in k ohm is : ');\n",
+"disp(R_F,'The value of R_F in k ohm is : ')\n",
+"// When both resistor connected in series\n",
+"disp('(ii) : When both resistor connected in series, in this condition')\n",
+"R1= 2*R;// in k ohm\n",
+"R_F= R1*(Ao-1);// in k ohm\n",
+"disp(R1,'The value of R1 in k ohm is : ');\n",
+"disp(R_F,'The value of R_F in k ohm is : ')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_10: Voltage_produced_at_output_terminal.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.10\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R_F = 60;// in ko hm\n",
+"R1 = 20;// in k ohm\n",
+"Vin1 = 2;// in V\n",
+"Vin2 = 0.1;// in V\n",
+"// The output voltage, by using super position theorm,\n",
+"Vo = ((-R_F/R1)*Vin1) + ((1+(R_F/R1))*Vin2);// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_11: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.11\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 10;// in k ohm\n",
+"R2 = 20;// in k ohm\n",
+"R3 = 10;// in k ohm\n",
+"R_F = 20;// in k ohm\n",
+"Vin1 = 2;// in V\n",
+"Vin2 = 1;// in V\n",
+"// The output voltage,\n",
+"Vo = ((-R_F/R1)*Vin1) - ((R_F/R2)*Vin2);// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_12: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.12\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R_F = 20;// in k ohm\n",
+"R1 = 10;// in k ohm\n",
+"R2 = 20;// in k ohm\n",
+"Vin1 = 2;// in V\n",
+"Vin2 = 2;// in V\n",
+"Vin3 = 2;// in V\n",
+"// The output voltage, by using super position theorm,\n",
+"Vo = ((-R_F/R1)*Vin1) + (-Vin2*R_F/R2+Vin2) + ((R_F/(((R1*R2)/(R1+R2))))*Vin3);// in V\n",
+"disp(Vo,'The voltage is appeared at the output terminal in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_13: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.13\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 20;// in k ohm\n",
+"R3 = 10;// in k ohm\n",
+"R2 = R3;// in k ohm\n",
+"R_F = 20;// in k ohm\n",
+"Vin1 = 2;// in V\n",
+"Vin2 = 2.1;// in V\n",
+"// The input voltage at non-inverting terminal,\n",
+"V_A = (R2*Vin2)/R1;// in V\n",
+"// The output voltage, by using super position theorm,\n",
+"Vo = ((-R_F/R1)*Vin1) + ((1+(R_F/R1))*(R1/(R2+R3))*V_A);// in V\n",
+"disp(Vo,'The output voltage in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_15: Maximum_loop_voltage_gai.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.15\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"//Output voltage of the amplifier, Vo = (1+(Rf/Rin))*Vin and voltage gain, Av = Vo/Vin = 1+(Rf/Rin)\n",
+"Rf = 0;\n",
+"Rin = 2;// in k ohm\n",
+"Avmin = 1+(Rf/Rin);\n",
+"Rf = 100;// in k ohm\n",
+"// The maximum loop voltage gain \n",
+"Avmax = 1+(Rf/Rin);\n",
+"disp(Avmax,'The maximum loop voltage gain is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_18: Output_voltage_and_percentage_error_due_to_common_mode.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.18\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"Ad = 5*10^5;// differential mode gain\n",
+"CMRR = 80;// in dB\n",
+"A_CM = Ad/(10^(CMRR/20));// common mode gain\n",
+"V1 = 745;// in µV\n",
+"V1 = V1 * 10^-6;// in V\n",
+"V2 = 740;// in µV\n",
+"V2 = V2 * 10^-6;// in V\n",
+"// CMRR = 20*log( Ad/A_CM );\n",
+"// //output voltage in differential mode gain\n",
+"Vod = Ad*(V1-V2);// in V\n",
+"disp(Vod,'The output voltage in differential mode gain in volts is : ')\n",
+"//output voltage due to common mode gain \n",
+"Vo_CM = A_CM*((V1+V2)/2);//in V\n",
+"disp(Vo_CM,'The output voltage due to common mode gain in volts is : ')\n",
+"Pr = (Vo_CM/Vod)*100;// percentage error in %\n",
+"disp(Pr,'The percentage error due to common mode in % is')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_19: Input_impedance_voltage_gain_and_power_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.19\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 1;// in Mohm\n",
+"// The input impedance \n",
+"Rin = R1;// in Mohm\n",
+"disp(Rin,'The input impedance in Mohm is');\n",
+"R2 = 1;// in Mohm\n",
+"// The voltage gain \n",
+"Avf = -R2/R1;// Voltage gain\n",
+"disp(Avf,'The voltage gain is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_1: CMRR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.1\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('e',8)\n",
+"// Given data\n",
+"Vid = 1;// in mV\n",
+"Vo = 120;// in mV\n",
+"V_CM = 1;// in mV\n",
+"Ad = Vo/Vid;\n",
+"Vo = 20;// in µV\n",
+"Vo = Vo * 10^-3;// in mV\n",
+"A_CM = Vo/V_CM;\n",
+"Vo = 120;// in mV\n",
+"// The value of CMRR for the circuit \n",
+"CMRR = Vo/A_CM;\n",
+"disp(CMRR,'The value of CMRR for the circuit is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_21: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.21\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"i1 = 1;//input current for first op-amp in mA\n",
+"i1 = i1 * 10^-3;// in A\n",
+"R_F = 1;// in k ohm\n",
+"R_F = R_F * 10^3;// in ohm\n",
+"// Output voltage at first op-amp stage\n",
+"Vo = -i1*R_F;// in V\n",
+"R1 = 10;// in k ohm\n",
+"R2 = 1;// in k ohm\n",
+"// The output voltage,\n",
+"Vg1 = Vo*(1+(R1/R2));// in V\n",
+"disp(Vg1,'The output volatge in V is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_22: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.22\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R_S3 = 10;// in k ohm\n",
+"R_S2 = R_S3;// in k ohm\n",
+"R_S1 = R_S3;// in k ohm\n",
+"Rf = 10;// in k ohm\n",
+"Vs1 = 0.2;// in V\n",
+"Vs2 = 0.5;// in V\n",
+"Vs3 = 0.8;// in V\n",
+"// I = I1+6I2+I3;\n",
+"// I = (Vs1/R_S1) + (Vs2/R_S2) + (Vs3/R_S3);\n",
+"// I = - If;\n",
+"// Vo = -If*Rf;\n",
+"Vo = (Rf/R_S1)*(Vs1+Vs2+Vs3);// in V (as R_S1= R_S2=R_S3)\n",
+"disp(Vo,'The value of Vo in volts is : ');\n",
+"disp('But the supply voltage of 10 V is used, so the op-amp will reach in saturation.');\n",
+"disp('Hence, output voltage is -10 volts.')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_25: Current_through_RL_resistor.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.25\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"//Ratio of R2/R1 = R3/R4 = 4 and R_L = -Vi/R3\n",
+"Vi = 3.7;// in V\n",
+"R3 = 2;// in k ohm\n",
+"R3 = R3 * 10^3;// in ohm\n",
+"// The current through R_L,\n",
+"I_L = -Vi/R3;// in A\n",
+"I_L= I_L*10^3;// in mA\n",
+"disp(I_L,'The current through R_L in mA is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_2: Closed_loop_gai.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.2\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 10;// in k ohm\n",
+"R_F = 1000;// in k ohm\n",
+"// Vin/R1 = -Vo/R_F and Vo/Vin = Ao = -R_F/R1\n",
+"Ao = abs(-R_F/R1);// in k ohm\n",
+"disp(Ao,'The closed loop gain is');\n",
+"Vin = 30;// in mV\n",
+"Vin = Vin * 10^-3;// in V\n",
+"// The output voltage,\n",
+"Vo =-Ao*Vin;// in V\n",
+"disp(Vo,'The output voltage in V is');\n",
+"\n",
+"// Note: The loop gain will be unit less."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_3: Range_of_voltage_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.3\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1min = 10;// in k ohm\n",
+"R1max = 20;// in k ohm\n",
+"R_F = 300;// in k ohm\n",
+"// The closed loop voltage gain corresponding to R1min,\n",
+"Ao_min = -R_F/R1min;\n",
+"// The closed loop voltage gain corresponding to R1max,\n",
+"Ao_max = -R_F/R1max;\n",
+"disp('The range of voltage gain is : '+string(Ao_max)+' to '+string(Ao_min));"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_4: Range_of_output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.4\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R_F = 500;// in k ohm\n",
+"R_desh = 20;// in k ohm\n",
+"Vin = 0.5;// in V\n",
+"Rd_desh = 0;\n",
+"R1min = 20;// in k ohm\n",
+"R1max = 50;// in k ohm\n",
+"// Ao = Vo/Vin = (1+(R_F/R1));\n",
+"Vo_max = Vin*(1+(R_F/R1min));// output voltage corresponding to R1min\n",
+"Vo_min = Vin*(1+(R_F/R1max));// output voltage corresponding to R1max\n",
+"disp('Range of output voltage is : '+string(Vo_min)+' volts to '+string(Vo_max)+' volts.');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_5: Minimum_and_maximum_closed_loop_voltage_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.5\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 2;// in k ohm\n",
+"Rdas = 2;// in k ohm\n",
+"R_Fmin = 2;// in k ohm\n",
+"R_Fmax = 102;// in k ohm\n",
+"// Ao = -R_F/R1;\n",
+"// The minimum closed loop voltage gain \n",
+"Aomin = -R_Fmin/R1;\n",
+"disp(Aomin,'The minimum closed loop voltage gain is');\n",
+"//The maximum closed loop voltage gain \n",
+"Aomax = -R_Fmax/R1;\n",
+"disp(Aomax,'The maximum closed loop voltage gain is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_6: Maximum_and_minimum_closed_loop_voltage_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.6\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R1 = 10;// in k ohm\n",
+"R_F = 0;\n",
+"// Ao = (1+(R_F/R1));\n",
+"// The minimum closed loop voltage gain \n",
+"Aomin = (1+(R_F/R1));\n",
+"disp(Aomin,'The minimum closed loop voltage gain is');\n",
+"R_F = 100;// in k ohm\n",
+"// The maximum closed loop voltage gain \n",
+"Aomax = (1+(R_F/R1));\n",
+"disp(Aomax,'The maximum closed loop voltage gain is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_7: Closed_loop_voltage_gai.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.7\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',7)\n",
+"// Given data\n",
+"R1 = 220;// in ohm\n",
+"R_F = 47;// in k ohm\n",
+"R_F =R_F * 10^3;// in ohm\n",
+"// The closed loop voltage for switch position-1\n",
+"Ao = -R_F/R1;\n",
+"disp(Ao,'The closed loop voltage for switch position-1 is');\n",
+"R_F = 18;// in k ohm\n",
+"R_F = R_F * 10^3;// in ohm\n",
+"// The closed loop voltage for switch position-2\n",
+"Ao = -R_F/R1;\n",
+"disp(Ao,'The closed loop voltage for switch position-2 is');\n",
+"R_F = 39;// in k ohm\n",
+"R_F = R_F * 10^3;// in ohm\n",
+"// The closed loop voltage for switch position-3\n",
+"Ao = -R_F/R1;\n",
+"disp(Ao,'The closed loop voltage for switch position-3 is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_8: Closed_loop_voltage_gai.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.8\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R_F = 120;// in k ohm\n",
+"Rdas1 = 6;// in k ohm\n",
+"Rddas1 = 3;// in k ohm\n",
+"R1 = Rdas1;// in k ohm\n",
+"// For switch position-1 , the closed loop voltage gain,\n",
+"Ao = 1+(R_F/R1);\n",
+"disp(Ao,'The closed loop voltage gain for switch position-1 is : ');\n",
+"R1 = (Rdas1*Rddas1)/(Rdas1+Rddas1);// in k ohm\n",
+"// For switch position-2, the closed loop voltage gain, \n",
+"Ao = 1+(R_F/R1);\n",
+"disp(Ao,'The closed loop voltage gain for switch position-2 is : ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.m_9: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa Misc. 6.9\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"format('v',6)\n",
+"// Given data\n",
+"R_F = 20;// in k ohm\n",
+"R1 = 20;// in k ohm\n",
+"R2 = 10;// in k ohm\n",
+"Vin1 = 2;// in V\n",
+"Vin2 = 1;// in V\n",
+"// The output voltage, by using super position theorm\n",
+"Vo = ((-R_F/R1)*Vin1) + ((1+(R_F/R1))*Vin2);\n",
+"disp(Vo,'The output voltage is');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}