diff options
Diffstat (limited to 'Engineering_Circuit_Analysis_by_W_Hayt/7-Capacitors_and_Inductors.ipynb')
-rw-r--r-- | Engineering_Circuit_Analysis_by_W_Hayt/7-Capacitors_and_Inductors.ipynb | 173 |
1 files changed, 173 insertions, 0 deletions
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 +} |