diff options
Diffstat (limited to 'Engineering_Circuit_Analysis_by_W_Hayt')
16 files changed, 3169 insertions, 0 deletions
diff --git a/Engineering_Circuit_Analysis_by_W_Hayt/10-Sinusoidal_Steady_state_Analysis.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/10-Sinusoidal_Steady_state_Analysis.ipynb new file mode 100644 index 0000000..e27ef8c --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/10-Sinusoidal_Steady_state_Analysis.ipynb @@ -0,0 +1,63 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10: Sinusoidal Steady state Analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4: The_Inductor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 10.4\n", +"//Determine phasor current and time-domain current\n", +"printf('Given')\n", +"disp('Voltage is 8(-50 deg),Frequency is 100rad/s,Inductance is 4H')\n", +"L=4;\n", +"w=100;\n", +"Vamp=8;Vang=-50;\n", +"//Let current be I\n", +"Iamp=Vamp/(w*L)\n", +"Iang=-90+Vang\n", +"printf('I=%3.2f(%d deg) A \n',Iamp,Iang)\n", +"//In time domain\n", +"printf('i(t)=%3.2f *cos(%d*t%d) A',Iamp,w,Iang);" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/11-AC_Circuit_Power_Analysis.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/11-AC_Circuit_Power_Analysis.ipynb new file mode 100644 index 0000000..07316b1 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/11-AC_Circuit_Power_Analysis.ipynb @@ -0,0 +1,342 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: AC Circuit Power Analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: Instantaneous_Power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.1\n", +"//Calculate the powerr absorbed by capacitor and resistor\n", +"printf('Given')\n", +"disp('Capacitor 5uF, Resistor 200 ohm, Voltage source is 40+60*u(t)')\n", +"C=5*10^-6;R=200;\n", +"//For t<0 the value of u(t) is zero hence at t=0- the value of voltage is 40V\n", +"//For t=0+ the voltage is 100V \n", +"//At t=0+ the capacitor cannot charge instantaneously hence resistor voltage is 60V\n", +"disp('For t=0+')\n", +"VR=60;\n", +"i0=VR/R\n", +"T=R*C\n", +"t=1.2*10^-3\n", +"disp('The value of current is i(t)=i0*exp(-t/T)')\n", +"ival=i0*exp(-t/T)\n", +"printf('Value of resistor current at 1.2ms=%3.2f mA \n',ival*10^3)\n", +"//Let PR be the power absorbed by the resistor\n", +"PR=ival^2*R\n", +"printf('Value of resistive power at 1.2ms=%3.2f W \n',PR)\n", +"//Out of the 100V available at t>0 the voltage across the capacitor is\n", +"disp('vC(t)=100-60*exp(-t/T)')\n", +"vCval=100-60*exp(-t/T)\n", +"printf('Value of capacitor voltage at 1.2ms=%3.2f V \n',vCval)\n", +"//Let PC be the power absorbed by the capacitor\n", +"PC=ival*vCval\n", +"printf('Value of capacitive power at 1.2ms=%3.2f W \n',PC)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2: Average_Power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.2\n", +"//Calculate the average power \n", +"printf('Given')\n", +"disp('v=4*cos(%pi/6*t), V=4(0 deg), Z=2(60 deg)')\n", +"Vamp=4;Vang=0;Zamp=2;Zang=60;\n", +"//Let I be the phasor current\n", +"Iamp=Vamp/Zamp\n", +"Iang=Vang-Zang\n", +"P=0.5*Vamp*Zamp*cos((Zang*%pi)/180)\n", +"printf('P=%d W \n',P);\n", +"t=-1:1:15\n", +"t1=-3:1:12\n", +"v=Vamp*cos(%pi/6*t)\n", +"//i=2*cos((%pi/6)*t-(%pi/3))\n", +"i=Iamp*cos(%pi/6*t+((Iang*%pi)/180))\n", +"figure\n", +"a= gca ();\n", +"plot (t,v,t,i)\n", +"xtitle ('v,i vs t' ,'t' ,'v,i');\n", +"a. thickness = 2;\n", +"//Instantaneous power p=v*i\n", +"//On solving\n", +"p=2+4*cos(%pi/3*t+((Iang*%pi)/180))\n", +"figure\n", +"a= gca ();\n", +"plot (t,p)\n", +"xtitle ('p vs t' ,'t' ,'p');\n", +"a. thickness = 2;" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3: Average_Power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.3\n", +"//Calculate the Average Power\n", +"printf('Given')\n", +"disp('ZL=8-i*11 ohm, I=5(20 deg)A')\n", +"R=8;Iamp=5;\n", +"//We need to calculate the average power\n", +"//In the calculation of average power the resistance part of impedace only occurs\n", +"//Let P be the average power\n", +"P=0.5*Iamp^2*R\n", +"printf('Average Power=%d W \n',P)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: Average_Power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.4\n", +"//Calculate the Average power absorbed and average power supplied by source\n", +"//From figure 11.6\n", +"//By applying mesh analysis\n", +"I1mag=11.18;I1ang=-63.43;I2mag=7.071;I2ang=-45;R=2;Vleft=20;Vright=10;\n", +"//Current through 2 ohm resistor\n", +"printf('I1-I2=%d(%d ang) A \n',5,-90)\n", +"//Average power absorbed by resistor\n", +"PR=0.5*5^2*R\n", +"printf('Average power absorbed by resistor=%d W \n',PR)\n", +"//Power supplied by left source\n", +"Pleft=0.5*Vleft*I1mag*cos(0-I1ang*%pi/180)\n", +"//Power supplied by right source\n", +"Pright=0.5*Vright*I2mag*cos(0+I2ang*%pi/180)\n", +"printf('Power supplied by sources \t Pleft=%d W \t Pright=%3.1f W',Pleft,Pright);\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: Average_Power_for_Non_periodic_Functions.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.6\n", +"//Calculate the Average power\n", +"printf('Given')\n", +"disp('Resistor value is 4 ohm, i1=2*cos(10t)-3*cos(20t) A')\n", +"R=4;im1=2;im2=-3;\n", +"//Let P be the average power delievered\n", +"P=0.5*im1^2*R+0.5*im2^2*R\n", +"printf('Average power=%d W',P)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7: Average_Power_for_Non_periodic_Functions.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.7\n", +"//Calculate the Average power\n", +"printf('Given')\n", +"disp('Resistor value is 4 ohm, i2=2*cos(10t)-3*cos(10t) A')\n", +"disp('On solving we get i2=-cos(10t)')\n", +"R=4;im=-1\n", +"//Let P be the average power delievered\n", +"P=0.5*im^2*R\n", +"printf('Average power=%d W',P)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.8: Apparent_Power_and_Power_factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.8\n", +"//Calculate average power, power supplied by source and the power factor\n", +"printf('Given')\n", +"disp('Voltage source is 60 V,Load values are 2-i ohm and 1+5i ohm')\n", +"Vamp=60;Vang=0;\n", +"//Let Z be the cobined resistance\n", +"Z=2-%i+1+5*%i\n", +"[Zmag Zph]=polar(Z)\n", +"Isamp=Vamp/Zmag;\n", +"Isang=Vang-Zph;\n", +"printf('Ieff=%3.0f A rms and angle of Is is %3.2f degree\n',Isamp,(Isang*180)/%pi);\n", +"//Let Pupper be the power delievered to the upper load\n", +"Rtop=2;\n", +"Pupper=Isamp^2*Rtop\n", +"printf('Average Power delievered to the top load=%3.0f W \n',Pupper)\n", +"//Let Plower be the power delievered to the lower load\n", +"Rright=1;\n", +"Plower=Isamp^2*Rright\n", +"printf('Average Power delievered to the right load=%3.0f W \n',Plower)\n", +"//Let Papp be the apparent power\n", +"Papp=Vamp*Isamp\n", +"printf('Apparent Power =%3.0f VA \n',Papp)\n", +"//Let pf be the power factor\n", +"pf=(Pupper+Plower)/Papp\n", +"printf('power factor=%3.1f lag \n',pf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.9: Complex_Power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 11.9\n", +"printf('Given')\n", +"disp('Power of induction motor=50kW ,power factor is 0.8 lag,Source voltage is 230V')\n", +"disp('The wish of the consumer is to raise the power factor to 0.95 lag')\n", +"//Let S1 be the complex power supplied to the indiction motor\n", +"V=230;Pmag=50*10^3;pf=0.8;\n", +"Pang=(acos(pf)*180)/%pi\n", +"S1mag=Pmag/pf\n", +"S1ph=Pang\n", +"x=S1mag * cos (( Pang * %pi ) /180) ;\n", +"y=S1mag * sin (( Pang * %pi ) /180) ;\n", +"z= complex (x,y)\n", +"disp(z ,'S1=')\n", +"//To achieve a power factor of 0.95\n", +"pf1=0.95\n", +"//Now the total complex power be S\n", +"P1ang=(acos(pf1)*180)/%pi\n", +"Smag=Pmag/pf1\n", +"Sph=P1ang\n", +"a=Smag * cos (( P1ang * %pi ) /180) ;\n", +"b=Smag * sin (( P1ang * %pi ) /180) ;\n", +"c= complex (a,b)\n", +"disp(c,'S=')\n", +"//Let S2 be the complex power drawn by the corrective load\n", +"S2=c-z\n", +"disp(S2,'S2=')\n", +"disp('Let a phase angle of voltage source selected be 0 degree')\n", +"//Let I2 be the current\n", +"I2=-S2/V\n", +"//Let Z2 be the impedance of corrective load\n", +"Z2=V/I2\n", +"disp(Z2,'Z2=')\n", +"" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/12-Polyphase_Circuits.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/12-Polyphase_Circuits.ipynb new file mode 100644 index 0000000..d1f0d83 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/12-Polyphase_Circuits.ipynb @@ -0,0 +1,277 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Polyphase Circuits" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: Three_phase_Wye_connection.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 12.2\n", +"//Calculate total power dissipated\n", +"disp('Given')\n", +"disp('Van=200 with angle 0 degree and Zp=100with angle 60 degree')\n", +"Zpamp=100;Zpang=60\n", +"//Since one of the phase voltage is given, we need to find other phase voltages\n", +"Vanamp=200;Vbnamp=200 ; Vcnamp=200;\n", +"Vanang=0;Vbnang=-120;Vcnang=-240;\n", +"disp('The phase voltages are')\n", +"printf('Van=%d /_%d deg V\tVbn=%d /_%d deg V\tVcn=%d /_%d deg V\t',Vanamp,Vanang,Vbnamp,Vbnang,Vcnamp,Vcnang)\n", +"\n", +"//Now we will find line voltages\n", +"//Let line voltage be Vline\n", +"Vline=200*sqrt(3)\n", +"//By constructing a phasor diagram\n", +"disp('The line voltages are')\n", +"printf('\n Vab=%d /_%d deg V\tVbc=%d /_%d deg V\tVca=%d /_%d deg V\t',Vline,30,Vline,-90,Vline,-210)\n", +"\n", +"//Let the line current be IaA\n", +"IaAamp=Vanamp/Zpamp\n", +"IaAang=Vanang-Zpang\n", +"//Since the given system is a balanced three phase system\n", +"//From phasor diagram as shown in figure 12.16\n", +"disp('The line currents are')\n", +"printf('\n IaA=%d /_%d deg V\tIbB=%d /_%d deg V\tIcC=%d /_%d deg V\t',IaAamp,IaAang,IaAamp,IaAang-120,IaAamp,IaAang-240)\n", +"//Let power absorbeed by phase A is PAN\n", +"PAN=Vanamp*IaAamp*cos(((Vanang+IaAang)*%pi)/180)\n", +"printf('\n Total average power = %d W',3*PAN)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3: Three_phase_Wye_connection.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 12.3\n", +"//Calculate the line current and phase impedance\n", +"disp('Given')\n", +"disp('Line voltage = 300V, Power factor=0.8(lead), Phase power = 1200W')\n", +"Vline=300;pf=0.8;PW=1200;\n", +"Vp=Vline/sqrt(3)\n", +"PerPhpower=PW/3;\n", +"//Line current can be found as\n", +"IL=PerPhpower/(pf*Vp)\n", +"printf('Line current= %3.2f A \n',IL)\n", +"//Let Zp be the phase impedance\n", +"Zpmag=Vp/IL\n", +"//Sice power factor is 'leading'\n", +"Zpang=-(acos(0.8)*180)/%pi\n", +"printf('Phase impedance = %d/_%3.2f deg ohm',Zpmag,Zpang);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: Three_phase_Wye_connection.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 12.4\n", +"//Calculate the line current\n", +"//Continuing from example 12.3\n", +"Vp=300/sqrt(3);\n", +"IL=2.89;pf=0.8\n", +"disp('A balanced 600W lighting load is added in parallel with the existing load')\n", +"disp('600W if balanced then 200W will be consumed by each phase')\n", +"Vpadd=200;\n", +"//From figure 12.17\n", +"I1=Vpadd/Vp\n", +"disp('Load current is unchanged')\n", +"I2mag=IL\n", +"I2ph=(acos(pf)*180)/%pi\n", +"x=I2mag * cos (( I2ph * %pi ) /180) ;\n", +"y=I2mag * sin (( I2ph * %pi ) /180) ;\n", +"z= complex (x,y)\n", +"disp(z)\n", +"ILnew=I1+z\n", +"[ILmag ILph]=polar(ILnew)\n", +"printf('Line current=%3.2f /_%3.2f deg A \n ',ILmag,ILph*(180/%pi));" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5: The_Delta_connection.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 12.5\n", +"//Calculate amplitude of line current\n", +"disp('Given')\n", +"disp('Line voltage = 300V, Power factor=0.8(lag), Phase power = 1200W')\n", +"Vline=300;pf=0.8;PW=1200;\n", +"disp('1200W will be consumed as 400W in each phase')\n", +"Vp=400\n", +"//Phase current be Ip\n", +"Ip=Vp/(Vline*pf)\n", +"//Let amplitude of line current be IL\n", +"IL=Ip*sqrt(3)\n", +"printf('Line current=%3.2f A \n',IL)\n", +"//Let Zp be the phase impedance\n", +"Zpmag=Vline/Ip\n", +"//Sice power factor is 'lagging'\n", +"Zpang=(acos(0.8)*180)/%pi\n", +"printf('Phase impedance = %d(%3.2f deg)ohm',Zpmag,Zpang);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6: The_Delta_connection.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 12.6\n", +"//Calculate amplitude of line current\n", +"disp('Given')\n", +"disp('Line voltage = 300V, Power factor=0.8(lag), Phase power = 1200W')\n", +"Vline=300;pf=0.8;PW=1200;\n", +"Vph=Vline/sqrt(3)\n", +"disp('1200W will be consumed as 400W in each phase')\n", +"Vp=400\n", +"//Let phase current be Ip\n", +"Ip=Vp/(Vph*pf)\n", +"printf('Phase current=%3.2f A \n',Ip)\n", +"//Let Zp be the phase impedance\n", +"Zpmag=Vph/Ip\n", +"//Sice power factor is 'lagging'\n", +"Zpang=(acos(0.8)*180)/%pi\n", +"printf('Phase impedance = %d(%3.2f deg)ohm\n',Zpmag,Zpang);\n", +"//PW=sqrt(3)*VL*IL*pf\n", +"IL=PW/(sqrt(3)*Vline*pf)\n", +"printf('Line current=%3.2f A \n',IL)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.7: Power_measurement_in_three_phase_systems.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 12.7\n", +"//Determine wattmeter reading and total power drawn by the load\n", +"disp('Given')\n", +"disp('Vab=230(0 deg)V')\n", +"Vline=230\n", +"//Since positive phase sequence is used\n", +"disp('The line voltages are')\n", +"printf('\n Vab=%d (%d deg)V\tVbc=%d (%d deg) V\tVca=%d (%d deg)V\t',Vline,0,Vline,-120,Vline,120)\n", +"Vacamp=Vline;\n", +"Vacang=-60;\n", +"Vbcamp=Vline;\n", +"Vbcang=-120;\n", +"//Now we will evaluate phase current\n", +"//Let IaA be the phase current\n", +"Vanamp=Vline/sqrt(3)\n", +"Vanph=-30\n", +"//From figure 12.28\n", +"Zph=4+%i*15\n", +"[Zphmag Zphang]=polar(Zph)\n", +"IaAamp=Vanamp/Zphmag\n", +"IaAang=Vanph-(Zphang*180)/%pi\n", +"IbBang=IaAang+240\n", +"printf('\nIaA=%3.2f(%3.2f deg)A\n',IaAamp,IaAang);\n", +"//Power rating of each wattmeter is now calculated\n", +"//Power measured by wattmeter #1\n", +"P1=Vline*IaAamp*cos(((Vacang-IaAang)*%pi)/180)\n", +"printf('P1=%d W \n',P1)\n", +"//Power measured by wattmeter #2\n", +"P2=Vline*IaAamp*cos(((Vbcang-IbBang)*%pi)/180)\n", +"printf('P2=%3.2f W \n',P2)\n", +"//Net power be P\n", +"P=P1+P2\n", +"printf('P=%3.2f W \n',P)" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/13-Magnetically_coupled_circuits.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/13-Magnetically_coupled_circuits.ipynb new file mode 100644 index 0000000..0ed6937 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/13-Magnetically_coupled_circuits.ipynb @@ -0,0 +1,203 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13: Magnetically coupled circuits" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2: Mutual_Inductance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 13.2\n", +"disp('Given')\n", +"disp('Input voltage is 10V')\n", +"Viamp=10\n", +"//From figure 13.7\n", +"//Writing the left mesh equations\n", +"disp('(1+10i)*I1-90i*I2=10')\n", +"//Writing the right mesh equations \n", +"disp('(400+1000i)*I2-90i*I1=0')\n", +"i=%i\n", +"A=[1+10*i -90*i;-90*i 400+1000*i]\n", +"i2mat=[1+10*i 10; -90*i 0] \n", +"//Find i2 \n", +"i2=det(i2mat)/det(A)\n", +"[mag Theta]=polar(i2)\n", +"Theta=(Theta*180)/%pi\n", +"//The value of resistor is 400 ohm\n", +"R=400;\n", +"//Let V=V2/V1\n", +"Vamp=R*mag/Viamp\n", +"printf('Ratio of output voltage to input is %3.2f with angle %3.2f degrees',Vamp,Theta);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.4: Energy_considerations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 13.4\n", +"disp('Given')\n", +"disp('L1=0.4H L2=2.5H k=0.6 i1=4i2=20*cos(500t-20)mA')\n", +"L1=0.4;L2=2.5;k=0.6;\n", +"disp('a)')\n", +"t=0;\n", +"i2=5*cos(500*t-(20*%pi)/180)\n", +"printf('i2(0)=%3.2f mA \n',i2)\n", +"disp('b)')\n", +"M=k*sqrt(L1*L2)\n", +"//v1(t)=L1*d/dt(i1)+M*d/dt(i2)\n", +"v1=-L1*20*500*10^-3*sin(500*t-(20*%pi)/180)-M*5*500*10^-3*sin(500*t-(20*%pi)/180)\n", +"printf('v1(0)=%3.2f V \n',v1)\n", +"disp('c')\n", +"//The total energy can be found as\n", +"w=(L1*(4*i2)^2)/2+ (L2*(i2)^2)/2+M*(4*i2)*(i2)\n", +"printf('w=%3.2f uJ \n',w)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.5: T_and_PI_equivalent_networks.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 13.5\n", +"printf('Given')\n", +"disp('L1=30 mH L2=60 mH M=40 mH')\n", +"L1=30*10^-3; L2=60*10^-3; M=40*10^-3;\n", +"//The equivalent T network is \n", +"UL=L1-M\n", +"UR=L2-M\n", +"CS=M\n", +"printf('The T network has \n')\n", +"printf('%d mH in the upper left arm\n',UL*10^3)\n", +"printf('%3.0f mH in the upper right arm\n',UR*10^3)\n", +"printf('%d mH in the center stem\n',CS*10^3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.6: T_and_PI_equivalent_networks.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 13.6\n", +"printf('Given')\n", +"disp('L1=30 mH L2=60 mH M=40 mH')\n", +"L1=30*10^-3; L2=60*10^-3; M=40*10^-3;\n", +"//Let X=L1*L2-M^2\n", +"X=L1*L2-M^2\n", +"//The equivalent PI network is \n", +"LA=X/(L2-M)\n", +"LB=X/M\n", +"LC=X/(L1-M)\n", +"printf('The PI network has \n')\n", +"printf('LA=%3.0f mH\n',LA*10^3)\n", +"printf('LB=%3.0f mH \n',LB*10^3)\n", +"printf('LC=%3.0f mH\n',LC*10^3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.8: Equivalent_Circuits.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 13.8\n", +"disp('Given')\n", +"disp('Vin=50V Zg=100 ohm')\n", +"Vin=50;Zg=100;\n", +"//From figure 13.32\n", +"disp('When the secondary circuit and ideal transformer is replaced by a Thevenin equivalent then the primary circuit sees a 100 ohm impedance')\n", +"//The turns ratio is a\n", +"a=10;\n", +"disp('We place the secondary circuit and ideal transformer by a Thevenin equivalent circuit')\n", +"Vth=-a*Vin\n", +"Zth=(-a)^2*Zg\n", +"printf('The secondary circuit has voltage source %d V rms with %d kohm resistance in series with it along with %d kohm load resistance',Vth,Zth*10^-3,10)" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/14-Complex_frequency_and_the_Laplace_Transform.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/14-Complex_frequency_and_the_Laplace_Transform.ipynb new file mode 100644 index 0000000..9c9e4ee --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/14-Complex_frequency_and_the_Laplace_Transform.ipynb @@ -0,0 +1,330 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Complex frequency and the Laplace Transform" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.10: The_time_shift_theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.10\n", +"//Install Symbolic toolbox\n", +"//Determine the transform of rectangular pulse\n", +"syms t s\n", +"v=integ(exp(-s*t),t,2,%inf)-integ(exp(-s*t),t,5,%inf)\n", +"disp(v,'V(s)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.11: The_Initial_and_Final_value_theorems.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.11\n", +"//Install Symbolic toolbox\n", +"//Calculate f(inf)\n", +"syms s t ;\n", +"disp('Given function is f(t)=1-exp(-a*t)')\n", +"u=laplace(1)\n", +"v=laplace(exp(-2*t))\n", +"F=u-v\n", +"x=s*F\n", +"//From final value theorem\n", +"y=limit(x,s,0)\n", +"disp(y,'f(inf)=')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2: Definition_of_the_Laplace_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 14.2\n", +"//Install Symbolic toolbox\n", +"//Find the Laplace transform\n", +"syms t s\n", +"clc\n", +"z=integ(2*exp(-s*t),t,3,%inf)\n", +"//The second term will result in zero\n", +"disp(z,'F(s)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3: Inverse_Transform_Techniques.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.3\n", +"//Install Symbolic toolbox\n", +"//Find the Inverse Laplace transform\n", +"syms s\n", +"a=7/s\n", +"b=31/(s+17)\n", +"x=ilaplace(a)\n", +"y=ilaplace(b)\n", +"g=x-y\n", +"disp(g,'g(t)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4: Inverse_Transform_Techniques.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.4\n", +"//Install Symbolic toolbox\n", +"//Find the Inverse Laplace transform\n", +"syms s t\n", +"a=2\n", +"b=4/s\n", +"x=ilaplace(b)\n", +"//Inverse laplace transform of a constant is\n", +"disp('inverse laplace(2)=2*delta(t)')\n", +"disp('Answer is')\n", +"disp(x+'2*delta(t)')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5: Inverse_Transform_Techniques.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.5\n", +"//Install Symbolic toolbox\n", +"//Find the Inverse Laplace transform\n", +"syms s\n", +"s=%s;\n", +"P =(7*s+5)/(s^2+s);\n", +"Pp=pfss (P)\n", +"p1=ilaplace (Pp(1))\n", +"p2=ilaplace (Pp(2))\n", +"p=p1+p2\n", +"disp(p,'p(t)=');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6: Inverse_Transform_Techniques.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.6\n", +"//Install Symbolic toolbox\n", +"//Find the Inverse Laplace transform\n", +"syms s\n", +"s=%s;\n", +"V =2/(s^3+12*s^2+36*s);\n", +"Vp=pfss (V)\n", +"v1=ilaplace (Vp(1))\n", +"v2=ilaplace (Vp(2))\n", +"v=v1+v2\n", +"disp(v,'v(t)=');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.7: Basic_Theorems_for_the_Laplace_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.7\n", +"//Install Symbolic toolbox\n", +"//Find the current through 5 ohm resistor\n", +"syms s\n", +"s=%s\n", +"//From figure 14.3\n", +"//Writing the KVL equation and taking the Laplace transform\n", +"I=1.5/(s*(s+2))+5/(s+2)\n", +"I1=1.5/(s*(s+2))\n", +"I2=5/(s+2)\n", +"I1p=pfss(I1)\n", +"i1=ilaplace(I1p(1))\n", +"i2=ilaplace(I1p(2)+I2)\n", +"i=i1+i2\n", +"disp(i,'i(t)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.8: Basic_Theorems_for_the_Laplace_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.8\n", +"//Install Symbolic toolbox\n", +"//Find the current for t>0\n", +"syms s\n", +"s=%s\n", +"//From figure 14.5\n", +"//Writing the KVL equation and taking the Laplace transform\n", +"I=-2/(s+4)\n", +"i=ilaplace(I)\n", +"disp(i,'i(t)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.9: Basic_Theorems_for_the_Laplace_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 14.9\n", +"//Install Symbolic toolbox\n", +"//Find the voltage v(t)\n", +"syms s\n", +"s=%s\n", +"//From figure 14.6\n", +"//Writing the KCL equation and taking the Laplace transform\n", +"V=4/(s*(s+4))+9/(s+4)\n", +"V1=4/(s*(s+4))\n", +"V2=9/(s+4)\n", +"V1p=pfss(V1)\n", +"v1=ilaplace(V1p(1))\n", +"v2=ilaplace(V1p(2)+V2)\n", +"v=v1+v2\n", +"disp(v,'v(t)=')" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/15-Circuit_Analysis_in_the_s_domain.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/15-Circuit_Analysis_in_the_s_domain.ipynb new file mode 100644 index 0000000..06c2abe --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/15-Circuit_Analysis_in_the_s_domain.ipynb @@ -0,0 +1,234 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 15: Circuit Analysis in the s domain" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.10: Convolution_and_Laplace_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 15.10\n", +"//Since the input function is given the Laplace transform is found\n", +"syms s t\n", +"s=%s\n", +"vin=6*exp(-t)\n", +"Vin=laplace(vin)\n", +"//Connecting the impulse voltage pulse to the circuit and converting to s-domain\n", +"//If vin=delta(t)..the impulse source\n", +"V0=2/((2/s)+2)\n", +"//As source voltage is 1V\n", +"H=V0\n", +"V=Vin*H\n", +"Vp=pfss ((6*s)/(s+1)^2)\n", +"Vp1=ilaplace(Vp(1))\n", +"v0=Vp1\n", +"disp(v0,'v0(t)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.1: Modeling_Inductors_in_the_s_domain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 15.1\n", +"//Install Symbolic toolbox\n", +"//Calculate the voltage\n", +"//From figure 15.3\n", +"//Writing the KVL equation for the voltage and taking the Laplace transform\n", +"syms s\n", +"s=%s\n", +"disp('V=(2*s*(s+9.5)/((s+8)*(s+0.5)))-2')\n", +"//On solving\n", +"V=(2*s-8)/((s+8)*(s+0.5))\n", +"Vp=pfss (V)\n", +"Vp1=ilaplace(Vp(1))\n", +"Vp2=ilaplace(Vp(2))\n", +"v=Vp1+Vp2\n", +"disp(v,'v(t)=')\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.2: Modeling_capacitors_in_the_s_domain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 15.2\n", +"//Install Symbolic toolbox\n", +"//Calculate the voltage\n", +"//Selecting the current based model\n", +"//From figure 15.6(b)\n", +"//Writing the KCL equation for the voltage and taking the Laplace transform\n", +"syms s\n", +"s=%s\n", +"Vc=-2*(s-3)/(s*(s+2/3))\n", +"Vcp=pfss (Vc)\n", +"Vcp1=ilaplace(Vcp(1))\n", +"Vcp2=ilaplace(Vcp(2))\n", +"vc=Vcp1+Vcp2\n", +"disp(vc,'vc=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.4: Nodal_and_Mesh_analysis_in_s_domain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 15.4\n", +"//Install Symbolic toolbox\n", +"//Calculate the voltage\n", +"//From figure 15.9\n", +"//Applying nodal equation and solving for vx\n", +"syms s\n", +"s=%s\n", +"Vx=(10*s^2+4)/(s*(2*s^2+4*s+1))\n", +"Vxp=pfss (Vx)\n", +"Vxp1= ilaplace (Vxp(1))\n", +"Vxp2= ilaplace (Vxp(2))\n", +"vx=Vxp1+Vxp2\n", +"disp(vx,'vx=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.6: Additional_circuit_analysis_techniques.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 15.6\n", +"//Install Symbolic toolbox\n", +"//Calculate the voltage\n", +"//Performing source transformatiom on the s-domain circuit\n", +"//Solving for V(s)\n", +"syms s\n", +"s=%s\n", +"V=(180*s^4)/((s^2+9)*(90*s^3+18*s^2+40*s+4))\n", +"Vp=pfss (V)\n", +"Vp1=ilaplace(Vp(1))\n", +"Vp2=ilaplace(Vp(2))\n", +"Vp3=ilaplace(Vp(3))\n", +"v=Vp1+Vp2+Vp3\n", +"disp(v,'v(t)=')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.9: Convolution_and_Laplace_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 15.9\n", +"//Install Symbolic toolbox\n", +"//Find the inverse Laplace transform\n", +"syms s\n", +"s=%s\n", +"//Let a=1 and b=3\n", +"a=1;b=3;\n", +"V=1/((s+a)*(s+b))\n", +"Vp=pfss (V)\n", +"Vp1=ilaplace(Vp(1))\n", +"Vp2=ilaplace(Vp(2))\n", +"v=Vp1+Vp2\n", +"disp(v,'v(t)=')" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/16-Frequency_Response.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/16-Frequency_Response.ipynb new file mode 100644 index 0000000..f23243d --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/16-Frequency_Response.ipynb @@ -0,0 +1,438 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Frequency Response" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.10: Bode_diagrams.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.10\n", +"s=poly(0,'s')\n", +"h=syslin('c',(10*s)/((1+s)*(s^2+20*s+10000)))\n", +"disp(h)\n", +"fmin=0.01\n", +"fmax=10^4\n", +"scf(1);clf;\n", +"//Calculate Bode plot\n", +"bode(h,fmin,fmax)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.11: Filters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.11\n", +"disp('Given')\n", +"disp('A high pass filter with cutoff frequency of 3k Hz')\n", +"//Cutoff frequency(wc)=1/(R*C)\n", +"//Let us select some standard value of resistor\n", +"disp('Let R=4.7k ohm')\n", +"fc=3*10^3;R=4.7*10^3;\n", +"wc=2*%pi*fc\n", +"C=1/(R*wc)\n", +"printf('\n C=%3.2f nF ',C*10^9);\n", +"s=poly(0,'s')\n", +"h=syslin('c',(R*C*s)/((1+s*R*C)))\n", +"disp(h)\n", +"HW = frmag(h,512);\n", +"w=0: %pi /511: %pi ;\n", +"plot(w,HW)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.12: Filters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.12\n", +"disp('Given')\n", +"disp('Bandwidth = 1M Hz and high frequency cutoff = 1.1M Hz')\n", +"B=10^6;fH=1.1*10^6\n", +"//B=fH-fL\n", +"fL=fH-B\n", +"printf('Low frequency cutoff fL= %d kHz \n',fL*10^-3);\n", +"wL=2*%pi*fL\n", +"printf('wL= %3.2f krad/s \n',wL*10^-3);\n", +"wH=2*%pi*fH\n", +"printf('wH= %3.3f Mrad/s \n',wH*10^-6);\n", +"//Now we need to find values for R,L and C\n", +"//Let X=1/LC\n", +"B=2*%pi*(fH-fL)\n", +"X=(wH-B/2)^2-(B^2/4)\n", +"disp(X)\n", +"disp('Let L=1H')\n", +"L=1;\n", +"C=1/(L*X)\n", +"disp(C,'C=')\n", +"//B=R/L\n", +"R=L*B\n", +"printf('R= %3.3f Mohm \n',R*10^-6);\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.13: Filters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.13\n", +"disp('Given')\n", +"disp('Voltage gain = 40dB and cutoff frequency = 10k Hz')\n", +"Av_dB=40\n", +"Av=10^(Av_dB/20)\n", +"f=10*10^3\n", +"B=2*%pi*f\n", +"//From figure 16.41(a)\n", +"disp('1+Rf/R1=100(Gain)')\n", +"//From figure 16.41(b)\n", +"//The transfer function is \n", +"disp('V+= Vi*(1/sC)/(1+1/sC)')\n", +"//Combining two transfer functions\n", +"disp('V0 = Vi*(1/sC)/(1+1/sC)*(1+Rf/R1)')\n", +"//The maximum value of the combined transfer function is\n", +"disp('Maximum value is V0 = Vi*(1+Rf/R1)')\n", +"disp('Let R1=1k ohm')\n", +"R1=10^3\n", +"Rf=(Av-1)*R1\n", +"printf('Rf= %d kohm \n',Rf*10^-3);\n", +"disp('C=1 uF')\n", +"C=10^-6\n", +"//B=1/(R2*C)\n", +"R2=1/(C*B)\n", +"printf('R2= %3.2f ohm \n',R2);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1: Parallel_Resonance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.1\n", +"disp('Given')\n", +"disp('L=2.5mH Q0=5 C=0.01uF')\n", +"L=2.5*10^-3; Q0=5; C=0.01*10^-6;\n", +"w0=1/sqrt(L*C)\n", +"printf('w0= %3.1f krad/s \n',w0*10^-3);\n", +"f0=w0/(2*%pi)\n", +"alpha=w0/(2*Q0)\n", +"printf('alpha= %3.1f Np/s \n',alpha);\n", +"wd=sqrt(w0^2-alpha^2)\n", +"printf('wd= %3.1f krad/s \n',wd*10^-3);\n", +"R=Q0/(w0*C)\n", +"printf('R= %3.2f ohm \n',R*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2: Bandwidth_and_high_Q_circuits.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.2\n", +"disp('Given')\n", +"disp('R=40Kohm L=1H C=1/64 uF w=8.2krad/s')\n", +"R=40*10^3; L=1; C=1/64 *10^-6; w=8.2*10^3;\n", +"//The value of Q0 must be at least 5 \n", +"Q0=5;\n", +"w0=1/sqrt(L*C)\n", +"printf('w0= %3.1f krad/s \n',w0*10^-3);\n", +"f0=w0/(2*%pi)\n", +"B=w0/Q0\n", +"printf('Bandwidth= %3.1f krad/s \n',B*10^-3);\n", +"//Number of half bandwidths be N\n", +"N=2*(w-w0)/B\n", +"disp(N)\n", +"//Admittance Y(s)=(1+i*N)/R\n", +"//Finding the magnitude and angle\n", +"magY=sqrt(1+N^2)/R\n", +"angY=atan(N)*(180/%pi)\n", +"disp(angY,'angY=')\n", +"printf('admittance value=%3.2f uS',magY*10^6)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3: Series_Resonance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.3\n", +"disp('Given')\n", +"disp('R=10 ohm L=2mH C=200 nF w=48 krad/s vs=100*cos(wt) mV')\n", +"R=10; L=2*10^-3; C=200*10^-9; w=48*10^3;\n", +"vsamp=100;\n", +"w0=1/sqrt(L*C)\n", +"printf('w0= %3.1f krad/s \n',w0*10^-3);\n", +"Q0=w0*L/R\n", +"printf('Q0=%d \n',Q0)\n", +"B=w0/Q0\n", +"printf('Bandwidth= %3.1f krad/s \n',B*10^-3);\n", +"//Number of half bandwidths be N\n", +"N=2*(w-w0)/B\n", +"disp(N)\n", +"//Impedance Z(s)=(1+i*N)*R\n", +"//Finding the magnitude and angle\n", +"magZ=sqrt(1+N^2)*R\n", +"angZ=atan(N)*(180/%pi)\n", +"disp(angZ,'angZ=')\n", +"printf('Equivalent impedance value=%3.2f ohm \n',magZ)\n", +"//Approx current magnitude is\n", +"Iamp=vsamp/magZ\n", +"printf('\n Approx current magnitude= %3.2f mA \n',Iamp);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4: Other_resonant_forms.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.4\n", +"disp('Given')\n", +"disp('R1=2 ohm R2=3 ohm L=1H C=125mF')\n", +"R1=2;R2=3 ; L=1;C=125*10^-3;\n", +"w0=sqrt(1/(L*C)-(R1/L)^2)\n", +"printf('w0=%d rad/s \n',w0)\n", +"//Input admittance is 1/R2+i*w*C+1/(R+I*w*L)\n", +"Y=1/3+%i/4+1/(2+%i*2)\n", +"printf('Y= %3.4f S \n',Y)\n", +"//Now input impedance at resonance \n", +"Z=1/Y\n", +"printf('Z= %3.4f ohm \n',Z)\n", +"//Resonant frequency f=1/sqrt(L*C)\n", +"f=1/sqrt(L*C)\n", +"printf('f=%3.2f rad/s \n',f);\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.5: Equivalent_Series_and_parallel_combination.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.5\n", +"disp('Given')\n", +"disp('R=5 ohm L=100mH w=100 rad/s')\n", +"Rs=5; Ls=100*10^-3 ;w=100;\n", +"//Let Xs be the capacitive and inductive reactance \n", +"Xs=w*Ls\n", +"Q=Xs/Rs\n", +"//As Q is greater than 5 we can approximate as\n", +"Rp=Q^2*Rs\n", +"Lp=Ls\n", +"printf('The parallel equivalent is \n');\n", +"printf('Rp= %d ohm \t Lp=%d mH',Rp,Lp*10^3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.6: Scaling.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.6\n", +"disp('Given')\n", +"disp('Km=20 Kf=50')\n", +"Km=20; Kf=50;\n", +"s=poly(0,'s')\n", +"//From figure 16.20(a)\n", +"C=0.05; L=0.5;\n", +"//Performing magnitude as well as frequency scaling simultaneously\n", +"Cscaled =C/(Km*Kf)\n", +"Lscaled = L*Km/Kf\n", +"printf('Scaled values are \n')\n", +"printf('Cscaled =%d uF \t Lscaled =%d mH \n',Cscaled*10^6,Lscaled*10^3)\n", +"//Converting the Laplace transform of the circuit\n", +"//From figure 16.20(c)\n", +"disp('Vin=V1+0.5s*(1-0.2*V1)')\n", +"disp('V1=20/s')\n", +"//On substituting V1 in equation of Vin\n", +"\n", +"Zin=(s^2-4*s+40)/(2*s)\n", +"disp(Zin,'Zin=')\n", +"//Now we need to scale Zin\n", +"//We will multiply Zin by Km and replace s by s/Kf\n", +"Zinscaled=horner(Km*Zin,s/Kf)\n", +"disp(Zinscaled,'Zinscaled')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.8: Bode_diagrams.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 16.8\n", +"//From figure 16.26\n", +"disp('Writing the expression for voltage gain')\n", +"disp('Vout/Vin=4000*(-1/200)*(5000*10^8/s)/((5000+10^8/s)*(5000+10^6/20s))')\n", +"//On simplification\n", +"s=poly(0,'s')\n", +"h=syslin('c',(-2*s)/((1+s/10)*(1+s/20000)))\n", +"disp(h)\n", +"fmin=0.01\n", +"fmax=10^7\n", +"scf(1);clf;\n", +"bode(h,fmin,fmax)\n", +"" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/17-Two_Port_Networks.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/17-Two_Port_Networks.ipynb new file mode 100644 index 0000000..61aff4a --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/17-Two_Port_Networks.ipynb @@ -0,0 +1,309 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 17: Two Port Networks" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.10: Transmission_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 17.10\n", +"//From figure 17.32\n", +"disp('Consider Network A')\n", +"//Writing the mesh equations \n", +"disp('V1=12*I1+10*I2')\n", +"disp('V2=10*I1+14*I2')\n", +"//Arranging in the standard form \n", +"//V1=t11*V2-t12*I2\n", +"//I1=t21*V2-t22*I2\n", +"//Therefore t parameters of Network A is\n", +"t11A=1.2;t12A=6.8;t21A=0.1;t22A=1.4;\n", +"disp('Consider Network B')\n", +"//Writing the mesh equations \n", +"disp('V1=24*I1+20*I2')\n", +"disp('V2=20*I1+28*I2')\n", +"//Arranging in the standard form \n", +"//V1=t11*V2-t12*I2\n", +"//I1=t21*V2-t22*I2\n", +"//Therefore t parameters of Network B is\n", +"t11B=1.2;t12B=13.6;t21B=0.05;t22B=1.4;\n", +"tA=[1.2 6.8;0.1 1.4]\n", +"tB=[1.2 13.6;0.05 1.4]\n", +"disp('t parameters of cascaded network is t=tA*tB')\n", +"t=tA*tB\n", +"disp(t)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.1: One_port_networks.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 17.1\n", +"clc\n", +"//From figure 17.3\n", +"disp('The mesh equations are')\n", +"disp('V1=10*I1-10*I2')\n", +"disp('0=-10*I1+17*I2-2*I3-5*I4')\n", +"disp('0=-2*I2+7*I3-I4')\n", +"disp('0=-5*I2-I3+26*I4')\n", +"//We need to find input impedance\n", +"disp('Zin=delz/del11')\n", +"//In matrix form\n", +"A=[10 -10 0 0 ;-10 17 -2 -5; 0 -2 7 -1;0 -5 -1 26]\n", +"delz=det(A)\n", +"printf('\n delz=%f ohm^4',delz);\n", +"//Eliminating first row and first column to find del11\n", +"B=[17 -2 -5;-2 7 -1;-5 -1 26]\n", +"del11=det(B)\n", +"printf('\n del11=%f ohm^3',del11);\n", +"Zin=delz/del11\n", +"printf('\n Zin=%f ohm',Zin);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.2: One_port_networks.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 17.2\n", +"clc\n", +"//From figure 17.5\n", +"disp('The mesh equations are')\n", +"disp('V1=10*I1-10*I2')\n", +"disp('0=-10*I1+17*I2-2*I3-5*I4')\n", +"disp('0=-2*I2+7*I3-I4')\n", +"disp('0=-0.5*I3+1.5*I4')\n", +"//We need to find input impedance\n", +"disp('Zin=delz/del11')\n", +"//In matrix form\n", +"A=[10 -10 0 0 ;-10 17 -2 -5; 0 -2 7 -1;0 0 -0.5 1.5]\n", +"delz=det(A)\n", +"printf('\n delz=%f ohm^3',delz);\n", +"//Eliminating first row and first column to find del11\n", +"B=[17 -2 -5;-2 7 -1;0 -0.5 1.5]\n", +"del11=det(B)\n", +"printf('\n del11=%f ohm^2',del11);\n", +"Zin=delz/del11\n", +"printf('\n Zin=%f ohm',Zin);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.3: One_port_networks.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 17.3\n", +"clc\n", +"//From figure 17.7\n", +"disp('The nodal equations are')\n", +"disp('I1=0.35*V1-0.2*V2-0.05*V3')\n", +"disp('I2=-0.2*V1+1.7*V2-1*V3')\n", +"disp('I3=-0.05*V1-1*V2+1.3*I3')\n", +"//We need to find input impedance\n", +"disp('Yin=dely/del11')\n", +"disp('Zin=1/Yin')\n", +"//In matrix form\n", +"A=[0.35 -0.2 -0.05;-0.2 1.7 -1;-0.05 -1 1.3]\n", +"dely=det(A)\n", +"printf('\n dely=%f S^3',dely);\n", +"//Eliminating first row and first column to find del11\n", +"B=[1.7 -1;-1 1.3]\n", +"del11=det(B)\n", +"printf('\n del11=%f S^2',del11);\n", +"Yin=dely/del11\n", +"printf('\n Yin=%f S',Yin);\n", +"Zin=1/Yin\n", +"printf('\n Zin=%f ohm',Zin);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.7: Some_equivalent_networks.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 17.7\n", +"//From figure 17.16\n", +"disp('Given a linear model of a transistor we need not explicitly find the aadmittance parameters ')\n", +"disp('-y12 corresponds to admittance of 2k ohm resistor')\n", +"disp('y11+y12 corresponds to admittance of 500 ohm resistor')\n", +"disp('y21-y12 correponds to gain of dependent voltage source')\n", +"disp('y22+y12 corresponds to admittance of 10k ohm resistor')\n", +"//Writing down in equation form\n", +"y12=-1/2000\n", +"y11=1/500-y12\n", +"y21=0.0395+y12\n", +"y22=1/10000-y12\n", +"printf('\n y11= %3.2f mS \n y12= %3.2f mS \n y21= %3.2f mS \n y22= %3.2f mS',y11*10^3,y12*10^3,y21*10^3,y22*10^3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.8: Impedance_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 17.8\n", +"disp('Given')\n", +"disp('Z=[10^3 10;-10^6 10^4 ]')\n", +"z11=10^3 ; z12=10;z21=-10^6;z22=10^4 \n", +"//Using the given matrix we can write the mesh equations as\n", +"disp('V1=10^3*I1+10*I2')\n", +"disp('V2=-10^6*I1+10^4*I2')\n", +"//The input to an two port network is an ideal sinusoidal voltage source in series with 500 ohm\n", +"//Mathematically\n", +"disp('The characterizing equations are')\n", +"disp('Vs=500*I1+V1')\n", +"//The output to an two port network is a 10k ohm resistor\n", +"//Mathematically\n", +"disp('V2=-10^4*I2')\n", +"Zg=500;\n", +"//Expressing V1,V2,I1,I2 in terms of Vs\n", +"V1=0.75*Vs\n", +"I1=Vs/2000\n", +"V2=-250*Vs\n", +"I2=Vs/40\n", +"disp('Voltage gain Gv=V2/V1')\n", +"Gv=V2/V1\n", +"disp(Gv,'Gv=')\n", +"disp('Current gain Gi=I2/I1')\n", +"Gi=I2/I1\n", +"disp(Gi,'Gi=')\n", +"disp('Power gain Gp=Real[-0.5*V2*I2*]/Real[0..5*V1*I1*]')\n", +"Gp=(-0.5*V2*I2)/(0.5*V1*I1)\n", +"disp(Gp,'Gp=')\n", +"disp('Input impedance is Zin=V1/I1')\n", +"Zin=V1/I1\n", +"printf('\n Zin= %d ohm',Zin)\n", +"disp('Output impedance is Zout=z22-((z12*z21)/(z11+Zg))')\n", +"Zout=z22-((z12*z21)/(z11+Zg))\n", +"printf('\n Zout= %3.2f kohm',Zout*10^-3)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.9: Hybrid_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 17.9\n", +"//From figure 17.27\n", +"//Writing the mesh equations \n", +"disp('V1=5*I1+4*I2')\n", +"disp('V2=4*I1+10*I2')\n", +"//Arranging in the standard form \n", +"//V1=h11*I1+h12*V2\n", +"//I2=h21*I1+h22*V2\n", +"//Therefore h parameters are\n", +"h11=3.4;h12=0.4;h21=-0.4;h22=0.1;\n", +"h=[h11 h12;h21 h22]\n", +"disp(h)" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/18-Fourier_Circuit_Analysis.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/18-Fourier_Circuit_Analysis.ipynb new file mode 100644 index 0000000..0e972cc --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/18-Fourier_Circuit_Analysis.ipynb @@ -0,0 +1,183 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18: Fourier Circuit Analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.1: Trigonometric_form_of_the_Fourier_Series.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clear\n", +"close\n", +"clc\n", +"//Example 18.1\n", +"//From the figure 18.2\n", +"disp('The equation of v(t) considering one period can be written as')\n", +"disp('v(t)=Vm*cos(5*%pi*t) for -0.1<=t<=0.1')\n", +"disp('v(t)=0 for 0.1<=t<=0.3')\n", +"//Assuming the value of Vm is 1\n", +"Vm=1;\n", +"//Evaluating the constants an and bn\n", +"//bn=0 for all n\n", +"//an=(2*Vm*cos(n*%pi/2))/(%pi*(1-n^2))\n", +"//a0=Vm/%pi\n", +"t=-1:0.02:1\n", +"v0t=Vm/%pi\n", +"v1t=(1/2)*(Vm*cos(5*%pi*t))\n", +"v0t_v1t=v0t+v1t\n", +"v2t=(2/(3*%pi))*(Vm*cos(10*%pi*t))\n", +"v0t_v1t_v2t=v0t+v1t+v2t\n", +"v3t=(2/(15*%pi))*(Vm*cos(20*%pi*t))\n", +"v0t_v1t_v2t_v3t=v0t+v1t+v2t-v3t\n", +"figure\n", +"a = gca ();\n", +"a. y_location = 'origin';\n", +"a. x_location = 'origin';\n", +"a. data_bounds =[ -1,0;1 0.5];\n", +"plot (t,v0t)\n", +"xtitle('vot vs t','t in s','vot')\n", +"figure\n", +"a = gca ();\n", +"a. y_location = 'origin';\n", +"a. x_location = 'origin';\n", +"a. data_bounds =[ -1,-0.5;1 0.5];\n", +"plot (t,v0t_v1t)\n", +"a. y_location = 'origin';\n", +"a. x_location = 'origin';\n", +"a. data_bounds =[ -1,-0.5;1 0.5];\n", +"plot (t,v0t_v1t_v2t,'r.->')\n", +"a. y_location = 'origin';\n", +"a. x_location = 'origin';\n", +"a. data_bounds =[ -1,-0.5;1 0.5];\n", +"plot (t,v0t_v1t_v2t_v3t,'d')\n", +"xtitle('v(t)','t in s','v(t) in V')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.5: Definition_of_the_Fourier_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//Example 18.5\n", +"//Let amplitude be 1 \n", +"A=1;\n", +"Dt=0.01;\n", +"T1=4;\n", +"t=0:Dt:T1/4;\n", +"for i=1:length(t)\n", +" xt(i)=A\n", +"end\n", +"//Calculate Fourier Transform\n", +"Wmax=2*%pi*1;\n", +"K=4;\n", +"k=-(2*K):(K/1000):(2*K);\n", +"W=k*Wmax/K;\n", +"xt=xt';\n", +"XW=xt*exp(-sqrt(-1)*t'*W)*Dt;\n", +"XW_Mag=real(XW);\n", +"W=[-mtlb_fliplr(W),W(2:1001)];\n", +"XW_Mag=[mtlb_fliplr(XW_Mag),XW_Mag(2:1001)];\n", +"subplot(2,1,1);\n", +"a=gca();\n", +"a.data_bounds=[0,0;1,1.5];\n", +"a.y_location='origin';\n", +"plot(t,xt);\n", +"xlabel('t in sec.');\n", +"title('v(t)vs t');\n", +"subplot(2,1,2);\n", +"a=gca();\n", +"a.y_location='origin';\n", +"plot(W*%pi/2,abs (XW_Mag));\n", +"xlabel('Freq in rad/sec');\n", +"ylabel('|F(jw)|')\n", +"title('|F(jw)| vs t');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.6: Physical_significance_of_Fourier_Transform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"syms s t\n", +"printf('Given')\n", +"disp('v(t)=4*exp(-3*t)*u(t)')\n", +"v=4*exp(-3*t)\n", +"\n", +"F=4*(integ(exp(-(3+%i*1)*s),s,0,%inf))\n", +"//The secind term tends to zero\n", +"disp(F,'F=')\n", +"//Let W be the total 1 ohm energy in the input signal\n", +"W=integ(v^2,t,0,%inf)\n", +"disp(W,'W=')\n", +"//Let Wo be the total energy\n", +"//As the frequency range is given as 1 Hz<|f|<2 Hz\n", +"//Considering symmetry\n", +"Wo=(1/%pi)*integ((16/(9+s^2)),s,2*%pi,4*%pi)\n", +"disp(Wo,'Wo=')\n", +"\n", +"\n", +"" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/2-Basic_components_and_Electric_Circuits.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/2-Basic_components_and_Electric_Circuits.ipynb new file mode 100644 index 0000000..a8cbdbd --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/2-Basic_components_and_Electric_Circuits.ipynb @@ -0,0 +1,181 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Basic components and Electric Circuits" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: Power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 2.1\n", +"//Computation of power absorbed by each part\n", +"//From figure 2.13a\n", +"V=2;I=3;\n", +"//We have Power(P)=V*I\n", +"P=V*I\n", +"printf('a) Power =%dW\n',P)\n", +"if P>0 then\n", +" printf('Power is absorbed by the element\n')\n", +"else\n", +" printf('Power is supplied by the element\n');\n", +"end \n", +"\n", +"clear P;\n", +"//From figure 2.13b\n", +"V=-2;I=-3;\n", +"//We have Power(P)=V*I\n", +"P=V*I\n", +"printf('b) Power =%dW\n',P)\n", +"if P>0 then\n", +" printf('Power is absorbed by the element\n')\n", +"else\n", +" printf('Power is supplied by the element\n')\n", +"end\n", +"\n", +"//From figure 2.13c\n", +"V=4;I=-5;\n", +"//We have Power(P)=V*I\n", +"P=V*I\n", +"printf('c) Power =%dW\n',P)\n", +"if P>0 then\n", +" printf('Power is absorbed by the element\n')\n", +"else\n", +" printf('Power is supplied by the element\n')\n", +"end " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: Dependent_sources.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 2.2\n", +"//Calculate vL \n", +"disp('Given')\n", +"disp('v2=3V')\n", +"v2=3;\n", +"//From figure 2.19b\n", +"disp('Considering the right hand part of the circuit ')\n", +"disp('vL=5v2')\n", +"vL=5*v2;\n", +"disp('On substitution')\n", +"printf('vL=%dV\n',vL);\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: Ohm_law.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 2.3\n", +"//Calculate the voltage and power dissipated acreoss the resistor terminals\n", +"//From figure 2.24b\n", +"disp('Given')\n", +"disp('R=560 ohm ; i=428mA')\n", +"R=560;i=428*10^-3;\n", +"//Voltage across a resistor is\n", +"disp('v=R*i')\n", +"v=R*i;\n", +"printf('Voltage across a resistor=%3.3fV\n',v)\n", +"\n", +"//Power dissipated by the resistor is\n", +"disp('p=v*i')\n", +"p=v*i;\n", +"printf('Power dissipated by the resistor=%3.3fW\n',p)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4: Ohm_law.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 2.4\n", +"//Calculate the power dissipated within the wire\n", +"//From figure 2.27\n", +"disp('Given')\n", +"disp('Total length of the wire is 4000 feet')\n", +"disp('Current drawn by lamp is 100A')\n", +"//Considering American Wire Gauge system(AWG)\n", +"//Referring Table 2.4\n", +"disp('4AWG=0.2485ohms/1000ft')\n", +"l=4000; i=100 ; rl=0.2485/1000;\n", +"//Let R be the wire resistance\n", +"R=l*rl;\n", +"//Let p be the power dissipated within the wire\n", +"disp('p=i^2*R')\n", +"p=i^2*R\n", +"printf('Power dissipated within the wire=%dW\n',p)" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/3-Voltage_and_Current_laws.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/3-Voltage_and_Current_laws.ipynb new file mode 100644 index 0000000..d66f6d0 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/3-Voltage_and_Current_laws.ipynb @@ -0,0 +1,32 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Voltage and Current laws" + ] + }, +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/4-Basic_Nodal_and_Mesh_Analysis.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/4-Basic_Nodal_and_Mesh_Analysis.ipynb new file mode 100644 index 0000000..4a2de73 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/4-Basic_Nodal_and_Mesh_Analysis.ipynb @@ -0,0 +1,32 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Basic Nodal and Mesh Analysis" + ] + }, +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/6-Network_Theorems_and_useful_Circuit_Analysis_Techniques.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/6-Network_Theorems_and_useful_Circuit_Analysis_Techniques.ipynb new file mode 100644 index 0000000..6234db5 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/6-Network_Theorems_and_useful_Circuit_Analysis_Techniques.ipynb @@ -0,0 +1,242 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Network Theorems and useful Circuit Analysis Techniques" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: The_Superposition_principle.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 6.10\n", +"//Calculate the voltage across 20 ohm capacitor\n", +"//Consider the circuit to be solved by superposition principle\n", +"disp('Consider the current source 2(90 deg)only')\n", +"//From figure 6.32\n", +"//Let I1 be the current through -i*4 capacitive reactance\n", +"Imag=2;Iph=90;\n", +"i=%i\n", +"x=Imag * cos (( Iph * %pi ) /180) ;\n", +"y=Imag * sin (( Iph * %pi ) /180) ;\n", +"I= complex (x,y)\n", +"I1=(I*(i*15))/(i*5+i*15-i*4)\n", +"//Let V20 be the voltage across -i*4 capacitive reactance\n", +"V200=(-i*4)*I1\n", +"printf('V20=%3.2fV \n',V200)\n", +"disp('Consider the 20 V voltage source only')\n", +"V=20;\n", +"//From figure 6.35\n", +"//let V201 be the voltage across -i*5 capacitive reactance\n", +"V201=-V\n", +"printf('V201=%d V \n',V201)\n", +"disp('Consider the current source 1(90 deg)only')\n", +"I1mag=1;I1ang=90;\n", +"//From figure 6.37\n", +"//Let V202 be the voltage across -i*5 capacitive reactance\n", +"V202=(-i*5)*I1mag*i\n", +"printf('V202=%3.2fV \n',V202)\n", +"//Let V20 be the voltage across -i*20 capacitive reactance\n", +"V20=V200+V201+V202\n", +"printf('\n V20=%3.2fV \n',V20)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.17: Reciprocity_Theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 6.17\n", +"//Verification of Reciprocity theorem\n", +"I=20\n", +"//From figure 6.59\n", +"disp('The current divides between the two parallel impedances')\n", +"//Let I2 be the current through i5 ohm \n", +"I2=(20*%i*(10+%i*5))/(10+%i*5+%i*5-%i*2)\n", +"//Let Vx be the voltage across -i2 ohm capacitive reactance\n", +"Vx=I2*(-%i*2)\n", +"[Vxmag Vxang]=polar(Vx)\n", +"printf('Vx=%3.2f(%3.2f deg)V \n',Vxmag,(Vxang*180)/%pi)\n", +"//To verify Reciprocity theorem remove the current source and place it parallel with -i2 ohm capacitive reactance\n", +"//From figure 6.60\n", +"//Let I2 be the current flowing through resistor of 10 ohm\n", +"I2=(20*%i*(-%i*2))/(10+%i*5+%i*5-%i*2)\n", +"//let Vx1 be the deired output voltage across 10 ohm resistor and i5 inductive reactance\n", +"Vx1=I2*(10+%i*5)\n", +"[Vx1mag Vx1ang]=polar(Vx1)\n", +"printf('Vx1=%3.2f(%3.2f deg)V \n',Vx1mag,(Vx1ang*180)/%pi)\n", +"//Comparing the values of Vx and Vx1\n", +"disp('Vx=Vx1')\n", +"disp('Hence Reciprocity theorem is verified')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.18: Reciprocity_Theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 6.18\n", +"//Verification of Reciprocity theorem\n", +"I=10\n", +"//From figure 6.61\n", +"disp('The current divides between the two parallel impedances')\n", +"//Let I2 be the current through 4 ohm \n", +"I2=(10*5)/(4-%i*4+5)\n", +"//Let Vx be the voltage across -i4 ohm capacitive reactance\n", +"Vx=I2*(-%i*4)\n", +"[Vxmag Vxang]=polar(Vx)\n", +"printf('Vx=%3.2f(%3.2f deg)V \n',Vxmag,(Vxang*180)/%pi)\n", +"//To verify Reciprocity theorem remove the current source and place it parallel with -i4 ohm capacitive reactance\n", +"//From figure 6.62\n", +"//Let I1 be the current flowing through resistor of 5 ohm\n", +"I1=(10*(-%i*4))/(5+4-%i*4)\n", +"//let Vx1 be the deired output voltage across 5 ohm resistor\n", +"Vx1=I1*5\n", +"[Vx1mag Vx1ang]=polar(Vx1)\n", +"printf('Vx1=%3.2f(%3.2f deg)V \n',Vx1mag,(Vx1ang*180)/%pi)\n", +"//Comparing the values of Vx and Vx1\n", +"disp('Vx=Vx1')\n", +"disp('Hence Reciprocity theorem is verified')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.19: Millman_Theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 6.19\n", +"//Calculate total current through load\n", +"//On applying source transformation \n", +"//From figure 6.65\n", +"i=%i\n", +"V1=10;V2mag=5;V2ph=90;V3mag=14.4;V3ph=225;\n", +"x=V2mag * cos (( V2ph * %pi ) /180) ;\n", +"y=V2mag * sin (( V2ph * %pi ) /180) ;\n", +"V2= complex (x,y)\n", +"a=V3mag * cos (( V3ph * %pi ) /180) ;\n", +"b=V3mag * sin (( V3ph * %pi ) /180) ;\n", +"V3= complex (a,b)\n", +"G1=1/2;G2=1/(2+i*3);G3=1/(2-i*2);\n", +"//By applying Millman Theorem\n", +"disp('V=((V1*G1)+(V2*G2)+(V3*G3))/(G1+G2+G3)')\n", +"V=((V1*G1)+(V2*G2)+(V3*G3))/(G1+G2+G3)\n", +"[Vmag Vang]=polar(V)\n", +"R=1/(G1+G2+G3)\n", +"printf('V=%3.2f(%3.2f deg)V',Vmag,(Vang*180)/%pi)\n", +"disp(R,'R=')\n", +"//Consider the resultant circuit from figure 6.66\n", +"disp('Let the total current through 3+i4 be I')\n", +"//Applying KVL to the circuit\n", +"I=V/(3+i*4+R)\n", +"[Imag Iang]=polar(I)\n", +"printf('I=%3.2f(%3.2f deg)V',Imag,(Iang*180)/%pi)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.22: Tellegen_Theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 6.22\n", +"//Writing KVL for the circuit\n", +"disp('10*i=30')\n", +"//On solving\n", +"i=3;R=10;V1=25;V2=5;\n", +"printf('Power absorbed by 10 ohm resistor is %d W \n',i^2*R)\n", +"printf('Power delivered by 25 V source is %d W \n',V1*i)\n", +"printf('Power delivered by 5 V source is %d W \n',V2*i)\n", +"//Let P be the total power\n", +"P=i^2*R-(V1*i+V2*i)\n", +"if P==0 then\n", +" disp('Tellegen theorem is valid')\n", +"else\n", +" disp('Tellegen theorem is not valid')\n", +"end" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/7-Capacitors_and_Inductors.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/7-Capacitors_and_Inductors.ipynb new file mode 100644 index 0000000..990342d --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/7-Capacitors_and_Inductors.ipynb @@ -0,0 +1,173 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Capacitors and Inductors" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: The_Capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"syms s t\n", +"//part(a)\n", +"i=diff(5*s^0,s)\n", +"disp(i,'i=')\n", +"//prt(b)\n", +"i1=diff(4*sin(3*t),t)\n", +"t=-2:.1:5\n", +" plot (t,12*cos(3*t))\n", +"xtitle('i vs t','t(s)','i(A)')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: The_Capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"t = 0:0.000001:0.002; \n", +"deff('y=u(t)','y=1*(t>=0)');\n", +"y =0.02*(u(t) - u(t-0.002));\n", +"figure\n", +"a=gca()\n", +"subplot(111)\n", +"plot2d(t,y,5,rect=[0 0 0.004 0.03])\n", +"xtitle('i vs t','t in ms','i in mA')\n", +"\n", +"syms s\n", +"//For t<=0 ms\n", +"v=0\n", +"//For the region in the rectangular pulse i.e 0<t<=2 ms\n", +"v=integ(s^0,s)*4000\n", +"//For t>2 ms\n", +"v=8\n", +"s=0:0.000001:0.002\n", +"\n", +"figure\n", +"a=gca()\n", +"subplot(111)\n", +"plot(s,(4000*s),s+0.002,8)\n", +"xtitle('v vs t','t in ms','v in V')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: The_Capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 7.3\n", +"//Let wc be the energy stored in capacitor\n", +"C=20*10^-6; R=10^6;\n", +"t=0:0.001:0.5\n", +"v=100*sin(2*%pi*t)\n", +"wc=0.5*C*v^2\n", +"plot(t,wc)\n", +"xtitle('wC vs t','t in sec','wC in J')\n", +"//Let iR be the current in the resistor\n", +"iR=v/R\n", +"//Let pR be the power dissipated in the resistor\n", +"pR=iR^2*R\n", +"//If wR is the energy dissipated in the resistor\n", +"syms s\n", +"wR=integ(100*(sin(2*%pi*s))^2,s,0,0.5)\n", +"disp(wR,'wR=')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7: The_Inductor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 7.7\n", +"printf('Given')\n", +"disp('i=12*sin(%pi*t/6),R=0.1 ohm,L=3H')\n", +"t=0:.1:6\n", +"i=12*sin(%pi*t/6),R=0.1;L=3;\n", +"//Let wL be the energy stored in the inductor\n", +"wL=0.5*L*i^2\n", +"plot(t,wL)\n", +"//From the above graph\n", +"wLmax=216;tmax=3;\n", +"printf('Maximum value at %d J at %d sec',wLmax,tmax)\n", +"//Let pR be the power dissipated in the resistor\n", +"pR=i^2*R\n", +"//Energy converted to heat in 6 sec interval in the resistor is \n", +"syms s\n", +"wR=integ(14.4*(sin(%pi/6*s))^2,s,0,6)\n", +"disp(wR,'wR')" + ] + } +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/8-Basic_RL_and_RC_circuits.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/8-Basic_RL_and_RC_circuits.ipynb new file mode 100644 index 0000000..6a28ac8 --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/8-Basic_RL_and_RC_circuits.ipynb @@ -0,0 +1,32 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Basic RL and RC circuits" + ] + }, +], +"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/Engineering_Circuit_Analysis_by_W_Hayt/9-The_RLC_Circuit.ipynb b/Engineering_Circuit_Analysis_by_W_Hayt/9-The_RLC_Circuit.ipynb new file mode 100644 index 0000000..990424c --- /dev/null +++ b/Engineering_Circuit_Analysis_by_W_Hayt/9-The_RLC_Circuit.ipynb @@ -0,0 +1,98 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: The RLC Circuit" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: The_Source_free_parallel_circuit.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example 9.1\n", +"//Calculate resistor values for underdamped and overdamped responses\n", +"printf('Given')\n", +"disp('L=10mH and C=100uF')\n", +"L=10*10^-3;C=100*10^-6\n", +"w0=sqrt(1/(L*C))\n", +"printf('w0=%drad/s\n',w0)\n", +"//alpha(a)=1/(2*R*C)\n", +"disp('For an overdamped response')\n", +"disp('a > w0')\n", +"//On solving\n", +"disp('Hence')\n", +"disp('R<5ohm')\n", +"disp('For an underdamped response')\n", +"disp('a < w0')\n", +"//On solving\n", +"disp('Hence')\n", +"disp('R>5ohm')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: Graphical_Representation_of_Overdamped_response.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Example 9.4\n", +"//Calculate settling time\n", +"t=0:0.1:5\n", +"ic=2*exp(-t)-4*exp(-t)\n", +"plot(t,ic)\n", +"xtitle('ic vs t','t in s','ic in A')\n", +"//Let ts be the settling time\n", +"//From the graph the maximum value is|-2|=2A\n", +"//'ts' is the time when ic has decreased to 0.02A\n", +"//On solving for 'ts'\n", +"ts=-log(0.02/4)\n", +"printf('ts=%3.2f s\n',ts)" + ] + } +], +"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 +} |