summaryrefslogtreecommitdiff
path: root/sample_notebooks
diff options
context:
space:
mode:
authorTrupti Kini2016-07-08 23:30:30 +0600
committerTrupti Kini2016-07-08 23:30:30 +0600
commit2f7e3b424b86764a75b25d490ef2581b95fa96a6 (patch)
tree19a316b86306abeabfe2b2e24c5cb16b94f49dcb /sample_notebooks
parent680d88758fa56798d0cd89ab95c8062c4b2cb690 (diff)
downloadPython-Textbook-Companions-2f7e3b424b86764a75b25d490ef2581b95fa96a6.tar.gz
Python-Textbook-Companions-2f7e3b424b86764a75b25d490ef2581b95fa96a6.tar.bz2
Python-Textbook-Companions-2f7e3b424b86764a75b25d490ef2581b95fa96a6.zip
Added(A)/Deleted(D) following books
A Electrical_Engineering_-_Principles_And_Applications_by_Allan._R._Hambley/README.txt A Engineering_Mechanics_of_Solids_by_Popov_E_P/Chapter1_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter10_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter11_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter12_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter13_6.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter2_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter4_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter5_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter6_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter7_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter8_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter9_7.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/charpter_3_8.ipynb A Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/1_5.PNG A Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/2_5.PNG A Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/3_5.PNG A sample_notebooks/NityaL/Sample.ipynb
Diffstat (limited to 'sample_notebooks')
-rw-r--r--sample_notebooks/NityaL/Sample.ipynb236
1 files changed, 236 insertions, 0 deletions
diff --git a/sample_notebooks/NityaL/Sample.ipynb b/sample_notebooks/NityaL/Sample.ipynb
new file mode 100644
index 00000000..c7730277
--- /dev/null
+++ b/sample_notebooks/NityaL/Sample.ipynb
@@ -0,0 +1,236 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 26:CHARGE AND MATTER"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "##Example 26.1 Magnitude of total charges in a copper penny"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Magnitude of the charges in coulombs is 133687.50000000003\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.1\n",
+ "\n",
+ "m =3.1 #mass of copper penny in grams\n",
+ "e =4.6*10** -18 #charge in coulombs\n",
+ "N0 =6*10**23 #avogadro’s number atoms / mole\n",
+ "M =64 #molecular weight of copper in gm/ mole\n",
+ "\n",
+ "#Calculation\n",
+ "N =( N0 * m ) / M #No. of copper atoms in penny\n",
+ "q = N * e # magnitude of the charges in coulombs\n",
+ "print (\" Magnitude of the charges in coulomb is \",q )"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "##Example 26.2 Separation between total positive and negative charges"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Separation between total positive and negative charges in meters is 5813776741.499454\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 2\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "F =4.5 #Force of attraction in nt\n",
+ "q =1.3*10**5 #total charge in coulomb\n",
+ "r = q * math.sqrt ((9*10**9) / F ) ;\n",
+ "print(\" Separation between total positive and negative charges in meters is \",r )"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "##Example 26.3 Force acting on charge q1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "X component of resultant force acting on q1 in nt is 2.0999999999999996\n",
+ "Y component of resultant force acting on q1 in nt is -1.5588457268119893\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 3\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#given three charges q1,q2,q3\n",
+ "q1=-1.0*10**-6 #charge in coul\n",
+ "q2=+3.0*10**-6 #charge in coul\n",
+ "q3=-2.0*10**-6 #charge in coul\n",
+ "r12=15*10**-2 #separation between q1 and q2 in m\n",
+ "r13=10*10**-2 # separation between q1 and q3 in m\n",
+ "angle=math.pi/6 #in degrees\n",
+ "F12=(9.0*10**9)*q1*q2/(r12**2) #in nt\n",
+ "F13=(9.0*10**9)*q1*q3/(r13**2) #in nt\n",
+ "F12x=-F12 #ignoring signs of charges\n",
+ "F13x=F13*math.sin(angle);\n",
+ "F1x=F12x+F13x\n",
+ "F12y=0 #from fig.263\n",
+ "F13y=-F13*math.cos(angle);\n",
+ "F1y=F12y+F13y #in nt\n",
+ "print(\"X component of resultant force acting on q1 in nt is\",F1x)\n",
+ "print(\"Y component of resultant force acting on q1 in nt is\",F1y)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "##Example 26.4 Electrical and Gravitational force between two particles"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Coulomb force in nt is 8.202207191171238e-08\n",
+ "Gravitational force in nt is 3.689889640441438e-47\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 4\n",
+ "\n",
+ "r=5.3*10**-11 #distance between electron and proton in the hydrogen atom in meter\n",
+ "e=1.6*10**-19 #charge in coul\n",
+ "G=6.7*10**-11 #gravitatinal constant in nt-m2/kg2\n",
+ "m1=9.1*10**-31 #mass of electron in kg\n",
+ "m2=1.7*10**-27 #mass of proton in kg\n",
+ "F1=(9*10**9)*e*e/(r**2) #coulomb's law\n",
+ "F2=G*m1*m2/(r**2) #gravitational force\n",
+ "print(\"Coulomb force in nt is\",F1)\n",
+ "print(\"Gravitational force in nt is\",F2)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "##Example 26.5 Repulsive force between two protons in a nucleus of iron"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Repulsive coulomb force F 14.4 nt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 5\n",
+ "\n",
+ "r=4*10**-15 #separation between proton annd nucleus in iron in meters\n",
+ "q=1.6*10**-19 #charge in coul\n",
+ "F=(9*10**9)*(q**2)/(r**2) #coulomb's law\n",
+ "print(\"Repulsive coulomb force F \",F,'nt')"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}