summaryrefslogtreecommitdiff
path: root/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18.ipynb
blob: b24f0f02bf57a04d832f385fa0da4c748ae266f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
 "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
}