PK II % College Physics (volume 2)/Ch15.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 15 : Electric forces and electric fields" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 15.1 Page No : 502" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The attractive force = 8.19e-08 N\n", "The gravitational force = 3.61e-47 N\n" ] } ], "source": [ "k_e=8.99*10**9\n", "e=1.6*10**-19\n", "r=5.3*10**-11\n", "F_e= (k_e*e*e)/(r*r)\n", "print \"The attractive force = %0.2e N\"%F_e\n", "G=6.67*10**-11\n", "m_e=9.11*10**-31\n", "m_p=1.67*10**-27\n", "F_g=(G*m_e*m_p)/(r*r)\n", "print \"The gravitational force = %0.2e N\"%F_g" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 15.2 Page No : 503" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The force = 5.62e-09 N\n", "The force = 1.08e-08 N\n" ] } ], "source": [ "k_e=8.99*10**9 #N.m**2/c**2\n", "q2=2*10**-9# = %0.2f c\n", "q3=5*10**-9# = %0.2f c\n", "r1=4#in m\n", "F_23=(q2*q3*k_e)/(r1*r1)\n", "print \"The force = %0.2e N\"%F_23\n", "q1=6*10**-9\n", "r2=5#in m\n", "F_13=(q1*q3*k_e)/(r2*r2)\n", "print \"The force = %0.2e N\"%F_13" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 15.4 Page No: 507" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The magnitude of force = 3.20e-15 N\n" ] } ], "source": [ "q=1.6*10**-19#in c\n", "E=2*10**4# = %0.2f N/C\n", "F=q*E\n", "print \"The magnitude of force = %0.2e N\"%F" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 15.5 Page No: 509" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Magnitude of E1 = 3.93e+05 N/C\n", "Magnitude of E2 = 1.80e+05 N/C\n", "Magnitude in x direction = 1.80e+05 N/C\n", "Magnitude in y direction = 2.49e+05 N/C\n", "Angle = 54.17 degree\n" ] } ], "source": [ "from math import degrees, atan\n", "k_e=8.99*10**9 #N.m**2/c**2\n", "q1=7*10**-6# = %0.2f C\n", "q2=5*10**-6#in C\n", "r1=0.4\n", "r2=0.5\n", "E1=(k_e*q1)/(r1**2)\n", "E2=(k_e*q2)/(r2**2)\n", "Ex=(k_e*q2)/(r2**2)\n", "print \"Magnitude of E1 = %0.2e N/C\"%E1\n", "print \"Magnitude of E2 = %0.2e N/C\"%E2\n", "print \"Magnitude in x direction = %0.2e N/C\"%Ex\n", "Ey=(3.93*10**5)+(-1.44*10**5)\n", "print \"Magnitude in y direction = %0.2e N/C\"%Ey\n", "phi=degrees(atan(Ey/Ex))\n", "print \"Angle = %0.2f degree\"%phi\n", "#Answer given in the book is wrong" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK IR % College Physics (volume 2)/Ch16.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 16 : Electrical Energy & Capacitance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.1 Page No : 533" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The value of E = 4000.00 v/m\n" ] } ], "source": [ "v_bminusv_a=-12\n", "d=0.3*10**-2#in m\n", "E=-(v_bminusv_a)/d\n", "print \"The value of E = %0.2f v/m\"%E" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.2 Page No : 533" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a\n", "Electric potential from A to B = -40000.00 V\n", "solution b\n", "Change in electric potential = -0.00 joules\n", "velocity = 2768514.16 m/s\n" ] } ], "source": [ "from math import sqrt\n", "print \"solution a\"\n", "E=8*10**4#in V/m\n", "d=0.5#in m\n", "delta_V=-E*d\n", "print \"Electric potential from A to B = %0.2f V\"%delta_V\n", "print \"solution b\"\n", "q=1.6*10**-19#in C\n", "delta_PE=q*delta_V\n", "print \"Change in electric potential = %0.2f joules\"%delta_PE\n", "m_p=1.67*10**-27#in kg\n", "vf=sqrt((2*-delta_PE)/m_p)\n", "print \"velocity = %0.2f m/s\"%vf" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.3 Page No: 534" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Magnitude of V1 = 112375.00 v\n", "Magnitude of V2 = -35960.00 v\n", "solution b\n", "Magnitude of Vp = 76415.00 v\n", "work done = 0.31 Joule\n" ] } ], "source": [ "k_e=8.99*10**9 #N.m**2/c**2\n", "q1=5*10**-6# in C\n", "q2=-2*10**-6#in C\n", "r1=0.4\n", "r2=0.5\n", "V1=(k_e*q1)/(r1)\n", "V2=(k_e*q2)/(r2)\n", "print \"Solution a\"\n", "print \"Magnitude of V1 = %0.2f v\"%V1\n", "print \"Magnitude of V2 = %0.2f v\"%V2\n", "print \"solution b\"\n", "vp=V1+V2\n", "print \"Magnitude of Vp = %0.2f v\"%vp\n", "q3=4*10**-6#in C\n", "w=vp*q3\n", "print \"work done = %0.2f Joule\"%w" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.4 Page No: 535" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Capacitance = 1.77e-12 farad\n" ] } ], "source": [ "e0=8.85*10**-12#in c2/N.m2\n", "A=2*10**-4#in m2\n", "d=1*10**-3#in m\n", "c=(e0*A)/d\n", "print \"Capacitance = %0.2e farad\"%c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.5 Page No : 535" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "capacitance = 4.50e-05 farad\n", "voltage between battery = 2.16e-04 c\n" ] } ], "source": [ "c1=3*10**-6\n", "c2=6*10**-6\n", "c3=12*10**-6\n", "c4=24*10**-6\n", "delta_v=18\n", "c_eq=c1+c2+c3+c4\n", "print \"capacitance = %0.2e farad\"%c_eq\n", "q=delta_v*c3\n", "print \"voltage between battery = %0.2e c\"%q" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.6 Page No : 536" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a\n", "capacitance = 1.60e-06 farad\n", "solution b\n", "voltage between battery = 2.88e-05 c\n" ] } ], "source": [ "c1=3*10**-6\n", "c2=6*10**-6\n", "c3=12*10**-6\n", "c4=24*10**-6\n", "delta_v=18\n", "print \"solution a\"\n", "c_eq=1/((1/c1)+(1/c2)+(1/c3)+(1/c4))\n", "print \"capacitance = %0.2e farad\"%c_eq\n", "q=delta_v*c_eq\n", "print \"solution b\"\n", "print \"voltage between battery = %0.2e c\"%q" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.7 Page No: 536" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a\n", "capacitance = 2.00e-06 farad\n" ] } ], "source": [ "c1=4*10**-6\n", "c2=4*10**-6\n", "print \"solution a\"\n", "c_eq=1/((1/c1)+(1/c2))\n", "print \"capacitance = %0.2e farad\"%c_eq" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.8 Page No: 537" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a\n", "Energy stored = 4671 volt\n", "solution b\n", "power = 240000 watt\n" ] } ], "source": [ "Energy=1.2*10**3#in J\n", "c=1.1*10**-4#in f\n", "delta_v=sqrt((2*Energy)/c)\n", "print \"solution a\"\n", "print \"Energy stored = %0.f volt\"%delta_v\n", "print \"solution b\"\n", "Energy_deliverd=600#in j\n", "delta_t=2.5*10**-3#in s\n", "p=(Energy_deliverd)/delta_t\n", "print \"power = %0.f watt\"%p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 16.9 Page No: 538" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a\n", "Capacitance = 1.96e-11 farad\n", "solution b\n", "Voltage = 16000.0 volt\n", "Maximum charge = 3.14e-07 columb\n" ] } ], "source": [ "k=3.7\n", "e0=8.85*10**-12#in c2/N.m2\n", "A=6*10**-4#in m2\n", "d=1*10**-3#in m\n", "c=(k*e0*A)/d\n", "print \"solution a\"\n", "print \"Capacitance = %0.2e farad\"%c\n", "print \"solution b\"\n", "E_max=16*10**6#in v/m\n", "delta_v_max=E_max*d\n", "print \"Voltage = %0.1f volt\"%delta_v_max\n", "Q_max=delta_v_max*c\n", "print \"Maximum charge = %0.2e columb\"%Q_max" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK I9 % College Physics (volume 2)/Ch17.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 17 : Current and resistance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.1 Page No: 571" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a : \n", "Current = 0.83 Amp\n", "solution b : \n", "Number of electrons = 0.84 C\n" ] } ], "source": [ "from __future__ import division\n", "print \"solution a : \"\n", "delta_q=1.67 # in c\n", "delta_t=2 # in s\n", "I=delta_q/delta_t\n", "print \"Current = %0.2f Amp\"%I\n", "print \"solution b : \"\n", "N=5.22*10**18\n", "N_q=(1.6*10**-19)*N\n", "\n", "print \"Number of electrons = %0.2f C\"%N_q" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.2 Page No: 573" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a :\n", "The drift speed = 2.46e-04 m/s=\n", "Drift speed of electron = 1.15e+05 m/s\n" ] } ], "source": [ "from math import sqrt\n", "M=63.5 # IN G\n", "rho=8.95\n", "v=M/rho\n", "electrons=6.02*10**23\n", "n=(electrons*10**6)/v\n", "I=10 # in c/s\n", "q=1.60*10**-19 # in c\n", "A=3*10**-6 # in m2\n", "vd=(I)/(n*q*A)\n", "print \"Solution a :\"\n", "print \"The drift speed = %0.2e m/s=\"%vd\n", "k_b=1.38*10**-23\n", "T=293\n", "m=9.11*10**-31\n", "v_rms=sqrt((3*k_b*T)/m)\n", "print \"Drift speed of electron = %0.2e m/s\"%v_rms" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.3 Page No: 578" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The resistance = 18.75 ohm\n" ] } ], "source": [ "delta_v=120\n", "I=6.4\n", "R=(delta_v)/I\n", "print \"The resistance = %0.2f ohm\"%R" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.4 Page No: 580" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a : \n", "Area = 3.24e-07 m**2\n", "Resistance = 4.63 ohm/m\n", "solution b : \n", "The current = 2.16 Amps\n" ] } ], "source": [ "from math import pi\n", "r=0.321*10**-3\n", "A=pi*(r*r)\n", "print \"Solution a : \"\n", "print \"Area = %0.2e m**2\"%A\n", "rho=1.5*10**-6 # in ohm=m\n", "l=rho/A\n", "print\"Resistance = %0.2f ohm/m\"% l\n", "print \"solution b : \"\n", "Delta_v=10\n", "I=(Delta_v)/l\n", "print \"The current = %0.2f Amps\"%I\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.5 Page No: 582" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Temperature = 156.73 C\n" ] } ], "source": [ "R=76.8\n", "Ro=50\n", "alpha=3.92*10**-3\n", "t=(R-Ro)/(alpha*Ro)\n", "T=t+20\n", "print \"Temperature = %0.2f C\"%T" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.6 Page No: 583" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The current = 6.00 A\n", "Power = 288.00 Watt\n" ] } ], "source": [ "delta_v=50\n", "R=8\n", "I=(delta_v)/R\n", "print \"The current = %0.2f A\"%I\n", "P=I*I*R\n", "print \"Power = %0.2f Watt\"%P" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.7 Page No: 585" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of bulbs = 32\n" ] } ], "source": [ "I=20 # in A\n", "delta_v=120\n", "p_bulb=75 # inwatt\n", "p_total=I*delta_v\n", "N=p_total/p_bulb\n", "print \"Number of bulbs = %d\"%N" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 17.8 Page No: 587" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Energy = 2.40 kwh\n", "Cost = 0.29 dollars\n" ] } ], "source": [ "p=0.10 # in w\n", "t=24 # in h\n", "Energy=p*t\n", "print \"Energy = %0.2f kwh\"%Energy\n", "cost=Energy*0.12\n", "print \"Cost = %0.2f dollars\"%cost" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK I# % College Physics (volume 2)/Ch18.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 18 : Direct current circuits" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.1 Page No: 597" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Equivalent resistance = 18.00 ohm\n", "Solution b\n", "Current = 0.33 Amps\n" ] } ], "source": [ "from __future__ import division\n", "R1=2\n", "R2=4\n", "R3=5\n", "R4=7\n", "R_eq=R1+R2+R3+R4\n", "v=6#in v\n", "print \"Solution a\"\n", "print \"Equivalent resistance = %0.2f ohm\"%R_eq\n", "print \"Solution b\"\n", "I=v/R_eq\n", "print \"Current = %0.2f Amps\"%I" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example18.2 Page No: 599" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution a\n", "Current = 6.00 amps\n", "Current = 3.00 amps\n", "Current = 2.00 amps\n", "solution B\n", "Power = 108.00 watt\n", "Power = 54.00 watt\n", "Power = 36.00 watt\n" ] } ], "source": [ "delta_V=18#in volt\n", "R1=3#in ohm\n", "R2=6#in ohm\n", "R3=9#in ohm\n", "I1=delta_V/R1\n", "I2=delta_V/R2\n", "I3=delta_V/R3\n", "print \"solution a\"\n", "print \"Current = %0.2f amps\"%I1\n", "print \"Current = %0.2f amps\"%I2\n", "print \"Current = %0.2f amps\"%I3\n", "P1=(I1**2)*R1\n", "P2=(I2**2)*R2\n", "P3=(I3**2)*R3\n", "print \"solution B\"\n", "print \"Power = %0.2f watt\"%P1\n", "print \"Power = %0.2f watt\"%P2\n", "print \"Power = %0.2f watt\"%P3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.3 Page No: 602" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "solution b\n", "Current = 3.00 amps\n" ] } ], "source": [ "delta_Vac=42#in volt\n", "R_eq=14#in ohm\n", "I=delta_Vac/R_eq\n", "print \"solution b\"\n", "print \"Current = %0.2f amps\"%I" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.4 Page No: 605" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Current value I1 = -0.83, I2 = -0.53 & I3 = -0.30 amps\n" ] } ], "source": [ "from numpy import mat\n", "#formula used x=inv(a)*b\n", "I=mat([[1 ,-1, -1],[-4, 0 ,-9],[0, -5, 9]])\n", "V=mat([[0],[6],[0]])\n", "X=(I**-1)\n", "a=X*V\n", "\n", "print \"Current value I1 = %0.2f, I2 = %0.2f & I3 = %0.2f amps\"%(a[0],a[1],a[2])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.5 Page No: 606" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Current value I1 = 2.00, I2 = -3.00 & I3 = -1.00 amps\n" ] } ], "source": [ "from numpy import mat\n", "#prob\n", "#formula used x=inv(a)*b\n", "I=mat([[8, 2, 0],[-3, 2, 0],[1, 1, -1]])\n", "V=mat([[10],[-12],[0]])\n", "X=I**-1\n", "a=X*V\n", "\n", "print \"Current value I1 = %0.2f, I2 = %0.2f & I3 = %0.2f amps\"%(a[0],a[1],a[2])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.6 Page No: 609" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Constant of the circuit = 4.00 s\n", "Charge = 6.00e-05 columb\n", "Charge = 3.79e-05 columb when capacitance 63.2%\n" ] } ], "source": [ "R=8*10**5#in ohms\n", "C=5*10**-6#in Farad\n", "t=R*C\n", "print \"Constant of the circuit = %0.2f s\"%t\n", "\n", "Q=C*12\n", "print \"Charge = %0.2e columb\"%Q\n", "q=0.632*Q\n", "print \"Charge = %0.2e columb when capacitance 63.2%%\"%q" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 18.7 Page No: 610" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "time = 1.39 s \n" ] } ], "source": [ "from math import log\n", "x=log(4)\n", "print \"time = %0.2f s \"%x" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK I& % College Physics (volume 2)/Ch19.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 19 : Magnetism" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.1 Page No: 631" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The force = 7.62e-19 Newton\n" ] } ], "source": [ "q=1.6*10**-19#in columb\n", "v=1*10**5#in m/s\n", "B=55*10**-6#in T\n", "F=q*v*B* 0.8660\n", "print \"The force = %0.2e Newton\"%F" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.2 Page No: 632" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The force = 2.77e-12 Newton\n", "Acceleration = 1.66e+15 m/s**2\n" ] } ], "source": [ "q=1.6*10**-19#in columb\n", "v=8*10**6#in m/s\n", "B=2.5#in T\n", "F=q*v*B* 0.8660\n", "print \"The force = %0.2e Newton\"%F\n", "m=1.67*10**-27\n", "a=F/m\n", "print \"Acceleration = %0.2e m/s**2\"%a" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.3 Page No: 635" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The maximaum force = 3.96e-02 Newton\n" ] } ], "source": [ "l=36#in m\n", "I=22#in A\n", "B=0.50*10**-4#in T\n", "F=B*I*l\n", "print \"The maximaum force = %0.2e Newton\"%F" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.4 Page No: 637" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The Torque = 0.39 N-m\n" ] } ], "source": [ "from math import pi\n", "A=pi*(0.5)*0.5#in m\n", "I=2#in A\n", "B=0.50#in T\n", "T=B*I*A*0.5\n", "print \"The Torque = %0.2f N-m\"%T" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.5 Page No: 640" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Velocity = 4.69e+06 m/s\n" ] } ], "source": [ "q=1.6*10**-19\n", "B=.35\n", "r=14*10**-2#in m\n", "m=1.67*10**-27#kg\n", "v=(q*B*r)/m\n", "print \"Velocity = %0.2e m/s\"%v" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.6 Page No: 641" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Radius of lighter istope = 0.10 m\n", "Radius of heavier istope = 0.21 m\n", "Distance of seperation = 0.21 m\n" ] } ], "source": [ "q=1.6*10**-19\n", "B=.10#in T\n", "v=1*10**6#in m/s\n", "r=14*10**-2#in m\n", "m1=1.67*10**-27#in kg\n", "m2=3.34*10**-27#in kg\n", "r1=(m1*v)/(q*B)\n", "r2=(m2*v)/(q*B)\n", "x=(2*r2)-(2*r1)\n", "print \"Radius of lighter istope = %0.2f m\"%r1\n", "print \"Radius of heavier istope = %0.2f m\"%r2\n", "print \"Distance of seperation = %0.2f m\"%x" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.7 Page No: 644" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Magnetic field = 2.5e-04 T\n", "Force = 6e-20 Newton\n" ] } ], "source": [ "from math import pi\n", "Uo=(4*pi*10**-7)\n", "I=5#in A\n", "r=4*10**-3\n", "B=(Uo*I)/(2*pi*r)\n", "print \"Magnetic field = %0.1e T\"%B\n", "q=1.6*10**-19\n", "v=1.5*10**3#in m/s\n", "F=q*v*B\n", "print \"Force = %0.e Newton\"%F" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.8 Page No: 646" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Current = 7.07 A\n" ] } ], "source": [ "from math import pi, sqrt\n", "mo=4*pi*10**-7#Tm/A\n", "d=0.1#in m\n", "x=1*10**-4#F/l\n", "I=sqrt((x*2*pi*d)/mo)\n", "print \"Current = %0.2f A\"%I" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 19.9 Page No: 649" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Magnetic field = 6.28e-04 T\n", "Force = 1.88e-20 N\n" ] } ], "source": [ "from math import pi\n", "N=100#turns\n", "l=.1#in m\n", "n=N/l#in turns/m\n", "mo=4*pi*10**-7#Tm/A\n", "I=.5#in A\n", "B=n*I*mo\n", "q=1.6*10**-19#in c\n", "v=375#in m/s\n", "F=q*v*(B/2)\n", "\n", "print \"Magnetic field = %0.2e T\"%B\n", "print \"Force = %0.2e N\"%F" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK IH % College Physics (volume 2)/Ch20.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 20 : Induced voltages and inductance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.1 Page No: 665" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Magnetic flux = 1.62e-04 T.m**2\n", "Induced emf = 5.06e-03 volt\n" ] } ], "source": [ "B=.5 # in T\n", "A=3.24*10**-4 # in m**2\n", "Flux=B*A\n", "N=25\n", "delta_t=.8\n", "print \"Magnetic flux = %0.2e T.m**2\"%Flux\n", "e=(N*Flux)/(delta_t)\n", "print \"Induced emf = %0.2e volt\"%e" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.2 Page No: 667" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Induced emf = 0.45 volt\n" ] } ], "source": [ "B=.6*10**-4 # in T\n", "l=30\n", "v=250 # in m/s\n", "e=B*l*v\n", "print \"Induced emf = %0.2f volt\"%e" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.3 Page No: 672" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Induced emf = 0.25 volt\n", "Solution b\n", "Current = 0.50 A\n", "Solution c\n", "Power = 0.12 watt\n", "Energy delivered = 0.12 J\n", "Solution d\n", "Force = 0.06 N\n" ] } ], "source": [ "B=.25 # in T\n", "l=.5\n", "v=2 # in m/s\n", "e=B*l*v\n", "print \"Solution a\"\n", "print \"Induced emf = %0.2f volt\"%e\n", "R=.5 # in ohm\n", "I=e/R\n", "\n", "print \"Solution b\"\n", "print \"Current = %0.2f A\"%I\n", "delta_v=.25\n", "P=I*delta_v\n", "print \"Solution c\"\n", "print \"Power = %0.2f watt\"%P\n", "t=1 # in s\n", "w=P*t\n", "print \"Energy delivered = %0.2f J\"%w\n", " # Answer give for J in textbook is wrong\n", "d=v*t\n", "F=w/d\n", "print \"Solution d\"\n", "print \"Force = %0.2f N\"%F" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.5 Page No: 678" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Induced emf = 135.72 volt\n", "Solution b\n", "Current = 11.31 A\n", "Solution c\n", "Emf in Volt 136*sinwt\n" ] } ], "source": [ "from math import pi\n", "f=60 # in Hz\n", "w=2*pi*f\n", "N=8\n", "A=.09 # in m**2\n", "B=.5 # in T\n", "emf=N*A*B*w\n", "print \"Solution a\"\n", "print \"Induced emf = %0.2f volt\"%emf\n", "R=12 # in ohm\n", "I=emf/R\n", "print \"Solution b\"\n", "print \"Current = %0.2f A\"%I\n", "\n", "print \"Solution c\"\n", "print \"Emf in Volt 136*sinwt\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.6 Page No: 680" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Maximum Current = 12.00 A\n", "Solution b\n", "Current = 5.00 A\n" ] } ], "source": [ "emf=120 # in Volt\n", "R=10 # in Ohm\n", "e_back=70\n", "I=emf/R\n", "print \"Solution a\"\n", "print \"Maximum Current = %0.2f A\"%I\n", "print \"Solution b\"\n", "I=(emf-e_back)/R\n", "print \"Current = %0.2f A\"%I" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.8 Page No: 684" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Inductance = 1.81e-04 H\n", "Solution b\n", "Emf = 9.05e-04 Volt\n" ] } ], "source": [ "from math import pi\n", "uo=4*pi*10**-7 # in m/A\n", "N=300\n", "A=4*10**-4 # in m**2\n", "l=25*10**-2\n", "L=(uo*N*N*A)/l\n", "print \"Solution a\"\n", "print \"Inductance = %0.2e H\"%L\n", "delta_I=-5\n", "delta_t=1\n", "e=(-L*delta_I)/(delta_t)\n", "print \"Solution b\"\n", "print \"Emf = %0.2e Volt\"%e" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 20.9 Page No: 685" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Time constant = 5.00e-03 s\n", "Solution b\n", "Current = 1.26 Amps\n" ] } ], "source": [ "L=30*10**-3 # in Henry\n", "R=6 # in Ohm\n", "tou=L/R\n", "print \"Solution a\"\n", "print \"Time constant = %0.2e s\"%tou\n", "\n", "e=12\n", "I=(0.632*e)/R\n", "\n", "\n", "print \"Solution b\"\n", "print \"Current = %0.2f Amps\"%I\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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK IUж< < % College Physics (volume 2)/Ch21.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 21 : Alternating current circuits and electromagnetic waves" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.1 Page No: 698" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Voltage = 141.42 V\n", "Current = 1.41 Amps\n" ] } ], "source": [ "from __future__ import division\n", "from math import sqrt\n", "V_max=200#in V\n", "V_rms=(V_max)/sqrt(2)\n", "R=100#in ohm\n", "I_rms=V_rms/R\n", "print \"Voltage = %0.2f V\"%V_rms\n", "print \"Current = %0.2f Amps\"%I_rms" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.2 Page No: 700" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance = 331.56 ohm\n", "Current = 0.45 Amps\n" ] } ], "source": [ "C=8*10**-6\n", "X_c=1/(377*C)\n", "print \"Resistance = %0.2f ohm\"%X_c\n", "I_rms=150/X_c\n", "print \"Current = %0.2f Amps\"%I_rms" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.3 Page No: 702" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance = 9.43 ohm\n", "Current = 15.92 Amps\n" ] } ], "source": [ "L=25*10**-3#In H\n", "w=377\n", "X_L=w*L#In ohm\n", "print \"Resistance = %0.2f ohm\"%X_L\n", "I_rms=150/X_L#In A\n", "print \"Current = %0.2f Amps\"%I_rms" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.4 Page No: 706" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Impedence = 587.81 ohm\n", "Current = 0.26 Amps\n", "Angle = -64.83 degree\n", "Voltage at Resistance = 63.80 Volt\n", "Voltage at Inductance = 57.67 Volt\n", "Voltage at Capacitance = 193.43 Volt\n" ] } ], "source": [ "from math import atan, degrees, sqrt\n", "R=250#in ohm\n", "Xc=758#in ohm\n", "Xl=226#in Ohm\n", "X=Xl-Xc\n", "V_max=150#in Volt\n", "Z=sqrt(R**2+X**2)\n", "I=V_max/Z\n", "q=degrees(atan(X/R))\n", "print \"Impedence = %0.2f ohm\"%Z\n", "print \"Current = %0.2f Amps\"%I\n", "print \"Angle = %0.2f degree\"%q\n", "V_R=I*R\n", "V_C=I*Xc\n", "V_L=I*Xl\n", "print \"Voltage at Resistance = %0.2f Volt\"%V_R\n", "print \"Voltage at Inductance = %0.2f Volt\"%V_L\n", "print \"Voltage at Capacitance = %0.2f Volt\"%V_C" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.5 Page No: 708" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Voltage = 106.07 V\n", "Current = 0.18 Amps\n", "Power = 8.15 watt\n" ] } ], "source": [ "from math import sqrt\n", "V_max=150#in V\n", "V_rms=(V_max)/sqrt(2)\n", "I_max=.255#in ohm\n", "I_rms=I_max/sqrt(2)\n", "cos=.426\n", "P=V_rms*I_rms*cos\n", "print \"Voltage = %0.2f V\"%V_rms\n", "print \"Current = %0.2f Amps\"%I_rms\n", "print \"Power = %0.2f watt\"%P" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.6 Page No: 709" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Capacitance = 2e-06 Farad\n" ] } ], "source": [ "L=20*10**-3#in H\n", "C=1/(25*10**6*L)\n", "print \"Capacitance = %0.e Farad\"%C" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.7 Page No: 711" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Percentage of power lost = 0.02\n", "Solution B\n", "Percentage of power lost = 75.00\n" ] } ], "source": [ "I1=100\n", "v1=4*10**3\n", "v2=2.40*10**5\n", "I2=(I1*v1)/v2\n", "R=30#in ohm\n", "p_lost=I2*I2*R\n", "P_output=I1*v1\n", "p_per=(p_lost*100/P_output)\n", "print \"Solution a\"\n", "print \"Percentage of power lost = %0.2f\"%p_per\n", "P_lost=I1*I1*R\n", "per=(P_lost*100)/(4*10**5)\n", "print \"Solution B\"\n", "print \"Percentage of power lost = %0.2f\"%per" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK IP* % College Physics (volume 2)/Ch22.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 22 : Reflection anda refraction of light" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.2 Page No: 739" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Angle = 19.20 degree\n" ] } ], "source": [ "from __future__ import division\n", "from math import sin, pi, degrees, asin\n", "n1=1\n", "n2=1.52\n", "x=sin(pi/180*30)\n", "theta_2=degrees(asin((n1*x)/n2))\n", "print \"Angle = %0.2f degree\"%theta_2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.3 Page No: 739" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Solution a\n", "Velocity = 2.06e+08 m/s\n", "Solution b\n", "Wavelength in Fused quartz = 403.98 nm\n" ] } ], "source": [ "print \"Solution a\"\n", "c=3*10**8# Constant in m/s\n", "n=1.458\n", "v=c/n\n", "print \"Velocity = %0.2e m/s\"%v\n", "print \"Solution b\"\n", "lambda_o=589#in nm\n", "lambda_n=lambda_o/n\n", "print \"Wavelength in Fused quartz = %0.2f nm\"%lambda_n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.5 Page No: 741" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Angle = 16.24 degree\n", "Angle = 25.69 degree\n" ] } ], "source": [ "from math import atan, degrees, asin\n", "x=699#in micrometer(w-a)\n", "t=1200 #in micrometer\n", "b=x/2\n", "theta_2=degrees(atan(b/t))\n", "print \"Angle = %0.2f degree\"%theta_2\n", "y=sin(pi/180*theta_2)\n", "n1=1\n", "n2=1.55\n", "theta_1=degrees(asin((n2*y)/n1))\n", "print \"Angle = %0.2f degree\"%theta_1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.6 Page No: 744" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Angle(theta_c) = 48.75 degree\n" ] } ], "source": [ "from math import asin, degrees\n", "n1=1.33\n", "n2=1\n", "x=degrees(asin(n2/n1))\n", "\n", "print \"Angle(theta_c) = %0.2f degree\"%x" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK I n"S S % College Physics (volume 2)/Ch23.ipynb{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 23 : Mirrors and lenses" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.1 Page No: 760" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The hight = 0.90 m\n" ] } ], "source": [ "from __future__ import division\n", "AC= 1.8-.1#in m\n", "AD=.5*AC\n", "CF=.10#/in m\n", "X=.5*CF#in m\n", "FA=1.8#in m\n", "d=FA-AD-X\n", "print \"The hight = %0.2f m\"%d" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.2 Page No : 767" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "part a\n", "The magnification when object is at 25cm : -0.67\n", "part c\n", "The magnification when object is at 5cm : 2.00\n" ] } ], "source": [ "p=25#in cm\n", "f=10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "p=25\n", "M=-(q/p)\n", "print \"part a\"\n", "print \"The magnification when object is at 25cm : %0.2f\"%M\n", "p=5#in cm\n", "f=10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "p=5\n", "M=-(q/p)\n", "print \"part c\"\n", "print \"The magnification when object is at 5cm : %0.2f\"%M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.3 Page No: 768" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "part a\n", "The position of final image = -5.71 cm\n", "part b\n", "The magnification : 0.23\n" ] } ], "source": [ "p=20#in cm\n", "f=-8#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "p=25\n", "M=-(q/p)\n", "print \"part a\"\n", "print \"The position of final image = %0.2f cm\"%q\n", "print \"part b\"\n", "print \"The magnification : %0.2f\"%M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.4 Page No: 769" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The focal length = 26.67 cm\n" ] } ], "source": [ "p=40#in cm\n", "q=-(2*p)\n", "\n", "x=(1/p)-(1/q)\n", "f=1/x\n", "print \"The focal length = %0.2f cm\"%f\n", "#Answer given in book is wrong" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.5 Page No: 770" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The position of final image = -17.14 cm\n", "The magnification when object = -1.29 cm\n", "The Position of image = 2.57 cm\n" ] } ], "source": [ "p=20#in cm\n", "n1=1.5#in cm\n", "n2=1#in cm\n", "R=-30#in cm\n", "x=(n2-n1)/R\n", "y=n1/p\n", "s=x-y\n", "q=1/s\n", "print \"The position of final image = %0.2f cm\"%q\n", "M=(n1*q)/(n2*p)\n", "print \"The magnification when object = %0.2f cm\"%M\n", "h=2#in cm\n", "h1=-M*h\n", "print \"The Position of image = %0.2f cm\"%h1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.7 Page No: 777" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "part a\n", "The position of final image = 15.00 cm\n", "The magnification : -0.50\n", "part b\n", "The position of final image = -10.00 cm\n", "The magnification : 2.00\n" ] } ], "source": [ "p=30#in cm\n", "f=10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "\n", "M=-(q/p)\n", "print \"part a\"\n", "print \"The position of final image = %0.2f cm\"%q\n", "print \"The magnification : %0.2f\"%M\n", "p=5#in cm\n", "f=10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "M=-(q/p)\n", "print \"part b\"\n", "print \"The position of final image = %0.2f cm\"%q\n", "print \"The magnification : %0.2f\"%M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.8 Page No: 778" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "part a\n", "The position of final image = -7.50 cm\n", "The magnification : 0.25\n", "part b\n", "The position of final image = -5.00 cm\n", "The magnification : 0.50\n", "part c\n", "The position of final image = -3.33 cm\n", "The magnification : 0.67\n" ] } ], "source": [ "p=30#in cm\n", "f=-10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "\n", "M=-(q/p)\n", "print \"part a\"\n", "print \"The position of final image = %0.2f cm\"%q\n", "print \"The magnification : %0.2f\"%M\n", "p=10#in cm\n", "f=-10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "M=-(q/p)\n", "print \"part b\"\n", "print \"The position of final image = %0.2f cm\"%q\n", "print \"The magnification : %0.2f\"%M\n", "p=5#in cm\n", "f=-10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "M=-(q/p)\n", "print \"part c\"\n", "print \"The position of final image = %0.2f cm\"%q\n", "print \"The magnification : %0.2f\"%M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 23.9 Page No: 779" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The magnification : -0.67\n" ] } ], "source": [ "p=30#in cm\n", "f=10#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "\n", "M1=-(q/p)\n", "\n", "p=5#in cm\n", "f=20#in cm\n", "x=(1/f)-(1/p)\n", "q=1/x\n", "\n", "M2=-(q/p)\n", "\n", "\n", "M=M1*M2\n", "print \"The magnification : %0.2f\"%M" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 } PK I