"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine (a) the resistance of an 8 m length of the same wire,\n",
"#and (b) the length of the same wire when the resistance is 420\n",
"from __future__ import division\n",
"#initializing the variables:\n",
"R = 600; # in ohms\n",
"L = 5; # in meter\n",
"L1 = 8; # in meter\n",
"R2 = 420; # in ohms\n",
"\n",
"#calculation:\n",
"R1 = R*L1/L\n",
"L2 = R2*L/R\n",
"\n",
"#results\n",
"print \"a)Resistance\", R1,\"Ohms\"\n",
"print \"b)Length:\", L2,\"meters(m)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"a)Resistance 960.0 Ohms\n",
"b)Length: 3.5 meters(m)"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 2, page no. 24
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Find (a) the resistance of a wire of the same length and material if the cross-sectional area is 5 mm2,\n",
"#(b) the cross-sectional area of a wire of the same length and material of resistance 750 \n",
"from __future__ import division\n",
"#initializing the variables:\n",
"R = 300; # in ohms\n",
"A = 2; # in mm2\n",
"A1 = 5; # in mm2\n",
"R2 = 750; # in ohms\n",
"\n",
"#calculation:\n",
"R1 = R*A/A1\n",
"A2 = R*A/R2\n",
"\n",
"#results\n",
"print \"(a)Resistance\", R1,\"Ohms\"\n",
"print \"(b)C.S.A:\", A2,\"mm^2\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Resistance 120.0 Ohms\n",
"(b)C.S.A: 0.8 mm^2"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"