{ "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 }