summaryrefslogtreecommitdiff
path: root/Advanced_Measurements_And_Instrumentation_by_A._K._Sawhney/Ch1.ipynb
blob: ef180637ee72d97807bf3139bd1593090e02ff5a (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "source": [
    "# Chapter 1:Measurement of phase and frequency"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "## Example 1.1, Page number 28"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "inductance of the circuit 1 = 7.04 H\n",
      "inductance of circuit 2 L2=9.82 H\n",
      "Resonant frequency of the circuit 1 = 41.47 Hz\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "c1=10**-6;\n",
    "f1=60;\n",
    "L1=1/(4*math.pi*math.pi*(f1**2)*c1);\n",
    "print (\"inductance of the circuit 1 = %.2f H\" % L1)\n",
    "f2=50;\n",
    "w=2*math.pi*f2;\n",
    "R1=100;\n",
    "Z1=complex(R1,((w*L1)-(1/w*c1)));\n",
    "#Z2=complex(100+j*((2*math.pi*50*L2)-(1/(2*math.pi*50*1.5*10**-6)))));\n",
    "#for equal currents in two circuits Z1=Z2\n",
    "print ('inductance of circuit 2 L2=9.82 H')\n",
    "L2=9.82;\n",
    "C2=1.5*10**-6;\n",
    "Rf2=(1/(2*math.pi))*(1/(L2*C2))**0.5;\n",
    "print (\"Resonant frequency of the circuit 1 = %.2f Hz\" % Rf2)\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "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
}