{
 "metadata": {
  "name": "",
  "signature": "sha256:974ed2f2844a32c3679f774415b0c9458096cf6af36688e6d18e22415c8dce7e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17  : The Laplace Transform Method"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.2  Page No : 327"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sympy.abc import t,s\n",
      "import math\n",
      "\n",
      "x = 3*math.e**(2*t)\n",
      "print  \" X(s) = \" ,x\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " X(s) =  3*2.71828182845905**(2*t)\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.4  Page No : 330"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from sympy.abc import t,s\n",
      "\n",
      "#Factorizing the denominator\n",
      "I = (s-10)/((s**2)*(s-1j)*(s+1j));\n",
      "print \"I(s) = \",I\n",
      "#The principal part at s = 0 is\n",
      "#B1/s+B2/s**2\n",
      "#Taking the limit s->0 to (s-10)/((s-1j)*(s+1j))\n",
      "\n",
      "B2 = -10\n",
      "\n",
      "#Taking the limit s->0 to (s*(s-10))/(s**2)*(s**2+1)+(10/s)\n",
      "\n",
      "B1 = 1\n",
      "\n",
      "#The principal part at s = 1j is\n",
      "#A/(s-1j)\n",
      "#Taking the limit s->1j to (s-10)/((s**2)*(s+1j))\n",
      "\n",
      "A = (-0.5-1j*5)\n",
      "\n",
      "#As the other co-efficient is conjugate of the above we can write the partial fraction expansion  of I(s)\n",
      "I = (1/s)-(10/s**2)-(0.5+1j*5)/(s-1j)-(0.5-1j*5)/(s+1j);\n",
      "#Taking inverse of each term\n",
      "I1 = 1/s\n",
      "I2 = 10/s**2\n",
      "I3 = (0.5+1j*5)/(s-1j)\n",
      "I4 = (0.5-1j*5)/(s+1j)\n",
      "I = I1-I2-I3-I4\n",
      "print \"i(t) = \",I\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "I(s) =  (s - 10)/(s**2*(s - 1.0*I)*(s + 1.0*I))\n",
        "i(t) =  -(0.5 - 5.0*I)/(s + 1.0*I) - (0.5 + 5.0*I)/(s - 1.0*I) + 1/s - 10/s**2\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}