{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 18: Transient Behaviour" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.1, Page 376" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "v = 18.36 V\n" ] } ], "source": [ "#Initialisation\n", "c=100*10**-6 #capacitance in farad\n", "r=100*10**3 #resistance in ohm\n", "v=20 #volt\n", "t=25 #time in seconds\n", "e=2.71828 #mathematical constant\n", "\n", "#Calculation\n", "T=c*r #time in seconds\n", "v1=v*(1-e**(-t*T**-1)) #volt\n", "\n", "#Result\n", "print'v = %.2f V'%v1\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.2, Page 378" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "t = 10.2 mSec\n" ] } ], "source": [ "import math\n", "\n", "#Initialisation\n", "l=400*10**-3 #inductance in henry\n", "i1=300 #current in milliamp\n", "r=20 #resistance in ohm\n", "v=15 #volt\n", "t=25 #time in seconds\n", "e=2.71828 #mathematical constant\n", "\n", "#Calculation\n", "T=l/r #time in seconds\n", "i=(v*r**-1)*10**3 #current in amp\n", "t=((math.log(i/(i-i1)))/(math.log(e)))*0.02 #expression to find time t\n", "\n", "#Result\n", "print't = %.1f mSec'%(t*10**3)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.3, Page 382" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "v = 10 - 5 e^( -t/0.2 ) V\n" ] } ], "source": [ "#Initialisation\n", "c=20*10**-6 #capacitance in farad\n", "r=10*10**3 #resistance in ohm\n", "v=5 #volt\n", "v2=10 #volt\n", "\n", "#Calculation\n", "T=c*r #time in seconds\n", "\n", "#Result\n", "print'v = %d - %d e^( -t/%.1f ) V'%(v2,v,T)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [Root]", "language": "python", "name": "Python [Root]" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.12" } }, "nbformat": 4, "nbformat_minor": 0 }