"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"B = 0.9;# in tesla\n",
"I = 20;# in Amperes\n",
"l = 0.30;# in m\n",
"alpha = 30;# in degree\n",
"u0 = 4*math.pi*1E-7;\n",
"\n",
"#calculation:\n",
"F1 = B*I*l\n",
"F2 = B*I*l*math.sin(alpha*math.pi/180)\n",
"\n",
"#Results\n",
"print \"\\n\\nResult\\n\\n\"\n",
"print \"\\n (a)Force when the conductor is at right angles to the field = \",F1,\" N\\n\"\n",
"print \"\\n (b)Force when the conductor is at 30\u00b0 angle to the field = \",F2,\" N\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
"Result\n",
"\n",
"\n",
"\n",
" (a)Force when the conductor is at right angles to the field = 5.4 N\n",
"\n",
"\n",
" (b)Force when the conductor is at 30\u00c2\u00b0 angle to the field = 2.7 N"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"