diff options
author | prashantsinalkar | 2020-04-14 10:19:27 +0530 |
---|---|---|
committer | prashantsinalkar | 2020-04-14 10:23:54 +0530 |
commit | 476705d693c7122d34f9b049fa79b935405c9b49 (patch) | |
tree | 2b1df110e24ff0174830d7f825f43ff1c134d1af /Basic_Electronics_by_R_K_Garg | |
parent | abb52650288b08a680335531742a7126ad0fb846 (diff) | |
download | all-scilab-tbc-books-ipynb-476705d693c7122d34f9b049fa79b935405c9b49.tar.gz all-scilab-tbc-books-ipynb-476705d693c7122d34f9b049fa79b935405c9b49.tar.bz2 all-scilab-tbc-books-ipynb-476705d693c7122d34f9b049fa79b935405c9b49.zip |
Initial commit
Diffstat (limited to 'Basic_Electronics_by_R_K_Garg')
8 files changed, 7841 insertions, 0 deletions
diff --git a/Basic_Electronics_by_R_K_Garg/1-Semiconductor_Materials_And_Junction_Diode.ipynb b/Basic_Electronics_by_R_K_Garg/1-Semiconductor_Materials_And_Junction_Diode.ipynb new file mode 100644 index 0000000..4f45b79 --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/1-Semiconductor_Materials_And_Junction_Diode.ipynb @@ -0,0 +1,1481 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1: Semiconductor Materials And Junction Diode" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.10: Minority_carrier_concentration.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',7)\n", +"// Given data\n", +"n_i = 1.5*10^16;//m^3\n", +"impurity = 10^20;\n", +"minority = (n_i^2)/impurity;// in atoms/m^3\n", +"q = 1.6*10^-19;// in C\n", +"rho = 2*10^3;// in ohm-m\n", +"// The miniority carrier concentration \n", +"miu_n = 1/(q*rho*n_i*2);// in m^2/V-s\n", +"disp(miu_n,'The miniority carrier concentration in m^2/V-s is');\n", +"n = impurity;\n", +"// The conductivity,\n", +"sigma = q*impurity*miu_n;// in (ohm-m)^-1\n", +"// The resistivity \n", +"rho = 1/sigma;// in ohm-m\n", +"disp(rho,'The resistivity in ohm-m is');\n", +"kT = 0.026;// in eV\n", +"n_o = n;\n", +"// The position of Fermi level \n", +"E_FdividedEi = kT*log(n_o/n_i);// in eV\n", +"disp(E_FdividedEi,'The position of Fermi level in eV is : ');\n", +"format('e',8)\n", +"// Minority carrier concentration \n", +"M = ((n_i*2)^2)/n_o;// in atoms/cm^3\n", +"disp(M,'Minority carrier concentration in atoms/cm^3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.11: Conductivity_and_resistivity_of_an_intrinsic_sample.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.12\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"d = 5.0*10^22;// in atoms/cm^3\n", +"impurity = 10^8;// in atoms\n", +"N_D = d/impurity;\n", +"n_i = 1.45*10^10;\n", +"n = N_D;\n", +"//Low of mass action, n*p = (n_i^2);\n", +"p = (n_i^2)/n;// in /cm^3\n", +"q = 1.6*10^-19;// in C\n", +"miu_n = 1300;// in cm/V-s\n", +"n_i = n;\n", +"//The Conductivity\n", +"sigma = q*miu_n*n_i;// in (ohm-cm)^-1\n", +"// The resistivity\n", +"rho = 1/sigma;// in ohm-cm\n", +"disp(rho,'The resistivity in ohm-cm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.12: Resistivity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.12\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"d = 5.0*10^22;// in atoms/cm^3\n", +"impurity = 10^8;// in atoms\n", +"N_D = d/impurity;\n", +"n_i = 1.45*10^10;\n", +"n = N_D;\n", +"//Low of mass action, n*p = (n_i^2);\n", +"p = (n_i^2)/n;// in /cm^3\n", +"q = 1.6*10^-19;// in C\n", +"miu_n = 1300;// in cm/V-s\n", +"n_i = n;\n", +"//The Conductivity\n", +"sigma = q*miu_n*n_i;// in (ohm-cm)^-1\n", +"// The resistivity\n", +"rho = 1/sigma;// in ohm-cm\n", +"disp(rho,'The resistivity in ohm-cm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.14: Minority_carrier_concentration.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.14\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"n_i = 1.5*10^10;// in electrons/cm^3\n", +"N_D = 10^17;// in electrons/cm^3\n", +"n = N_D;// in electrons/cm^3\n", +"// The minority carrier concentration\n", +"p = (n_i^2)/n;// in holes/cm^3\n", +"disp(p,'The minority carrier concentration in holes/cm^3 is');\n", +"kT = 0.026;\n", +"// The location of Fermi level \n", +"E_FminusEi = kT*log(N_D/n_i);// in eV\n", +"disp(E_FminusEi,'The location of Fermi level in eV is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.15: Doping_level_and_drift_velocity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.15\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',9)\n", +"// Given data\n", +"V = 1;// in V\n", +"I = 8;// in mA\n", +"I = I * 10^-3;// in A\n", +"R = V/I;// in ohm\n", +"l = 2;// in mm\n", +"l = l * 10^-1;// in cm\n", +"b = 2;// in mm\n", +"b = b * 10^-1;// in cm\n", +"A = l*b;// in cm^2\n", +"L = 2;// in cm\n", +"// R = (rho*L)/A;\n", +"sigma = L/(R*A);// in (ohm-cm)^-1\n", +"// n = N_D;\n", +"miu_n = 1300;// in cm^2/V-s\n", +"q = 1.6 * 10^-19;// in C\n", +"// sigma = n*q*miu_n;\n", +"N_D = sigma/( miu_n*q );// in /cm^3\n", +"disp(N_D,'The doping level in /cm^3 is');\n", +"d = 2;\n", +"E = V/d;\n", +"// The drift velocity \n", +"Vd = miu_n * E;// in cm/s\n", +"disp(Vd,'The drift velocity in cm/sec is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.17: Conductivity_mobility_and_drift_velocity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.17\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',9)\n", +"// Given data\n", +"l = 1000;// in ft\n", +"l = l * 12*2.54;// in cm\n", +"R = 6.51;// in ohm\n", +"rho = R/l;// in ohm/cm\n", +"// The conductivity \n", +"sigma = 1/rho;// in mho/cm\n", +"sigma = sigma * 10^2;// in mho/m\n", +"D= 1.03*10^-3;// in m\n", +"A= %pi*D^2/4;// in m^2\n", +"disp(sigma,'The conductivity in mho/m is');\n", +"q = 1.6*10^-19;// in C\n", +"n = 8.4*10^28;// in electrons/m^3\n", +"// sigma = n*q*miu;\n", +"miu = sigma/(n*q);// in m^2/V-s\n", +"disp(miu,'The mobility in m^2/V-s is');\n", +"T = 2;\n", +"// The drift velocity \n", +"V = T/(n*q*A);// in m/s\n", +"disp(V,'The drift velocity in m/s is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.18: Concentration_of_holes_and_electrons.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.18\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',8)\n", +"// Given data\n", +"N_D = 2*10^16;// in /cm^3\n", +"N_A = 5*10^15;// in /cm^3\n", +"// The concentration of holes \n", +"Pp = N_D-N_A;// in /cm^3\n", +"disp(Pp,'The concentration of holes in /cm^3 is');\n", +"n_i = 10^12;\n", +"// The concentartion of electrons \n", +"n_p = (n_i^2)/Pp;// in /cm^3\n", +"disp(n_p,'The concentartion of electrons in /cm^3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.19: Hall_angle.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.19\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"rho = 0.005;// in ohm-m\n", +"Bz = 0.48;// in Wb/m^2\n", +"R_H = 3.55*10^-4;// in m^3/C\n", +"ExByJx= rho;\n", +"// R_H = Ey/(Bz*Jx);\n", +"EyByJx= R_H*Bz;\n", +"// The hall angle \n", +"theta_H = atand(EyByJx/ExByJx);// in °\n", +"disp(theta_H,'The hall angle in degree is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.1: Drift_velocity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"miu = 0.2;// in m^2/V-s\n", +"V = 100;// in mV\n", +"V = V * 10^-3;// in V\n", +"d = 0.5;// in mm\n", +"d = d * 10^-3;// in m\n", +"// mobility, miu = Vd/E and\n", +"E = V/d;\n", +"// Drift velocity,\n", +"Vd = miu*E;// in m/s\n", +"disp(Vd,'The electron drift velocity in m/s is');\n", +"// Time required,\n", +"T = d/Vd;// in sec\n", +"T=T*10^6;// in µs\n", +"disp(T,'The time required for an electron to move across the thickness in micro seconds is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.20: Voltage_between_contact.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.20\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',9)\n", +"// Given data\n", +"R_H = 3.55 * 10^-4;// in m^3/C\n", +"Ix = 15;// in mA\n", +"Ix = Ix * 10^-3;// in A\n", +"A = 15*1;// in mm\n", +"A = A * 10^-6;// in m^2\n", +"Bz = 0.48;// in Wb/m^2\n", +"Jx = Ix/A;// in A/m^2\n", +"// R_H = Ey/(Bz*Jx);\n", +"Ey = R_H*Bz*Jx;// in V/m\n", +"// voltage between contacts \n", +"Voltage = Ey*Ix;// in V\n", +"disp(Voltage,'The voltage between contacts in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.21: Concentration_of_donar_atoms.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.21\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',8)\n", +"// Given data\n", +"A = 0.001;// in cm^2\n", +"l = 20;// in µm\n", +"l = l * 10^-4;// in cm\n", +"V = 20;// in V\n", +"I = 100;// in mA\n", +"I = I * 10^-3;// in A\n", +"R = V/I;// in ohm\n", +"// R = l/(sigma*A);\n", +"sigma = l/(R*A);// in (ohm-cm)^-1\n", +"miu_n = 1350;// in cm^2/V-s\n", +"q = 1.6*10^-19;// in C\n", +"// sigma = n*q*miu_n or\n", +"// The concentration of donor atoms \n", +"n = sigma/(q*miu_n);// in cm^-3\n", +"disp(n,'The concentration of donor atoms in cm^-3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.22: Dopping_needed.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.22\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',8)\n", +"// Given data\n", +"R = 2;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"L = 200;// in µm\n", +"L = L * 10^-4;// in cm\n", +"A = 10^-6;// in cm^2\n", +"miu_n = 8000;// in cm^2/V-s\n", +"q = 1.6*10^-19;// in C\n", +"n = '0.9*N_D';\n", +"// R = (rho*l)/A= (1/(n*q*miu_n))*(l/A);\n", +"// rho = L/(R*q*miu_n*A);\n", +"n = L/(R*q*miu_n*A);// in /cm^-3\n", +"// The doping needed \n", +"Nd= n/0.9\n", +"disp(Nd,'The doping needed in cm^-3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.23: Position_of_Fermi_level.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.23\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"KT = 26*10^-3;\n", +"Nd = 10^15;\n", +"n_i = 1.5*10^10;\n", +"// The position of the Fermi level \n", +"E_FminusE_Fi = KT*log(abs( Nd/n_i ));// in eV\n", +"disp(E_FminusE_Fi,'The position of the Fermi level in eV is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.24: Concentration_of_donar_atoms_added.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.24\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',9)\n", +"// Given data\n", +"Na = 5 * 10^15;// in cm^-3\n", +"Nc = 2.8 * 10^19;// in cm^-3\n", +"E_CminusE_F = 0.215;// in eV\n", +"KT = 26* 10^-3;// in eV\n", +"// The concentration of donors atoms \n", +"Nd = Na + Nc * (%e^( -E_CminusE_F/KT ));// in cm^-3\n", +"disp(Nd,'The concentration of donors atoms in cm^-3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.25: Dopping_efficiency_of_sample.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.25\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"Nd = 10^18;\n", +"R = 10;// in ohm\n", +"A =10^-6;// in cm^2\n", +"L = 10;// in mm\n", +"L = L * 10^-4;// in cm\n", +"miu_n = 800;// in cm^2/V-s\n", +"q = 1.6*10^-19;// in C\n", +"//Formula used, n = L/(q*miu_n*A*R)\n", +"n = L/(q*miu_n*A*R);// in cm^-3\n", +"// The percentage doping efficiency \n", +"doping = (n/Nd)*100;// % doping efficiency in %\n", +"disp(doping,'The percentage doping efficiency in % is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.26: Flowing_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.26\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Io = 2*10^-7;// in A\n", +"V = 0.1;// in V\n", +"// Current through the diode under forward bias,\n", +"I = Io*( (%e^(40*V))-1 );// in A\n", +"I = I * 10^6;// in µA\n", +"disp(I,'The current through the diode under forward bias in µA is');\n", +"\n", +"// Note: Calculated value of I in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.28: Dynamic_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.28\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"T = 125;// in degree C\n", +"T = T + 273;// in K\n", +"V_T = T/11600;\n", +"Io = 30;// in µA\n", +"Io = Io * 10^-6;// in A\n", +"V = 0.2;// in V\n", +"// The dynamic resistance in forward direction,\n", +"r_f = V_T/( Io * (%e^(V/V_T)) );// in ohm\n", +"disp(r_f,'The dynamic resistance in forward direction in ohm is');\n", +"r_f = V_T/( Io * (%e^(-V/V_T)) );// in ohm\n", +"// The dynamic resistance in reverse direction \n", +"r_f = r_f * 10^-6;// in Mohm\n", +"disp(r_f,'The dynamic resistance in reverse direction in Mohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.29: Voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.29\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Eta = 1;\n", +"V_T = 0.026;\n", +"// I = Io*( (%e^(V/(Eta*V_T))) - 1 ) and I = -Io;\n", +"// I = -0.9*Io;\n", +"// -0.9*Io = Io*( (%e^(V/(Eta*V_T))) - 1 );\n", +"V = Eta*V_T*log(0.1);// in V\n", +"V = V * 10^3;// in mV\n", +"disp(V,'The voltage in mV is');\n", +"V = 0.05;// in V\n", +"// The ratio of diode current with a forward bias to current with a reverse bias \n", +"If_by_Ir= ( (%e^(V/V_T))-1 )/( (%e^(-V/V_T))-1 );\n", +"disp(If_by_Ir,'The ratio of diode current with a forward bias to current with a reverse bias is');\n", +"Io = 10;// in µA\n", +"V = 0.1;// in V\n", +"// The value of I1 \n", +"I1 = Io*( (%e^(V/V_T))-1 );// in µA\n", +"disp(I1,'The value of I1 in µA is');\n", +"V = 0.2;// in V\n", +"// The value of I2\n", +"I2 = Io*( (%e^(V/V_T))-1 );// in µA \n", +"I2 = I2 * 10^-3;// in mA\n", +"disp(I2,'The value of I2 in mA is');\n", +"V = 0.3;// in V\n", +"// The value of I3\n", +"I3 = Io*( (%e^(V/V_T))-1 );// in µA\n", +"I3 = I3 * 10^-6;// in A\n", +"disp(I3,'The value of I3 in A is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.2: Intrinsic_Conductivity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"q = 1.6*10^-19;// in C\n", +"n_i = 2.5*10^19;// in /m^3\n", +"miu_n = 0.38;// in m^2/V-s\n", +"miu_p = 0.18;// in m^2/V-s\n", +"// The intrinsic conductivity for germanium,\n", +"sigma_i = q*n_i*(miu_n+miu_p);// in (ohm-m)^-1\n", +"disp(sigma_i,'The intrinsic conductivity in (ohm-m)^-1 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.30: Factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.30\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"// Io150 = Io25 * 2^((150-25)/10);\n", +"//Io150 = 5800*Io25;\n", +"T = 150;// in degree C\n", +"T = T + 273;// in K\n", +"V_T = 8.62*10^-5 * T;// in V\n", +"V = 0.4;// in V\n", +"Eta = 2;\n", +"Vt = 0.026;// in V \n", +"// The factor by which current will get multiplied \n", +"I150byI25= 5800*%e^(V/(Eta*V_T))/%e^(V/(Eta*Vt));\n", +"disp(I150byI25,'The factor by which current will get multiplied is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.31: Operating_Point.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.31\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R = 1;// in ohm\n", +"V = 5;// in V\n", +"V1 = 0.5;// in V\n", +"R1 = 1;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"// V-(I_D*R1)-(I_D*R) - V1 = 0;\n", +"I_D = (V-V1)/(R1+R);// in A\n", +"I_D = I_D * 10^3;// in mA\n", +"V_D = (I_D*10^-3*R) + V1;// in V\n", +"disp('The operating point of the diode is : '+string(V_D)+' V, '+string(I_D)+' mA')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.32: VOlage_drop_across_the_forward_bias_diode.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.32\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Eta = 1;\n", +"kT = 26;// in meV\n", +"// (%e^((e*V1)/kT)) = 2 or\n", +"//The voltage drop across the forward biased diode\n", +"V1 = log(2)*kT;// in mV\n", +"V1= V1*10^-3;// in V\n", +"disp(V1,'The voltage drop across the forward biased diode, in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.33: Space_charge_capacitance_of_Ge_diode.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.33\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"epsilon_Ge = 16/(36*%pi*10^11);// in F/cm\n", +"d = 2*10^-4;// in cm\n", +"A = 1;// in mm^2\n", +"A = A * 10^-2;// in cm^2\n", +"epsilon_o = epsilon_Ge;// in F/cm\n", +"// The space charge capacitance \n", +"C_T = (epsilon_o*A)/d;// in F\n", +"C_T = C_T * 10^12;// in pF\n", +"disp(C_T,'The space charge capacitance in pF is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.34: Transition_capacitance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.34\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"D = 0.102;// in cm \n", +"A = (%pi*(D^2))/4;// in cm^2\n", +"sigma_p = 0.286;// in (ohm-cm)^-1\n", +"q = 1.6*10^-19;// in C\n", +"miu_p = 500;\n", +"// Formula used, sigma_p = q*miu_p*N_A;\n", +"N_A = sigma_p/(q*miu_p);// in atoms/cm^3\n", +"V1 = 5;// in V\n", +"V2 = 0.35;// in V\n", +"Vb = V1+V2;// in V\n", +"// The transition capacitance,\n", +"C_T = 2.92*10^-4*((N_A/Vb)^(1/2))*A;// in pF/cm^2\n", +"disp(C_T,'The value of C_T in pf/cm^2 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.35: Transition_capacitance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.35\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"C_T1 = 15;// in pF\n", +"Vb1 = 8;// in V\n", +"Vb2 = 12;// in V\n", +"// C_T1/C_T2 = (Vb2/Vb1)^(1/2);\n", +"C_T2 = C_T1 * ((Vb1/Vb2)^(1/2));// in pF\n", +"disp(C_T2,'The value of C_T for reverse bias in pF is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.36: Voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.36\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_T = 0.026;// in V\n", +"Eta = 1;\n", +"I = '-0.9*Io';\n", +"// T = Io*((%e^(V/(Eta*V_T)))-1 );\n", +"// I = Io*((%e^(V/(Eta*V_T)))-1 );\n", +"V = log(0.1)*V_T;// in V \n", +"V = V * 10^3;// in mV\n", +"disp(V,'The voltage in mV is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.37: Drain_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.37\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vin = 20;// in V\n", +"Vgamma = 0.7;// in V\n", +"R = 20;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"// Vin-(I_D*Vin) - Vgamma = 0 or\n", +"// The value of I_D,\n", +"I_D = (Vin-Vgamma)/R;// in A\n", +"I_D = I_D * 10^3;// in mA\n", +"disp(I_D,'Part (a) : The value of I_D for first circuit in mA is');\n", +"\n", +"// Part (b)\n", +"Vin= 10;// in V\n", +"Vgamma = 0.7;// in V\n", +"R = 100;// in k ohm\n", +"// Drain current,\n", +"I_D= Vin/R;// in mV\n", +"disp(I_D,'Part (b) : The value of I_D for second circuit in mA is ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.38: Vo_and_ID.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.38\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R1 = 1;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R2 = 2;// in k ohm\n", +"R2 = R2 * 10^3;// in ohm\n", +"V = 10;// in V\n", +"V1 = 0.7;// in V \n", +"// V * (I_D*R1) - (R2*I_D) - V1 = 0;\n", +"I_D = (V-V1)/(R1+R2);// in A\n", +"I_D = I_D * 10^3;// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"// The output voltage,\n", +"Vo = (I_D*10^-3 * R2) +V1;// in V\n", +"disp(Vo,'The value of Vo in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.39: Current_in_each_branch.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.39\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V = 10;// in V\n", +"R = 10;// in ohm\n", +"// Current through resistance,\n", +"I = V/R;// in A\n", +"disp(I,'Part (a): The current through resistance in A is : ')\n", +"disp('Part (b) : Current through 10 ohm resistance will be Zero')\n", +"disp('Part (c): Current will be zero')\n", +"disp(I,'Part (d): The diode will be ON and current in A is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.3: Intrinsic_carrier_concentration.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',10)\n", +"// Given data\n", +"rho = 0.50;// in ohm-m\n", +"q = 1.6*10^-19;// in C\n", +"miu_n = 0.39;// in m^2/V-s\n", +"miu_p = 0.19;// in m^2/V-s\n", +"sigma = 1/rho;// in (ohm-m)^-1\n", +"//conductivity of a semiconductor, sigma = q*n_i*(miu_p+miu_n) or\n", +"n_i = sigma/(q*(miu_n+miu_p));// in /m^3\n", +"disp(n_i,'The intrinsic carrier concentration per m^3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.40: Operating_Point.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.40\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vth= 0.5;// in V\n", +"R_F= 1*10^3;// in ohm\n", +"V= 5;// in V\n", +"// Applying KVL for loop, V-Vd-R_F*Ii= 0 (i)\n", +"// When Ii=0\n", +"Vd= V;// in V\n", +"// When Vd= 0\n", +"Ii= V/R_F;// in A\n", +"// From eq(i)\n", +"Ii= (V-Vth)/R_F;// in A\n", +"Vd= V-R_F*Ii;// in V\n", +"disp('The operating point is : '+string(Vd)+' V, '+string(Ii*10^3)+' mA')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.43: Voltages.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.43\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_CC = 6;// in V\n", +"Vr = 0.6;// in V\n", +"V1= V_CC;//in V\n", +"V2 = V1-Vr;// in V\n", +"disp(V1,'The voltage at V1 in volts is : ')\n", +"disp(V2,'The voltage at V2 in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.44: I1_and_I2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.44\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_T = 0.7;// in V\n", +"V = 5;// in V\n", +"R = 2;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"Vs = 0.7;\n", +"Vx = Vs+V_T;// in V\n", +"// The value of I1 \n", +"I1 = (V-Vx)/R;// in A\n", +"I1 = I1 * 10^3;// in mA\n", +"disp(I1,'The value of I1 in mA is');\n", +"// The value of I2 \n", +"I2 = I1;// in mA\n", +"disp(I2,'The value of I2 in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.45: Output_waveform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.45\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Rf = 300;// in ohm\n", +"V = 0.5;// in V\n", +"R = 600;// in ohm\n", +"Vi = 2;// in V\n", +"// The output voltage \n", +"Vo = (Vi-V)*( R/(R+Rf) );// in V\n", +"disp(Vo,'The value of Vo in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.4: Conductivity_of_Si_sample.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"N_D = 10^21;// in /m^3\n", +"N_A = 5*10^20;// in /m^3\n", +"NdasD = N_D-N_A;// in /m^3\n", +"n = NdasD;// in /m^3\n", +"miu_n = 0.18;// in m^2/V-s\n", +"q = 1.6*10^-19;// in C\n", +"// The conductivity of silicon,\n", +"sigma = q*n*miu_n;// in (ohm-m)^-1\n", +"disp(sigma,'The conductivity of Si sample in (ohm-m)^-1 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.5: Conductivity_of_the_copper.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',8)\n", +"// Given data\n", +"At = 63.54;// atomic weight of copper\n", +"d = 8.9;// density in gm/cm^3\n", +"n = 6.023*10^23/At*d;// in electron/cm^3\n", +"q = 1.63*10^-19;// in C\n", +"miu = 34.8;// in m^2/V-s\n", +"// The conductivity of copper,\n", +"sigma = n*q*miu;// in mho/cm\n", +"disp(sigma,'The conductivity of copper in mho/cm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.6: Concentration_of_holes_and_electrons.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.6\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',9)\n", +"// Given data\n", +"sigma = 100;// in (ohm-m)^-1\n", +"n_i = 2.5*10^13;// in /cm^3\n", +"miu_n = 3800;// in cm^2/V-s\n", +"miu_p = 1800;// in cm^2/V-s\n", +"q = 1.6*10^-19;// in C\n", +"// Conductivity of a p-type germanium, sigma = q*p*miu_p or\n", +"p = sigma/(q*miu_p);// in /cm^3\n", +"disp(p,'Concentration of holes in a p-type Ge in /cm^3 is');\n", +"// The concentration of electrons in a p-type Ge\n", +"n = (n_i^2)/p;// in /cm^3\n", +"disp(n,'The concentration of electrons in a p-type Ge in /cm^3 is');\n", +"//Given for Si\n", +"sigma= 0.1;// in (ohm m)^-1\n", +"miu_n= 1300;// in cm^2/V-sec\n", +"n_i= 1.5*10^10;// in /cm^3\n", +"//sigma = q*n*miu_n;\n", +"n = sigma/(q*miu_n);// in /cm^3\n", +"disp(n,'The concentration of electrons in n-type Si in /cm^3 is');\n", +"// The concentration of holes in n-type Si\n", +"p = (n_i^2)/n;// in /cm^3\n", +"disp(p,'The concentration of holes in n-type Si in /cm^3 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.7: Resistivity_of_Ge_sample.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"miu_n = 3800;// cm^2/V-s\n", +"miu_p = 1800;// cm^2/V-s\n", +"n_i = 2.5*10^13;// in /cm^3\n", +"Nge = 4.41*10^22;// in /cm^3\n", +"q = 1.602*10^-19;// in C\n", +"impurity = 10^8;\n", +"// The number of donor atoms,\n", +"N_D = Nge/impurity;//in /cm^3\n", +"// The number of holes\n", +"p = (n_i^2)/N_D;// in /cm^3\n", +"// Conductivity of an N-type Ge,\n", +"sigma = q*N_D*miu_n;// in (ohm-cm)^-1\n", +"// The resistivity of the Ge\n", +"rho = 1/sigma;// in ohm-cm\n", +"disp(rho,'The resistivity of a dopped Ge in ohm-cm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.8: Resistivity_of_intrinsic_Si.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.8\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('e',8)\n", +"// Given data\n", +"Nsi = 4.96*10^22;// in /cm^3\n", +"n_i = 1.52*10^10;// in /cm^2\n", +"q = 1.6*10^-19;// in C\n", +"miu_n = 0.135;// in m^2/V-s\n", +"miu_n = miu_n * 10^4;// in cm^2/V-s\n", +"miu_p = 0.048;// in m^2/V-s\n", +"miu_p = miu_p * 10^4;// in cm^2/V-s\n", +"// The conductivity of an intrinsic silicon,\n", +"sigma = q*n_i*(miu_n+miu_p);// in (ohm-cm)^-1\n", +"// The resistivity of intrinsic silicon \n", +"rho = 1/sigma;// in ohm-cm\n", +"disp(rho,'The resistivity of intrinsic silicon in ohm-cm is');\n", +"format('v',5)\n", +"impurity = 50*10^6;\n", +"// The number of donor atoms,\n", +"N_D = Nsi/impurity;// in /cm^3\n", +"// Total free electrons,\n", +"n = N_D;// in /cm^3\n", +"// Total holes in a doped Si,\n", +"p = (n_i^2)/n;// in /cm^3\n", +"// Conductivity of a doped Si,\n", +"sigma = q*n*miu_n;// in (ohm-m)^-1\n", +"// The resistivity of doped silicon\n", +"rho = 1/sigma;// in ohm-cm\n", +"disp(rho,'The resistivity of doped silicon in ohm-cm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.9: Value_of_temperature.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 1.9\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"N_D= 5*10^28/(2*10^8);\n", +"// The Fermi level, E_F= E_C if,\n", +"N_C= N_D;\n", +"// Formula N_C= 4.82*10^21*T^(3/2)\n", +"T= (N_C/(4.82*10^21))^(2/3);// in K\n", +"disp(T,'The value of temperature in K 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 +} diff --git a/Basic_Electronics_by_R_K_Garg/2-Diode_Applications.ipynb b/Basic_Electronics_by_R_K_Garg/2-Diode_Applications.ipynb new file mode 100644 index 0000000..fd3ff7c --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/2-Diode_Applications.ipynb @@ -0,0 +1,979 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Diode Applications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.10: Average_load_current_and_rectification_efficiency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"Rf = 1;// in ohm\n", +"R2 = 2;// in ohm\n", +"N1 = 4;\n", +"N2 = 1;\n", +"V1rms = 240;// in V\n", +"V2rms = (N2/N1)*V1rms;// in V\n", +"Vm = sqrt(2)*V2rms;// in V\n", +"// The average load current \n", +"I_LDC = (2*Vm)/(%pi*(R2+Rf+R_L));// in A\n", +"I_LDC= I_LDC *10^3;// in mA\n", +"disp(I_LDC,'The average load current in mA is');\n", +"I_LDC= I_LDC *10^-3;// in A\n", +"// The average load voltage at no load \n", +"V_NL = (2*Vm)/%pi;// in V\n", +"disp(V_NL,'The average load voltage at no load in V is');\n", +"// The average load voltage at full load \n", +"V_LDC = I_LDC*R_L;// in V\n", +"disp(V_LDC,'The average load voltage at full load in V is');\n", +"// The percentage load regulation \n", +"Per_loadReg= (V_NL-V_LDC)/V_LDC*100;// in %\n", +"disp(Per_loadReg,'The percentage load regulation in % is : ')\n", +"Im = Vm/(R_L+R2+Rf);// in A\n", +"Irms = Im/2;// in A\n", +"P_iAC = (Vm^2)/(2*(R2+Rf+R_L));// in W \n", +"P_ODC = (I_LDC^2)*R_L;// in W\n", +"// The rectification efficiency \n", +"Eta = (P_ODC/P_iAC)*100;// in %\n", +"disp(Eta,'The rectification efficiency in % is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.11: Output_waveform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.11\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R1 = 2;// in k ohm\n", +"R2 = 2;// in k ohm\n", +"V_AB = 20;// in V\n", +"Vo = V_AB*(R1/(R1+R2));// in V\n", +"// The required PIV \n", +"V_AC = Vo;// in V\n", +"disp(V_AC,'The required PIV in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.12: Idc_and_Irms.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.12\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vrms = 10;// in V\n", +"r_f = 0.3;// in ohm\n", +"R_L = 2;// in ohm\n", +"Vm = sqrt(2)*Vrms;// in V\n", +"Im = Vm/(R_L+r_f);// in A\n", +"// The value of Idc \n", +"Idc = Im/%pi;// in A\n", +"disp(Idc,'The value of Idc in A is');\n", +"// The RMS value of output current \n", +"Irms = Im/2;// in A\n", +"disp(Irms,'The RMS value of output current in A is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.13: Ripple_factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.13\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vdc = 50;// in V\n", +"Vrms = 5;// in V\n", +"// The ripple factor,\n", +"Gamma = Vrms/Vdc;\n", +"disp(Gamma,'The ripple factor is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.14: Mean_and_rms_load_current_and_output_efficiency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.14\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vrms = 50;// in V\n", +"r_f = 20;// in ohm\n", +"R_L = 980;// in ohm\n", +"Vm = sqrt(2)*Vrms;// in V\n", +"Im = (Vm)/(R_L+r_f);\n", +"// The mean load current \n", +"Idc = (2*Im)/%pi;// in A\n", +"Idc = round(Idc * 10^3);// in mA\n", +"disp(Idc,'The mean load current in mA is');\n", +"// The RMS load current \n", +"Irms = Im/sqrt(2);// in A\n", +"Irms = Irms*10^3;// in mA\n", +"disp(Irms,'The RMS load current in mA is');\n", +"a = 0.812;// assumed\n", +"// The output efficiency \n", +"Eta = a/(1+(r_f/R_L));\n", +"Eta = Eta * 100;// in %\n", +"disp(Eta,'The output efficiency in % is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.15: Output_voltage_for_a_complete_cycle.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.15\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V = 10;// in V\n", +"V1 = 2.5;// in V\n", +"R = 1;// in Mohm\n", +"R = R * 10^6;// in ohm\n", +"i = (V-V1)/R;// in A\n", +"i = i * 10^6;// in µA\n", +"// The output voltage for a complete cycle \n", +"Vo1 = (i*10^-6*R)+V1;// in V\n", +"disp(Vo1,'The output voltage for a complete cycle in V is');\n", +"// The output voltage for half neagtive cycle \n", +"Vo2 = V1;// in V\n", +"disp(Vo2,'The output voltage for half negative cycle in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.17: DC_output_voltage_PIV_and_rectification_efficiency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.17\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"V1 = 230;// iin V\n", +"N2 = 1;\n", +"N1 = 5;\n", +"R_L = 100;// in ohm\n", +"V2 = V1*N2/N1;// in V\n", +"Vrms = V2;// in V\n", +"Vs = V2/2;// in V\n", +"Vm = sqrt(2)*Vs;// in V\n", +"// The dc output voltage \n", +"Vdc = (2*Vm)/%pi;// in V\n", +"disp(Vdc,'The dc output voltage in V is');\n", +"// The PIV value \n", +"PIV = round(2*Vm);// in V\n", +"disp(PIV,'The PIV value in V is');\n", +"// The rectification efficiency \n", +"Eta = 0.812;\n", +"Eta = Eta*100;// in %\n", +"disp(Eta,'The rectification efficiency in % is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.18: DC_output_voltage_and_output_frequency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.18\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V1 = 220;// in V\n", +"N2 = 1;\n", +"N1 = 10;\n", +"R_L = 250;// in ohm\n", +"V2 = V1 * (N2/N1);// in V\n", +"Vm = sqrt(2)*V2;// in V\n", +"Im =Vm/R_L;// in A\n", +"Iav = (2*Im)/%pi;// in A\n", +"Idc = Iav;// in A\n", +"// The dc output volatge \n", +"Vdc = Idc* R_L;// in V\n", +"disp(Vdc,'The dc output volatge in V is');\n", +"Pdc = (Idc^2)*R_L;// in W\n", +"Irms = (Im)/sqrt(2);// in A\n", +"Pac = (Irms^2)*R_L;// in W\n", +"// The rectification efficiency \n", +"Eta = (Pdc/Pac)*100;// in %\n", +"disp(Eta,'The rectification efficiency in % is');\n", +"// The peak inverse volatge \n", +"PIV = Vm;// in V\n", +"disp(PIV,'The peak inverse volatge in V is');\n", +"f_in = 50;// in Hz\n", +"// The output frequency \n", +"f_out = 2*f_in;// in Hz\n", +"disp(f_out,'The output frequency in Hz is');\n", +"\n", +"// Note: The answer of rectification efficiency in the book is not accurate." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: Average_current_and_load_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"N2 = 4;\n", +"N1 = 1;\n", +"R_L = 1*10^3;// in ohm\n", +" Vm = 40;// in V\n", +"V_Lav = Vm/%pi;// in V\n", +"// The average load voltage \n", +"V_LDC = V_Lav;// in V\n", +"disp(V_LDC,'The average load voltage in V is');\n", +"Im = Vm/R_L;// in A\n", +"I_DC = Im/%pi;// in A\n", +"I_DC= I_DC*10^3;// in mA\n", +"disp(I_DC,'The average load current in mA is');\n", +"I_DC= I_DC*10^-3;// in A\n", +"// The RMS voltage\n", +"V_Lrms = Vm/2;// in V\n", +"disp(V_Lrms,'The RMS voltage in V is');\n", +"// The RMS current\n", +"Irms = V_Lrms/R_L;// in A\n", +"Irms= Irms*10^3;// in mA\n", +"disp(Irms,'The RMS current in mA is');\n", +"Irms= Irms*10^-3;// in A\n", +"//Eta = (P_ODC/P_iAC)*100;\n", +"I_Loc = I_DC;// in A\n", +"P_ODC = (I_Loc^2)*R_L;// in W\n", +"P_iAC = (Irms^2)*R_L;// in W\n", +"// The efficiency of rectification \n", +"Eta = (P_ODC/P_iAC)*100;// in %\n", +"disp(Eta,'The efficiency of rectification in % is');\n", +"V2rms = Vm/sqrt(2);\n", +"I2rms = Irms;// in A\n", +"// The value of TUF \n", +"TUF = ((P_ODC)/(V2rms*I2rms))*100;// in %\n", +"disp(TUF,'The value of TUF in % is');\n", +"// The ripple factor \n", +"Gamma = (sqrt((V_Lrms^2)-(V_LDC^2)))/V_LDC;\n", +"Gamma = round(Gamma * 100);// in % done by own\n", +"disp(Gamma,'The ripple factor in % is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.21: Filter_capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.21\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_F = 0.01;\n", +"Vdc = 30;// in V\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"Idc = Vdc/R_L;// in A\n", +"Idc = Idc * 10^3;// in mA\n", +"// Vdc = Vm-( (5000*Idc)/C );\n", +"Gamma = 0.01;// ripple factor\n", +"//Gamma = 2900/(C*R_L);\n", +"C = 2900/(Gamma*R_L);// in F\n", +"Vm = Vdc + ((5000*Idc*10^-3)/C);// in V\n", +"// The input voltage required \n", +"V2 = (2*Vm)/sqrt(2);// in V \n", +"disp(V2,'The input voltage required in V is');\n", +"\n", +"//Note: The value of Vm in the book is not accurate, So the answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.22: Designing_of_a_filter_for_full_wave_circuit.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.22\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',7)\n", +"// Given data\n", +"V_L = 25;// in V\n", +"I_L = 200;// in mA\n", +"I_L = I_L * 10^-3;// in A\n", +"R_L = V_L/I_L;// in ohm\n", +"Gamma = 3/100;\n", +"//Gamma = 1/(6*sqrt(2)*(omega^2)*L*C);\n", +"f = 50;// in Hz\n", +"omega = 2*%pi*f;// in rad/sec\n", +"//LC = 1/( 6*sqrt(2)*(omega^2)*Gamma )\n", +"L = R_L/(3*omega);// in H\n", +"disp(L,'The value of L in H is');\n", +"C = 1/( 6*sqrt(2)*(omega^2)*Gamma*L );// in F\n", +"C = C * 10^6;// in µF\n", +"disp(C,'The value of C in µF is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.23: Output_voltage_current_and_ripple.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.23\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vm = 15;// in V\n", +"// The output voltage \n", +"Vdc = (2*sqrt(2)*Vm)/%pi;// in V\n", +"disp(Vdc,'The output voltage in V is');\n", +"R_L = 5;// in ohm\n", +"Idc = Vdc/R_L;// in A\n", +"disp(Idc,'The current in A is');\n", +"L = 50;// in mH\n", +"L = L * 10^-3;// in H\n", +"C = 1000;// in µF\n", +"C = C * 10^-6;// in F\n", +"f = 50;// in Hz\n", +"omega = 2*%pi*f;// in rad/sec\n", +"// The ripple factor \n", +"Gamma = 1/( 6*sqrt(2)*(omega^2)*L*C );\n", +"disp(Gamma,'The ripple factor is');\n", +"// Im =Vm/X_L = (Vm*sqrt(2))/(2*%pi*f*L);\n", +"Im = (Vm*sqrt(2))/(2*%pi*f*L);// in A\n", +"I_Lmin = Im;// in A\n", +"// The maximum value of R_L \n", +"R_Lmax = Vdc/I_Lmin;// in ohm\n", +"disp(R_Lmax,'The maximum value of R_L in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.24: Percentage_ripple.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.24\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"f = 50;// in Hz\n", +"Vrms = 280;// in V\n", +"Vm = sqrt(2)*Vrms;// in V\n", +"V_Lmax = Vm;// in V\n", +"Idc = 100;// in mA\n", +"Idc =Idc * 10^-3;// in A\n", +"C2 = 10;// in µF\n", +"C2 = C2 * 10^-6;// in F\n", +"C1 = C2 ;// in F\n", +"R_L =V_Lmax/Idc;// in ohm\n", +"L = 104;// in H\n", +"omega = 2*%pi*f;// in rad/sec\n", +"// The percentage ripple \n", +"Gamma = sqrt(2)/( 8*omega^3*C1*C2*L*R_L)*100;// in %\n", +"disp(Gamma,'The percentage ripple in % is');\n", +"\n", +"// Note: There is calculation error to find the value of gamma, So the answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.25: Peak_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.25\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vin = 15;// in V\n", +"// Peak output voltage,\n", +"Vout = Vin;// in V\n", +"disp(Vout,'Peak output voltage in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.26: Peak_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.26\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_L = 2;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"R = 2;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"Vin = 5;// in V\n", +"// The peak output voltage \n", +"Vout = (R_L/(R+R_L))*Vin;// in V\n", +"disp(Vout,'The peak output voltage in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.27: IR_and_IRmax.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.27\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vi = 10;// in V\n", +"V1 = 6;// in V\n", +"R = 10;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"// The value of i_Rmax\n", +"i_Rmax = (Vi-V1)/R;// in A\n", +"i_Rmax = i_Rmax * 10^3;// in mA\n", +"Vi = -10;// in V\n", +"V1 = 8;// in V\n", +"// The value of i_R \n", +"i_R =(Vi+V1)/R;// in A\n", +"i_R =i_R * 10^3;// in mA\n", +"disp(i_Rmax,'The value of i_Rmax in mA is : ')\n", +"disp(i_R,'The value of i_R in mA is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.28: Output_voltage_and_voltage_across_R.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.28\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vout = -0.7;// in V\n", +"V = -12;// in V\n", +"// The output voltage \n", +"V_R =V-Vout;// in V\n", +"disp(V_R,'The output voltage in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.29: Output_waveform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.29\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vin = 10;// in V\n", +"V1 = 2;// in V\n", +"// Vin -V_C - V1 = 0;\n", +"V_C =Vin-V1;// in V\n", +"// During positive half cycle the output voltage \n", +"Vout = Vin-V_C;// in V\n", +"disp(Vout,'During positive half cycle the output voltage in V is : ')\n", +"Vin = -10;// in V\n", +"V1 = 8;// in V\n", +"// Vin-V1-Vout = 0;\n", +"// During negative half cycle the output voltage \n", +"Vout = Vin-V1;// in V\n", +"disp(Vout,'During negative half cycle the output voltage in V is : ')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: Input_AC_power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Rf = 10;// in ohm\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"Vi = 230;// in V\n", +"Vm = Vi*sqrt(2);\n", +"//I_DC = Im/%pi;\n", +"I_DC = Vm/((R_L+Rf)*%pi);// in A\n", +"Irms = Vm/((R_L+Rf)*2);// in A\n", +"// The input ac power \n", +"P_iAC = (Irms^2)*(Rf+R_L);// in W \n", +"disp(P_iAC,'The input ac power in W is');\n", +"// The output ac power \n", +"P_ODC = (I_DC^2)*R_L;// in W\n", +"disp(P_ODC,'The output ac power in W is');\n", +"// The efficiency \n", +"Eta = (P_ODC/P_iAC)*100;// in %\n", +"disp(Eta,'The efficiency in % is');\n", +"// The percentage regulation \n", +"R = (Rf/R_L)*100;// in %\n", +"disp(R,'The percentage regulation in % is');\n", +"\n", +"// Note: The calculated value of input a.c. power in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.30: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.30\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vin = 10;// in V\n", +"V1 = 2;// in V\n", +"// Vin-V_C+V1 = 0;\n", +"V_C = Vin+V1;// in V\n", +"//During positive half cycle the output voltage \n", +"Vout = Vin-V_C;// in V\n", +"disp(Vout,'During positive half cycle the output voltage in V is');\n", +"Vin = -10;// iin V\n", +"V1 = 12;// in V\n", +"// Vin-V1-Vout = 0;\n", +"//During negative half cycle the output voltage \n", +"Vout = Vin-V1;// in V\n", +"disp(Vout,'During negative half cycle the output voltage in V is');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.31: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.31\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vi = 20;// in V\n", +"V1 = 5;// in V\n", +"Vc = Vi-V1;// in V\n", +"Vo = -5;// in V\n", +"// The value of Vo,\n", +"Vo = Vi+Vc;// in V\n", +"disp(Vo,'The value of Vo in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: Output_DC_voltage_and_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V1 = 230;// in V\n", +"N2= 1;\n", +"N1 = 4;\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"Vd = 0.7;// in V\n", +"// V_LDC = (Vm-Vd)/%pi;// in V\n", +"V2 = V1*(N2/N1);// in V\n", +"// Vm = sqrt(2)*Vrms;\n", +"Vm = sqrt(2)*V2;// in V\n", +"// The output dc voltage \n", +"V_LDC = (Vm-Vd)/%pi;// in V\n", +"disp(V_LDC,'The output dc voltage in V is');\n", +"// The current for a load resistance \n", +"I_LDC = V_LDC/R_L;// in A\n", +"I_LDC = I_LDC * 10^3;// in mA\n", +"disp(I_LDC,'The current for a load resistance in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7: PIV_rating.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R1 = 2.2;// in k ohm\n", +"R2 = 2.2;// in kohm\n", +"R3 = 4.7;// in k ohm\n", +"R = (R2*R3)/(R2+R3);// in k ohm\n", +"Vin = 200;\n", +"// Vo = (R/(R1+R))*Vin;\n", +"// The PIV rating for first diode \n", +"Vomax= round(R/(R1+R)*Vin);// in V\n", +"disp(Vomax,'The PIV rating for first diode in V is : ')\n", +"Rdas = (R1*R3)/(R1+R3);// in k ohm\n", +"// Vo = (Rdas/(R1+Rdas))*(-Vin);\n", +"// The PIV rating for second diode \n", +"Vomax=round(Rdas/(R1+Rdas)*Vin);// in V\n", +"disp(Vomax,'The PIV rating for second diode in V is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9: PIV_of_diode.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 2.9\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"// Vi = 15*sind(314*t);\n", +"Vm = 15;// in V\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"Im = Vm/R_L;// in A\n", +"Im = Im * 10^3;// in mA\n", +"Idc = Im/%pi;// in mA\n", +"// The average current \n", +"I_Dav = Idc;// in mA\n", +"disp(I_Dav,'The average current in mA is');\n", +"// The RMS current \n", +"I_Drms = Im/2;// in mA\n", +"disp(I_Drms,'The RMS current in mA is');\n", +"// The peak diode current \n", +"I_Dpeak = Im;// in mA\n", +"disp(I_Dpeak,'The peak diode current in mA is');\n", +"// The PIV of diode \n", +"PIV = 2*Vm;// in V\n", +"disp(PIV,'The PIV of diode in V 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 +} diff --git a/Basic_Electronics_by_R_K_Garg/3-Zener_Diode_And_LED.ipynb b/Basic_Electronics_by_R_K_Garg/3-Zener_Diode_And_LED.ipynb new file mode 100644 index 0000000..1a1b88f --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/3-Zener_Diode_And_LED.ipynb @@ -0,0 +1,749 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Zener Diode And LED" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10: Value_of_VL_IL_IR_and_IZ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R = 200;// in ohm\n", +"Vi = 20;// in V\n", +"V_Z = 10;// in V\n", +"R_L = 300;// in ohm\n", +"P_Zmax = 400;// in mW\n", +"// The value of V_L \n", +"V_L = (R_L/(R_L+R))*Vi;// in V\n", +"disp(V_L,'The value of V_L in V is');\n", +"V_L = V_Z;// in V\n", +"// The value of I_L \n", +"I_L = V_L/R_L;// in A\n", +"I_L = I_L * 10^3;// in mA\n", +"disp(I_L,'The value of I_L in mA is');\n", +"// The value of I_R \n", +"I_R = (Vi-V_Z)/R;// in A\n", +"I_R = I_R * 10^3;// in mA\n", +"disp(I_R,'The value of I_R in mA is');\n", +"// The value of I_Z \n", +"I_Z = I_R-I_L;// in mA\n", +"disp(I_Z,'The value of I_Z in mA is');\n", +"// V_L >= V_Z and V_L= R_L*Vi/(R_L+R)\n", +"// So, the minimum value of R_L \n", +"R_L= R*V_Z/(Vi-V_Z);// in ohm\n", +"disp(R_L,'The minimum value of R_L in ohm is : ')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11: Maximum_value_of_Ri.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.11\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_Z = 0.2;// in A\n", +"R = 10;// in ohm\n", +"V_Z = 8 + (R*I_Z);// in V\n", +"I_Lmin = V_Z/R;// in A\n", +"I_Zmax = 0.2;//in A\n", +"Vimax = 15;// in V\n", +"// The minimum value of R\n", +"Rimin = (Vimax-V_Z)/(I_Zmax+I_Lmin);// in ohm\n", +"disp(Rimin,'The minimum value of R in ohm is');\n", +"\n", +"// Note: The calculation in the book is not accurate, So the answer in the book is not accurate." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.12: Output_voltage_and_current_through_the_zener_diode.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.12\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_L = 10;// in k ohm\n", +"R_S = 5;// in k ohm\n", +"V_S = 12;// in V\n", +"V_Z = 8;// in V\n", +"V_L = (R_L/(R_S+R_L))*V_S;// in V\n", +"//The output voltage \n", +"Vo = V_L;// in V\n", +"disp(Vo,'The output voltage in V is');\n", +"// The voltage drop across R_S \n", +"R_S = V_S-Vo;// in V\n", +"disp(R_S,'The voltage drop across R_S in V is');\n", +"// The current through the zener diode \n", +"I_Z = 0;// in A\n", +"disp(I_Z,'The current through the zener diode in A is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.13: value_of_VZ_IZ_and_PZ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.13\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"R_S = 1;// in k ohm\n", +"R_L = 1.2;// in k ohm\n", +"V_Z = 10;// in V\n", +"V_S = 16;// in V\n", +"V_L = (R_L/(R_L+R_S))*V_S;// in V\n", +"//The value of I_Z \n", +"I_Z = 0;// in A\n", +"disp(I_Z,'The value of I_Z in A is');\n", +"// The value of P_Z \n", +"P_Z = 0;\n", +"disp(P_Z,'The value of P_Z is');\n", +"//The value of Vo\n", +"Vo = V_L;// in V\n", +"disp(Vo,'The value of Vo in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.14: Value_of_VL_IL_IZ_and_IR.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.14\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_L = 200;// in ohm\n", +"Vin = 20;// in V\n", +"V_Z = 10;// in V\n", +"P_Zmaz = 400;// in mW\n", +"R_S = 220;// in ohm\n", +"//The value of V_L with 200 ohm \n", +"V_L =(R_L/(R_S+R_L))*Vin;// in V\n", +"disp(V_L,'The value of V_L with 200 ohm in V is');\n", +"// The value of I_Z with 200 ohm \n", +"I_Z = 0;// in A\n", +"disp(I_Z,'The value of I_Z with 200 ohm in A is');\n", +"// The value of I_L with 200 ohm \n", +"I_L = Vin/(R_S+R_L)*10^3;// in mA\n", +"disp(I_L,'The value of I_L with 200 ohm in mA is');\n", +"//The value of I_R with 200 ohm \n", +"I_R = I_L;// in mA\n", +"disp(I_R,'The value of I_R with 200 ohm in mA is');\n", +"R_L = 50;// in ohm\n", +"V_L = (R_L/(R_S+R_L))*Vin;// in V\n", +"//The value of I_L with 50 ohm \n", +"I_L = Vin/(R_S+R_L)*10^3;// in mA\n", +"disp(I_L,'The value of I_L with 50 ohm in mA is');\n", +"// The value of I_R with 50 ohm \n", +"I_R = I_L;// in mA\n", +"disp(I_R,'The value of I_R with 50 ohm in mA is');\n", +"// The value of I_Z with 50 ohm \n", +"I_Z = 0;// in A\n", +"disp(I_Z,'The value of I_Z with 50 ohm in A is');\n", +"disp(V_L,'The value of V_L with 50 ohm in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.15: Value_of_RLmi.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.15\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_Z = 15;// in V\n", +"Vin = 24;// in V\n", +"R = 27;// in ohm\n", +"I = (Vin-V_Z)/R;// in A\n", +"// The minimum value of R_L \n", +"R_Lmin = V_Z/I;// in ohm\n", +"disp(R_Lmin,'The minimum value of R_L in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.16: Minimum_value_of_R.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.16\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R = 50;// in ohm\n", +"Vin = 10;// in V\n", +"V_Z = 6;// in V\n", +"I = (Vin-V_Z)/R;// in A\n", +"I = I * 10^3;// in mA\n", +"I_Zmin = 5;// in mA\n", +"// I = I_Z+I_L;\n", +"I_Rmax = I-I_Zmin;// in mA\n", +"// The minimum value of R \n", +"R = V_Z/(I_Rmax*10^-3);// in ohm\n", +"disp(R,'The minimum value of R in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.17: Power_dissipation_in_zener_diode.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.17\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R = 150*10^3;// in ohm\n", +"R_L = 75;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"V_Z = 15;// in V\n", +"Vin = 50;// in V\n", +"R_Z = 0;\n", +"Rth = (R*R_L)/(R+R_L);// in ohm\n", +"Vth = Vin * ( R_L/(R_L+R) );// in V\n", +"I_Z = Vth/Rth;// in A\n", +"// The power dissipation in the zener diode \n", +"P_Z = V_Z*I_Z;// in W\n", +"P_Z= P_Z*10^3;//in mW\n", +"disp(P_Z,'The power dissipation in the zener diode in mW is');\n", +"\n", +"// Note: The calculation in the last line is wrong as 15*0.333 = 5 mW not 0.5mW, So the answer in the book is wrong. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.18: Value_of_RL.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.18\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',4)\n", +"// Given data\n", +"R = 222;// in ohm\n", +"Vin = 20;// in V\n", +"V_Z = 10;// in V\n", +"P = 400;// in mW\n", +"P= P*10^-3;// in W\n", +"I_Zmax = P/V_Z;// in A\n", +"//I = I_Z+I_L;\n", +"I = (Vin-V_Z)/R;// in A\n", +"I_Lmin = I - I_Zmax;// in mA\n", +"// The value of R_L \n", +"R_L =V_Z/I_Lmin;// in ohm\n", +"R_L= R_L*10^-3;// in k ohm\n", +"disp(R_L,'The value of R_L in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.19: Range_of_possible_load_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.19\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R = 12;// in k ohm\n", +"Vin = 6.3;// in V\n", +"V_Z = 4.8;// in V\n", +"I = (Vin-V_Z)/R*10^3;// in mA\n", +"I_Z = 5;// in mA\n", +"// Maximum value of load current,\n", +"I_Lmax = I - I_Z;// in mA\n", +"I_Z = 100;// in mA\n", +"// Minimum value of load current,\n", +"I_Lmin = I - I_Z;// in mA\n", +"disp('The range of possible load current is : '+string(I_Lmin)+' mA <= I_L <= '+string(I_Lmax)+' mA')\n", +"// Minimum value of load resistance,\n", +"R_Lmin= I_Lmin*10^-3*V_Z;// in ohm\n", +"// Maximum value of load resistance,\n", +"R_Lmax= I_Lmax*10^-3*V_Z;// in ohm\n", +"disp('The range of possible load resistance is : '+string(R_Lmin)+' ohm <= R_L <= '+string(R_Lmax)+' ohm')\n", +"// The power rating required for load resistance \n", +"P_Zmax = I_Lmax*10^-3*V_Z;// in W\n", +"P_Zmax= P_Zmax*10^3;// in mW\n", +"disp(P_Zmax,'The power rating required for load resistance in mW is');\n", +"\n", +"// Note: The calculated value of P_Zmax is wrong as 120*10^-3*4.8= 576 mW not 5.76 mW" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: Resistance_of_device.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I1 = 30;// in mA\n", +"I2 = 20;// in mA\n", +"delI_Z = I1-I2;// in mA\n", +"delI_Z = delI_Z * 10^-3;// in A\n", +"V1 = 5.75;// in V\n", +"V2 = 5.6;// in V\n", +"delV_Z = V1-V2;// in V\n", +"// The resistance of the device \n", +"r_Z = delV_Z/delI_Z;// in ohm\n", +"disp(r_Z,'The resistance of the device in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: Terminal_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_Z = 4.7;// in V\n", +"r_Z = 15;// in ohm\n", +"I_Z = 20;// in mA\n", +"I_Z = I_Z * 10^-3;// in A\n", +"// The terminal voltage \n", +"VdasZ = V_Z + (I_Z*r_Z);// in V\n", +"disp(VdasZ,'The terminal voltage in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: Value_of_IZM.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"P_ZM = 500;// in mW\n", +"P_ZM = P_ZM * 10^-3;// in W\n", +"V_Z = 6.8;// in V\n", +"// The value of I_ZM \n", +"I_ZM = P_ZM/V_Z;// in A\n", +"I_ZM = I_ZM * 10^3;// in mA\n", +"disp(I_ZM,'The value of I_ZM in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Maximum_power_dissipatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',8)\n", +"// Given data\n", +"P_ZM = 1500;// in mW\n", +"Deratingfactor = 3.33;// in mW\n", +"T1 = 85;// in degree C\n", +"T2 = 60;// in degree C\n", +"total = Deratingfactor*(T1-T2);// total derating factor in mW\n", +"// The maximum power dissipation \n", +"P_ZM = P_ZM - total;// in mW\n", +"disp(P_ZM,'The maximum power dissipation in mW is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: Value_of_VL_VR_VZ_and_PZ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"R_L = 1.2;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"Vi = 16;// in V\n", +"R = 1;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"// The value of V_L \n", +"V_L = (R_L*Vi)/(R+R_L);// in V\n", +"disp(V_L,'The value of V_L in V is');\n", +"V_Z = 10;// in V\n", +"// The value of V_R \n", +"V_R = Vi-V_L;// in V\n", +"disp(V_R,'The value of V_R in V is');\n", +"// The value of I_Z \n", +"I_Z = 0;// in A\n", +"disp(I_Z,'The value of I_Z in A is');\n", +"// The value of P_Z \n", +"P_Z =V_Z*I_Z;// in W\n", +"disp(P_Z,'The value of P_Z in W is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: Range_of_value_of_Vi.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.6\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_L = 1.2;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"R = 220;// in ohm\n", +"V_Z = 20;// in V\n", +"// The minimum value of Vi \n", +"Vimin = ((R_L+R)/R_L)*V_Z;// in V\n", +"disp(Vimin,'The minimum value of Vi in V is');\n", +"I_L = V_Z/R_L;// in A\n", +"I_ZM = 60;// in mA\n", +"I_ZM = I_ZM * 10^-3;// in A\n", +"// I_ZM = I_R-I_L;\n", +"I_Rmax = I_ZM + I_L;\n", +"// The maximum value of Vi \n", +"Vimax = (I_Rmax*R)+V_Z;// in V\n", +"disp(Vimax,'The maximum value of Vi in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: Whether_zener_diode_operating_in_Breakdown_region.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"R = 270;// in ohm \n", +"V = 18;// in V\n", +"V_Z= 10;// in V\n", +"V_L = (R_L/(R_L+R))*V;// in V\n", +"if V_L > V_Z then\n", +" disp('As the value of V_L ('+string(V_L)+' V) is greater than the value of V_Z ('+string(V_Z)+' V), So')\n", +"disp('The zener diode is operating in the breakdown region.');\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: Zener_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.8\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V1 = 18;// in V\n", +"V2 = 10;// in V\n", +"R = 250;// in ohm\n", +"I_R = (V1-V2)/R;// in A\n", +"I_R = I_R * 10^3;// in mA\n", +"R_L = 1;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"I_L = V2/R_L;// in A\n", +"I_L =I_L * 10^3;// in mA\n", +"// I_R = I_L+I_Z;\n", +"// So, the value of zener current \n", +"I_Z = I_R - I_L;// in mA\n", +"disp(I_Z,'The value of zener current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: Current_flowing_through_resistance_R.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.9\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R = 10;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"Vi = 20;// in V\n", +"V_Z = 10;// in V\n", +"I_L = 1;// in mA\n", +"I_L = I_L * 10^-3;// in A\n", +"R_L = 10;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"V_L = (R_L/(R_L+R))*Vi;// in V\n", +"// The current flowing through the resistance \n", +"I = (Vi-V_Z)/R;// in A\n", +"I= I*10^3;// in mA\n", +"disp(I,'The current flowing through the resistance in mA 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 +} diff --git a/Basic_Electronics_by_R_K_Garg/4-Bipolar_Junction_Transistor.ipynb b/Basic_Electronics_by_R_K_Garg/4-Bipolar_Junction_Transistor.ipynb new file mode 100644 index 0000000..0f7eeee --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/4-Bipolar_Junction_Transistor.ipynb @@ -0,0 +1,1270 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Bipolar Junction Transistor" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10: DC_laod_line.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_BE = 0.6;// in V\n", +"V_CE = 0;// in V\n", +"R_C = 2;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"V_CC = 9;// in V\n", +"Beta= 2;\n", +"R_B = 8;// in k ohm\n", +"R_B = R_B * 10^3;// in ohm\n", +"// V_CC - (I_C*R_C) - V_CE = 0;\n", +"I_C = V_CC/R_C;// in A\n", +"I_C= I_C*10^3;// in mA\n", +"V_CE = V_CC;// in V\n", +"plot([V_CE,0],[0,I_C]);\n", +"xlabel('V_CE in volts');\n", +"ylabel('I_C in mA');\n", +"title('DC load line')\n", +"I_C= I_C*10^-3;// in A\n", +"I_B = (V_CC-V_BE)/R_B;// in A\n", +"//Collector emitter voltage, V_CE = V_CC - (I_C*R_C) = V_CC - (Beta*10^-3*I_B*R_C);\n", +"V_CE = V_CC - (Beta*I_B*R_C);// in V\n", +"// Collector current,\n", +"I_C =Beta*I_B;// in A\n", +"I_C= I_C*10^3;// in mA\n", +"disp('The operating point is : '+string(V_CE)+' V, '+string(I_C)+' mA')\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11: Emitter_current_and_collector_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.11\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"V_CC = 12;// in V\n", +"Beta = 100;\n", +"R = 600;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"R1 = 600;// in ohm\n", +"//Applying KVL to input side, V_CC -(I_E*R1) - (I_B*R) - V_BE = 0\n", +"I_B = V_CC/(R+(Beta*R1));// in A\n", +"I_C = Beta*I_B;// in A\n", +"I_E = I_C+I_B;// in A\n", +"// Applying KVL to output side\n", +"V_CE = V_CC - (I_E*R1);// in V\n", +"I_E= I_E*10^3;// in mA\n", +"disp(I_E,'The emitter current in mA is');\n", +"disp(V_CE,'The collector voltage in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.12: Value_of_RB.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.12\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"I_C = 6.4;// in mA\n", +"I_C = I_C * 10^-3;// in A\n", +"V_CE = 8.4;// in V\n", +"Beta = 80;\n", +"V_CC= 10;// in V\n", +"R = 250;// in ohm\n", +"R_E = 500;// in ohm\n", +"I_B = I_C/Beta;// in A\n", +"//Applying KVL to the input side, V_CC - (I_B*R_B) - V_BE - (I_E*R1) = 0 or\n", +"R_B = (V_CC-(Beta+1)*R_E*I_B)/I_B\n", +"R_B = R_B * 10^-3;// in k ohm\n", +"disp(R_B,'The value of R_B in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.13: Q_point_and_stability_factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.13\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"Beta = 44;\n", +"R_L = 1.51 * 10^3;// in ohm\n", +"R_E = 270;// in ohm\n", +"V_CC = 4.5;// in V\n", +"R2 = 2.7 * 10^3;// in ohm\n", +"R1 = 27 * 10^3;// in ohm\n", +"R_C = 1.5 * 10^3;// in ohm\n", +"Vth = V_CC * (R2/(R1+R2));// in V\n", +"Rth = (R1*R2)/(R1+R2);// in ohm\n", +"// Applying KVL to input circuit, Vth - (I_B*Rth) - V_BE - (I_E*R_E) = 0 or\n", +"I_C = (Vth*Beta)/(Rth + (Beta*R_E));// in A (On putting I_C= Beta*I_B and V_BE=0)\n", +"//Applying KVL to output side, V_CC - (I_C*R_C) - V_CE - (I_E*R_E) = 0;\n", +"V_CE = V_CC - (I_C*(R_C+R_E));// in V\n", +"S = (Beta+1)*( (1+(Rth/R_E))/(Beta+1+(Rth/R_E)) );\n", +"I_C= I_C*10^3;// in mA\n", +"disp(S,'The stability factor is');\n", +"disp('The quiescent points : '+string(I_C)+' mA, '+string(V_CE)+' V')\n", +"\n", +"// Note: In the book the calculated value of V_CE is correct as well as coding output, but at last they print wrong value (4.01 V)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.15: Value_of_R1_R2_and_RE.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.15\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"S = 12;\n", +"V_CC = 16;// in V\n", +"R_C = 1.5 * 10^3;// in ohm\n", +"V_CE = 8;// in V\n", +"V_BE= 0.2;// in V\n", +"I_C = 4;// in mA\n", +"I_C = I_C * 10^-3;// in A\n", +"Beta = 50;\n", +"// Vth = V_CC*(R2/(R1+R2)) and Rth = (R1*R2)/(R1+R2);\n", +"//Applying KVL to input side, Vth - I_B*Rth - V_BE - I_E*R_E = 0 (i)\n", +"I_B = I_C/Beta;// in A\n", +"I_E = I_B*(1+Beta);// in A\n", +"// Applying KVL to output section,\n", +"R_E = (V_CC - (I_C*R_C) - V_CE)/I_E;// in ohm\n", +"//S = ((Rth+R3)*(1+Beta))/(Rth + ((1+Beta)*R_E)) (ii)\n", +"Rth= R_E*(1+Beta-S-Beta*S)/(S-1-Beta);// in ohm\n", +"V_BN= V_BE+I_E*R_E;//in V\n", +"Vth= V_BN+I_B*Rth;// in V\n", +"// Vth= V_CC*R2/(R1+R2) and Rth= R2*R1/(R1+R2), So Vth= V_CC*Rth/R1\n", +"R1= V_CC*Rth/Vth;// in ohm\n", +"R2= R1*Rth/(R1-Rth);// in ohm\n", +"R1= round(R1*10^-3);// in k ohm\n", +"R2= R2*10^-3;// in k ohm\n", +"R_E= R_E*10^-3;// in k ohm\n", +"disp(R1,'The value of R1 in kΩ is : ')\n", +"disp(R2,'The value of R2 in kΩ is : ')\n", +"disp(R_E,'The value of R_E in kΩ is : ')\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.19: Region_of_transistor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.19\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"h_FE = 100;\n", +"R = 50;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"R1 = 3;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"V1 = 10;// in V\n", +"V2 = 5;// in V\n", +"V_BE = 0.8;// in V\n", +"V_CE = 0.2;// in V\n", +"//Applying KVL in input side, V2 - (R*I_B)-V_BE = 0;\n", +"I_B = (V2-V_BE)/R;// in A\n", +"I_B = I_B * 10^3;// in mA\n", +"//Applying KVL to output side, V1 - (R1*I_C) - V_CE = 0;\n", +"I_C = (V1-V_CE)/R1;// in A\n", +"I_C = I_C * 10^3;// in mA\n", +"I_Bmin = I_C/h_FE;// in mA\n", +"if I_B>I_Bmin then\n", +" disp('As the value of I_B ('+string(I_B)+' mA) is greater than the value of I_Bmin ('+string(I_Bmin)+' mA),')\n", +" disp('So the transistor will be in saturation region.')\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: Base_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Alpha = 0.98;\n", +"Vo = 4.9;// in V\n", +"R_L = 5;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"I_C = Vo/R_L;// in A\n", +"I_C = I_C * 10^3;// in mA\n", +"// Alpha = I_C/I_E;\n", +"I_E = I_C/Alpha;// in mA\n", +"// The base current \n", +"I_B = I_E-I_C;// in mA\n", +"disp(I_B,'The base current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.20: Vo_and_minimum_value_of_RC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.20\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_BE= 0.8;// in V\n", +"V_CE= 0.2;// in V\n", +"Beta = 100;\n", +"h_FE = Beta;\n", +"V1 = 3;// in V\n", +"V2 = -10;// in V\n", +"R_B = 7*10^3;// in ohm\n", +"R_E = 3*10^3;// in ohm\n", +"R_C = 500;// in ohm\n", +"//Applying KVL to input side, V1 - (I_B+I_C)*Rc - V_BEsat - (R1*I_B) = 0 or I_B*(R_B+R_C)+I_C*R_C= V1-V_BE (i)\n", +"// Applying KVL to output side, V2+I_C*R_E+V_CE+R_C*(I_B+I_C) = 0 or I_B*R_C+I_C*(R_C+R_E)= -V2-V_CE (ii)\n", +"A= [(R_B+R_C) R_C;R_C (R_C+R_E)];\n", +"B= [V1-V_BE -V2-V_CE];\n", +"C=B*A^-1;// Solving eq(i) and (ii) by matrix method\n", +"I_B= C(1);// in A\n", +"I_C= C(2);// in A\n", +"I_B=I_B*10^3;// in mA\n", +"I_C=I_C*10^3;// in mA\n", +"I_Bmin= I_C/h_FE;//in mA\n", +"if I_B>I_Bmin then\n", +" disp('Part (a) :')\n", +" disp('As the value of I_B ('+string(I_B)+' mA) is greater than the value of I_Bmin ('+string(I_Bmin)+' mA),')\n", +" disp('So the transistor will be in saturation region.')\n", +"end\n", +"Vo= -V_CE-(I_B+I_C)*10^-3*R_C;// in V\n", +"disp(Vo,'Part (b) : The value of Vo in volts is : ')\n", +"V_BEactive= 0.7;// in V\n", +"V_BC= -0.5;\n", +"// V_BN= (1+Beta)*(V1-V_BEactive)*R_C/(R_B+(1+Beta)*R_C) (iii)\n", +"// V_CN= Beta*R_E*(V1-V_BEactive)/(R_B+(1+Beta)*R_C) (iv)\n", +"// and V_BC= V_BN-V_CN, so from eq(iii) and (iv)\n", +"R_C= (V_BC*R_B+Beta*R_E*(V1-V_BEactive))/((1+Beta)*(V1-V_BEactive)-V_BC*(1+Beta));// in ohm\n", +"disp(R_C,'Part (c) :The value of R_C in ohm is : ')\n", +"\n", +"// Note : 1 In the book, the calculated value of I_B i.e 0.14mA is wrong.\n", +"// Note: 2 In the book the calculated value of R_C i.e 819 Ω is wrong. we can easily check that on putting 0.819 kΩ in the last step.\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.21: Q_point_value.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.21\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CC = 10;// in V\n", +"R_C = 10;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"R_B = 100*10^3;// in ohm\n", +"Beta_dc = 100;\n", +"V_BE = 0.7;// in V\n", +"// Applying KVL to input section, V_CC = (I_E*R_E) + (I_B*R_B) + V_BE or\n", +"I_C = (V_CC-V_BE)/( R_C + (R_B/Beta_dc) );// in A\n", +"V_CE =V_CC - (I_C*R_C);// in V\n", +"I_C=I_C*10^3;// in mA\n", +"disp('DC load line shown in figure.')\n", +"disp('Q-points : '+string(V_CE)+' V, '+string(I_C)+' mA')\n", +"I_Csat =V_CC/R_C*10^3;// in mA\n", +"V_CEcutoff = V_CC;// in V\n", +"plot([V_CEcutoff ,0],[0,I_Csat]);\n", +"xlabel('V_CE in volts');\n", +"ylabel('I_C in mA')\n", +"title('DC load line')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.23: Value_of_RE.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.23\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CC = 24;// in V\n", +"V_CE= 12;// in V\n", +"Rc = 5;// in k ohm\n", +"Rc = Rc * 10^3;// in ohm\n", +"Beta = 100;\n", +"I_C = 2;// in mA\n", +"I_C = I_C * 10^-3;// in A\n", +"//Applying KVL to the output section, V_CC = (I_C*R_C) + V_CE + (I_E*R_E) or\n", +"// (V_CC-V_CE)/I_C =Rc + R_E*(1+(1/Beta)) (on putting I_E= I_C+I_B and I_B = I_C/Beta)\n", +"R_E = (((V_CC-V_CE)/I_C)-Rc)*(1/(1+(1/Beta)));// in ohm\n", +"disp(R_E,'The value of R_E in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.24: Limiting_value_of_R1_and_R2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.24\n", +"format('v',7)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"S = 3;\n", +"Beta = 100;\n", +"I_C = 2;// in mA\n", +"I_C = I_C * 10^-3;// in A\n", +"R_E = 990;// in ohm\n", +"V_CC = 24;// in V\n", +"V_BE= 0.65;// in V\n", +"I_B = I_C/Beta;// in A\n", +"I_E= I_B+I_C;// in A\n", +"// S = ((Beta+1)*(Rth+R_E))/(Rth+(R_E*(1+Beta))), where Rth= R1*R2/(R1+R2)\n", +"Rth = ((R_E*Beta) - (S*R_E) - (S*R_E*Beta) + R_E)/(S-Beta-1);// in ohm\n", +"Vth= I_B*Rth+V_BE+I_E*R_E;// in V\n", +"// Vth= V_CC*R2/(R1+R2) or \n", +"R1= V_CC*Rth/Vth;// in ohm\n", +"R1= R1*10^-3;// in k ohm\n", +"R2= Vth*R1/(V_CC-Vth);// in k ohm\n", +"disp(R1,'The value of R1 in k ohm is : ');\n", +"disp(R2,'The value of R2 in k ohm is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.25: Values_of_resistors.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.25\n", +"format('v',7)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_C =5 * 10^-3;// in A\n", +"V_CE = 8;// in V\n", +"V_E = 6;// in V\n", +"S = 10;\n", +"h_fc = 200;\n", +"Beta = h_fc;\n", +"V_CC = 20;// in V\n", +"V_BE = 0.6;// in V\n", +"I_B =I_C/Beta;// in A\n", +"I_E = I_C+I_B;// in A\n", +"// I_C*R_C = V_CC - V_CE - V_E;\n", +"R_C = (V_CC - V_CE - V_E)/I_C;// in ohm\n", +"R_C = R_C * 10^-3;// in k ohm\n", +"disp(R_C,'The value of R_C in k ohm is');\n", +"R_C = R_C * 10^3;// in ohm\n", +"//Voltage at point E, V_E =I_E*R_E;\n", +"R_E = V_E/I_E;// in ohm\n", +"R_E = R_E * 10^-3;// in k ohm\n", +"disp(R_E,'The value of R_E in k ohm is');\n", +"R_E = R_E * 10^3;// in ohm\n", +"// S = ((Beta+1)*(R_B+R_E))/( R_B+(R_E*(1+Beta)) ), where R_B= R1*R2/(R1+R2)\n", +"R_B = ((R_E*(1+Beta))-(S*R_E*(1+Beta)))/( S-(1+Beta) );// in ohm\n", +"// Vth = V_CC*(R2/(R1+R2)) = V_CC*(R_B/R1)\n", +"// Applying KVL we get, Vth= I_B*R_B+V_BE+V_E or\n", +"Vth = (I_B*R_B) + V_BE + V_E;// in V\n", +"R1 =(V_CC/Vth)*R_B;// in ohm\n", +"R1= R1*10^-3;// in k ohm\n", +"disp(R1,'The value of R1 in k ohm is');\n", +"R2 = (R1*Vth)/(V_CC-Vth);// in k ohm\n", +"disp(R2,'The value of R2 in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.26: VBB_to_saturate_the_transistor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.26\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CEsat = 0.1;// in V\n", +"V_BEsat = 0.6;// in V\n", +"h_fc = 50;\n", +"Beta = h_fc;\n", +"V_CC = 12;// in V\n", +"R_C = 1;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"R_B = 10;// in k ohm\n", +"R_B = R_B * 10^3;// in ohm\n", +"// The collector current,\n", +"I_C = (V_CC-V_CEsat)/R_C;// in A\n", +"I_B = I_C/Beta;// in mA\n", +"// The value of V_BB to saturate the transistor \n", +"V_BB = (I_B*R_B) + V_BEsat;// in V\n", +"disp(V_BB,'The value of V_BB to saturate the transistor in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.27: IC_and_Vo.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.27\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CC = 30;// in V\n", +"R1 = 90;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R2 = 45;// in k ohm\n", +"R2 = R2 * 10^3;// in ohm\n", +"R_C = 5;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"R_E = 5;// in k ohm\n", +"R_E =R_E * 10^3;// in ohm\n", +"V_BE = 0.6;// in V\n", +"h_FE = 100;\n", +"Beta = h_FE;\n", +"I_CBO = 10;// in µA\n", +"I_CBO = I_CBO * 10^-6;// in A\n", +"V_BB = V_CC*(R2/(R1+R2));// in V\n", +"Vth = V_BB;// in V\n", +"R_BB = (R1*R2)/(R1+R2);// in ohm\n", +"Rth= R_BB;// in ohm\n", +"I_C = (V_CC-V_BE)/( (Rth/Beta)+R_E );// in A\n", +"I_CEO = (Beta+1)*I_CBO;// in A\n", +"// The value of I_C \n", +"I_C = I_C-I_CEO;// in A\n", +"I_C= I_C*10^3;// in mA\n", +"disp(I_C,'The value of I_C in mA is');\n", +"// The value of Vo\n", +"Vo =V_CC-(I_C*10^-3*R_C);// in V\n", +"disp(Vo,'The value of Vo in V is');\n", +"\n", +"// Note: In the book, the putted value of V_CC (i.e 20 V ) to evaluate the value of I_C is wrong, so the value of I_C in the book is wrong and due to this the value of Vo is also wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.28: ICO_and_VCEQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.28\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"Beta = 130;\n", +"V_BE = 0.7;// in V\n", +"V_CC = 18;// in V\n", +"R1 = 510;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R2 = 510;// in k ohm\n", +"R2 = R2 * 10^3;// in ohm\n", +"R_C = 9.1;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"R_E = 7.5*10^3;// in ohm\n", +"Vth = V_CC*(R2/(R1+R2));// in V\n", +"Rth = (R1*R2)/(R1+R2);// in ohm\n", +"//Applying KVL in the input loop, Vth = (I_B*Rth)+V_BE+(I_E*R_E) or\n", +"I_CQ = (Vth-V_BE)/( (Rth/Beta)+R_E+(R_E/Beta) );// in A (On putting I_E = I_C+I_B and I_C = Beta*I_B)\n", +"I_CQ= I_CQ*10^3;// in mA\n", +"disp(I_CQ,'The value of I_CQ in mA is');\n", +"// Applying KVL in the output loop, V_CC = (I_C*R_C) + V_CEQ + (I_E*R_E);\n", +"V_CEQ = V_CC - (I_CQ*10^-3*( R_C+R_E+(R_E/Beta) ));// in V\n", +"disp(V_CEQ,'The value of V_CEQ in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.29: ICQ_and_VCEQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.29\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CC = 18;// in V\n", +"V_BE = 0.7;// in V\n", +"R1 = 510;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"Beta = 130;\n", +"R_E = 7.5;// in k ohm\n", +"R_E = R_E * 10^3;// in ohm\n", +"R_C = 9.1;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"// The value of I_CQ \n", +"I_CQ = (V_CC-V_BE)/( (R1/Beta)+R_E+(R_E/Beta) );// in A\n", +"I_CQ= I_CQ*10^3;// in mA\n", +"disp(I_CQ,'The value of I_CQ in mA is');\n", +"// The value of V_CEQ \n", +"V_CEQ = V_CC - I_CQ*10^-3*(R_C+R_E+(R_E/Beta));// in V\n", +"disp(V_CEQ,'The value of V_CEQ in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: Collector_and_base_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Alpha = 0.95;\n", +"I_CBO = 5* 10^-3;// in mA\n", +"I_E = 3;// in mA\n", +"// The collector current \n", +"I_C = (Alpha*I_E)+I_CBO;// in mA\n", +"disp(I_C,'The collector current in mA is');\n", +"// The base current \n", +"I_B = I_E-I_C;// in mA\n", +"disp(I_B,'The base current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.30: Q_point.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.30\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CC = 10;// in V\n", +"Beta = 90;\n", +"V_BE = 0.7;// in V\n", +"R_E = 4.7;// in k ohm\n", +"R_E = R_E * 10^3;// in ohm\n", +"R_B = 250;// in k ohm\n", +"R_B = R_B * 10^3;// in ohm\n", +"R = 1.2;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"//Applying KVL for input loop, V_CC = R_E*I_E + R_B*I_B + V_BE +I_E*R or\n", +"I_CQ = (Beta*(V_CC-V_BE))/( ((1+Beta)*(R_E+R))+R_B );// in A (On putting I_E = I_C+I_B and I_B = I_C/Beta)\n", +"I_CQ=I_CQ*10^3;// in mA\n", +"disp(I_CQ,'The value of I_CQ in mA is');\n", +"I_CQ=I_CQ*10^-3;// in A\n", +"//Applying KVL for output loop, V_CC = ((I_CQ+(I_CQ/Beta))*R_E)+V_CEQ + ((I_CQ+(I_CQ/Beta))*R)\n", +"V_CEQ = V_CC - ( (I_CQ+(I_CQ/Beta)) * (R_E+R) );// in V\n", +"disp(V_CEQ,'The value of V_CEQ in V is');\n", +"// If beta is increased by 50% i.e\n", +"bita = Beta+Beta/2;\n", +"I_deshCQ = (bita*(V_CC-V_BE))/( ((1+bita)*(R_E+R))+R_B );// in A\n", +"I_deshCQ=I_deshCQ*10^3;// in mA\n", +"disp(I_deshCQ,'The value of I''CQ in mA is');\n", +"V_deshCEQ = V_CC - ( (I_CQ+(I_CQ/bita)) * (R_E+R) );// in V\n", +"disp(V_deshCEQ,'The value of V''CEQ in V is');\n", +"\n", +"// Note: In the book, there is calculation error to evaluate the value of V'CEQ, So the answer in the book is wrong.\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.34: Beta_VCC_and_RB.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.34\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_B = 20;// in µA\n", +"I_B = I_B * 10^-6;// in A\n", +"R_C = 2.7;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"V_CE = 7.3;// in V\n", +"V_BE = 0.7;// in V\n", +"R_E = 0.68;// in k ohm\n", +"R_E = R_E * 10^3;// in ohm\n", +"V_E = 2.1;// in V\n", +"I_E = V_E/R_E;// in A\n", +"I_C =I_E-I_B;// in A (as I_E = I_C+I_B)\n", +"Beta = I_C/I_B;\n", +"disp(Beta,'The value of beta is');\n", +"// Applying KVL to the output loop, \n", +"V_CC = (I_C*R_C) +V_CE + (I_E*R_E);// in V\n", +"disp(V_CC,'The value of V_CC in V is');\n", +"// Applying KVL to the output loop, V_CC = (I_B*R_B)+V_BE+(I_E*R_E) or\n", +"R_B = (V_CC-V_BE-(I_E*R_E))/I_B;// in ohm\n", +"R_B= R_B*10^-3;// k ohm\n", +"disp(R_B,'The value of R_B in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.36: Load_line.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.36\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_CC = 20;// in V\n", +"R_C = 3.3;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"R_B = 1;// in Mohm\n", +"R_B = R_B * 10^6;// in ohm\n", +"V_CE = V_CC;// in V\n", +"I_C = V_CC/R_C;// in A\n", +"I_C=I_C*10^3;// in mA\n", +"// Plotting of the DC load line,\n", +"plot([V_CE,0],[0,I_C]);\n", +"xlabel('V_CE in volts.');\n", +"ylabel('I_C in mA.');\n", +"title('DC load line.')\n", +"disp(I_C,'At saturation, the value of I_C in mA is : ')\n", +"disp(V_CE,'At cut off, the value of V_CE in volts is : ')\n", +"disp('DC load line shown in figure.');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.37: VCE_and_IE.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.37\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"Beta = 100;\n", +"Rth = 1.8;// in k ohm\n", +"V_CC = 10;// in V\n", +"R2 = 2.2;// in k ohm\n", +"R2 = R2 * 10^3;// in ohm\n", +"R1 = 10;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R_C=3.6*10^3;// in ohm\n", +"R_E = 1;// in k ohm\n", +"R_E = R_E * 10^3;// in ohm\n", +"V_BE = 0.7;// in V\n", +"Vth = (R2/(R1+R2))*V_CC;// in V\n", +"Rth = (R1*R2)/(R1+R2);// in ohm\n", +"// Applying KVL for input loop, Vth = (I_B*Rth)+V_BE+(I_E*R_E) or \n", +"I_E = (Vth-V_BE)/( R_E+(Rth/(Beta+1)) );// in A (On putting I_E = (Beta+1)*I_B)\n", +"I_E= I_E*10^3;// in mA\n", +"disp(I_E,'The value of I_E in mA is');\n", +"I_B =I_E/(Beta+1);// in mA\n", +"I_C= I_E-I_B;// in mA\n", +"//Applying KVL for output loop, V_CC = (I_C*R_C) + V_CE + (I_E*R_E)\n", +"V_CE = V_CC - (I_C*10^-3*R_C) - (I_E*10^-3*R_E);// in V\n", +"disp(V_CE,'The value of V_CE in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.38: Zi_Zo_and_Av.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.38\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"h_fe = 110;\n", +"h_ie = 1.6;// in k ohm\n", +"h_ie = h_ie * 10^3;// in ohm\n", +"h_re = 2*10^-4;\n", +"h_oe = 20*10^-6;// in A/V\n", +"R_B = 470;// in k ohm\n", +"R_B = R_B * 10^3;// in ohm\n", +"R_C = 4.7;// in k ohm\n", +"Ri= 1.51*10^3;// in ohm\n", +"R_C =R_C * 10^3;// in ohm\n", +"Rin = h_ie - ( (h_fe*h_re*R_C)/(1+(h_oe*R_C)) );// in ohm\n", +"// The value of Zi,\n", +"Zi = (R_B*Ri)/(R_B+Ri);// in ohm\n", +"Zi= Zi*10^-3;// in k ohm\n", +"disp(Zi,'The value of Zi in k ohm');\n", +"Zi= Zi*10^3;// in ohm\n", +"R_L = R_C;// in ohm\n", +"// The voltag gain,\n", +"Av = -h_fe/( Zi*(h_oe+(1/R_L)) );\n", +"disp(Av,'The value of Av is');\n", +"Rs = 0;// in ohm\n", +"// The value of Zo \n", +"Zo = 1/( h_oe-( (h_fe*h_re)/(Zi+Rs) ) );// in ohm\n", +"Zo= Zo*10^-3;// k ohm\n", +"disp(Zo,'The value of Zo in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: value_of_Bita.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Alpha = 0.9;\n", +"// For alpha = 0.9, the value of Beta \n", +"Beta = Alpha/(1-Alpha);\n", +"disp(Beta,'For alpha = 0.9, the value of Beta is');\n", +"Alpha = 0.99;\n", +"// For alpha = 0.99, the value of Beta \n", +"Beta = Alpha/(1-Alpha);\n", +"disp(Beta,'For alpha = 0.99, the value of Beta is');\n", +"Alpha = 0.98;\n", +"// For alpha = 0.98, the value of Beta \n", +"Beta = Alpha/(1-Alpha);\n", +"disp(Beta,'For alpha = 0.98, the value of Beta is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4: Base_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_C = 2;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"V = 2;// in V\n", +"// The collector current\n", +"I_C = V/R_C;// in A\n", +"Beta = 50;\n", +"// The base current \n", +"I_B = I_C/Beta;// in A\n", +"I_B= I_B*10^6;// in µA\n", +"disp(I_B,'The base current in µA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5: Value_of_IC_using_alpha_and_bita.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Beta = 49;\n", +"I_E = 12;// in mA\n", +"I_B = 240;// in µA\n", +"I_B = I_B * 10^-3;// in mA\n", +"Alpha = Beta/(1+Beta);\n", +"//Using alpha rating, the value of collector current,\n", +"I_C = Alpha*I_E;// in mA\n", +"disp(Alpha,'The value of alpha is : ')\n", +"disp(I_C,'Using alpha rating, the value of I_C in mA is');\n", +"//Using beta rating, the value of collector current,\n", +"I_C = Beta*I_B;// in mA\n", +"disp(I_C,'Using bita rating, the value of I_C in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: Value_of_alpha_and_bita.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.6\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Alpha = 0.975;\n", +"Beta = Alpha/(1-Alpha);\n", +"// The value of beta,\n", +"disp(Beta,'The value of Beta is');\n", +"Beta = 200;\n", +"// The value of alpha,\n", +"Alpha = Beta/(1+Beta);\n", +"disp(Alpha,'The value of Alpha is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: Collector_and_emitter_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Alpha = 0.98;\n", +"I_CO = 5;// in µA\n", +"I_CO = I_CO * 10^-3;// in mA\n", +"I_B = 100;// in µA\n", +"I_B = I_B * 10^-3;// in mA\n", +"Beta = Alpha/(1-Alpha);\n", +"// The collector current \n", +"I_C = Beta*I_B + (1+Beta)*I_CO;// in mA\n", +"disp(I_C,'The collector current in mA is');\n", +"// The emitter current \n", +"I_E = I_C+I_B;// in mA\n", +"disp(I_E,'The emitter current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8: Collector_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.8\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',7)\n", +"// Given data\n", +"I_CBO = 10;// in µA\n", +"I_CBO = I_CBO * 10^-6;// in A\n", +"Beta = 50;\n", +"h_FE = Beta;\n", +"I_B = 0.25;// in mA\n", +"I_B = I_B * 10^-3;// in A\n", +"// The collector current \n", +"I_C = (Beta*I_B) + ((1+Beta)*I_CBO);//in A\n", +"I_C = I_C * 10^3;// in mA\n", +"disp(I_C,'The collector current in mA is');\n", +"T2 = 50;// in degree C\n", +"T1 = 25;// in degree C\n", +"I_CBOat25 = 10;// in µA\n", +"I_CBOat50 = I_CBOat25 * (2^((T2-T1)/10));// in µA\n", +"I_CBOat50 = I_CBOat50 * 10^-6;// in A\n", +"//The new collector current \n", +"I_C = (Beta*I_B) + ((1+Beta)*I_CBOat50);// in A\n", +"I_C = I_C * 10^3;// in mA\n", +"disp(I_C,'The new collector current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9: Value_of_IC_and_VCE.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 4.9\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_BE = 0.6;// in V\n", +"V_CC = 10;// in V\n", +"Beta = 60;\n", +"R_B = 20;// in k ohm\n", +"R_B = R_B * 10^3;// in ohm\n", +"R_C = 300;// in ohm\n", +"// V_CC - (I_B*R_B)-V_BE = 0;\n", +"I_B = (V_CC-V_BE)/R_B;// in A\n", +"// The collector current \n", +"I_C = Beta*I_B;// in A\n", +"I_C= I_C*10^3;// in mA\n", +"disp(I_C,'The collector current in mA is');\n", +"// V_CC - (I_C*R_C) -V_CE = 0;\n", +"// The collector emitter voltage \n", +"V_CE = V_CC - (I_C*10^-3*R_C);// in V\n", +"disp(V_CE,'The collector emitter voltage in V 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 +} diff --git a/Basic_Electronics_by_R_K_Garg/5-Transistor_Amplifier.ipynb b/Basic_Electronics_by_R_K_Garg/5-Transistor_Amplifier.ipynb new file mode 100644 index 0000000..1e698d5 --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/5-Transistor_Amplifier.ipynb @@ -0,0 +1,1239 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Transistor Amplifier" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.10: Ai_Ri_Av_and_gammaO.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"h_ie = 1.5;// in ohm\n", +"h_fe = 100;\n", +"h_re = 3 * 10^-4;\n", +"h_oe = 25 * 10^-6;// in mho\n", +"V_CC = 20;// in V\n", +"R1 = 50 * 10^3;// in ohm\n", +"R2 = 5 * 10^3;// in ohm\n", +"R_C = 5 * 10^3;// in ohm\n", +"R_L = 10 * 10^3;// in ohm\n", +"R_S = 1;// in k ohm\n", +"Ri= 1.4*10^3;// in ohm\n", +"R_B = (R1*R2)/(R1+R2);// in ohm\n", +"R_Ldesh= R_L*R_C/(R_L+R_C);// in ohm\n", +"// Current gain for transisor,\n", +"Ai= -h_fe/(1+h_oe*R_Ldesh);\n", +"// Overall current gain, A_I= Ai+Ib/I= Ai+R_B/(R_B+Ri) \n", +"A_I= Ai*R_B/(R_B+Ri);\n", +"disp(A_I,'The overall current gain is : ')\n", +"//Part (ii)\n", +"R_i= R_B*Ri/(R_B*Ri);// in k ohm\n", +"disp(R_i,'The value of Ri in k ohm is : ')\n", +"// Part (iii)\n", +"Av= A_I*R_Ldesh/Ri;// voltage gain for transistor\n", +"// overall voltage gain,\n", +"A_VS= Av*R_i/(R_S+R_i);\n", +"disp(A_VS,'The value of A_VS is : ')\n", +"// Part (iv)\n", +"R_S=R_S*10^3;// in ohm\n", +"R_Sdesh= R_S*R_B/(R_S+R_B);// in ohm\n", +"gamma_o= h_re*h_fe/(h_ie+R_Sdesh)-h_oe;// in mho\n", +"gamma_o= round(gamma_o*10^6);// in µ mho\n", +"disp(gamma_o,'The value of gamma_o in µ mho is : ')\n", +"\n", +"// Note: In the book, all these calculated value is not accurate.\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.11: Ai_Ri_Av_Ro_Ro1_and_Ap.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.11\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_S = 800;// in ohm\n", +"R_L = 2;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"h_ie = 1.1;// in k ohm\n", +"h_ie = h_ie * 10^3;// in ohm\n", +"h_fe = 50;\n", +"h_oe = 25;// in µohm\n", +"h_oe = h_oe * 10^-6;// in ohm\n", +"h_re = 2.5*10^-4;\n", +"\n", +"// Part (a) : Exact analysis\n", +"disp('Part (a) : Exact analysis')\n", +"// The current gain\n", +"Ai_exact = -h_fe/(1+(h_oe*R_L));\n", +"disp(Ai_exact,'The current gain is');\n", +"// The input resistance \n", +"Ri = h_ie + (h_re*Ai_exact*R_L);// in ohm\n", +"Ri= Ri*10^-3;// in k ohm\n", +"disp(Ri,'The input resistance in k ohm is');\n", +"Ri= Ri*10^3;// in ohm\n", +"A_V = (Ai_exact*R_L)/Ri;\n", +"// The voltage gain,\n", +"A_VS = (A_V*Ri)/(Ri+R_S);\n", +"disp(A_VS,'The voltage gain is');\n", +"Gamma_o = h_oe - ( (h_re*h_fe)/(h_ie+R_S) );// in mho\n", +"// The output resistance \n", +"Ro = 1/Gamma_o;// in ohm\n", +"Ro= Ro*10^-3;// k ohm\n", +"disp(Ro,'The output resistance in k ohm is');\n", +"Ro= Ro*10^3;// ohm\n", +"// The power gain,\n", +"Ap = Ai_exact*A_V;\n", +"disp(Ap,'The power gain is');\n", +"// The output terminal resistance \n", +"Rot = (Ro*R_L)/(Ro+R_L);// in ohm\n", +"Rot= Rot*10^-3;// in k ohm\n", +"disp(Rot,'The output terminal resistance in k ohm is');\n", +"Rot= Rot*10^3;// in ohm\n", +"\n", +"// Part (b) : Approximate analysis\n", +"disp('Part (b) : Approximate analysis')\n", +"h_re =0;\n", +"h_oe = 0;\n", +"Ai_app = -h_fe/(1+(h_oe*R_L));\n", +"disp(Ai_app,'The value of Ai is');\n", +"Ri = h_ie+(h_re*Ai_app*R_L);\n", +"disp(Ri,'The value of Ri in ohm is');\n", +"A_V= Ai_app*R_L/Ri;\n", +"A_VS = (-A_V*h_ie)/(R_S+h_ie);\n", +"disp(A_VS,'The value of A_VS is');\n", +"Gamma_o = 18.42// in µohms\n", +"Gamma_o = Gamma_o * 10^-6;// in mho\n", +"// // The output resistance \n", +"Ro = 1/Gamma_o;// in ohm\n", +"Ro= Ro*10^-3;// k ohm\n", +"disp(Ro,'The output resistance in k ohm is');\n", +"Ro= Ro*10^3;// ohm\n", +"Ap = Ai_app*A_V;\n", +"disp(Ap,'The value of Ap is');\n", +"//The output terminal resistance, Rot = (Ro*R_L)/(Ro+R_L)= 20;// in k ohm\n", +"Rot= 20;// in k ohm\n", +"disp(Rot,'The output terminal resistance in k ohm is');\n", +"Rot= Rot*10^3;// in ohm\n", +"// Percentage error\n", +"Per_error= abs((Ai_exact-Ai_app)/Ai_exact*100);// in %\n", +"disp(Per_error,'The percentage error in % is');\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.13: Voltage_gain_current_gain_and_power_gain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.13\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_S = 600;// in ohm\n", +"r_i = 400;// in ohm\n", +"Vs = 1;// in mV\n", +"Vs = Vs * 10^-3;// in V\n", +"//Input voltage\n", +"Vi = Vs*(r_i/(R_S+r_i));// in V\n", +"// Input current\n", +"Ii =Vs/(R_S+r_i);// in A\n", +"Vo = 100;// in mV\n", +"Vo = Vo * 10^-3;// in V\n", +"R_L = 5;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"// Output current \n", +"Io = Vo/R_L;// in A\n", +"// voltage gain\n", +"A_V =Vo/Vi ; \n", +"disp(A_V,'The voltage gain is');\n", +"// current gain\n", +"A_I = Io/Ii;\n", +"disp(A_I,'The current gain is');\n", +"// Power gain\n", +"P =A_V*A_I;\n", +"disp(P,'The power gain is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.14: Gain_of_negative_feedback_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.14\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"A = 125;\n", +"Beta = 1/10;\n", +"// Gain of negative feedback\n", +"Af = A/(1+(A*Beta));\n", +"disp(Af,'The gain of negative feedback is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.15: Value_of_A_and_B.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.15\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Af = 100;\n", +"Vi = 0.6;// in V\n", +"Vo =Af*Vi;// in V\n", +"Vi = 50;// in mV\n", +"Vi = Vi * 10^-3;// in V\n", +"// Internal gain of amplifier,\n", +"A = Vo/Vi;\n", +"disp(A,'The value of A is : ');\n", +"B= ((A/Af)-1)/A;\n", +"disp(B,'The value of B is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.16: Change_in_overall_gain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.16\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"A = 60;// in dB\n", +"A =10^(A/20);\n", +"Beta = 0.005;\n", +"dAbyA = -12/100;//gain reduction in %\n", +"dAf_byAf = (1/(1+(A*Beta)))*dAbyA;// change in overall gain\n", +"dAf_byAf = dAf_byAf * 100;// in %\n", +"disp(dAf_byAf,'The change in overall gain in % is');\n", +"disp('Thus, the overall gain will be reduced by 2%')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.17: Feedback_Factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.17\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',7)\n", +"// Given data\n", +"Zo = 12.6;// in k ohm\n", +"Zo = Zo * 10^3;// in ohm\n", +"A = 60;// in dB\n", +"A = 10^(A/20)\n", +"Zof = 500;// in ohm\n", +"// Zof = Zo/(1+(A*Beta));\n", +"Beta = ((Zo/Zof)-1)/A;\n", +"disp(Beta,'The value of feed back factor is');\n", +"// Part (ii)\n", +"dAbyA= 20/100;// change in gain of basic amplifier\n", +"dAf_byAf =dAbyA*1/(1+A*Beta)*100;//change in overall gain in %\n", +"disp(dAf_byAf,'The change in overall gain for 20 % change in gain of the basic amplifier in % is');\n", +"\n", +"// Note: In the book, there is calculation error to find the value of dAf/Af" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.18: output_and_input_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.18\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vo = 36;// in V\n", +"Vi = 0.028;// in V\n", +"A = Vo/Vi;\n", +"Vf = 1.2;\n", +"Vo = 100;\n", +"Beta = Vf/Vo;\n", +"// Gain with feedback\n", +"Af = A/(1+(A*Beta));\n", +"Vs = Vi;// in V\n", +"// Output voltage\n", +"Vo =Af*Vs;// in V\n", +"disp(Vo,'The output voltage in V is');\n", +"//Df =D/(1+(A*Beta));\n", +"DbyDf = 7/1;\n", +"ABeta = (DbyDf)-1;\n", +"Af =A/(1+(ABeta));\n", +"Vo = 36;// in V\n", +"// The input voltage,\n", +"Vs =Vo/Af;\n", +"disp(Vs,'The input voltage is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.19: Required_feedback_ratio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.19\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"dAf_byAf = 10/100;\n", +"dAbyA = 10;\n", +"A = 1000;\n", +"// dAf_byAf = dAbyA*(1/(1+(A*Beta)));\n", +"// The required feed back \n", +"Beta = ((dAbyA/dAf_byAf)-1)/A;\n", +"disp(Beta,'The required feed back is');\n", +"Af = A/(1+(A*Beta));// closed loop voltage gain \n", +"disp(Af,'The closed loop voltage gain is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: Value_of_C_and_hfe.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R_C = 10;// in k ohm\n", +"R_C = R_C * 10^3;// in ohm\n", +"f = 2;// in kHz\n", +"f = f * 10^3;// in Hz\n", +"R = 8;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"//Formula, f = 1/(2*%pi*R*C*sqrt(6+((4*R_C)/R)));\n", +"C = 1/(2*%pi*R*f*sqrt(6+((4*R_C)/R)));// in F\n", +"C= C*10^6;// in µF\n", +"disp(C,'The value of capacitor in µF is');\n", +"h_fe= 23+29*R/R_C+4*R_C/R;\n", +"disp(h_fe,'The value of h_fe is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.20: Distortion_and_new_value_of_input_required.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.20\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"Vi= 10*10^-3;// input voltage in V\n", +"A=1000;// open loop voltage gain\n", +"Do= 10;//second harmonic distortion in %\n", +"feedback= 40;//feedback in dB\n", +"feedback= 10^(feedback/20);\n", +"// feedback= 1+A*bita or\n", +"bita= (feedback-1)/A\n", +"Af= A/(1+A*bita);\n", +"// New value of second harmonic distortion,\n", +"Df= Do/(1+A*bita);// in %\n", +"disp(Df,' The new value of second harmonic distortion in % is : ')\n", +"// New value of input required,\n", +"Vs= Vi*(1+A*bita);// in V\n", +"disp(Vs,'The new value of input required in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.21: Gain_input_voltage_output_voltage_with_feedback.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.21\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"D = 10/100;\n", +"Df = 1/100;\n", +"A = 200;\n", +"Vs = 10;// in mV\n", +"Vs = Vs * 10^-3;// in V\n", +"// Df = D/(1+A*Beta);\n", +"Beta = (((D/Df)-1)/A);\n", +"// gain with feedback \n", +"Af = A/(1+(A*Beta));\n", +"disp(Af,'The gain with feedback is : ');\n", +"// The output voltage \n", +"Vo = Af*Vs;// in V\n", +"disp(Vo,'The output voltage in V is : ');\n", +"// The input voltage \n", +"Vin = Df+(-Beta*Vo);// in V\n", +"disp(Vin,'The input voltage in V is : ');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.22: Input_and_output_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.22\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',8)\n", +"// Given data\n", +"A = 10000;\n", +"Beta = 0.02;\n", +"Zi = 1;// in k ohm\n", +"Zi = Zi * 10^3;// in ohm\n", +"Zo = 10;// in k ohm\n", +"Zo = Zo * 10^3;// in ohm\n", +"// The input impedance \n", +"Zif = Zi*(1+(A*Beta));// in ohm\n", +"Zif= Zif*10^-3;// in k ohm\n", +"disp(Zif,'The input impedance in k ohm is');\n", +"// The output impedance \n", +"Zof = Zo/(1+(A*Beta));// in ohm\n", +"Zof= Zof*10^-3;// in k ohm\n", +"disp(Zof,'The output impedance in k ohm is');\n", +"\n", +"// Note: In the book, there is calculation error to find the value of Zof because 10/201 will be 0.04975 not 0.4975" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.23: Gain_and_frequency_responce.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.23\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"A = 400;\n", +"Beta = 0.01;\n", +"// The gain with feedback\n", +"Af =A/(1+(A*Beta));\n", +"disp(Af,'The gain with feedback is');\n", +"f_L = 200;// in Hz\n", +"// The Lower cut-off frequency with feedback \n", +"f_LF = f_L/(1+(A*Beta));// in Hz\n", +"disp(f_LF,'The Lower cut-off frequency with feedback in Hz is');\n", +"f_H = 40;// in kHz\n", +"f_H = f_H * 10^3;// in Hz\n", +"// The Upper cut-off frequency with feedback \n", +"f_HF = f_H*(1+(A*Beta));// in Hz\n", +"f_HF=f_HF*10^-3;// in k Hz\n", +"disp(f_HF,'The Upper cut-off frequency with feedback in kHz is');\n", +"\n", +"// Note: In the book, there is calculation error to find the value of gain with feedback i.e. Af, so the answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.24: Feedback_fractio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.24\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"format('v',6)\n", +"A = 4000;\n", +"R1 = 1;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R2 = 9;// in k ohm\n", +"R2 = R2 * 10^3;// in ohm\n", +"Beta = R1/(R1+R2);// feedback fraction \n", +"disp(Beta,'The feedback fraction is');\n", +"// The overall voltage gain with feedback \n", +"Af = A/(1+(A*Beta));\n", +"disp(Af,'The overall voltage gain with feedback is');\n", +"Vs = 2;// in mV\n", +"//Af = Vo/Vs;\n", +"// The output voltage \n", +"Vo = Af*Vs;// in mV\n", +"disp(Vo,'The output voltage in mV is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.25: Percentage_reduction_in_harmonic_distortion.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.25\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"A = 54.8;\n", +"A = 20 * log(A);\n", +"Beta = 1/50;// feedback factor\n", +"// gain with feedback\n", +"Af = A/(1+(A*Beta));\n", +"//Distortion with feedback, Df = D/(1+(A*Beta))\n", +"Df = 1;\n", +"D = 12;\n", +"Pd = (Df/D)*100;// percenatge change in distortion in %\n", +"disp(Pd,'The percentage reduction in harmonic distortion in % is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.26: Minimum_gain_required_for_oscillation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.26 \n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"// Part(iii)\n", +"Vf_byVo= 1/3;\n", +"bita= Vf_byVo;\n", +"// A*bita>=1 or\n", +"// The minimum gain required for oscillation \n", +"Amin= 1/bita;\n", +"disp(Amin,'The minimum gain required for oscillation is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.27: Stability_of_an_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.27\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',9)\n", +"// Magnitude of loop gain, Mag_Tf= bita*100/(sqrt(1+(f/10^5)^2))^3 (i)\n", +"// Phase of loop gain, P_Tf= -3*atand(f/10^5) (ii)\n", +"f_180= tand(180/3)*10^5;// from eq(ii), frequency at which phase becomes -180°\n", +"bita= 0.20;\n", +"T_f_180= bita*100/(sqrt(1+(f_180/10^5)^2))^3;// from eq (i), the magnitude of loop gain at f_180 for bita= 0.20\n", +"disp(T_f_180,'The magnitude of loop gain for beta = 0.20 is : ')\n", +"bita= 0.02;\n", +"T_f_180= bita*100/(sqrt(1+(f_180/10^5)^2))^3;// from eq (i), the magnitude of loop gain at f_180 for bita= 0.20\n", +"disp(T_f_180,'The magnitude of loop gain for beta = 0.20 is : ')\n", +"disp('Hence system is unstable for beta=0.20 and stable for beta= 0.02 because at beta= 0.20 gain is greater than 1.')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.29: Frequency_of_oscillations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.29\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"L = 0.01;// in H\n", +"C = 10;// in pF\n", +"C = C * 10^-12;// in F\n", +"// The frequency of oscillation \n", +"f = 1/(2*%pi*sqrt(L*C));// in Hz\n", +"f = f * 10^-3;// in kHz\n", +"disp(f,'The frequency of oscillation in kHz is');\n", +"\n", +"// Note: In the book, the calculation is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: Value_of_C.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"f = 10;// in kHz\n", +"f = f * 10^3;// in Hz\n", +"R = 100;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"//Formula used, f = 1/(2*%pi*R*C);\n", +"C = 1/(2*%pi*R*f);// in F\n", +"C = round(C * 10^12);// in pF\n", +"disp(C,'The value of capacitor in pF is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.30: Range_of_variable_capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.30\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"L = 150;// in µH\n", +"L = L * 10^-6;// in H\n", +"// f = 1/(2*%pi*sqrt(L*C)) or C = 1/(4*%pi^2*f^2*L)\n", +"//For f= 500 kHz\n", +"f1 = 500;// in kHz\n", +"f1 = f1 * 10^3;// in Hz\n", +"C1 = 1/(4*%pi^2*f1^2*L);// in F\n", +"//For f= 1500 kHz\n", +"f2 = 1500;// in kHz\n", +"f2 = f2 * 10^3;// in Hz\n", +"C2 = 1/(4*%pi^2*f2^2*L);// in F\n", +"C1= C1*10^12;// in pF\n", +"C2= C2*10^12;// in pF\n", +"disp('The required capacitor range is : '+string(C2)+' pF to '+string(C1)+' pF')\n", +"\n", +"// Note: The answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.31: Operating_frequency_and_feedback_fraction.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.31\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"L = 100;// in µH\n", +"L = L * 10^-6;// in H\n", +"A=10;\n", +"C1 = 0.001;// in µF\n", +"C1 = C1 * 10^-6;// in F\n", +"C2 = 0.01;// in µF\n", +"C2 = C2 * 10^-6;// in F\n", +"C = (C1*C2)/(C1+C2);// in F\n", +"f = 1/(2*%pi*sqrt( L*C ));// in Hz\n", +"f = round(f * 10^-3);// in kHz\n", +"disp(f,'The operating frequency in kHz is');\n", +"Beta = C1/C2;// feedback fraction\n", +"disp(Beta,'The feed back fraction is');\n", +"//Minimum gain to sustain oscillations, Amin*Beta = 1;\n", +"Amin = 1/Beta;\n", +"disp(Amin,'The minimum gain to sustain oscillation is');\n", +"// A = R_C/R_E;\n", +"R_C = 2.5;// in ohm\n", +"R_E = R_C/A;// in ohm\n", +"disp(R_E,'The emitter resistance in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.32: Value_of_capacitor_of_oscillatory.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.32\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"L1 = 0.1;// in mH\n", +"L1 = L1 * 10^-3;// in H\n", +"L2 = 10;// in mH\n", +"L2 = L2 * 10^-3;// in H\n", +"L = 150;// in µH\n", +"L = L * 10^-6;// in H\n", +"f = 4110;// in kHz\n", +"f = f * 10^3;// in Hz\n", +"//Frequency of oscillations, f = 1/(2*%pi*sqrt(L*C)), So\n", +"C = 1/(4*(%pi^2)*(f^2)*L );// in F\n", +"C = round(C * 10^12);// in pF\n", +"disp(C,'The value of capacitor in pF is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.33: Value_of_C.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.33\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"f = 1;// in kHz\n", +"f = f * 10^3;// in Hz\n", +"R = 10;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"omega = 2*%pi*f;//in rad/sec\n", +"phi = 60;// in degree\n", +"// tand(phi) = Alpha_C/R = 1/(omega*C*R);\n", +"C = 1/(omega*R*tand(phi));// in F\n", +"C = C * 10^6;// in µF\n", +"disp(C,'The value of C in µF is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.34: Frequency_of_oscillations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.34\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',8)\n", +"// Given data\n", +"R2 = 200;// in k ohm\n", +"R2 = R2 * 10^3;// in ohm\n", +"R1 = R2;// in ohm\n", +"C2 = 250;// in pF\n", +"C2 = C2 * 10^-12;// in F\n", +"C1 = C2;// in F\n", +"R = R2;// in ohm\n", +"C = C2;// in F\n", +"// Frequency of oscillations,\n", +"f = 1/(2*%pi*R*C);// in Hz\n", +"disp(f,'The frequency in Hz is');\n", +"\n", +"// Note: The answer in the book is not accurate." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.36: Frequency_of_oscillations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.36\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"C1 = 300;// in pF\n", +"C2 = 100;// in pF\n", +"Ceq = (C1*C2)/(C1+C2);// in pF\n", +"Ceq = Ceq * 10^-12;// in F\n", +"L = 50;// in µH\n", +"L = L * 10^-6;// in H\n", +"// The frequency of oscillation \n", +"f = 1/(2*%pi*sqrt(L*Ceq));// in Hz\n", +"f = f * 10^-6;// in MHz\n", +"disp(f,'The frequency of oscillation in MHz is');\n", +"// For maintaining oscillation, A_loop >=1 and Aopenloop*Beta = 1;\n", +"// Beta = C2/C1;\n", +"Aopenloop = C1/C2;\n", +"disp(Aopenloop,'The minimum gain for maintaining oscillation is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: Paraller_and_seried_resonant_frequency_and_Q_factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"C = 0.06;// in pF\n", +"C = C * 10^-12;// in F\n", +"L = 0.5;// in H\n", +"R = 10;// in k ohm\n", +"R = R * 10^3;// in ohm\n", +"Cm = 1;// in pF\n", +"Cm = Cm * 10^-12;// in F\n", +"// The parallel resonant frequency \n", +"f_p = (1/(2*%pi))*( sqrt( (C+Cm)/(L*C*Cm) ) );// in Hz\n", +"f_p= f_p*10^-3;// in kHz\n", +"disp(f_p,'The parallel resonant frequency in kHz is');\n", +"// The series resonant frequency \n", +"f_s = 1/(2*%pi*(sqrt(L*C)));// in Hz\n", +"f_s= f_s*10^-3;// in kHz\n", +"disp(f_s,'The series resonant frequency in kHz is ');\n", +"omega_s = 2*%pi*f_s*10^3;// in rad/sec\n", +"// The Q factor of the crystal \n", +"Q = (omega_s*L)/R;\n", +"disp(Q,'The Q factor of the crystal is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4: h_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R1 = 6;// in ohm\n", +"R2 = 4;// in ohm\n", +"R3 = 4;// in ohm\n", +"h11 = R1+( (R2*R3)/(R2+R3) );// in ohm\n", +"disp(h11,'The value of h11 in ohm is');\n", +"// i2 = -i*1/2 and h21 = i2/i1 = (-i1/2)/2, So\n", +"h21 = -1/2;\n", +"disp(h21,'The value of h21 is');\n", +"// V1 = V2/2 and h12 = V1/V2 = (V2/2)/2, SO\n", +"h12 = 1/2;\n", +"disp(h12,'The value of h12 is');\n", +"Zo = R2+R3;// output resistance in ohm\n", +"h22 = 1/Zo;// in mho\n", +"disp(h22,'The value of h22 in mho is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5: h_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"R1 = 3;// in ohm\n", +"R2 = 6;// in ohm\n", +"R3 = 2;// in ohm\n", +"// V1 = (R1*I1)+ (R2*(I1+I2)) = ((R1+R2)*I1)+(R2*I2) (i)\n", +"// V2 = (R3*I2) + (R2*(I1+I2)) = (R2*I1) + ((R1+R3)*I2) (ii)\n", +"// Standard h-parameter equation \n", +"//V1= h11*I1 +h12*I2 and V2= h21*I1 + h22*I2\n", +"// Comparing eq (i) and (ii) with standard equaation, we get\n", +"h11= R1+R2;\n", +"disp(h11,'The value of h11 is');\n", +"h12= R2;\n", +"disp(h12,'The value of h12 is');\n", +"h21= R2;\n", +"disp(h21,'The value of h21 is');\n", +"h22= R2+R3;\n", +"disp(h22,'The value of h22 is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.7: Value_of_Ai_Av_Avs_Ri_and_Ro.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"h_ic = 1.1;// in k ohm\n", +"h_ic = h_ic * 10^3;// in ohm\n", +"h_rc = 1;\n", +"h_fc = -51;\n", +"h_oc = 25;// in µA/V\n", +"h_oc = h_oc * 10^-6;// in A/V\n", +"R_L = 10;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"R_S = R_L;// in ohm\n", +"// The current gain,\n", +"Ai = -h_fc/(1+(h_oc*R_L));\n", +"disp(Ai,'The value of Ai is');\n", +"// The value of Ri \n", +"Ri = h_ic+(h_rc*Ai*R_L);// in ohm\n", +"Ri= Ri*10^-3;// in k ohm\n", +"disp(Ri,'The value of Ri in k ohm is');\n", +"Ri= Ri*10^3;// in ohm\n", +"// The value of A_V \n", +"A_V = (Ai*R_L)/Ri;\n", +"disp(A_V,'The value of A_V is');\n", +"Gamma_o = h_oc - ( (h_fc*h_rc)/(h_ic+R_S) );// in mho\n", +"// The value of Ro \n", +"Ro = round(1/Gamma_o);// in ohm\n", +"disp(Ro,'The value of Ro in ohm is');\n", +"A_VS = (A_V*Ri)/(Ri+R_S);\n", +"disp(A_VS,'The value of A_VS 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 +} 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 +} diff --git a/Basic_Electronics_by_R_K_Garg/7-Junction_Field_Effect_Transistor.ipynb b/Basic_Electronics_by_R_K_Garg/7-Junction_Field_Effect_Transistor.ipynb new file mode 100644 index 0000000..20fe3c2 --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/7-Junction_Field_Effect_Transistor.ipynb @@ -0,0 +1,809 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Junction Field Effect Transistor" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.10: Transconductance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_D1 = 1.2;// in mA\n", +"I_D2 = 1.5;// in mA\n", +"// change in gate to source voltage,\n", +"delI_D = I_D2-I_D1;// in mA\n", +"V_GS2 = -4.10;// in V\n", +"V_GS1 = -4.25;// in V\n", +"delV_GS = V_GS2-V_GS1;// in V\n", +"// The transconductance \n", +"g_m = delI_D/delV_GS;// in mA/V\n", +"disp(g_m,'The transconductance in mA/V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.11: Id_and_gm.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.11\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_DSS = 8.4;// in mA\n", +"V_P = -3;// in V\n", +"V_GS = -1.5;// in V\n", +"// The value of I_D,\n", +"I_D = I_DSS*((1-(V_GS/V_P))^2);// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"g_mo = (-2*I_DSS)/V_P;// in mA/V\n", +"// The value of g_m \n", +"g_m = g_mo*(1-(V_GS/V_P));// in mA/V\n", +"disp(g_m,'The value of g_m in mA/V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.12: Pinch_off_voltage_for_Si_and_Ge.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.12\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"rho = 10;// in ohm-cm\n", +"epsilon_o = 8.86*10^-12;// in c^2/Nm^2\n", +"a = 2*10^-4;// in cm\n", +"// V_P= q*N_A*a^2/(2*epsilon) (i)\n", +"// and sigma= n*miu*q = N_A*miu*q => N_A= 1/(q*miu*rho) (ii)\n", +"// From eq(i) and (ii), V_P = (a^2)/(2*miu_p*Epsilon*rho)\n", +"miu_p= 500;// in cm^2/V-sec (for Si)\n", +"epsilon= 12*epsilon_o;// for Si\n", +"// The pinch off voltage for Si \n", +"V_P = (a^2)/(2*miu_p*epsilon*rho);//in V\n", +"disp(V_P,'Part (a) : The pinch off voltage for Si in volts is : ')\n", +"miu_p= 1800;// in cm^2/V-sec (for Ge)\n", +"epsilon= 16*epsilon_o;// for Ge\n", +"// The pinch off voltage for Ge \n", +"V_P = (a^2)/(2*miu_p*epsilon*rho);//in V\n", +"disp(V_P,'Part (b) : The pinch off voltage for Ge in volts is : ')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.14: gm_rd_Zi_Zo_and_Av.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.14\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_DSS = 16*10^-3;// in A\n", +"V_P = 4;// in V\n", +"V_GS= 2.86;//in V\n", +"Yos = 25;// in µS\n", +"Yos= Yos* 10^-6;// in S\n", +"R_S= 2.2*10^3;// in ohm\n", +"//gm = gmo * (1-(V_GS/V_P)) or\n", +"gm= 2*I_DSS/V_P*(1-V_GS/V_P);// in A/V\n", +"gm= gm*10^3;// in mA/V\n", +"disp(gm,'Part (i) : The value of gm in mS or mA/V is');\n", +"gm= gm*10^-3;// in A/V\n", +"r_d = 1/Yos;// in ohm\n", +"r_d= r_d*10^-3;// in k ohm\n", +"disp(r_d,'The value of r_d in k ohm is');\n", +"r_d= r_d*10^3;// in ohm\n", +"// Part (ii)\n", +"Zi = 1;// in Mohm\n", +"miu = r_d*gm;\n", +"Zof_int= r_d/(1+miu)\n", +"// The value of Zo \n", +"Zo= Zof_int*R_S/(Zof_int+R_S);// in ohm\n", +"// The value of Av\n", +"Av= miu*R_S/(r_d+(1+miu)*R_S);\n", +"disp(Zi,'Part (ii) : The value of Zi in M ohm is : ')\n", +"disp(Zo,'Part (iii) : The value of Zo in ohm is : ')\n", +"disp(Av,'Part (iv) : The value of Av is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.16: Voltage_gai.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.16\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// GIven data\n", +"g_m = 2*10^-3;// in A/V\n", +"r_d = 10;// in k ohm\n", +"r_d = r_d * 10^3;// in ohm\n", +"R_D = 50;// in k ohm\n", +"R_D = R_D * 10^3;// in ohm\n", +"R_L = 50;// in k ohm\n", +"R_L = R_L * 10^3;// in ohm\n", +"f = 1;// in kHz\n", +"f = f * 10^3;// in Hz\n", +"C = 2;// in nF\n", +"C = C * 10^-9;// in F\n", +"omega= 2*%pi*f;// in radian/sec\n", +"R = (r_d*R_D*R_L)/( (r_d*R_D)+(R_D*R_L)+(R_L*r_d) );// in ohm\n", +"// The voltage gain,\n", +"Av = -g_m*R;\n", +"disp(Av,'Part (a) : The voltage gain is');\n", +"// Part (b) For small value of Cb, \n", +"Av = -g_m*( (r_d*R_D)/(r_d+R_D) );\n", +"Ro = (r_d*R_D)/(r_d+R_D);// in ohm\n", +"X_C = 1/(omega*C);// in ohm\n", +"Av= abs(Av)*R_L/(-%i*X_C+Ro+R_L);\n", +"Mag_Av= abs(Av);// magnitude of voltage gain\n", +"Phase_Av= atand(imag(Av),real(Av));// phase angle of voltage gain in °\n", +"disp(Mag_Av,'Part (b) : Magnitude of voltage gain is : ');\n", +"disp(Phase_Av,'The phase angle of voltage gain in degree is: ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.17: Quiescent_drain_current_drain_to_source_voltage_and_Av.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.17\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_DD = 30;// in V\n", +"R_D = 12;// in k ohm\n", +"R_S= 1.5;// in k ohm\n", +"V_GS = -0.47;// in V\n", +"V_P = -2.4;// in V\n", +"I_DSS = 3;// in mA\n", +"I_D= poly(0,'I_D');\n", +"I_D= I_D-I_DSS*(1-(V_GS/V_P)*I_D)^2;\n", +"// On solving equation by polynomial method, quiescent drain current \n", +"I_D= roots(I_D)\n", +"I_D= I_D(2);// in mA\n", +"disp(I_D,'The quiescent drain current in mA is : ')\n", +"V_D= round(V_DD-I_D*R_D);//in V\n", +"V_S= -V_GS*R_S;// in V\n", +"// The quiescent drain to source voltage \n", +"V_DS= ceil(V_D-V_S);// in V\n", +"disp(V_DS,'The quiescent drain to source voltage in volts is : ')\n", +"// gm= gmo*(1-V_GS/V_P)= -2*I_DSS/V_P*(1-V_GS/V_P)\n", +" gm=-2*I_DSS/V_P*(1+V_S/V_P);//in mA/V\n", +" // The small signal voltage gain \n", +" Av= -gm*R_D;\n", +" disp(Av,'The small signal voltage gain is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.18: Voltage_gain_and_change_in_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.18\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"I_DSS = 5.6;// in mA\n", +"V_P = -4;// in V\n", +"g_m = 2;// in mA/V\n", +"R_S = 10;// in k ohm\n", +"A_V = (g_m*R_S)/(1+(g_m*R_S));\n", +"Vi = 10;// in V\n", +"// Change in output voltage,\n", +"delVo = A_V*Vi;// in V\n", +"disp(delVo,'The changes in Vo in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.19: Change_in_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.19\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_CC= 24;// in V\n", +"V_SS= -12// in V\n", +"R_D= 4.7;// in k ohm\n", +"R_S= 10;// in k ohm\n", +"V_P= -4;// in V\n", +"I_DSS= 5.6;// in mA\n", +"// For\n", +"Vi= 0;\n", +"I_D= poly(0,'I_D') ;\n", +"V_GS= Vi-V_SS-I_D*R_S;// in V\n", +"I_D= I_D-I_DSS*(1-V_GS/V_P)^2\n", +"// Evaluating the value of I_D by using polynomial method,\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// taking lower value\n", +"Vo1= V_SS+I_D*R_S;//in V\n", +"disp(Vo1,'For Vi= 0 V, the output voltage in volts is : ')\n", +"// For\n", +"Vi= 10;// in V\n", +"I_D= poly(0,'I_D') ;\n", +"V_GS= Vi-V_SS-I_D*R_S;// in V\n", +"I_D= I_D-I_DSS*(1-V_GS/V_P)^2\n", +"// Evaluating the value of I_D by using polynomial method,\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// taking lower value\n", +"Vo2= V_SS+I_D*R_S;//in V\n", +"disp(Vo2,'For Vi= 10 V, the output voltage in volts is : ')\n", +"del_Vo= Vo2-Vo1;// in V\n", +"disp('This compares well with '+string(del_Vo)+' V of small signal model.')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Transfer_characteristics.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_DSS = 14;// in mA\n", +"V_GSoff = -6;// in V\n", +"V_GS= 0:-0.1:V_GSoff;// in V\n", +"I_D= I_DSS*(1-V_GS/V_GSoff)^2;// in mA\n", +"// Ploting of the dc transfer characteristics\n", +"plot(V_GS,I_D);\n", +"xlabel('V_GS in volts')\n", +"ylabel('I_D in mA')\n", +"title('Transfer characteristics of a JFET')\n", +"disp('Transfer characteristics of a JFET shown in figure.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.20: Vds_Id_and_VGS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.20\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_DD = -60;// in V\n", +"R1 = 1.3;// in Mohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R2 = 200;// in k ohm\n", +"I_DSS = -4;// in mA\n", +"V_P = 4;// in V\n", +"R_S= 4;// in k ohm\n", +"R_D= 18;// in k ohm\n", +"V_GG = V_DD * (R2/(R1+R2));// in V\n", +"R_G = (R2*R1)/(R1+R2);// in k ohm\n", +"V_G = -8;// in V\n", +"I_D= poly(0,'I_D');\n", +"V_S= I_D*R_S;// in V\n", +"V_GS= V_G-V_S;// in V\n", +"I_D= I_D-I_DSS*(1-V_GS/V_P)^2;\n", +"// Evaluating the value of I_D by using, polynomial method,\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// in mA\n", +"V_S= I_D*R_S;// in V\n", +"V_GS= V_G-V_S;// in V\n", +"V_DS= V_DD-I_D*(R_D+R_S);// in V\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_GS,'The value of V_GS in volts is: ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.21: IDQ_VGSQ_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.21\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"I_DSS= 6;// in mA\n", +"V_P= -4;// in V\n", +"R_S= 0.43;// in k ohm\n", +"R_D= 1.2;// in k ohm\n", +"V_DD= 12;// in V\n", +"I_D= poly(0,'I_D');\n", +"V_GS= -I_D*R_S;// in V\n", +"I_D= I_D-I_DSS*(1-V_GS/V_P)^2;\n", +"// Evaluating the value of I_D by using polynomial method,\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);//in mA (taking lower value)\n", +"V_GSQ= -I_D*R_S// in V\n", +"disp(I_D,'The value of I_DQ in mA is : ')\n", +"disp(V_GSQ,'The value of V_GSQ in volts is : ')\n", +"// part (b) \n", +"// Applying KVL, V_DD-I_D*R_D-V_DS-I_D*R_S=0 or\n", +"V_DS= V_DD-I_D*(R_D+R_S);// in V\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"\n", +"// Note: In the book, the calculated value of I_D is wrong due to this all the answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Drain_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_DSS = 30;// in mA\n", +"V_GSoff = -8;// in V\n", +"V_GS = -5;// in V\n", +"// The value of drain current \n", +"I_D = I_DSS * ((1-(V_GS/V_GSoff))^2);// in mA\n", +"disp(I_D,'The value of drain current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: Value_of_RS_and_RD.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',4)\n", +"// Given data\n", +"I_D = 1.5;// in mA\n", +"I_D = I_D*10^-3;// in A\n", +"V_DS = 10;// in V\n", +"I_DSS = 5;// in mA\n", +"I_DSS = I_DSS * 10^-3;// in A\n", +"V_P = -2;// in V\n", +"V_DD = 20;// in V\n", +"// I_D = I_DSS*((1-(V_GS/V_P))^2);\n", +"// ((V_GS/2)+1) = sqrt(I_D/I_DSS);\n", +"V_GS = 2*( (sqrt(I_D/I_DSS))-1 );// in V\n", +"V_G = 0;// in V\n", +"// V_GS = V_G-V_S;\n", +"V_S = -V_GS;// in V\n", +"R_S = V_S/I_D;// in ohm\n", +"R_S= R_S*10^-3;// in k ohm\n", +"disp(R_S,'The value of R_S in k ohm is');\n", +"R_S= R_S*10^3;// in ohm\n", +"// V_DD = (I_D*R_D) + V_DS + (I_D*R_S);\n", +"R_D = (V_DD-V_DS-(I_D*R_S))/I_D;// in ohm\n", +"R_D = round(R_D * 10^-3);// in k ohm\n", +"disp(R_D,'The value of R_D in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: VDS_and_VGS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_DD = 30;// in V\n", +"R_D = 5;// in k ohm\n", +"R_D = R_D * 10^3;// in ohm\n", +"I_D = 2.5;// in mA\n", +"I_D = I_D * 10^-3;// in A\n", +"R_S = 200;// in ohm\n", +"// V_DD = (I_D*R_D) + V_DS + (I_D*R_S);\n", +"V_DS = V_DD - (I_D*(R_D+R_S));// in V\n", +"disp(V_DS,'The value of V_DS in V is');\n", +"// The value of V_GS \n", +"V_GS = -I_D*R_S;// in V\n", +"disp(V_GS,'The value of V_GS in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5: Pinch_off_voltage_and_chanel_half_width.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',4)\n", +"// Given data\n", +"Alpha = 3*10^-6;// in m\n", +"N_D = 10^21;// in electrons/cm^3\n", +"q = 1.6 * 10^-19;// in C\n", +"Epsilon_o = (36*%pi*10^9)^-1;\n", +"Epsilon = 12*Epsilon_o;\n", +"// The pinch of voltage \n", +"V_P = ((q*N_D)/(2*Epsilon))*(Alpha^2);// in V\n", +"disp(V_P,'The pinch of voltage in V is');\n", +"// Part (ii)\n", +"format('e',9)\n", +"VGSbyVp= 1/2;\n", +"// V_GS = ((1-b/Alpha)^2)*V_P\n", +"// The channel half width \n", +"b = Alpha*( 1-sqrt(VGSbyVp));// in m\n", +"b=b*10^2;// in cm\n", +"disp(b,'The channel half width in cm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6: VGS_gm_Rs_and_Rd.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.6\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"V_P = -2;// in V\n", +"I_DSS = 1.65;// in mA\n", +"I_D = 0.8;// in mA\n", +"V_DD = 24;// in V\n", +"// I_D =I_DSS*(( 1-(V_GS/V_P) )^2);\n", +"V_GS = V_P*(1-sqrt(I_D/I_DSS))\n", +"disp(V_GS,'The value of V_GS in V is');\n", +"// Part (b)\n", +"g_mo = (-2*I_DSS)/V_P;// in mA/V\n", +"g_m = g_mo*(1-(V_GS/V_P));// in mA/V\n", +"disp(g_m,'The value of gm in mA/V is');\n", +"// Part (c)\n", +"// The value of R_S \n", +"R_S = -V_GS/(I_D*10^-3);// in ohm\n", +"disp(R_S,'The value of R_S in ohm is');\n", +"// Part (d)\n", +"Av= 20;//voltage gain in dB\n", +"Av= 10^(Av/20);\n", +"// r_d >> Rd and |Av|= gm*Rd\n", +"Rd= Av/g_m;// in k ohm\n", +"disp(Rd,'The value of Rd in k ohm is : ')\n", +"\n", +"// Note: The value of R_S in the book is quite different from the coding output because in the book the calculated value of V_GS is not correct, correct value is -0.61" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7: VGS_IDQ_VDS_VD_VG_and_VS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_DSS =10;// in mA\n", +"V_P = -8;// in V\n", +"V_GG = 2;// in V\n", +"V_GS = -V_GG;// in V\n", +"V_DD = 16;// in V\n", +"R_D = 2;// in k ohm\n", +"R_D = R_D * 10^3;// in ohm\n", +"disp(V_GS,'The value of V_GS in V is');\n", +"// Part (b)\n", +"// The value of I_DQ \n", +"I_DQ = I_DSS * (1-V_GS/V_P)^2;// in mA\n", +"disp(I_DQ,'The value of I_DQ in mA is');\n", +"// Part (c)\n", +"// The value of V_DS \n", +"V_DS = V_DD - (I_DQ*10^-3*R_D);// in V\n", +"disp(V_DS,'The value of V_DS in V is');\n", +"// Part (d)\n", +"// The value of V_D \n", +"V_D = V_DS;// in V\n", +"disp(V_D,'The value of V_D in V is');\n", +"// Part (e)\n", +"// The value of V_G \n", +"V_G = V_GS;// in V\n", +"disp(V_G,'The value of V_G in V is');\n", +"// Part (f)\n", +"// The value of V_S \n", +"V_S = 0;// in V\n", +"disp(V_S,'The value of V_S in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8: Value_of_RGS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.8\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_GS = 10;// in V\n", +"I_G = 0.001;// in µA\n", +"I_G = I_G * 10^-6;// in A\n", +"// The resistance between gate and source \n", +"R_GS = V_GS/I_G;// in ohm\n", +"R_GS = R_GS * 10^-6;// in Mohm\n", +"disp(R_GS,'The resistance between gate and source in M ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9: AC_drain_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 7.9\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"delV_DS = 1.5;// in V\n", +"delI_D = 120;// in µA\n", +"delI_D = delI_D*10^-6;// in A\n", +"// The ac drain resistance of the JFET \n", +"r_d = delV_DS/delI_D;// in ohm\n", +"r_d= r_d*10^-3;// in k ohm\n", +"disp(r_d,'The ac drain resistance of the JFET in k ohm 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 +} diff --git a/Basic_Electronics_by_R_K_Garg/8-Metal_Oxide_Semiconductor_Field_Effect_Transistor.ipynb b/Basic_Electronics_by_R_K_Garg/8-Metal_Oxide_Semiconductor_Field_Effect_Transistor.ipynb new file mode 100644 index 0000000..deb8d90 --- /dev/null +++ b/Basic_Electronics_by_R_K_Garg/8-Metal_Oxide_Semiconductor_Field_Effect_Transistor.ipynb @@ -0,0 +1,206 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Metal Oxide Semiconductor Field Effect Transistor" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: Transfer_Characteristics.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 8.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"I_DSS= 10;// in mA\n", +"V_P= -4;// in V\n", +"V_GS= 0:-0.1:V_P;// in V\n", +"// The value of I_D,\n", +"I_D= I_DSS*(1-V_GS/V_P)^2;// in mA\n", +"plot(V_GS,I_D)\n", +"xlabel('V_GS in volts');\n", +"ylabel('I_D in mA');\n", +"title('Transfer characteristics for an n-channel depletion-type MOSFET');\n", +"disp('Transfer characteristics for an n-channel depletion-type MOSFET shown in figure.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: Value_of_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 8.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',6)\n", +"// Given data\n", +"V_DD= 20;// in V\n", +"V_GS = 0;// in V\n", +"I_DSS = 10;// in mA\n", +"I_P = I_DSS;// in mA\n", +"I_D = I_DSS;// in mA\n", +"R_D = 1.5;// in k ohm\n", +"// The drain to source voltage,\n", +"V_DS = V_DD - (I_D*R_D);// in V\n", +"disp(V_DS,'The value of V_DS in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: Drain_curent.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 8.3\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',7)\n", +"// Given data\n", +"I_Don = 5;// in mA\n", +"V_GS = 8;// in V\n", +"V_GST = 4;// in V\n", +"K = I_Don/((V_GS-V_GST)^2);// in mA/V^2\n", +"// Drain current when V_GS= 6 V\n", +"V_GS= 6;// in V\n", +"I_D = K*((V_GS-V_GST)^2);// in mA\n", +"disp(I_D,'The drain current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: Value_of_ID.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 8.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',5)\n", +"// Given data\n", +"I_Don = 10;// in mA\n", +"V_GS = -12;// in V\n", +"V_Ton = -3;// in V\n", +"if V_GS<0 then\n", +" disp('Since the value of V_GS is negative, hence the device is P-channel')\n", +"end\n", +"K = I_Don/((V_GS-V_Ton)^2);// in mA/V\n", +"V_GS = -6;// in V\n", +"// The drain current,\n", +"I_D = K*( (V_GS-V_Ton)^2 );// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"\n", +"// Note: The answer in the book is not accurate." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5: IDQ_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 8.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"format('v',9)\n", +"// Given data\n", +"I_Don = 5;// in mA\n", +"V_GSon = 7;// in V\n", +"V_T = 4;// in V\n", +"V_DD = 9;// in V\n", +"R_D = 1.2;// in k ohm\n", +"R_S = 0.5;// in k ohm\n", +"K = (I_Don)/((V_GSon-V_T)^2);// in mA/V^2\n", +"// The value of drain current,\n", +"I_D = K*((V_GSon-V_T)^2);// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"//The drain to source voltage, V_DS = V_DD - (I_D*R_D) - (I_D*R_S);\n", +"V_DS = V_DD - (I_D*(R_D+R_S));// in V\n", +"disp(V_DS,'The value of V_DS in V');\n", +"\n", +"// Note: The answer in the book is not accurate." + ] + } +], +"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 +} |