diff options
author | Trupti Kini | 2016-11-23 23:30:49 +0600 |
---|---|---|
committer | Trupti Kini | 2016-11-23 23:30:49 +0600 |
commit | fe7d6dc0b65b3a4139c355c3e765d646eddb35ec (patch) | |
tree | 202f897465056eae3df4941ad1a5fc49a12fbdf4 | |
parent | 58d3182f891e7980fd7a5602486d6e59ab18763a (diff) | |
download | Python-Textbook-Companions-fe7d6dc0b65b3a4139c355c3e765d646eddb35ec.tar.gz Python-Textbook-Companions-fe7d6dc0b65b3a4139c355c3e765d646eddb35ec.tar.bz2 Python-Textbook-Companions-fe7d6dc0b65b3a4139c355c3e765d646eddb35ec.zip |
Added(A)/Deleted(D) following books
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_VppI6PU.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_eDxglQh.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_s0rxYmx.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_u0ZzXNL.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_vTLvAsl.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_2hw19L7.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_d4LZwNS.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_orxiKvI.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_rVPjDNV.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_shlSF2D.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_4NAW2Fm.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_FfNxDUK.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_ZDZIhlt.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_gTfdUW2.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_qUFA2gJ.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_DtcvRnP.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_Rka6634.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_cZJsXcd.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_kdoUcUP.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_meY4gNm.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3CrecVA.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3GOPcRl.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3oe48aD.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_elIpiT6.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_svJ0ZRH.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_5zdARLq.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_ByttvTe.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_fzQxngT.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_maz8Mpx.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_yrs8aD8.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_Cj6lfrp.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_dkmYc9u.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_pVrZ16h.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_rlB25DY.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_v0NmXc1.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_9e9mp4v.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_P4XexVb.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_ZzjWlQd.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_aODGM7T.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_hefoBhO.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_1gnNs9u.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_3jQe33P.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_82dKcIb.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_B9Rqa7w.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_sbBGzp3.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_48wEqkn.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_4Sf4X8V.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_K4XC4i4.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_Lujuudw.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_q7uuGrG.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_5IoMeUe.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_IAy71Ch.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_SxldOqQ.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_nKNv9Wk.ipynb
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_vmNsUjP.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_AzBO5oY.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_r6Y8ULo.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_SOLVgXg.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_dWG3d2Y.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_D0ImquH.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_EeN8oH7.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_Z95iVp3.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_fdbb8ly.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_xobe83Y.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_yzunizs.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_42vnHw9.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_F9Bz15n.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_KLSq0oK.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_MoXnaf4.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_mHtlO6a.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_xHYwxJ4.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_EZKiqPL.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_VkfH2oR.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_dbMwF5t.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_lB9BZeV.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_phPgJb2.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_vhNgss4.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_JAwYggT.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_N9DqFsm.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_P9rwEqr.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_R0XPX4L.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_S0t8OJu.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_uFVYXqM.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_24XsJCT.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_8mD0UuG.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_LKhM1Au.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_ZKnRxp7.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_nV0EOp8.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_woQKdAT.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_0a0tZuT.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_5vrvPsl.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_RVkqLSe.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_gyVuqN8.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_jOUBDFo.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_otmOyr2.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_CCZqXKR.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_JTyCJsL.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_f3CqV2f.ipynb
A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_lYxlTcT.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_1aLh7y0.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_2XXGNQt.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_3V8tDtA.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_43oToOV.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_4fqVxcE.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5XodvPd.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5alZU29.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_61hsExw.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_6qwmhHU.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7lzRnr0.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7pdEUt8.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_96rcQDS.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_986l79d.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9ErC6RA.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9Rw4WUL.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9cwcC1v.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9dxIAgL.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9saU825.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_BUWDqRo.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_GefqDaC.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_HyPiW9H.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Jzzhgw5.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Lz458Y6.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG81yt8.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG8z9eQ.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Oxr9B3A.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Pwqzb8a.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Q7PpTqw.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_SwvijzF.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UM4ptLd.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UUIzKI9.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VJUnpiC.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VRyICL4.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VtilP9P.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_XvRiQzf.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ZgH5gHk.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Zo9zby0.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aMuyjoe.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aOrqAnb.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aXglZdg.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_b69VCaT.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_bg51CID.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_dsYxoMq.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_eobmuMh.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_fq4RONl.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_gAk3z0j.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hCfFR8F.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hK5EJWu.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iL7yFH3.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iMZmAfZ.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ighXyFk.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_jacaAtE.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ktswPb3.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_l0DVFDN.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_lhKq0fF.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_m7Qc24V.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_nCBI46r.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_oSlKePW.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_pG48gQ4.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_rk3KbDl.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_sns7nwl.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_t48qDiD.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_u1j27Ap.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_vTg4lNU.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_wF4TlOQ.ipynb
A Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_xPlbJ6n.ipynb
165 files changed, 81768 insertions, 0 deletions
diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_VppI6PU.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_VppI6PU.ipynb new file mode 100644 index 00000000..254b9907 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_VppI6PU.ipynb @@ -0,0 +1,247 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 10: Vibrations in Bars" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of longitudinal vibrations is 1780.0 Hz\n", + "fundamental frequency of transverse vibrations is 31.691 Hz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.01/2; #radius(m)\n", + "V=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "fL=V/(2*l); #fundamental frequency of longitudinal vibrations(Hz)\n", + "fT=math.pi*V*k*x**2/(8*(l**2)); #fundamental frequency of transverse vibrations(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of longitudinal vibrations is\",fL,\"Hz\"\n", + "print \"fundamental frequency of transverse vibrations is\",round(fT,3),\"Hz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 1.96 *10**11 N/m**2\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "C=5050; #sound velocity(m/sec)\n", + "rho=7700; #steel density(kg/m**3)\n", + "\n", + "#Calculation\n", + "Y=C**2*rho; #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**11,2),\"*10**11 N/m**2\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of transverse vibrations is 25.35 Hz\n", + "first overtone of transverse vibrations is 69.9 Hz\n", + "answer for first overtone in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.004; #radius(m)\n", + "C=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "f1=math.pi*C*k*x**2/(8*(l**2)); #fundamental frequency of transverse mode of vibration(Hz)\n", + "f2=math.pi*C*k*5**2/(8*(l**2)); #first overtone of transverse mode of vibration(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of transverse vibrations is\",round(f1,2),\"Hz\"\n", + "print \"first overtone of transverse vibrations is\",round(f2,1),\"Hz\"\n", + "print \"answer for first overtone in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of a is 0.00195 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.2; #bar length(m)\n", + "C=4990; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "f1=250; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "a=f1*8*(l**2)*math.sqrt(12)/(math.pi*C*(x**2)); #value of a(m)\n", + "\n", + "#Result\n", + "print \"value of a is\",round(a,5),\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 350" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency is 0.155 MHz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=21*10**10; #youngs modulus(N/m**2) \n", + "rho=8800; #nickel density(kg/m**3)\n", + "R=0.01; #radius(m)\n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "C=math.sqrt(Y/rho); #sound velocity(m/sec)\n", + "f=C/(2*math.pi*k); #frequency(Hz)\n", + "\n", + "#Result\n", + "print \"frequency is\",round(f/10**6,3),\"MHz\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_eDxglQh.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_eDxglQh.ipynb new file mode 100644 index 00000000..254b9907 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_eDxglQh.ipynb @@ -0,0 +1,247 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 10: Vibrations in Bars" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of longitudinal vibrations is 1780.0 Hz\n", + "fundamental frequency of transverse vibrations is 31.691 Hz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.01/2; #radius(m)\n", + "V=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "fL=V/(2*l); #fundamental frequency of longitudinal vibrations(Hz)\n", + "fT=math.pi*V*k*x**2/(8*(l**2)); #fundamental frequency of transverse vibrations(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of longitudinal vibrations is\",fL,\"Hz\"\n", + "print \"fundamental frequency of transverse vibrations is\",round(fT,3),\"Hz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 1.96 *10**11 N/m**2\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "C=5050; #sound velocity(m/sec)\n", + "rho=7700; #steel density(kg/m**3)\n", + "\n", + "#Calculation\n", + "Y=C**2*rho; #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**11,2),\"*10**11 N/m**2\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of transverse vibrations is 25.35 Hz\n", + "first overtone of transverse vibrations is 69.9 Hz\n", + "answer for first overtone in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.004; #radius(m)\n", + "C=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "f1=math.pi*C*k*x**2/(8*(l**2)); #fundamental frequency of transverse mode of vibration(Hz)\n", + "f2=math.pi*C*k*5**2/(8*(l**2)); #first overtone of transverse mode of vibration(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of transverse vibrations is\",round(f1,2),\"Hz\"\n", + "print \"first overtone of transverse vibrations is\",round(f2,1),\"Hz\"\n", + "print \"answer for first overtone in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of a is 0.00195 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.2; #bar length(m)\n", + "C=4990; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "f1=250; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "a=f1*8*(l**2)*math.sqrt(12)/(math.pi*C*(x**2)); #value of a(m)\n", + "\n", + "#Result\n", + "print \"value of a is\",round(a,5),\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 350" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency is 0.155 MHz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=21*10**10; #youngs modulus(N/m**2) \n", + "rho=8800; #nickel density(kg/m**3)\n", + "R=0.01; #radius(m)\n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "C=math.sqrt(Y/rho); #sound velocity(m/sec)\n", + "f=C/(2*math.pi*k); #frequency(Hz)\n", + "\n", + "#Result\n", + "print \"frequency is\",round(f/10**6,3),\"MHz\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_s0rxYmx.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_s0rxYmx.ipynb new file mode 100644 index 00000000..254b9907 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_s0rxYmx.ipynb @@ -0,0 +1,247 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 10: Vibrations in Bars" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of longitudinal vibrations is 1780.0 Hz\n", + "fundamental frequency of transverse vibrations is 31.691 Hz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.01/2; #radius(m)\n", + "V=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "fL=V/(2*l); #fundamental frequency of longitudinal vibrations(Hz)\n", + "fT=math.pi*V*k*x**2/(8*(l**2)); #fundamental frequency of transverse vibrations(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of longitudinal vibrations is\",fL,\"Hz\"\n", + "print \"fundamental frequency of transverse vibrations is\",round(fT,3),\"Hz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 1.96 *10**11 N/m**2\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "C=5050; #sound velocity(m/sec)\n", + "rho=7700; #steel density(kg/m**3)\n", + "\n", + "#Calculation\n", + "Y=C**2*rho; #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**11,2),\"*10**11 N/m**2\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of transverse vibrations is 25.35 Hz\n", + "first overtone of transverse vibrations is 69.9 Hz\n", + "answer for first overtone in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.004; #radius(m)\n", + "C=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "f1=math.pi*C*k*x**2/(8*(l**2)); #fundamental frequency of transverse mode of vibration(Hz)\n", + "f2=math.pi*C*k*5**2/(8*(l**2)); #first overtone of transverse mode of vibration(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of transverse vibrations is\",round(f1,2),\"Hz\"\n", + "print \"first overtone of transverse vibrations is\",round(f2,1),\"Hz\"\n", + "print \"answer for first overtone in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of a is 0.00195 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.2; #bar length(m)\n", + "C=4990; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "f1=250; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "a=f1*8*(l**2)*math.sqrt(12)/(math.pi*C*(x**2)); #value of a(m)\n", + "\n", + "#Result\n", + "print \"value of a is\",round(a,5),\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 350" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency is 0.155 MHz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=21*10**10; #youngs modulus(N/m**2) \n", + "rho=8800; #nickel density(kg/m**3)\n", + "R=0.01; #radius(m)\n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "C=math.sqrt(Y/rho); #sound velocity(m/sec)\n", + "f=C/(2*math.pi*k); #frequency(Hz)\n", + "\n", + "#Result\n", + "print \"frequency is\",round(f/10**6,3),\"MHz\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_u0ZzXNL.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_u0ZzXNL.ipynb new file mode 100644 index 00000000..254b9907 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_u0ZzXNL.ipynb @@ -0,0 +1,247 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 10: Vibrations in Bars" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of longitudinal vibrations is 1780.0 Hz\n", + "fundamental frequency of transverse vibrations is 31.691 Hz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.01/2; #radius(m)\n", + "V=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "fL=V/(2*l); #fundamental frequency of longitudinal vibrations(Hz)\n", + "fT=math.pi*V*k*x**2/(8*(l**2)); #fundamental frequency of transverse vibrations(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of longitudinal vibrations is\",fL,\"Hz\"\n", + "print \"fundamental frequency of transverse vibrations is\",round(fT,3),\"Hz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 1.96 *10**11 N/m**2\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "C=5050; #sound velocity(m/sec)\n", + "rho=7700; #steel density(kg/m**3)\n", + "\n", + "#Calculation\n", + "Y=C**2*rho; #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**11,2),\"*10**11 N/m**2\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of transverse vibrations is 25.35 Hz\n", + "first overtone of transverse vibrations is 69.9 Hz\n", + "answer for first overtone in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.004; #radius(m)\n", + "C=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "f1=math.pi*C*k*x**2/(8*(l**2)); #fundamental frequency of transverse mode of vibration(Hz)\n", + "f2=math.pi*C*k*5**2/(8*(l**2)); #first overtone of transverse mode of vibration(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of transverse vibrations is\",round(f1,2),\"Hz\"\n", + "print \"first overtone of transverse vibrations is\",round(f2,1),\"Hz\"\n", + "print \"answer for first overtone in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of a is 0.00195 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.2; #bar length(m)\n", + "C=4990; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "f1=250; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "a=f1*8*(l**2)*math.sqrt(12)/(math.pi*C*(x**2)); #value of a(m)\n", + "\n", + "#Result\n", + "print \"value of a is\",round(a,5),\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 350" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency is 0.155 MHz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=21*10**10; #youngs modulus(N/m**2) \n", + "rho=8800; #nickel density(kg/m**3)\n", + "R=0.01; #radius(m)\n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "C=math.sqrt(Y/rho); #sound velocity(m/sec)\n", + "f=C/(2*math.pi*k); #frequency(Hz)\n", + "\n", + "#Result\n", + "print \"frequency is\",round(f/10**6,3),\"MHz\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_vTLvAsl.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_vTLvAsl.ipynb new file mode 100644 index 00000000..254b9907 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_vTLvAsl.ipynb @@ -0,0 +1,247 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 10: Vibrations in Bars" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of longitudinal vibrations is 1780.0 Hz\n", + "fundamental frequency of transverse vibrations is 31.691 Hz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.01/2; #radius(m)\n", + "V=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "fL=V/(2*l); #fundamental frequency of longitudinal vibrations(Hz)\n", + "fT=math.pi*V*k*x**2/(8*(l**2)); #fundamental frequency of transverse vibrations(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of longitudinal vibrations is\",fL,\"Hz\"\n", + "print \"fundamental frequency of transverse vibrations is\",round(fT,3),\"Hz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 348" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 1.96 *10**11 N/m**2\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "C=5050; #sound velocity(m/sec)\n", + "rho=7700; #steel density(kg/m**3)\n", + "\n", + "#Calculation\n", + "Y=C**2*rho; #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**11,2),\"*10**11 N/m**2\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency of transverse vibrations is 25.35 Hz\n", + "first overtone of transverse vibrations is 69.9 Hz\n", + "answer for first overtone in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=1; #bar length(m)\n", + "R=0.004; #radius(m)\n", + "C=3560; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "f1=math.pi*C*k*x**2/(8*(l**2)); #fundamental frequency of transverse mode of vibration(Hz)\n", + "f2=math.pi*C*k*5**2/(8*(l**2)); #first overtone of transverse mode of vibration(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency of transverse vibrations is\",round(f1,2),\"Hz\"\n", + "print \"first overtone of transverse vibrations is\",round(f2,1),\"Hz\"\n", + "print \"answer for first overtone in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 349" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of a is 0.00195 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.2; #bar length(m)\n", + "C=4990; #wave velocity(m/sec)\n", + "x=3.0112; \n", + "f1=250; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "a=f1*8*(l**2)*math.sqrt(12)/(math.pi*C*(x**2)); #value of a(m)\n", + "\n", + "#Result\n", + "print \"value of a is\",round(a,5),\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 350" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency is 0.155 MHz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=21*10**10; #youngs modulus(N/m**2) \n", + "rho=8800; #nickel density(kg/m**3)\n", + "R=0.01; #radius(m)\n", + "\n", + "#Calculation\n", + "k=R/2; #geometric radius(m)\n", + "C=math.sqrt(Y/rho); #sound velocity(m/sec)\n", + "f=C/(2*math.pi*k); #frequency(Hz)\n", + "\n", + "#Result\n", + "print \"frequency is\",round(f/10**6,3),\"MHz\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_2hw19L7.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_2hw19L7.ipynb new file mode 100644 index 00000000..2722c8a0 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_2hw19L7.ipynb @@ -0,0 +1,403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 11: Vibrations in Strings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 10 cm\n", + "frequency is 1 Hz\n", + "wavelength is 200.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=10sinmath.pi(0.01x-2t)\n", + "#by comparing with Y=Asin(kx-omegat) we get\n", + "A=10; #amplitude(cm)\n", + "omega=2*math.pi;\n", + "k=0.01*math.pi; #wavelength constant\n", + "\n", + "#Calculation\n", + "f=omega/(2*math.pi); #frequency(Hz)\n", + "lamda=2*math.pi/k; #wavelength(cm) \n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"cm\"\n", + "print \"frequency is\",int(f),\"Hz\"\n", + "print \"wavelength is\",lamda,\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "along negative axis displacement y= 0.01 sin( 10 *math.pi/3 x + 1100 t)\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=550; #frequency(Hz)\n", + "A=0.01; #amplitude(cm)\n", + "v=330; #wave velocity(m/sec)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency\n", + "k=omega/v; #wavelength constant\n", + "#along negative axis displacement y=Asin(kx+omegat) substitute the values\n", + "\n", + "#Result\n", + "print \"along negative axis displacement y=\",A,\"sin(\",int(k*3/math.pi),\"*math.pi/3 x +\",int(omega/math.pi),\"t)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wave velocity is 40.82 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "m=0.6; #mass(kg)\n", + "T=500; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=m/l; #linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "\n", + "#Result\n", + "print \"wave velocity is\",round(v,2),\"m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 1.028 units\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=10; #stationary wave point\n", + "t=1; #assume\n", + "y1=5*math.sin(((2*math.pi*t)-(2*x))*math.pi/180); #transverse wave\n", + "y2=5*math.sin(((2*math.pi*t)+(2*x))*math.pi/180); #transverse wave\n", + "\n", + "#Calculation\n", + "y=y1+y2; #amplitude(units)\n", + "\n", + "#Result\n", + "print \"amplitude is\",round(y,3),\"units\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "string linear density is 0.0249 kg/m\n", + "wave velocity is 633.56 m/s\n", + "fundamental frequency is 316.78 Hz\n", + "frequency of 1st overtone is 633.56 Hz\n", + "frequency of 2nd overtone is 950.34 Hz\n", + "fundamental wavelength is 2 m\n", + "1st overtone wavelength is 1 m\n", + "2nd overtone wavelength is 0.667 m\n", + "answers in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=1*10**-3; #string radius(m)\n", + "l=1; #length(m)\n", + "rho=7930; #density(kg/m**3)\n", + "T=10**4; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=math.pi*r**2*rho/l; #string linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "f1=v/(2*l); #fundamental frequency(Hz)\n", + "f2=2*f1; #frequency of 1st overtone(Hz)\n", + "f3=3*f1; #frequency of 2nd overtone(Hz)\n", + "lamda1=2*l/1; #fundamental wavelength(m)\n", + "lamda2=2*l/2; #1st overtone wavelength(m)\n", + "lamda3=2*l/3; #2nd overtone wavelength(m)\n", + "\n", + "#Result\n", + "print \"string linear density is\",round(mew,4),\"kg/m\"\n", + "print \"wave velocity is\",round(v,2),\"m/s\"\n", + "print \"fundamental frequency is\",round(f1,2),\"Hz\"\n", + "print \"frequency of 1st overtone is\",round(f2,2),\"Hz\"\n", + "print \"frequency of 2nd overtone is\",round(f3,2),\"Hz\"\n", + "print \"fundamental wavelength is\",int(lamda1),\"m\"\n", + "print \"1st overtone wavelength is\",int(lamda2),\"m\"\n", + "print \"2nd overtone wavelength is\",round(lamda3,3),\"m\"\n", + "print \"answers in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "power is 19.74 watts\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mew=0.1; #string linear density(kg/m)\n", + "A=0.1; #amplitude(m)\n", + "f=10; #frequency(Hz)\n", + "T=10; #tension(N)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "P=2*math.pi**2*f**2*A**2*v*mew; #power(watt)\n", + "\n", + "#Result\n", + "print \"power is\",round(P,2),\"watts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tension in string is 524.29 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=500; #frequency(Hz)\n", + "T=500; #tension(N)\n", + "f1=512; #required frequency(Hz)\n", + "\n", + "#Calculation\n", + "T1=T*f1**2/f**2; #tension in string(N)\n", + "\n", + "#Result\n", + "print \"tension in string is\",round(T1,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 374" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude at x=5 is 4.0\n", + "first node position is 0.0 m\n", + "second node position is 30.0 m\n", + "third node position is 60.0 m\n", + "wavelength is 60.0 m\n", + "component transverse wave equations are y1= 4.0 sin math.pi((x/30)-(48*t))\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=8sin(math.pi*x/30)cos(48*math.pi*t)\n", + "#by comparing with Y=2Asin(kx)cos(omegat) we get\n", + "A=8/2; #amplitude(cm)\n", + "omega=48*math.pi;\n", + "x=5; #stationary wave point\n", + "k=math.pi/30; #wavelength constant\n", + "y1=0;\n", + "y2=math.pi;\n", + "y3=2*math.pi;\n", + "\n", + "#Calculation\n", + "y=2*A*math.sin(math.pi*x/30); #amplitude at x=5\n", + "x1=y1*30/math.pi; #first node position(m) \n", + "x2=y2*30/math.pi; #second node position(m) \n", + "x3=y3*30/math.pi; #third node position(m) \n", + "lamda=2*(x3-x2); #wavelength(m) \n", + "\n", + "#Result\n", + "print \"amplitude at x=5 is\",y\n", + "print \"first node position is\",x1,\"m\"\n", + "print \"second node position is\",x2,\"m\"\n", + "print \"third node position is\",x3,\"m\"\n", + "print \"wavelength is\",lamda,\"m\"\n", + "print \"component transverse wave equations are y1=\",A,\"sin math.pi((x/30)-(48*t))\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_d4LZwNS.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_d4LZwNS.ipynb new file mode 100644 index 00000000..2722c8a0 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_d4LZwNS.ipynb @@ -0,0 +1,403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 11: Vibrations in Strings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 10 cm\n", + "frequency is 1 Hz\n", + "wavelength is 200.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=10sinmath.pi(0.01x-2t)\n", + "#by comparing with Y=Asin(kx-omegat) we get\n", + "A=10; #amplitude(cm)\n", + "omega=2*math.pi;\n", + "k=0.01*math.pi; #wavelength constant\n", + "\n", + "#Calculation\n", + "f=omega/(2*math.pi); #frequency(Hz)\n", + "lamda=2*math.pi/k; #wavelength(cm) \n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"cm\"\n", + "print \"frequency is\",int(f),\"Hz\"\n", + "print \"wavelength is\",lamda,\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "along negative axis displacement y= 0.01 sin( 10 *math.pi/3 x + 1100 t)\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=550; #frequency(Hz)\n", + "A=0.01; #amplitude(cm)\n", + "v=330; #wave velocity(m/sec)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency\n", + "k=omega/v; #wavelength constant\n", + "#along negative axis displacement y=Asin(kx+omegat) substitute the values\n", + "\n", + "#Result\n", + "print \"along negative axis displacement y=\",A,\"sin(\",int(k*3/math.pi),\"*math.pi/3 x +\",int(omega/math.pi),\"t)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wave velocity is 40.82 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "m=0.6; #mass(kg)\n", + "T=500; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=m/l; #linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "\n", + "#Result\n", + "print \"wave velocity is\",round(v,2),\"m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 1.028 units\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=10; #stationary wave point\n", + "t=1; #assume\n", + "y1=5*math.sin(((2*math.pi*t)-(2*x))*math.pi/180); #transverse wave\n", + "y2=5*math.sin(((2*math.pi*t)+(2*x))*math.pi/180); #transverse wave\n", + "\n", + "#Calculation\n", + "y=y1+y2; #amplitude(units)\n", + "\n", + "#Result\n", + "print \"amplitude is\",round(y,3),\"units\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "string linear density is 0.0249 kg/m\n", + "wave velocity is 633.56 m/s\n", + "fundamental frequency is 316.78 Hz\n", + "frequency of 1st overtone is 633.56 Hz\n", + "frequency of 2nd overtone is 950.34 Hz\n", + "fundamental wavelength is 2 m\n", + "1st overtone wavelength is 1 m\n", + "2nd overtone wavelength is 0.667 m\n", + "answers in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=1*10**-3; #string radius(m)\n", + "l=1; #length(m)\n", + "rho=7930; #density(kg/m**3)\n", + "T=10**4; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=math.pi*r**2*rho/l; #string linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "f1=v/(2*l); #fundamental frequency(Hz)\n", + "f2=2*f1; #frequency of 1st overtone(Hz)\n", + "f3=3*f1; #frequency of 2nd overtone(Hz)\n", + "lamda1=2*l/1; #fundamental wavelength(m)\n", + "lamda2=2*l/2; #1st overtone wavelength(m)\n", + "lamda3=2*l/3; #2nd overtone wavelength(m)\n", + "\n", + "#Result\n", + "print \"string linear density is\",round(mew,4),\"kg/m\"\n", + "print \"wave velocity is\",round(v,2),\"m/s\"\n", + "print \"fundamental frequency is\",round(f1,2),\"Hz\"\n", + "print \"frequency of 1st overtone is\",round(f2,2),\"Hz\"\n", + "print \"frequency of 2nd overtone is\",round(f3,2),\"Hz\"\n", + "print \"fundamental wavelength is\",int(lamda1),\"m\"\n", + "print \"1st overtone wavelength is\",int(lamda2),\"m\"\n", + "print \"2nd overtone wavelength is\",round(lamda3,3),\"m\"\n", + "print \"answers in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "power is 19.74 watts\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mew=0.1; #string linear density(kg/m)\n", + "A=0.1; #amplitude(m)\n", + "f=10; #frequency(Hz)\n", + "T=10; #tension(N)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "P=2*math.pi**2*f**2*A**2*v*mew; #power(watt)\n", + "\n", + "#Result\n", + "print \"power is\",round(P,2),\"watts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tension in string is 524.29 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=500; #frequency(Hz)\n", + "T=500; #tension(N)\n", + "f1=512; #required frequency(Hz)\n", + "\n", + "#Calculation\n", + "T1=T*f1**2/f**2; #tension in string(N)\n", + "\n", + "#Result\n", + "print \"tension in string is\",round(T1,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 374" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude at x=5 is 4.0\n", + "first node position is 0.0 m\n", + "second node position is 30.0 m\n", + "third node position is 60.0 m\n", + "wavelength is 60.0 m\n", + "component transverse wave equations are y1= 4.0 sin math.pi((x/30)-(48*t))\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=8sin(math.pi*x/30)cos(48*math.pi*t)\n", + "#by comparing with Y=2Asin(kx)cos(omegat) we get\n", + "A=8/2; #amplitude(cm)\n", + "omega=48*math.pi;\n", + "x=5; #stationary wave point\n", + "k=math.pi/30; #wavelength constant\n", + "y1=0;\n", + "y2=math.pi;\n", + "y3=2*math.pi;\n", + "\n", + "#Calculation\n", + "y=2*A*math.sin(math.pi*x/30); #amplitude at x=5\n", + "x1=y1*30/math.pi; #first node position(m) \n", + "x2=y2*30/math.pi; #second node position(m) \n", + "x3=y3*30/math.pi; #third node position(m) \n", + "lamda=2*(x3-x2); #wavelength(m) \n", + "\n", + "#Result\n", + "print \"amplitude at x=5 is\",y\n", + "print \"first node position is\",x1,\"m\"\n", + "print \"second node position is\",x2,\"m\"\n", + "print \"third node position is\",x3,\"m\"\n", + "print \"wavelength is\",lamda,\"m\"\n", + "print \"component transverse wave equations are y1=\",A,\"sin math.pi((x/30)-(48*t))\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_orxiKvI.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_orxiKvI.ipynb new file mode 100644 index 00000000..2722c8a0 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_orxiKvI.ipynb @@ -0,0 +1,403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 11: Vibrations in Strings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 10 cm\n", + "frequency is 1 Hz\n", + "wavelength is 200.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=10sinmath.pi(0.01x-2t)\n", + "#by comparing with Y=Asin(kx-omegat) we get\n", + "A=10; #amplitude(cm)\n", + "omega=2*math.pi;\n", + "k=0.01*math.pi; #wavelength constant\n", + "\n", + "#Calculation\n", + "f=omega/(2*math.pi); #frequency(Hz)\n", + "lamda=2*math.pi/k; #wavelength(cm) \n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"cm\"\n", + "print \"frequency is\",int(f),\"Hz\"\n", + "print \"wavelength is\",lamda,\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "along negative axis displacement y= 0.01 sin( 10 *math.pi/3 x + 1100 t)\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=550; #frequency(Hz)\n", + "A=0.01; #amplitude(cm)\n", + "v=330; #wave velocity(m/sec)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency\n", + "k=omega/v; #wavelength constant\n", + "#along negative axis displacement y=Asin(kx+omegat) substitute the values\n", + "\n", + "#Result\n", + "print \"along negative axis displacement y=\",A,\"sin(\",int(k*3/math.pi),\"*math.pi/3 x +\",int(omega/math.pi),\"t)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wave velocity is 40.82 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "m=0.6; #mass(kg)\n", + "T=500; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=m/l; #linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "\n", + "#Result\n", + "print \"wave velocity is\",round(v,2),\"m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 1.028 units\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=10; #stationary wave point\n", + "t=1; #assume\n", + "y1=5*math.sin(((2*math.pi*t)-(2*x))*math.pi/180); #transverse wave\n", + "y2=5*math.sin(((2*math.pi*t)+(2*x))*math.pi/180); #transverse wave\n", + "\n", + "#Calculation\n", + "y=y1+y2; #amplitude(units)\n", + "\n", + "#Result\n", + "print \"amplitude is\",round(y,3),\"units\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "string linear density is 0.0249 kg/m\n", + "wave velocity is 633.56 m/s\n", + "fundamental frequency is 316.78 Hz\n", + "frequency of 1st overtone is 633.56 Hz\n", + "frequency of 2nd overtone is 950.34 Hz\n", + "fundamental wavelength is 2 m\n", + "1st overtone wavelength is 1 m\n", + "2nd overtone wavelength is 0.667 m\n", + "answers in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=1*10**-3; #string radius(m)\n", + "l=1; #length(m)\n", + "rho=7930; #density(kg/m**3)\n", + "T=10**4; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=math.pi*r**2*rho/l; #string linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "f1=v/(2*l); #fundamental frequency(Hz)\n", + "f2=2*f1; #frequency of 1st overtone(Hz)\n", + "f3=3*f1; #frequency of 2nd overtone(Hz)\n", + "lamda1=2*l/1; #fundamental wavelength(m)\n", + "lamda2=2*l/2; #1st overtone wavelength(m)\n", + "lamda3=2*l/3; #2nd overtone wavelength(m)\n", + "\n", + "#Result\n", + "print \"string linear density is\",round(mew,4),\"kg/m\"\n", + "print \"wave velocity is\",round(v,2),\"m/s\"\n", + "print \"fundamental frequency is\",round(f1,2),\"Hz\"\n", + "print \"frequency of 1st overtone is\",round(f2,2),\"Hz\"\n", + "print \"frequency of 2nd overtone is\",round(f3,2),\"Hz\"\n", + "print \"fundamental wavelength is\",int(lamda1),\"m\"\n", + "print \"1st overtone wavelength is\",int(lamda2),\"m\"\n", + "print \"2nd overtone wavelength is\",round(lamda3,3),\"m\"\n", + "print \"answers in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "power is 19.74 watts\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mew=0.1; #string linear density(kg/m)\n", + "A=0.1; #amplitude(m)\n", + "f=10; #frequency(Hz)\n", + "T=10; #tension(N)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "P=2*math.pi**2*f**2*A**2*v*mew; #power(watt)\n", + "\n", + "#Result\n", + "print \"power is\",round(P,2),\"watts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tension in string is 524.29 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=500; #frequency(Hz)\n", + "T=500; #tension(N)\n", + "f1=512; #required frequency(Hz)\n", + "\n", + "#Calculation\n", + "T1=T*f1**2/f**2; #tension in string(N)\n", + "\n", + "#Result\n", + "print \"tension in string is\",round(T1,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 374" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude at x=5 is 4.0\n", + "first node position is 0.0 m\n", + "second node position is 30.0 m\n", + "third node position is 60.0 m\n", + "wavelength is 60.0 m\n", + "component transverse wave equations are y1= 4.0 sin math.pi((x/30)-(48*t))\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=8sin(math.pi*x/30)cos(48*math.pi*t)\n", + "#by comparing with Y=2Asin(kx)cos(omegat) we get\n", + "A=8/2; #amplitude(cm)\n", + "omega=48*math.pi;\n", + "x=5; #stationary wave point\n", + "k=math.pi/30; #wavelength constant\n", + "y1=0;\n", + "y2=math.pi;\n", + "y3=2*math.pi;\n", + "\n", + "#Calculation\n", + "y=2*A*math.sin(math.pi*x/30); #amplitude at x=5\n", + "x1=y1*30/math.pi; #first node position(m) \n", + "x2=y2*30/math.pi; #second node position(m) \n", + "x3=y3*30/math.pi; #third node position(m) \n", + "lamda=2*(x3-x2); #wavelength(m) \n", + "\n", + "#Result\n", + "print \"amplitude at x=5 is\",y\n", + "print \"first node position is\",x1,\"m\"\n", + "print \"second node position is\",x2,\"m\"\n", + "print \"third node position is\",x3,\"m\"\n", + "print \"wavelength is\",lamda,\"m\"\n", + "print \"component transverse wave equations are y1=\",A,\"sin math.pi((x/30)-(48*t))\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_rVPjDNV.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_rVPjDNV.ipynb new file mode 100644 index 00000000..2722c8a0 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_rVPjDNV.ipynb @@ -0,0 +1,403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 11: Vibrations in Strings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 10 cm\n", + "frequency is 1 Hz\n", + "wavelength is 200.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=10sinmath.pi(0.01x-2t)\n", + "#by comparing with Y=Asin(kx-omegat) we get\n", + "A=10; #amplitude(cm)\n", + "omega=2*math.pi;\n", + "k=0.01*math.pi; #wavelength constant\n", + "\n", + "#Calculation\n", + "f=omega/(2*math.pi); #frequency(Hz)\n", + "lamda=2*math.pi/k; #wavelength(cm) \n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"cm\"\n", + "print \"frequency is\",int(f),\"Hz\"\n", + "print \"wavelength is\",lamda,\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "along negative axis displacement y= 0.01 sin( 10 *math.pi/3 x + 1100 t)\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=550; #frequency(Hz)\n", + "A=0.01; #amplitude(cm)\n", + "v=330; #wave velocity(m/sec)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency\n", + "k=omega/v; #wavelength constant\n", + "#along negative axis displacement y=Asin(kx+omegat) substitute the values\n", + "\n", + "#Result\n", + "print \"along negative axis displacement y=\",A,\"sin(\",int(k*3/math.pi),\"*math.pi/3 x +\",int(omega/math.pi),\"t)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wave velocity is 40.82 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "m=0.6; #mass(kg)\n", + "T=500; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=m/l; #linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "\n", + "#Result\n", + "print \"wave velocity is\",round(v,2),\"m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 1.028 units\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=10; #stationary wave point\n", + "t=1; #assume\n", + "y1=5*math.sin(((2*math.pi*t)-(2*x))*math.pi/180); #transverse wave\n", + "y2=5*math.sin(((2*math.pi*t)+(2*x))*math.pi/180); #transverse wave\n", + "\n", + "#Calculation\n", + "y=y1+y2; #amplitude(units)\n", + "\n", + "#Result\n", + "print \"amplitude is\",round(y,3),\"units\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "string linear density is 0.0249 kg/m\n", + "wave velocity is 633.56 m/s\n", + "fundamental frequency is 316.78 Hz\n", + "frequency of 1st overtone is 633.56 Hz\n", + "frequency of 2nd overtone is 950.34 Hz\n", + "fundamental wavelength is 2 m\n", + "1st overtone wavelength is 1 m\n", + "2nd overtone wavelength is 0.667 m\n", + "answers in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=1*10**-3; #string radius(m)\n", + "l=1; #length(m)\n", + "rho=7930; #density(kg/m**3)\n", + "T=10**4; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=math.pi*r**2*rho/l; #string linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "f1=v/(2*l); #fundamental frequency(Hz)\n", + "f2=2*f1; #frequency of 1st overtone(Hz)\n", + "f3=3*f1; #frequency of 2nd overtone(Hz)\n", + "lamda1=2*l/1; #fundamental wavelength(m)\n", + "lamda2=2*l/2; #1st overtone wavelength(m)\n", + "lamda3=2*l/3; #2nd overtone wavelength(m)\n", + "\n", + "#Result\n", + "print \"string linear density is\",round(mew,4),\"kg/m\"\n", + "print \"wave velocity is\",round(v,2),\"m/s\"\n", + "print \"fundamental frequency is\",round(f1,2),\"Hz\"\n", + "print \"frequency of 1st overtone is\",round(f2,2),\"Hz\"\n", + "print \"frequency of 2nd overtone is\",round(f3,2),\"Hz\"\n", + "print \"fundamental wavelength is\",int(lamda1),\"m\"\n", + "print \"1st overtone wavelength is\",int(lamda2),\"m\"\n", + "print \"2nd overtone wavelength is\",round(lamda3,3),\"m\"\n", + "print \"answers in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "power is 19.74 watts\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mew=0.1; #string linear density(kg/m)\n", + "A=0.1; #amplitude(m)\n", + "f=10; #frequency(Hz)\n", + "T=10; #tension(N)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "P=2*math.pi**2*f**2*A**2*v*mew; #power(watt)\n", + "\n", + "#Result\n", + "print \"power is\",round(P,2),\"watts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tension in string is 524.29 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=500; #frequency(Hz)\n", + "T=500; #tension(N)\n", + "f1=512; #required frequency(Hz)\n", + "\n", + "#Calculation\n", + "T1=T*f1**2/f**2; #tension in string(N)\n", + "\n", + "#Result\n", + "print \"tension in string is\",round(T1,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 374" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude at x=5 is 4.0\n", + "first node position is 0.0 m\n", + "second node position is 30.0 m\n", + "third node position is 60.0 m\n", + "wavelength is 60.0 m\n", + "component transverse wave equations are y1= 4.0 sin math.pi((x/30)-(48*t))\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=8sin(math.pi*x/30)cos(48*math.pi*t)\n", + "#by comparing with Y=2Asin(kx)cos(omegat) we get\n", + "A=8/2; #amplitude(cm)\n", + "omega=48*math.pi;\n", + "x=5; #stationary wave point\n", + "k=math.pi/30; #wavelength constant\n", + "y1=0;\n", + "y2=math.pi;\n", + "y3=2*math.pi;\n", + "\n", + "#Calculation\n", + "y=2*A*math.sin(math.pi*x/30); #amplitude at x=5\n", + "x1=y1*30/math.pi; #first node position(m) \n", + "x2=y2*30/math.pi; #second node position(m) \n", + "x3=y3*30/math.pi; #third node position(m) \n", + "lamda=2*(x3-x2); #wavelength(m) \n", + "\n", + "#Result\n", + "print \"amplitude at x=5 is\",y\n", + "print \"first node position is\",x1,\"m\"\n", + "print \"second node position is\",x2,\"m\"\n", + "print \"third node position is\",x3,\"m\"\n", + "print \"wavelength is\",lamda,\"m\"\n", + "print \"component transverse wave equations are y1=\",A,\"sin math.pi((x/30)-(48*t))\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_shlSF2D.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_shlSF2D.ipynb new file mode 100644 index 00000000..2722c8a0 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_shlSF2D.ipynb @@ -0,0 +1,403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 11: Vibrations in Strings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 10 cm\n", + "frequency is 1 Hz\n", + "wavelength is 200.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=10sinmath.pi(0.01x-2t)\n", + "#by comparing with Y=Asin(kx-omegat) we get\n", + "A=10; #amplitude(cm)\n", + "omega=2*math.pi;\n", + "k=0.01*math.pi; #wavelength constant\n", + "\n", + "#Calculation\n", + "f=omega/(2*math.pi); #frequency(Hz)\n", + "lamda=2*math.pi/k; #wavelength(cm) \n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"cm\"\n", + "print \"frequency is\",int(f),\"Hz\"\n", + "print \"wavelength is\",lamda,\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "along negative axis displacement y= 0.01 sin( 10 *math.pi/3 x + 1100 t)\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=550; #frequency(Hz)\n", + "A=0.01; #amplitude(cm)\n", + "v=330; #wave velocity(m/sec)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency\n", + "k=omega/v; #wavelength constant\n", + "#along negative axis displacement y=Asin(kx+omegat) substitute the values\n", + "\n", + "#Result\n", + "print \"along negative axis displacement y=\",A,\"sin(\",int(k*3/math.pi),\"*math.pi/3 x +\",int(omega/math.pi),\"t)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 371" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wave velocity is 40.82 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "m=0.6; #mass(kg)\n", + "T=500; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=m/l; #linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "\n", + "#Result\n", + "print \"wave velocity is\",round(v,2),\"m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 1.028 units\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=10; #stationary wave point\n", + "t=1; #assume\n", + "y1=5*math.sin(((2*math.pi*t)-(2*x))*math.pi/180); #transverse wave\n", + "y2=5*math.sin(((2*math.pi*t)+(2*x))*math.pi/180); #transverse wave\n", + "\n", + "#Calculation\n", + "y=y1+y2; #amplitude(units)\n", + "\n", + "#Result\n", + "print \"amplitude is\",round(y,3),\"units\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 372" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "string linear density is 0.0249 kg/m\n", + "wave velocity is 633.56 m/s\n", + "fundamental frequency is 316.78 Hz\n", + "frequency of 1st overtone is 633.56 Hz\n", + "frequency of 2nd overtone is 950.34 Hz\n", + "fundamental wavelength is 2 m\n", + "1st overtone wavelength is 1 m\n", + "2nd overtone wavelength is 0.667 m\n", + "answers in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=1*10**-3; #string radius(m)\n", + "l=1; #length(m)\n", + "rho=7930; #density(kg/m**3)\n", + "T=10**4; #tension(N)\n", + "\n", + "#Calculation\n", + "mew=math.pi*r**2*rho/l; #string linear density(kg/m)\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "f1=v/(2*l); #fundamental frequency(Hz)\n", + "f2=2*f1; #frequency of 1st overtone(Hz)\n", + "f3=3*f1; #frequency of 2nd overtone(Hz)\n", + "lamda1=2*l/1; #fundamental wavelength(m)\n", + "lamda2=2*l/2; #1st overtone wavelength(m)\n", + "lamda3=2*l/3; #2nd overtone wavelength(m)\n", + "\n", + "#Result\n", + "print \"string linear density is\",round(mew,4),\"kg/m\"\n", + "print \"wave velocity is\",round(v,2),\"m/s\"\n", + "print \"fundamental frequency is\",round(f1,2),\"Hz\"\n", + "print \"frequency of 1st overtone is\",round(f2,2),\"Hz\"\n", + "print \"frequency of 2nd overtone is\",round(f3,2),\"Hz\"\n", + "print \"fundamental wavelength is\",int(lamda1),\"m\"\n", + "print \"1st overtone wavelength is\",int(lamda2),\"m\"\n", + "print \"2nd overtone wavelength is\",round(lamda3,3),\"m\"\n", + "print \"answers in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "power is 19.74 watts\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mew=0.1; #string linear density(kg/m)\n", + "A=0.1; #amplitude(m)\n", + "f=10; #frequency(Hz)\n", + "T=10; #tension(N)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(T/mew); #wave velocity(m/s)\n", + "P=2*math.pi**2*f**2*A**2*v*mew; #power(watt)\n", + "\n", + "#Result\n", + "print \"power is\",round(P,2),\"watts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 373" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "tension in string is 524.29 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "f=500; #frequency(Hz)\n", + "T=500; #tension(N)\n", + "f1=512; #required frequency(Hz)\n", + "\n", + "#Calculation\n", + "T1=T*f1**2/f**2; #tension in string(N)\n", + "\n", + "#Result\n", + "print \"tension in string is\",round(T1,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 374" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude at x=5 is 4.0\n", + "first node position is 0.0 m\n", + "second node position is 30.0 m\n", + "third node position is 60.0 m\n", + "wavelength is 60.0 m\n", + "component transverse wave equations are y1= 4.0 sin math.pi((x/30)-(48*t))\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given Y=8sin(math.pi*x/30)cos(48*math.pi*t)\n", + "#by comparing with Y=2Asin(kx)cos(omegat) we get\n", + "A=8/2; #amplitude(cm)\n", + "omega=48*math.pi;\n", + "x=5; #stationary wave point\n", + "k=math.pi/30; #wavelength constant\n", + "y1=0;\n", + "y2=math.pi;\n", + "y3=2*math.pi;\n", + "\n", + "#Calculation\n", + "y=2*A*math.sin(math.pi*x/30); #amplitude at x=5\n", + "x1=y1*30/math.pi; #first node position(m) \n", + "x2=y2*30/math.pi; #second node position(m) \n", + "x3=y3*30/math.pi; #third node position(m) \n", + "lamda=2*(x3-x2); #wavelength(m) \n", + "\n", + "#Result\n", + "print \"amplitude at x=5 is\",y\n", + "print \"first node position is\",x1,\"m\"\n", + "print \"second node position is\",x2,\"m\"\n", + "print \"third node position is\",x3,\"m\"\n", + "print \"wavelength is\",lamda,\"m\"\n", + "print \"component transverse wave equations are y1=\",A,\"sin math.pi((x/30)-(48*t))\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_4NAW2Fm.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_4NAW2Fm.ipynb new file mode 100644 index 00000000..a30f5154 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_4NAW2Fm.ipynb @@ -0,0 +1,194 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 12: Ultrasonics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency is 958.33 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=5750; #velocity(m/s)\n", + "t=3*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #fundamental frequency(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency is\",round(f/10**3,2),\"KHz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "natural frequency is 1365.0 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=7.9*10**10; #youngs modulus(N/m**2)\n", + "rho=2650; #density(Kg/m**3)\n", + "t=2*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(Y/rho); #velocity(m/s)\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #natural frequency(Hz)\n", + "\n", + "#Result\n", + "print \"natural frequency is\",round(f/10**3),\"KHz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pressure wave amplitude is 13.04 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rho0=1.21; #air density(kg/m**3)\n", + "C=343; #sound velocity(m/sec)\n", + "f=500; #frequency(Hz)\n", + "A=10**-5; #displacement amplitude(m)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency(Hz)\n", + "Pe=rho0*C*omega*A; #pressure wave amplitude(N/m**2)\n", + "\n", + "#Result\n", + "print \"pressure wave amplitude is\",round(Pe,2),\"N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of pressure amplitudes is 58.0\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z1=1.43*10**6; #value of constant in water(Rayls)\n", + "Z2=425.7; #value of constant in air(Rayls)\n", + "\n", + "#Calculation\n", + "Pe1byPe2=math.sqrt(Z1/Z2); #ratio of pressure amplitudes\n", + "\n", + "#Result\n", + "print \"ratio of pressure amplitudes is\",round(Pe1byPe2)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_FfNxDUK.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_FfNxDUK.ipynb new file mode 100644 index 00000000..a30f5154 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_FfNxDUK.ipynb @@ -0,0 +1,194 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 12: Ultrasonics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency is 958.33 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=5750; #velocity(m/s)\n", + "t=3*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #fundamental frequency(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency is\",round(f/10**3,2),\"KHz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "natural frequency is 1365.0 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=7.9*10**10; #youngs modulus(N/m**2)\n", + "rho=2650; #density(Kg/m**3)\n", + "t=2*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(Y/rho); #velocity(m/s)\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #natural frequency(Hz)\n", + "\n", + "#Result\n", + "print \"natural frequency is\",round(f/10**3),\"KHz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pressure wave amplitude is 13.04 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rho0=1.21; #air density(kg/m**3)\n", + "C=343; #sound velocity(m/sec)\n", + "f=500; #frequency(Hz)\n", + "A=10**-5; #displacement amplitude(m)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency(Hz)\n", + "Pe=rho0*C*omega*A; #pressure wave amplitude(N/m**2)\n", + "\n", + "#Result\n", + "print \"pressure wave amplitude is\",round(Pe,2),\"N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of pressure amplitudes is 58.0\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z1=1.43*10**6; #value of constant in water(Rayls)\n", + "Z2=425.7; #value of constant in air(Rayls)\n", + "\n", + "#Calculation\n", + "Pe1byPe2=math.sqrt(Z1/Z2); #ratio of pressure amplitudes\n", + "\n", + "#Result\n", + "print \"ratio of pressure amplitudes is\",round(Pe1byPe2)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_ZDZIhlt.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_ZDZIhlt.ipynb new file mode 100644 index 00000000..a30f5154 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_ZDZIhlt.ipynb @@ -0,0 +1,194 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 12: Ultrasonics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency is 958.33 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=5750; #velocity(m/s)\n", + "t=3*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #fundamental frequency(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency is\",round(f/10**3,2),\"KHz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "natural frequency is 1365.0 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=7.9*10**10; #youngs modulus(N/m**2)\n", + "rho=2650; #density(Kg/m**3)\n", + "t=2*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(Y/rho); #velocity(m/s)\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #natural frequency(Hz)\n", + "\n", + "#Result\n", + "print \"natural frequency is\",round(f/10**3),\"KHz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pressure wave amplitude is 13.04 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rho0=1.21; #air density(kg/m**3)\n", + "C=343; #sound velocity(m/sec)\n", + "f=500; #frequency(Hz)\n", + "A=10**-5; #displacement amplitude(m)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency(Hz)\n", + "Pe=rho0*C*omega*A; #pressure wave amplitude(N/m**2)\n", + "\n", + "#Result\n", + "print \"pressure wave amplitude is\",round(Pe,2),\"N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of pressure amplitudes is 58.0\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z1=1.43*10**6; #value of constant in water(Rayls)\n", + "Z2=425.7; #value of constant in air(Rayls)\n", + "\n", + "#Calculation\n", + "Pe1byPe2=math.sqrt(Z1/Z2); #ratio of pressure amplitudes\n", + "\n", + "#Result\n", + "print \"ratio of pressure amplitudes is\",round(Pe1byPe2)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_gTfdUW2.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_gTfdUW2.ipynb new file mode 100644 index 00000000..a30f5154 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_gTfdUW2.ipynb @@ -0,0 +1,194 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 12: Ultrasonics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency is 958.33 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=5750; #velocity(m/s)\n", + "t=3*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #fundamental frequency(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency is\",round(f/10**3,2),\"KHz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "natural frequency is 1365.0 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=7.9*10**10; #youngs modulus(N/m**2)\n", + "rho=2650; #density(Kg/m**3)\n", + "t=2*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(Y/rho); #velocity(m/s)\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #natural frequency(Hz)\n", + "\n", + "#Result\n", + "print \"natural frequency is\",round(f/10**3),\"KHz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pressure wave amplitude is 13.04 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rho0=1.21; #air density(kg/m**3)\n", + "C=343; #sound velocity(m/sec)\n", + "f=500; #frequency(Hz)\n", + "A=10**-5; #displacement amplitude(m)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency(Hz)\n", + "Pe=rho0*C*omega*A; #pressure wave amplitude(N/m**2)\n", + "\n", + "#Result\n", + "print \"pressure wave amplitude is\",round(Pe,2),\"N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of pressure amplitudes is 58.0\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z1=1.43*10**6; #value of constant in water(Rayls)\n", + "Z2=425.7; #value of constant in air(Rayls)\n", + "\n", + "#Calculation\n", + "Pe1byPe2=math.sqrt(Z1/Z2); #ratio of pressure amplitudes\n", + "\n", + "#Result\n", + "print \"ratio of pressure amplitudes is\",round(Pe1byPe2)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_qUFA2gJ.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_qUFA2gJ.ipynb new file mode 100644 index 00000000..a30f5154 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_qUFA2gJ.ipynb @@ -0,0 +1,194 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 12: Ultrasonics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fundamental frequency is 958.33 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=5750; #velocity(m/s)\n", + "t=3*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #fundamental frequency(Hz)\n", + "\n", + "#Result\n", + "print \"fundamental frequency is\",round(f/10**3,2),\"KHz\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 394" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "natural frequency is 1365.0 KHz\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=7.9*10**10; #youngs modulus(N/m**2)\n", + "rho=2650; #density(Kg/m**3)\n", + "t=2*10**-3; #thickness(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(Y/rho); #velocity(m/s)\n", + "lamda=2*t; #wavelength(m)\n", + "f=v/lamda; #natural frequency(Hz)\n", + "\n", + "#Result\n", + "print \"natural frequency is\",round(f/10**3),\"KHz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pressure wave amplitude is 13.04 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rho0=1.21; #air density(kg/m**3)\n", + "C=343; #sound velocity(m/sec)\n", + "f=500; #frequency(Hz)\n", + "A=10**-5; #displacement amplitude(m)\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*f; #angular frequency(Hz)\n", + "Pe=rho0*C*omega*A; #pressure wave amplitude(N/m**2)\n", + "\n", + "#Result\n", + "print \"pressure wave amplitude is\",round(Pe,2),\"N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 395" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of pressure amplitudes is 58.0\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z1=1.43*10**6; #value of constant in water(Rayls)\n", + "Z2=425.7; #value of constant in air(Rayls)\n", + "\n", + "#Calculation\n", + "Pe1byPe2=math.sqrt(Z1/Z2); #ratio of pressure amplitudes\n", + "\n", + "#Result\n", + "print \"ratio of pressure amplitudes is\",round(Pe1byPe2)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_DtcvRnP.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_DtcvRnP.ipynb new file mode 100644 index 00000000..f7586865 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_DtcvRnP.ipynb @@ -0,0 +1,164 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1: Vector Analysis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "divergence of force vector is 3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import tplquad\n", + "\n", + "#Calculation\n", + "func = lambda x,y,z: 2*(x+y+z)\n", + "x1,x2 = 0,1\n", + "y1,y2 = lambda x: 0, lambda x: 1\n", + "z1,z2 = lambda x,y: 0, lambda x,y: 1\n", + "r1,r2=tplquad(func,x1,x2,y1,y2,z1,z2) \n", + "r=r1-r2; #divergence of force vector\n", + "\n", + "#Result\n", + "print \"divergence of force vector is\",int(round(r))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 28" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 59 /60\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return x**3\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*x**4\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 3*x**8\n", + "r3=quad(zintg,0,1)[0]\n", + "r=r1+r2+r3; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*60),\"/60\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 29" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 2 /3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "from fractions import Fraction\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return (x-(x**2))\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*((x**2)+(x**3))\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(y):\n", + " return 2*((y**3)-(y**2))\n", + "r3=quad(zintg,1,0)[0]\n", + "def zintg(y):\n", + " return (y**2)+y\n", + "r4=quad(zintg,1,0)[0]\n", + "r=r1+r2+r3+r4; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*3),\"/3\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_Rka6634.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_Rka6634.ipynb new file mode 100644 index 00000000..f7586865 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_Rka6634.ipynb @@ -0,0 +1,164 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1: Vector Analysis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "divergence of force vector is 3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import tplquad\n", + "\n", + "#Calculation\n", + "func = lambda x,y,z: 2*(x+y+z)\n", + "x1,x2 = 0,1\n", + "y1,y2 = lambda x: 0, lambda x: 1\n", + "z1,z2 = lambda x,y: 0, lambda x,y: 1\n", + "r1,r2=tplquad(func,x1,x2,y1,y2,z1,z2) \n", + "r=r1-r2; #divergence of force vector\n", + "\n", + "#Result\n", + "print \"divergence of force vector is\",int(round(r))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 28" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 59 /60\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return x**3\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*x**4\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 3*x**8\n", + "r3=quad(zintg,0,1)[0]\n", + "r=r1+r2+r3; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*60),\"/60\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 29" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 2 /3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "from fractions import Fraction\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return (x-(x**2))\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*((x**2)+(x**3))\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(y):\n", + " return 2*((y**3)-(y**2))\n", + "r3=quad(zintg,1,0)[0]\n", + "def zintg(y):\n", + " return (y**2)+y\n", + "r4=quad(zintg,1,0)[0]\n", + "r=r1+r2+r3+r4; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*3),\"/3\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_cZJsXcd.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_cZJsXcd.ipynb new file mode 100644 index 00000000..f7586865 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_cZJsXcd.ipynb @@ -0,0 +1,164 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1: Vector Analysis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "divergence of force vector is 3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import tplquad\n", + "\n", + "#Calculation\n", + "func = lambda x,y,z: 2*(x+y+z)\n", + "x1,x2 = 0,1\n", + "y1,y2 = lambda x: 0, lambda x: 1\n", + "z1,z2 = lambda x,y: 0, lambda x,y: 1\n", + "r1,r2=tplquad(func,x1,x2,y1,y2,z1,z2) \n", + "r=r1-r2; #divergence of force vector\n", + "\n", + "#Result\n", + "print \"divergence of force vector is\",int(round(r))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 28" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 59 /60\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return x**3\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*x**4\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 3*x**8\n", + "r3=quad(zintg,0,1)[0]\n", + "r=r1+r2+r3; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*60),\"/60\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 29" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 2 /3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "from fractions import Fraction\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return (x-(x**2))\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*((x**2)+(x**3))\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(y):\n", + " return 2*((y**3)-(y**2))\n", + "r3=quad(zintg,1,0)[0]\n", + "def zintg(y):\n", + " return (y**2)+y\n", + "r4=quad(zintg,1,0)[0]\n", + "r=r1+r2+r3+r4; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*3),\"/3\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_kdoUcUP.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_kdoUcUP.ipynb new file mode 100644 index 00000000..f7586865 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_kdoUcUP.ipynb @@ -0,0 +1,164 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1: Vector Analysis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "divergence of force vector is 3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import tplquad\n", + "\n", + "#Calculation\n", + "func = lambda x,y,z: 2*(x+y+z)\n", + "x1,x2 = 0,1\n", + "y1,y2 = lambda x: 0, lambda x: 1\n", + "z1,z2 = lambda x,y: 0, lambda x,y: 1\n", + "r1,r2=tplquad(func,x1,x2,y1,y2,z1,z2) \n", + "r=r1-r2; #divergence of force vector\n", + "\n", + "#Result\n", + "print \"divergence of force vector is\",int(round(r))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 28" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 59 /60\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return x**3\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*x**4\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 3*x**8\n", + "r3=quad(zintg,0,1)[0]\n", + "r=r1+r2+r3; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*60),\"/60\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 29" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 2 /3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "from fractions import Fraction\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return (x-(x**2))\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*((x**2)+(x**3))\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(y):\n", + " return 2*((y**3)-(y**2))\n", + "r3=quad(zintg,1,0)[0]\n", + "def zintg(y):\n", + " return (y**2)+y\n", + "r4=quad(zintg,1,0)[0]\n", + "r=r1+r2+r3+r4; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*3),\"/3\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_meY4gNm.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_meY4gNm.ipynb new file mode 100644 index 00000000..f7586865 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_meY4gNm.ipynb @@ -0,0 +1,164 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1: Vector Analysis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "divergence of force vector is 3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import tplquad\n", + "\n", + "#Calculation\n", + "func = lambda x,y,z: 2*(x+y+z)\n", + "x1,x2 = 0,1\n", + "y1,y2 = lambda x: 0, lambda x: 1\n", + "z1,z2 = lambda x,y: 0, lambda x,y: 1\n", + "r1,r2=tplquad(func,x1,x2,y1,y2,z1,z2) \n", + "r=r1-r2; #divergence of force vector\n", + "\n", + "#Result\n", + "print \"divergence of force vector is\",int(round(r))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 28" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 59 /60\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return x**3\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*x**4\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 3*x**8\n", + "r3=quad(zintg,0,1)[0]\n", + "r=r1+r2+r3; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*60),\"/60\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 29" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the result is 2 /3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from scipy.integrate import quad\n", + "from fractions import Fraction\n", + "\n", + "#Calculation\n", + "def zintg(x):\n", + " return (x-(x**2))\n", + "r1=quad(zintg,0,1)[0]\n", + "def zintg(x):\n", + " return 2*((x**2)+(x**3))\n", + "r2=quad(zintg,0,1)[0]\n", + "def zintg(y):\n", + " return 2*((y**3)-(y**2))\n", + "r3=quad(zintg,1,0)[0]\n", + "def zintg(y):\n", + " return (y**2)+y\n", + "r4=quad(zintg,1,0)[0]\n", + "r=r1+r2+r3+r4; #result\n", + "\n", + "#Result\n", + "print \"the result is\",int(r*3),\"/3\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3CrecVA.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3CrecVA.ipynb new file mode 100644 index 00000000..68990ae4 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3CrecVA.ipynb @@ -0,0 +1,532 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2: Mechanics of Particles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 75" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "momentum of electron is 5.37 *10**-19 gm cm/sec\n", + "velocity of truck in 1st case is 12 m/sec\n", + "velocity of truck in 2nd case is 18.97 m/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=9*10**-28; #mass(gram)\n", + "E=100; #kinetic energy(eV)\n", + "e=1.6*10**-12; #kinetic energy(erg)\n", + "mc=4000; #mass of car(kg)\n", + "mt=10000; #mass of truck(kg)\n", + "vc=30; #speed of car(m/s)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(E*e*2*m); #momentum of electron(gm cm/sec)\n", + "vt=mc*vc/mt; #velocity of truck in 1st case(m/sec)\n", + "v1=math.sqrt(mc*vc**2/mt); #velocity of truck in 2nd case(m/sec)\n", + "\n", + "#Result\n", + "print \"momentum of electron is\",round(P*10**19,2),\"*10**-19 gm cm/sec\"\n", + "print \"velocity of truck in 1st case is\",int(vt),\"m/sec\"\n", + "print \"velocity of truck in 2nd case is\",round(v1,2),\"m/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 76" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnitude of velocity is 10 *math.sqrt(2) m/sec\n", + "direction of velocity is 135 degrees or 225 degrees\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=30; #speed(m/sec)\n", + "P1=30; #momentum of 1st part(i)\n", + "P2=30; #momentum of 2nd part(j)\n", + "P3=3; #momentum of 3rd part(v)\n", + "\n", + "#Calculation\n", + "#from conservation of momentum, 30i+30j+3v=0. from which we get v=-10(i+j)\n", + "i=1; #coordinate of i\n", + "j=1; #coordinate of j\n", + "m=math.sqrt(i**2+j**2); #magnitude\n", + "mv=10*m; #magnitude of velocity(m/sec)\n", + "vbar=math.acos(-10/mv); #direction of velocity(rad) \n", + "vbar1=int(vbar*180/math.pi); #direction of velocity(degrees)\n", + "vbar2=360-vbar1; #direction of velocity(degrees) \n", + "\n", + "#Result\n", + "print \"magnitude of velocity is\",int(mv/math.sqrt(2)),\"*math.sqrt(2) m/sec\"\n", + "print \"direction of velocity is\",vbar1,\"degrees or\",vbar2,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 77" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of mass of fuel to empty rocket is 1095\n", + "answer given in the book is wrong\n", + "time is 9.99 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v0=0; #initial velocity of rocket\n", + "vr=1.6; #velocity of gases(km/sec)\n", + "v=11.2; #final velocity(km/sec)\n", + "alphabyM0=1/10; #fuel burnt rate\n", + "\n", + "#Calculation\n", + "#assume x=log(M0/M)\n", + "x=(v-v0)/vr; \n", + "M0byM=math.exp(x); \n", + "MfbyMe=M0byM-1; #ratio of mass of fuel to empty rocket\n", + "t=(1-(1/M0byM))*(1/alphabyM0); #time(sec)\n", + "\n", + "#Result\n", + "print \"ratio of mass of fuel to empty rocket is\",int(MfbyMe)\n", + "print \"answer given in the book is wrong\"\n", + "print \"time is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 7.82 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=300; #mass in 1st stage(kg)\n", + "m2=30; #mass in 2nd stage(kg)\n", + "m3=2400; #fuel filled(kg)\n", + "m4=270; #fuel filled(kg)\n", + "u=2; #velocity(km/sec)\n", + "\n", + "#Calculation\n", + "M0=m1+m2+m3+m4; #mass(kg)\n", + "M=m1+m2+m4; #mass(kg)\n", + "v0=u*math.log(M0/M); #initial velocity of rocket to the second stage(km/sec)\n", + "M01=m2+m4; #mass(kg)\n", + "V=v0+(u*math.log(M01/m2)); #final velocity of rocket(km/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V,2),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 79" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 2.8 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mr=40; #mass of rocket(kg)\n", + "mf=360; #mass of fuel(kg)\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "v=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; #velocity(m/sec)\n", + "\n", + "#Calculation\n", + "M=mr+mf; #mass(kg)\n", + "dmbydt=M*g/v; #thrust(kg/sec)\n", + "t=mf/dmbydt; #time taken(sec)\n", + "Vmax=v0+(v*math.log(M/mr))-(g*t); #final velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(Vmax/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust on rocket is 98 kg/sec\n", + "thrust on rocket to give acceleration is 398 kg/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "vr=800; #exhaust velocity(m/sec)\n", + "M=8000; #mass(kg)\n", + "a=30; #acceleration(m/s**2)\n", + "\n", + "#Calculation\n", + "dMbydt=M*g/vr; #thrust on rocket(kg/sec)\n", + "dMbydt1=M*(g+a)/vr; #thrust on rocket to give acceleration(kg/sec)\n", + "\n", + "#Result\n", + "print \"thrust on rocket is\",int(dMbydt),\"kg/sec\"\n", + "print \"thrust on rocket to give acceleration is\",int(dMbydt1),\"kg/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 81" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust acting on rocket is 200 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "urel=10000; #exhaust velocity(m/s)\n", + "dMbydt=0.02; #rate of fuel burnt(kg/sec)\n", + "\n", + "#Calculation\n", + "Freaction=urel*dMbydt; #thrust acting on rocket(N)\n", + "\n", + "#Result\n", + "print \"thrust acting on rocket is\",int(Freaction),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 4.4 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=5000; #mass of rocket(kg)\n", + "mf=40000; #mass of fuel(kg)\n", + "urel=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; \n", + "\n", + "#Calculation\n", + "M0=M+mf; #mass(kg)\n", + "V=v0+(urel*math.log(M0/M)); #maximum velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of nucleus is 0.27 *10**5 m/s\n", + "direction of momentum of nucleus is 150.0 degrees\n", + "kinetic energy is 0.145 *10**-15 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "P1=9.22*10**-21; #momentum(kgm/s)\n", + "P2=5.33*10**-21; #momentum(kgm/s)\n", + "m=3.9*10**-25; #mass of nucleus(kg)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(P1**2+P2**2); #momentum(kgm/s)\n", + "V=P/m; #recoil velocity of nucleus(m/s)\n", + "theta=math.atan(P2/P1); #direction of momentum of nucleus(rad)\n", + "theta=180-(theta*180/math.pi); #direction of momentum of nucleus(degrees) \n", + "K=P**2/(2*m); #kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"recoil velocity of nucleus is\",round(V/10**5,2),\"*10**5 m/s\"\n", + "print \"direction of momentum of nucleus is\",round(theta),\"degrees\"\n", + "print \"kinetic energy is\",round(K*10**15,3),\"*10**-15 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of residual is -2.564 *10**5 m/s\n", + "kinetic energy of residual is 0.068 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "malpha=4; #kinetic energy of alpha particle(MeV)\n", + "mth=234; #mass of thorium(kg)\n", + "valpha=1.5*10**7; #velocity(m/s)\n", + "\n", + "#Calculation\n", + "vth=-malpha*valpha/mth; #recoil velocity of residual(m/s)\n", + "Kalpha=malpha; #kinetic energy of alpha(MeV)\n", + "Kth=malpha*Kalpha/mth; #kinetic energy of residual(MeV)\n", + "\n", + "#Result\n", + "print \"recoil velocity of residual is\",round(vth/10**5,3),\"*10**5 m/s\"\n", + "print \"kinetic energy of residual is\",round(Kth,3),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity before collision is 5.196\n", + "velocity after collision is 5.196\n", + "kinetic energy before collision is 40.5*m\n", + "kinetic energy before collision is 27.0*m\n", + "energy is not conserved\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from sympy import Symbol\n", + "\n", + "#Variable declaration\n", + "u1=9; #velocity(m/sec)\n", + "theta=30*math.pi/180; #scattering angle(rad)\n", + "u2=0; #velocity(m/sec)\n", + "m=Symbol(\"m\");\n", + "\n", + "#Calculation\n", + "v1plusv2=u1/math.cos(theta); \n", + "v1minusv2=u2/math.cos(180-theta); \n", + "v1=(v1plusv2+v1minusv2)/2; #velocity before collision\n", + "v2=(v1plusv2-v1minusv2)/2; #velocity after collisiovelocity after collision isn,v2\n", + "KE1=(m*(u1**2/2))+(m*(u2**2/2)); #kinetic energy before collision\n", + "KE2=((m*v1**2)/2)+((m*v2**2)/2); #kinetic energy before collision\n", + "\n", + "#Result\n", + "print \"velocity before collision is\",round(v1,3)\n", + "print \"velocity after collision is\",round(v2,3)\n", + "print \"kinetic energy before collision is\",KE1\n", + "print \"kinetic energy before collision is\",KE2\n", + "print \"energy is not conserved\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3GOPcRl.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3GOPcRl.ipynb new file mode 100644 index 00000000..68990ae4 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3GOPcRl.ipynb @@ -0,0 +1,532 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2: Mechanics of Particles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 75" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "momentum of electron is 5.37 *10**-19 gm cm/sec\n", + "velocity of truck in 1st case is 12 m/sec\n", + "velocity of truck in 2nd case is 18.97 m/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=9*10**-28; #mass(gram)\n", + "E=100; #kinetic energy(eV)\n", + "e=1.6*10**-12; #kinetic energy(erg)\n", + "mc=4000; #mass of car(kg)\n", + "mt=10000; #mass of truck(kg)\n", + "vc=30; #speed of car(m/s)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(E*e*2*m); #momentum of electron(gm cm/sec)\n", + "vt=mc*vc/mt; #velocity of truck in 1st case(m/sec)\n", + "v1=math.sqrt(mc*vc**2/mt); #velocity of truck in 2nd case(m/sec)\n", + "\n", + "#Result\n", + "print \"momentum of electron is\",round(P*10**19,2),\"*10**-19 gm cm/sec\"\n", + "print \"velocity of truck in 1st case is\",int(vt),\"m/sec\"\n", + "print \"velocity of truck in 2nd case is\",round(v1,2),\"m/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 76" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnitude of velocity is 10 *math.sqrt(2) m/sec\n", + "direction of velocity is 135 degrees or 225 degrees\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=30; #speed(m/sec)\n", + "P1=30; #momentum of 1st part(i)\n", + "P2=30; #momentum of 2nd part(j)\n", + "P3=3; #momentum of 3rd part(v)\n", + "\n", + "#Calculation\n", + "#from conservation of momentum, 30i+30j+3v=0. from which we get v=-10(i+j)\n", + "i=1; #coordinate of i\n", + "j=1; #coordinate of j\n", + "m=math.sqrt(i**2+j**2); #magnitude\n", + "mv=10*m; #magnitude of velocity(m/sec)\n", + "vbar=math.acos(-10/mv); #direction of velocity(rad) \n", + "vbar1=int(vbar*180/math.pi); #direction of velocity(degrees)\n", + "vbar2=360-vbar1; #direction of velocity(degrees) \n", + "\n", + "#Result\n", + "print \"magnitude of velocity is\",int(mv/math.sqrt(2)),\"*math.sqrt(2) m/sec\"\n", + "print \"direction of velocity is\",vbar1,\"degrees or\",vbar2,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 77" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of mass of fuel to empty rocket is 1095\n", + "answer given in the book is wrong\n", + "time is 9.99 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v0=0; #initial velocity of rocket\n", + "vr=1.6; #velocity of gases(km/sec)\n", + "v=11.2; #final velocity(km/sec)\n", + "alphabyM0=1/10; #fuel burnt rate\n", + "\n", + "#Calculation\n", + "#assume x=log(M0/M)\n", + "x=(v-v0)/vr; \n", + "M0byM=math.exp(x); \n", + "MfbyMe=M0byM-1; #ratio of mass of fuel to empty rocket\n", + "t=(1-(1/M0byM))*(1/alphabyM0); #time(sec)\n", + "\n", + "#Result\n", + "print \"ratio of mass of fuel to empty rocket is\",int(MfbyMe)\n", + "print \"answer given in the book is wrong\"\n", + "print \"time is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 7.82 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=300; #mass in 1st stage(kg)\n", + "m2=30; #mass in 2nd stage(kg)\n", + "m3=2400; #fuel filled(kg)\n", + "m4=270; #fuel filled(kg)\n", + "u=2; #velocity(km/sec)\n", + "\n", + "#Calculation\n", + "M0=m1+m2+m3+m4; #mass(kg)\n", + "M=m1+m2+m4; #mass(kg)\n", + "v0=u*math.log(M0/M); #initial velocity of rocket to the second stage(km/sec)\n", + "M01=m2+m4; #mass(kg)\n", + "V=v0+(u*math.log(M01/m2)); #final velocity of rocket(km/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V,2),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 79" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 2.8 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mr=40; #mass of rocket(kg)\n", + "mf=360; #mass of fuel(kg)\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "v=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; #velocity(m/sec)\n", + "\n", + "#Calculation\n", + "M=mr+mf; #mass(kg)\n", + "dmbydt=M*g/v; #thrust(kg/sec)\n", + "t=mf/dmbydt; #time taken(sec)\n", + "Vmax=v0+(v*math.log(M/mr))-(g*t); #final velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(Vmax/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust on rocket is 98 kg/sec\n", + "thrust on rocket to give acceleration is 398 kg/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "vr=800; #exhaust velocity(m/sec)\n", + "M=8000; #mass(kg)\n", + "a=30; #acceleration(m/s**2)\n", + "\n", + "#Calculation\n", + "dMbydt=M*g/vr; #thrust on rocket(kg/sec)\n", + "dMbydt1=M*(g+a)/vr; #thrust on rocket to give acceleration(kg/sec)\n", + "\n", + "#Result\n", + "print \"thrust on rocket is\",int(dMbydt),\"kg/sec\"\n", + "print \"thrust on rocket to give acceleration is\",int(dMbydt1),\"kg/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 81" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust acting on rocket is 200 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "urel=10000; #exhaust velocity(m/s)\n", + "dMbydt=0.02; #rate of fuel burnt(kg/sec)\n", + "\n", + "#Calculation\n", + "Freaction=urel*dMbydt; #thrust acting on rocket(N)\n", + "\n", + "#Result\n", + "print \"thrust acting on rocket is\",int(Freaction),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 4.4 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=5000; #mass of rocket(kg)\n", + "mf=40000; #mass of fuel(kg)\n", + "urel=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; \n", + "\n", + "#Calculation\n", + "M0=M+mf; #mass(kg)\n", + "V=v0+(urel*math.log(M0/M)); #maximum velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of nucleus is 0.27 *10**5 m/s\n", + "direction of momentum of nucleus is 150.0 degrees\n", + "kinetic energy is 0.145 *10**-15 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "P1=9.22*10**-21; #momentum(kgm/s)\n", + "P2=5.33*10**-21; #momentum(kgm/s)\n", + "m=3.9*10**-25; #mass of nucleus(kg)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(P1**2+P2**2); #momentum(kgm/s)\n", + "V=P/m; #recoil velocity of nucleus(m/s)\n", + "theta=math.atan(P2/P1); #direction of momentum of nucleus(rad)\n", + "theta=180-(theta*180/math.pi); #direction of momentum of nucleus(degrees) \n", + "K=P**2/(2*m); #kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"recoil velocity of nucleus is\",round(V/10**5,2),\"*10**5 m/s\"\n", + "print \"direction of momentum of nucleus is\",round(theta),\"degrees\"\n", + "print \"kinetic energy is\",round(K*10**15,3),\"*10**-15 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of residual is -2.564 *10**5 m/s\n", + "kinetic energy of residual is 0.068 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "malpha=4; #kinetic energy of alpha particle(MeV)\n", + "mth=234; #mass of thorium(kg)\n", + "valpha=1.5*10**7; #velocity(m/s)\n", + "\n", + "#Calculation\n", + "vth=-malpha*valpha/mth; #recoil velocity of residual(m/s)\n", + "Kalpha=malpha; #kinetic energy of alpha(MeV)\n", + "Kth=malpha*Kalpha/mth; #kinetic energy of residual(MeV)\n", + "\n", + "#Result\n", + "print \"recoil velocity of residual is\",round(vth/10**5,3),\"*10**5 m/s\"\n", + "print \"kinetic energy of residual is\",round(Kth,3),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity before collision is 5.196\n", + "velocity after collision is 5.196\n", + "kinetic energy before collision is 40.5*m\n", + "kinetic energy before collision is 27.0*m\n", + "energy is not conserved\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from sympy import Symbol\n", + "\n", + "#Variable declaration\n", + "u1=9; #velocity(m/sec)\n", + "theta=30*math.pi/180; #scattering angle(rad)\n", + "u2=0; #velocity(m/sec)\n", + "m=Symbol(\"m\");\n", + "\n", + "#Calculation\n", + "v1plusv2=u1/math.cos(theta); \n", + "v1minusv2=u2/math.cos(180-theta); \n", + "v1=(v1plusv2+v1minusv2)/2; #velocity before collision\n", + "v2=(v1plusv2-v1minusv2)/2; #velocity after collisiovelocity after collision isn,v2\n", + "KE1=(m*(u1**2/2))+(m*(u2**2/2)); #kinetic energy before collision\n", + "KE2=((m*v1**2)/2)+((m*v2**2)/2); #kinetic energy before collision\n", + "\n", + "#Result\n", + "print \"velocity before collision is\",round(v1,3)\n", + "print \"velocity after collision is\",round(v2,3)\n", + "print \"kinetic energy before collision is\",KE1\n", + "print \"kinetic energy before collision is\",KE2\n", + "print \"energy is not conserved\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3oe48aD.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3oe48aD.ipynb new file mode 100644 index 00000000..68990ae4 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_3oe48aD.ipynb @@ -0,0 +1,532 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2: Mechanics of Particles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 75" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "momentum of electron is 5.37 *10**-19 gm cm/sec\n", + "velocity of truck in 1st case is 12 m/sec\n", + "velocity of truck in 2nd case is 18.97 m/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=9*10**-28; #mass(gram)\n", + "E=100; #kinetic energy(eV)\n", + "e=1.6*10**-12; #kinetic energy(erg)\n", + "mc=4000; #mass of car(kg)\n", + "mt=10000; #mass of truck(kg)\n", + "vc=30; #speed of car(m/s)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(E*e*2*m); #momentum of electron(gm cm/sec)\n", + "vt=mc*vc/mt; #velocity of truck in 1st case(m/sec)\n", + "v1=math.sqrt(mc*vc**2/mt); #velocity of truck in 2nd case(m/sec)\n", + "\n", + "#Result\n", + "print \"momentum of electron is\",round(P*10**19,2),\"*10**-19 gm cm/sec\"\n", + "print \"velocity of truck in 1st case is\",int(vt),\"m/sec\"\n", + "print \"velocity of truck in 2nd case is\",round(v1,2),\"m/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 76" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnitude of velocity is 10 *math.sqrt(2) m/sec\n", + "direction of velocity is 135 degrees or 225 degrees\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=30; #speed(m/sec)\n", + "P1=30; #momentum of 1st part(i)\n", + "P2=30; #momentum of 2nd part(j)\n", + "P3=3; #momentum of 3rd part(v)\n", + "\n", + "#Calculation\n", + "#from conservation of momentum, 30i+30j+3v=0. from which we get v=-10(i+j)\n", + "i=1; #coordinate of i\n", + "j=1; #coordinate of j\n", + "m=math.sqrt(i**2+j**2); #magnitude\n", + "mv=10*m; #magnitude of velocity(m/sec)\n", + "vbar=math.acos(-10/mv); #direction of velocity(rad) \n", + "vbar1=int(vbar*180/math.pi); #direction of velocity(degrees)\n", + "vbar2=360-vbar1; #direction of velocity(degrees) \n", + "\n", + "#Result\n", + "print \"magnitude of velocity is\",int(mv/math.sqrt(2)),\"*math.sqrt(2) m/sec\"\n", + "print \"direction of velocity is\",vbar1,\"degrees or\",vbar2,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 77" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of mass of fuel to empty rocket is 1095\n", + "answer given in the book is wrong\n", + "time is 9.99 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v0=0; #initial velocity of rocket\n", + "vr=1.6; #velocity of gases(km/sec)\n", + "v=11.2; #final velocity(km/sec)\n", + "alphabyM0=1/10; #fuel burnt rate\n", + "\n", + "#Calculation\n", + "#assume x=log(M0/M)\n", + "x=(v-v0)/vr; \n", + "M0byM=math.exp(x); \n", + "MfbyMe=M0byM-1; #ratio of mass of fuel to empty rocket\n", + "t=(1-(1/M0byM))*(1/alphabyM0); #time(sec)\n", + "\n", + "#Result\n", + "print \"ratio of mass of fuel to empty rocket is\",int(MfbyMe)\n", + "print \"answer given in the book is wrong\"\n", + "print \"time is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 7.82 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=300; #mass in 1st stage(kg)\n", + "m2=30; #mass in 2nd stage(kg)\n", + "m3=2400; #fuel filled(kg)\n", + "m4=270; #fuel filled(kg)\n", + "u=2; #velocity(km/sec)\n", + "\n", + "#Calculation\n", + "M0=m1+m2+m3+m4; #mass(kg)\n", + "M=m1+m2+m4; #mass(kg)\n", + "v0=u*math.log(M0/M); #initial velocity of rocket to the second stage(km/sec)\n", + "M01=m2+m4; #mass(kg)\n", + "V=v0+(u*math.log(M01/m2)); #final velocity of rocket(km/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V,2),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 79" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 2.8 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mr=40; #mass of rocket(kg)\n", + "mf=360; #mass of fuel(kg)\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "v=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; #velocity(m/sec)\n", + "\n", + "#Calculation\n", + "M=mr+mf; #mass(kg)\n", + "dmbydt=M*g/v; #thrust(kg/sec)\n", + "t=mf/dmbydt; #time taken(sec)\n", + "Vmax=v0+(v*math.log(M/mr))-(g*t); #final velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(Vmax/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust on rocket is 98 kg/sec\n", + "thrust on rocket to give acceleration is 398 kg/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "vr=800; #exhaust velocity(m/sec)\n", + "M=8000; #mass(kg)\n", + "a=30; #acceleration(m/s**2)\n", + "\n", + "#Calculation\n", + "dMbydt=M*g/vr; #thrust on rocket(kg/sec)\n", + "dMbydt1=M*(g+a)/vr; #thrust on rocket to give acceleration(kg/sec)\n", + "\n", + "#Result\n", + "print \"thrust on rocket is\",int(dMbydt),\"kg/sec\"\n", + "print \"thrust on rocket to give acceleration is\",int(dMbydt1),\"kg/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 81" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust acting on rocket is 200 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "urel=10000; #exhaust velocity(m/s)\n", + "dMbydt=0.02; #rate of fuel burnt(kg/sec)\n", + "\n", + "#Calculation\n", + "Freaction=urel*dMbydt; #thrust acting on rocket(N)\n", + "\n", + "#Result\n", + "print \"thrust acting on rocket is\",int(Freaction),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 4.4 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=5000; #mass of rocket(kg)\n", + "mf=40000; #mass of fuel(kg)\n", + "urel=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; \n", + "\n", + "#Calculation\n", + "M0=M+mf; #mass(kg)\n", + "V=v0+(urel*math.log(M0/M)); #maximum velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of nucleus is 0.27 *10**5 m/s\n", + "direction of momentum of nucleus is 150.0 degrees\n", + "kinetic energy is 0.145 *10**-15 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "P1=9.22*10**-21; #momentum(kgm/s)\n", + "P2=5.33*10**-21; #momentum(kgm/s)\n", + "m=3.9*10**-25; #mass of nucleus(kg)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(P1**2+P2**2); #momentum(kgm/s)\n", + "V=P/m; #recoil velocity of nucleus(m/s)\n", + "theta=math.atan(P2/P1); #direction of momentum of nucleus(rad)\n", + "theta=180-(theta*180/math.pi); #direction of momentum of nucleus(degrees) \n", + "K=P**2/(2*m); #kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"recoil velocity of nucleus is\",round(V/10**5,2),\"*10**5 m/s\"\n", + "print \"direction of momentum of nucleus is\",round(theta),\"degrees\"\n", + "print \"kinetic energy is\",round(K*10**15,3),\"*10**-15 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of residual is -2.564 *10**5 m/s\n", + "kinetic energy of residual is 0.068 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "malpha=4; #kinetic energy of alpha particle(MeV)\n", + "mth=234; #mass of thorium(kg)\n", + "valpha=1.5*10**7; #velocity(m/s)\n", + "\n", + "#Calculation\n", + "vth=-malpha*valpha/mth; #recoil velocity of residual(m/s)\n", + "Kalpha=malpha; #kinetic energy of alpha(MeV)\n", + "Kth=malpha*Kalpha/mth; #kinetic energy of residual(MeV)\n", + "\n", + "#Result\n", + "print \"recoil velocity of residual is\",round(vth/10**5,3),\"*10**5 m/s\"\n", + "print \"kinetic energy of residual is\",round(Kth,3),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity before collision is 5.196\n", + "velocity after collision is 5.196\n", + "kinetic energy before collision is 40.5*m\n", + "kinetic energy before collision is 27.0*m\n", + "energy is not conserved\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from sympy import Symbol\n", + "\n", + "#Variable declaration\n", + "u1=9; #velocity(m/sec)\n", + "theta=30*math.pi/180; #scattering angle(rad)\n", + "u2=0; #velocity(m/sec)\n", + "m=Symbol(\"m\");\n", + "\n", + "#Calculation\n", + "v1plusv2=u1/math.cos(theta); \n", + "v1minusv2=u2/math.cos(180-theta); \n", + "v1=(v1plusv2+v1minusv2)/2; #velocity before collision\n", + "v2=(v1plusv2-v1minusv2)/2; #velocity after collisiovelocity after collision isn,v2\n", + "KE1=(m*(u1**2/2))+(m*(u2**2/2)); #kinetic energy before collision\n", + "KE2=((m*v1**2)/2)+((m*v2**2)/2); #kinetic energy before collision\n", + "\n", + "#Result\n", + "print \"velocity before collision is\",round(v1,3)\n", + "print \"velocity after collision is\",round(v2,3)\n", + "print \"kinetic energy before collision is\",KE1\n", + "print \"kinetic energy before collision is\",KE2\n", + "print \"energy is not conserved\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_elIpiT6.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_elIpiT6.ipynb new file mode 100644 index 00000000..68990ae4 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_elIpiT6.ipynb @@ -0,0 +1,532 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2: Mechanics of Particles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 75" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "momentum of electron is 5.37 *10**-19 gm cm/sec\n", + "velocity of truck in 1st case is 12 m/sec\n", + "velocity of truck in 2nd case is 18.97 m/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=9*10**-28; #mass(gram)\n", + "E=100; #kinetic energy(eV)\n", + "e=1.6*10**-12; #kinetic energy(erg)\n", + "mc=4000; #mass of car(kg)\n", + "mt=10000; #mass of truck(kg)\n", + "vc=30; #speed of car(m/s)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(E*e*2*m); #momentum of electron(gm cm/sec)\n", + "vt=mc*vc/mt; #velocity of truck in 1st case(m/sec)\n", + "v1=math.sqrt(mc*vc**2/mt); #velocity of truck in 2nd case(m/sec)\n", + "\n", + "#Result\n", + "print \"momentum of electron is\",round(P*10**19,2),\"*10**-19 gm cm/sec\"\n", + "print \"velocity of truck in 1st case is\",int(vt),\"m/sec\"\n", + "print \"velocity of truck in 2nd case is\",round(v1,2),\"m/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 76" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnitude of velocity is 10 *math.sqrt(2) m/sec\n", + "direction of velocity is 135 degrees or 225 degrees\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=30; #speed(m/sec)\n", + "P1=30; #momentum of 1st part(i)\n", + "P2=30; #momentum of 2nd part(j)\n", + "P3=3; #momentum of 3rd part(v)\n", + "\n", + "#Calculation\n", + "#from conservation of momentum, 30i+30j+3v=0. from which we get v=-10(i+j)\n", + "i=1; #coordinate of i\n", + "j=1; #coordinate of j\n", + "m=math.sqrt(i**2+j**2); #magnitude\n", + "mv=10*m; #magnitude of velocity(m/sec)\n", + "vbar=math.acos(-10/mv); #direction of velocity(rad) \n", + "vbar1=int(vbar*180/math.pi); #direction of velocity(degrees)\n", + "vbar2=360-vbar1; #direction of velocity(degrees) \n", + "\n", + "#Result\n", + "print \"magnitude of velocity is\",int(mv/math.sqrt(2)),\"*math.sqrt(2) m/sec\"\n", + "print \"direction of velocity is\",vbar1,\"degrees or\",vbar2,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 77" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of mass of fuel to empty rocket is 1095\n", + "answer given in the book is wrong\n", + "time is 9.99 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v0=0; #initial velocity of rocket\n", + "vr=1.6; #velocity of gases(km/sec)\n", + "v=11.2; #final velocity(km/sec)\n", + "alphabyM0=1/10; #fuel burnt rate\n", + "\n", + "#Calculation\n", + "#assume x=log(M0/M)\n", + "x=(v-v0)/vr; \n", + "M0byM=math.exp(x); \n", + "MfbyMe=M0byM-1; #ratio of mass of fuel to empty rocket\n", + "t=(1-(1/M0byM))*(1/alphabyM0); #time(sec)\n", + "\n", + "#Result\n", + "print \"ratio of mass of fuel to empty rocket is\",int(MfbyMe)\n", + "print \"answer given in the book is wrong\"\n", + "print \"time is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 7.82 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=300; #mass in 1st stage(kg)\n", + "m2=30; #mass in 2nd stage(kg)\n", + "m3=2400; #fuel filled(kg)\n", + "m4=270; #fuel filled(kg)\n", + "u=2; #velocity(km/sec)\n", + "\n", + "#Calculation\n", + "M0=m1+m2+m3+m4; #mass(kg)\n", + "M=m1+m2+m4; #mass(kg)\n", + "v0=u*math.log(M0/M); #initial velocity of rocket to the second stage(km/sec)\n", + "M01=m2+m4; #mass(kg)\n", + "V=v0+(u*math.log(M01/m2)); #final velocity of rocket(km/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V,2),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 79" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 2.8 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mr=40; #mass of rocket(kg)\n", + "mf=360; #mass of fuel(kg)\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "v=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; #velocity(m/sec)\n", + "\n", + "#Calculation\n", + "M=mr+mf; #mass(kg)\n", + "dmbydt=M*g/v; #thrust(kg/sec)\n", + "t=mf/dmbydt; #time taken(sec)\n", + "Vmax=v0+(v*math.log(M/mr))-(g*t); #final velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(Vmax/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust on rocket is 98 kg/sec\n", + "thrust on rocket to give acceleration is 398 kg/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "vr=800; #exhaust velocity(m/sec)\n", + "M=8000; #mass(kg)\n", + "a=30; #acceleration(m/s**2)\n", + "\n", + "#Calculation\n", + "dMbydt=M*g/vr; #thrust on rocket(kg/sec)\n", + "dMbydt1=M*(g+a)/vr; #thrust on rocket to give acceleration(kg/sec)\n", + "\n", + "#Result\n", + "print \"thrust on rocket is\",int(dMbydt),\"kg/sec\"\n", + "print \"thrust on rocket to give acceleration is\",int(dMbydt1),\"kg/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 81" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust acting on rocket is 200 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "urel=10000; #exhaust velocity(m/s)\n", + "dMbydt=0.02; #rate of fuel burnt(kg/sec)\n", + "\n", + "#Calculation\n", + "Freaction=urel*dMbydt; #thrust acting on rocket(N)\n", + "\n", + "#Result\n", + "print \"thrust acting on rocket is\",int(Freaction),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 4.4 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=5000; #mass of rocket(kg)\n", + "mf=40000; #mass of fuel(kg)\n", + "urel=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; \n", + "\n", + "#Calculation\n", + "M0=M+mf; #mass(kg)\n", + "V=v0+(urel*math.log(M0/M)); #maximum velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of nucleus is 0.27 *10**5 m/s\n", + "direction of momentum of nucleus is 150.0 degrees\n", + "kinetic energy is 0.145 *10**-15 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "P1=9.22*10**-21; #momentum(kgm/s)\n", + "P2=5.33*10**-21; #momentum(kgm/s)\n", + "m=3.9*10**-25; #mass of nucleus(kg)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(P1**2+P2**2); #momentum(kgm/s)\n", + "V=P/m; #recoil velocity of nucleus(m/s)\n", + "theta=math.atan(P2/P1); #direction of momentum of nucleus(rad)\n", + "theta=180-(theta*180/math.pi); #direction of momentum of nucleus(degrees) \n", + "K=P**2/(2*m); #kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"recoil velocity of nucleus is\",round(V/10**5,2),\"*10**5 m/s\"\n", + "print \"direction of momentum of nucleus is\",round(theta),\"degrees\"\n", + "print \"kinetic energy is\",round(K*10**15,3),\"*10**-15 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of residual is -2.564 *10**5 m/s\n", + "kinetic energy of residual is 0.068 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "malpha=4; #kinetic energy of alpha particle(MeV)\n", + "mth=234; #mass of thorium(kg)\n", + "valpha=1.5*10**7; #velocity(m/s)\n", + "\n", + "#Calculation\n", + "vth=-malpha*valpha/mth; #recoil velocity of residual(m/s)\n", + "Kalpha=malpha; #kinetic energy of alpha(MeV)\n", + "Kth=malpha*Kalpha/mth; #kinetic energy of residual(MeV)\n", + "\n", + "#Result\n", + "print \"recoil velocity of residual is\",round(vth/10**5,3),\"*10**5 m/s\"\n", + "print \"kinetic energy of residual is\",round(Kth,3),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity before collision is 5.196\n", + "velocity after collision is 5.196\n", + "kinetic energy before collision is 40.5*m\n", + "kinetic energy before collision is 27.0*m\n", + "energy is not conserved\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from sympy import Symbol\n", + "\n", + "#Variable declaration\n", + "u1=9; #velocity(m/sec)\n", + "theta=30*math.pi/180; #scattering angle(rad)\n", + "u2=0; #velocity(m/sec)\n", + "m=Symbol(\"m\");\n", + "\n", + "#Calculation\n", + "v1plusv2=u1/math.cos(theta); \n", + "v1minusv2=u2/math.cos(180-theta); \n", + "v1=(v1plusv2+v1minusv2)/2; #velocity before collision\n", + "v2=(v1plusv2-v1minusv2)/2; #velocity after collisiovelocity after collision isn,v2\n", + "KE1=(m*(u1**2/2))+(m*(u2**2/2)); #kinetic energy before collision\n", + "KE2=((m*v1**2)/2)+((m*v2**2)/2); #kinetic energy before collision\n", + "\n", + "#Result\n", + "print \"velocity before collision is\",round(v1,3)\n", + "print \"velocity after collision is\",round(v2,3)\n", + "print \"kinetic energy before collision is\",KE1\n", + "print \"kinetic energy before collision is\",KE2\n", + "print \"energy is not conserved\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_svJ0ZRH.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_svJ0ZRH.ipynb new file mode 100644 index 00000000..68990ae4 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_svJ0ZRH.ipynb @@ -0,0 +1,532 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2: Mechanics of Particles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 75" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "momentum of electron is 5.37 *10**-19 gm cm/sec\n", + "velocity of truck in 1st case is 12 m/sec\n", + "velocity of truck in 2nd case is 18.97 m/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=9*10**-28; #mass(gram)\n", + "E=100; #kinetic energy(eV)\n", + "e=1.6*10**-12; #kinetic energy(erg)\n", + "mc=4000; #mass of car(kg)\n", + "mt=10000; #mass of truck(kg)\n", + "vc=30; #speed of car(m/s)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(E*e*2*m); #momentum of electron(gm cm/sec)\n", + "vt=mc*vc/mt; #velocity of truck in 1st case(m/sec)\n", + "v1=math.sqrt(mc*vc**2/mt); #velocity of truck in 2nd case(m/sec)\n", + "\n", + "#Result\n", + "print \"momentum of electron is\",round(P*10**19,2),\"*10**-19 gm cm/sec\"\n", + "print \"velocity of truck in 1st case is\",int(vt),\"m/sec\"\n", + "print \"velocity of truck in 2nd case is\",round(v1,2),\"m/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 76" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnitude of velocity is 10 *math.sqrt(2) m/sec\n", + "direction of velocity is 135 degrees or 225 degrees\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=30; #speed(m/sec)\n", + "P1=30; #momentum of 1st part(i)\n", + "P2=30; #momentum of 2nd part(j)\n", + "P3=3; #momentum of 3rd part(v)\n", + "\n", + "#Calculation\n", + "#from conservation of momentum, 30i+30j+3v=0. from which we get v=-10(i+j)\n", + "i=1; #coordinate of i\n", + "j=1; #coordinate of j\n", + "m=math.sqrt(i**2+j**2); #magnitude\n", + "mv=10*m; #magnitude of velocity(m/sec)\n", + "vbar=math.acos(-10/mv); #direction of velocity(rad) \n", + "vbar1=int(vbar*180/math.pi); #direction of velocity(degrees)\n", + "vbar2=360-vbar1; #direction of velocity(degrees) \n", + "\n", + "#Result\n", + "print \"magnitude of velocity is\",int(mv/math.sqrt(2)),\"*math.sqrt(2) m/sec\"\n", + "print \"direction of velocity is\",vbar1,\"degrees or\",vbar2,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 77" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of mass of fuel to empty rocket is 1095\n", + "answer given in the book is wrong\n", + "time is 9.99 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v0=0; #initial velocity of rocket\n", + "vr=1.6; #velocity of gases(km/sec)\n", + "v=11.2; #final velocity(km/sec)\n", + "alphabyM0=1/10; #fuel burnt rate\n", + "\n", + "#Calculation\n", + "#assume x=log(M0/M)\n", + "x=(v-v0)/vr; \n", + "M0byM=math.exp(x); \n", + "MfbyMe=M0byM-1; #ratio of mass of fuel to empty rocket\n", + "t=(1-(1/M0byM))*(1/alphabyM0); #time(sec)\n", + "\n", + "#Result\n", + "print \"ratio of mass of fuel to empty rocket is\",int(MfbyMe)\n", + "print \"answer given in the book is wrong\"\n", + "print \"time is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 7.82 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=300; #mass in 1st stage(kg)\n", + "m2=30; #mass in 2nd stage(kg)\n", + "m3=2400; #fuel filled(kg)\n", + "m4=270; #fuel filled(kg)\n", + "u=2; #velocity(km/sec)\n", + "\n", + "#Calculation\n", + "M0=m1+m2+m3+m4; #mass(kg)\n", + "M=m1+m2+m4; #mass(kg)\n", + "v0=u*math.log(M0/M); #initial velocity of rocket to the second stage(km/sec)\n", + "M01=m2+m4; #mass(kg)\n", + "V=v0+(u*math.log(M01/m2)); #final velocity of rocket(km/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V,2),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 79" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 2.8 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "mr=40; #mass of rocket(kg)\n", + "mf=360; #mass of fuel(kg)\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "v=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; #velocity(m/sec)\n", + "\n", + "#Calculation\n", + "M=mr+mf; #mass(kg)\n", + "dmbydt=M*g/v; #thrust(kg/sec)\n", + "t=mf/dmbydt; #time taken(sec)\n", + "Vmax=v0+(v*math.log(M/mr))-(g*t); #final velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(Vmax/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust on rocket is 98 kg/sec\n", + "thrust on rocket to give acceleration is 398 kg/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(kg/m**2)\n", + "vr=800; #exhaust velocity(m/sec)\n", + "M=8000; #mass(kg)\n", + "a=30; #acceleration(m/s**2)\n", + "\n", + "#Calculation\n", + "dMbydt=M*g/vr; #thrust on rocket(kg/sec)\n", + "dMbydt1=M*(g+a)/vr; #thrust on rocket to give acceleration(kg/sec)\n", + "\n", + "#Result\n", + "print \"thrust on rocket is\",int(dMbydt),\"kg/sec\"\n", + "print \"thrust on rocket to give acceleration is\",int(dMbydt1),\"kg/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 81" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thrust acting on rocket is 200 N\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "urel=10000; #exhaust velocity(m/s)\n", + "dMbydt=0.02; #rate of fuel burnt(kg/sec)\n", + "\n", + "#Calculation\n", + "Freaction=urel*dMbydt; #thrust acting on rocket(N)\n", + "\n", + "#Result\n", + "print \"thrust acting on rocket is\",int(Freaction),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final velocity of rocket is 4.4 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=5000; #mass of rocket(kg)\n", + "mf=40000; #mass of fuel(kg)\n", + "urel=2*10**3; #exhaust velocity(m/sec)\n", + "v0=0; \n", + "\n", + "#Calculation\n", + "M0=M+mf; #mass(kg)\n", + "V=v0+(urel*math.log(M0/M)); #maximum velocity of rocket(m/sec)\n", + "\n", + "#Result\n", + "print \"final velocity of rocket is\",round(V/10**3,1),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 82" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of nucleus is 0.27 *10**5 m/s\n", + "direction of momentum of nucleus is 150.0 degrees\n", + "kinetic energy is 0.145 *10**-15 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "P1=9.22*10**-21; #momentum(kgm/s)\n", + "P2=5.33*10**-21; #momentum(kgm/s)\n", + "m=3.9*10**-25; #mass of nucleus(kg)\n", + "\n", + "#Calculation\n", + "P=math.sqrt(P1**2+P2**2); #momentum(kgm/s)\n", + "V=P/m; #recoil velocity of nucleus(m/s)\n", + "theta=math.atan(P2/P1); #direction of momentum of nucleus(rad)\n", + "theta=180-(theta*180/math.pi); #direction of momentum of nucleus(degrees) \n", + "K=P**2/(2*m); #kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"recoil velocity of nucleus is\",round(V/10**5,2),\"*10**5 m/s\"\n", + "print \"direction of momentum of nucleus is\",round(theta),\"degrees\"\n", + "print \"kinetic energy is\",round(K*10**15,3),\"*10**-15 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "recoil velocity of residual is -2.564 *10**5 m/s\n", + "kinetic energy of residual is 0.068 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "malpha=4; #kinetic energy of alpha particle(MeV)\n", + "mth=234; #mass of thorium(kg)\n", + "valpha=1.5*10**7; #velocity(m/s)\n", + "\n", + "#Calculation\n", + "vth=-malpha*valpha/mth; #recoil velocity of residual(m/s)\n", + "Kalpha=malpha; #kinetic energy of alpha(MeV)\n", + "Kth=malpha*Kalpha/mth; #kinetic energy of residual(MeV)\n", + "\n", + "#Result\n", + "print \"recoil velocity of residual is\",round(vth/10**5,3),\"*10**5 m/s\"\n", + "print \"kinetic energy of residual is\",round(Kth,3),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 86" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity before collision is 5.196\n", + "velocity after collision is 5.196\n", + "kinetic energy before collision is 40.5*m\n", + "kinetic energy before collision is 27.0*m\n", + "energy is not conserved\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from sympy import Symbol\n", + "\n", + "#Variable declaration\n", + "u1=9; #velocity(m/sec)\n", + "theta=30*math.pi/180; #scattering angle(rad)\n", + "u2=0; #velocity(m/sec)\n", + "m=Symbol(\"m\");\n", + "\n", + "#Calculation\n", + "v1plusv2=u1/math.cos(theta); \n", + "v1minusv2=u2/math.cos(180-theta); \n", + "v1=(v1plusv2+v1minusv2)/2; #velocity before collision\n", + "v2=(v1plusv2-v1minusv2)/2; #velocity after collisiovelocity after collision isn,v2\n", + "KE1=(m*(u1**2/2))+(m*(u2**2/2)); #kinetic energy before collision\n", + "KE2=((m*v1**2)/2)+((m*v2**2)/2); #kinetic energy before collision\n", + "\n", + "#Result\n", + "print \"velocity before collision is\",round(v1,3)\n", + "print \"velocity after collision is\",round(v2,3)\n", + "print \"kinetic energy before collision is\",KE1\n", + "print \"kinetic energy before collision is\",KE2\n", + "print \"energy is not conserved\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_5zdARLq.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_5zdARLq.ipynb new file mode 100644 index 00000000..37d67888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_5zdARLq.ipynb @@ -0,0 +1,425 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3: Rigid Body Dynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia through centre is 5 kg m**2\n", + "moment of inertia through length of rod is 10 kg m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "ma=mb=10; #mass(kg)\n", + "ra1=rb1=0.5; #radius(m)\n", + "ra2=1; #radius(m)\n", + "rb2=0; #radius(m)\n", + " \n", + "#Calculation\n", + "I0=(ma*ra1**2)+(mb*rb1**2); #moment of inertia through centre(kg m**2)\n", + "IA=IB=(ma*ra2**2)+(mb*rb2**2); #moment of inertia through length of rod(kg m**2)\n", + "\n", + "#Result\n", + "print \"moment of inertia through centre is\",int(I0),\"kg m**2\"\n", + "print \"moment of inertia through length of rod is\",IA,\"kg m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 117" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final angular velocity is 3 rev/sec\n", + "increase in kinetic energy 237.0 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I0=6; #initial moment of inertia(Kg m**2)\n", + "omega0=1; #initial angular velocity(rev/sec)\n", + "I=2; #final moment of inertia(Kg m**2)\n", + "\n", + "#Calculation\n", + "omega=I0*omega0/I; #final angular velocity(rev/sec)\n", + "K0=I0*(omega0*2*math.pi)**2/2; #initial kinetic energy(J)\n", + "K=I*(omega*2*math.pi)**2/2; #final kinetic energy(J)\n", + "deltaK=K-K0; #increase in kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"final angular velocity is\",int(omega),\"rev/sec\"\n", + "print \"increase in kinetic energy\",round(deltaK),\"J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 2 rad/sec in clockwise direction\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I=5*10**-4; #moment of inertia(Kg m**2)\n", + "omega=30*2*math.pi; #angular velocity(rad/sec)\n", + "m=0.5; #mass(Kg) \n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "r=0.04; #radius(m)\n", + "\n", + "#Calculation\n", + "J=I*omega; #angular momentum(Kg m**2/sec)\n", + "tow=m*g*r; #torque(Nm)\n", + "omegap=tow/J; #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap),\"rad/sec in clockwise direction\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "common speed is 250 revolutions/min\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I1=I2=1; #assume\n", + "omega1=500; #angular velocity(rev/min)\n", + "omega2=0; #angular velocity(rev/min)\n", + "\n", + "#Calculation\n", + "omega=((I1*omega1)+(I2*omega2))/(I1+I2); #common speed(revolutions/minute)\n", + "\n", + "#Result\n", + "print \"common speed is\",int(omega),\"revolutions/min\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 119" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 12.19 rad/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=50; #mass of sphere(g)\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=0.02; #radius(m)\n", + "l=0.005; #length(m)\n", + "n=20; #number of revolutions\n", + "\n", + "#Calculation\n", + "I=2*M*r**2/5; #moment of inertia of sphere(kg m**2)\n", + "L=r+l; #distance from pivot(m)\n", + "omega=n*2*math.pi; #angular velocity(rad/sec)\n", + "omegap=M*g*L*100/(I*10**4*omega); #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,2),\"rad/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia of ring is 1 *10**4 gram cm**2\n", + "angular momentum is 6.28 *10**5 erg sec\n", + "torque is 1 *10**4 dyne cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=100; #mass(gm)\n", + "R=10; #radius(cm)\n", + "omega=10*2*math.pi; #angular velocity(rad/sec)\n", + "t=10; #time(sec)\n", + "\n", + "#Calculation\n", + "I=M*R**2; #moment of inertia of ring(gram cm**2)\n", + "L=I*omega; #angular momentum(erg sec)\n", + "tow=L/(2*math.pi*t); #torque(dyne cm)\n", + "\n", + "#Result\n", + "print \"moment of inertia of ring is\",int(I/10**4),\"*10**4 gram cm**2\"\n", + "print \"angular momentum is\",round(L/10**5,2),\"*10**5 erg sec\"\n", + "print \"torque is\",int(tow/10**4),\"*10**4 dyne cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 1.2 radians/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=5; #radius(cm)\n", + "k=6; #radius of gyration(cm)\n", + "omega=2*math.pi*18; #angular velocity(revolutions/sec)\n", + "\n", + "#Calculation\n", + "omegap=g*r/(k**2*omega); #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,1),\"radians/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 128" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torque acting on it is ( 9.6 i -7.2 j+ 0.0 k)*10**-4 Nm\n", + "rate of change of kinetic energy is 0\n", + "hence kinetic energy is constant\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=0.1; #mass(kg)\n", + "R=0.04; #radius(m)\n", + "#omega=3i+4j+6k\n", + "omegax=3; #angular velocity(rad/s)\n", + "omegay=4; #angular velocity(rad/s)\n", + "omegaz=6; #angular velocity(rad/s)\n", + "domegaxbydt=domegaybydt=domegazbydt=0;\n", + "\n", + "#Calculation\n", + "Ixx=M*R**2/4; #principal inertia element(kg m**2)\n", + "Iyy=M*R**2/4; #principal inertia element(kg m**2)\n", + "Izz=M*R**2/2; #principal inertia element(kg m**2)\n", + "towx=(omegax*domegaxbydt)+(omegay*omegaz*(Izz-Iyy)); #torque on x(Nm)\n", + "towy=(omegay*domegaybydt)+(omegaz*omegax*(Ixx-Izz)); #torque on y(Nm)\n", + "towz=(omegaz*domegazbydt)+(omegax*omegay*(Iyy-Ixx)); #torque on x(Nm)\n", + "dTbydt=(omegax*towx)+(omegay*towy)+(omegaz*towz); #rate of change of kinetic energy\n", + "\n", + "#Result\n", + "print \"torque acting on it is (\",towx*10**4,\"i\",towy*10**4,\"j+\",towz,\"k)*10**-4 Nm\"\n", + "print \"rate of change of kinetic energy is\",int(dTbydt)\n", + "print \"hence kinetic energy is constant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 40 *math.pi rad/sec or 20 revolutions/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=1; #assume\n", + "R=1; #assume\n", + "omega=20*2*math.pi; #angular velocity(rad/sec)\n", + "\n", + "#Calculation\n", + "Ixx=Iyy=M*R**2/4; #moment of inertia about diametrical axis\n", + "Izz=M*R**2/2; #moment of inertia about axis normal to plane\n", + "omegap=(Izz-Ixx)*omega/Ixx; #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap/math.pi),\"*math.pi rad/sec or\",int(omegap/(2*math.pi)),\"revolutions/sec\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_ByttvTe.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_ByttvTe.ipynb new file mode 100644 index 00000000..37d67888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_ByttvTe.ipynb @@ -0,0 +1,425 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3: Rigid Body Dynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia through centre is 5 kg m**2\n", + "moment of inertia through length of rod is 10 kg m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "ma=mb=10; #mass(kg)\n", + "ra1=rb1=0.5; #radius(m)\n", + "ra2=1; #radius(m)\n", + "rb2=0; #radius(m)\n", + " \n", + "#Calculation\n", + "I0=(ma*ra1**2)+(mb*rb1**2); #moment of inertia through centre(kg m**2)\n", + "IA=IB=(ma*ra2**2)+(mb*rb2**2); #moment of inertia through length of rod(kg m**2)\n", + "\n", + "#Result\n", + "print \"moment of inertia through centre is\",int(I0),\"kg m**2\"\n", + "print \"moment of inertia through length of rod is\",IA,\"kg m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 117" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final angular velocity is 3 rev/sec\n", + "increase in kinetic energy 237.0 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I0=6; #initial moment of inertia(Kg m**2)\n", + "omega0=1; #initial angular velocity(rev/sec)\n", + "I=2; #final moment of inertia(Kg m**2)\n", + "\n", + "#Calculation\n", + "omega=I0*omega0/I; #final angular velocity(rev/sec)\n", + "K0=I0*(omega0*2*math.pi)**2/2; #initial kinetic energy(J)\n", + "K=I*(omega*2*math.pi)**2/2; #final kinetic energy(J)\n", + "deltaK=K-K0; #increase in kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"final angular velocity is\",int(omega),\"rev/sec\"\n", + "print \"increase in kinetic energy\",round(deltaK),\"J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 2 rad/sec in clockwise direction\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I=5*10**-4; #moment of inertia(Kg m**2)\n", + "omega=30*2*math.pi; #angular velocity(rad/sec)\n", + "m=0.5; #mass(Kg) \n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "r=0.04; #radius(m)\n", + "\n", + "#Calculation\n", + "J=I*omega; #angular momentum(Kg m**2/sec)\n", + "tow=m*g*r; #torque(Nm)\n", + "omegap=tow/J; #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap),\"rad/sec in clockwise direction\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "common speed is 250 revolutions/min\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I1=I2=1; #assume\n", + "omega1=500; #angular velocity(rev/min)\n", + "omega2=0; #angular velocity(rev/min)\n", + "\n", + "#Calculation\n", + "omega=((I1*omega1)+(I2*omega2))/(I1+I2); #common speed(revolutions/minute)\n", + "\n", + "#Result\n", + "print \"common speed is\",int(omega),\"revolutions/min\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 119" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 12.19 rad/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=50; #mass of sphere(g)\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=0.02; #radius(m)\n", + "l=0.005; #length(m)\n", + "n=20; #number of revolutions\n", + "\n", + "#Calculation\n", + "I=2*M*r**2/5; #moment of inertia of sphere(kg m**2)\n", + "L=r+l; #distance from pivot(m)\n", + "omega=n*2*math.pi; #angular velocity(rad/sec)\n", + "omegap=M*g*L*100/(I*10**4*omega); #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,2),\"rad/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia of ring is 1 *10**4 gram cm**2\n", + "angular momentum is 6.28 *10**5 erg sec\n", + "torque is 1 *10**4 dyne cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=100; #mass(gm)\n", + "R=10; #radius(cm)\n", + "omega=10*2*math.pi; #angular velocity(rad/sec)\n", + "t=10; #time(sec)\n", + "\n", + "#Calculation\n", + "I=M*R**2; #moment of inertia of ring(gram cm**2)\n", + "L=I*omega; #angular momentum(erg sec)\n", + "tow=L/(2*math.pi*t); #torque(dyne cm)\n", + "\n", + "#Result\n", + "print \"moment of inertia of ring is\",int(I/10**4),\"*10**4 gram cm**2\"\n", + "print \"angular momentum is\",round(L/10**5,2),\"*10**5 erg sec\"\n", + "print \"torque is\",int(tow/10**4),\"*10**4 dyne cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 1.2 radians/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=5; #radius(cm)\n", + "k=6; #radius of gyration(cm)\n", + "omega=2*math.pi*18; #angular velocity(revolutions/sec)\n", + "\n", + "#Calculation\n", + "omegap=g*r/(k**2*omega); #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,1),\"radians/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 128" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torque acting on it is ( 9.6 i -7.2 j+ 0.0 k)*10**-4 Nm\n", + "rate of change of kinetic energy is 0\n", + "hence kinetic energy is constant\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=0.1; #mass(kg)\n", + "R=0.04; #radius(m)\n", + "#omega=3i+4j+6k\n", + "omegax=3; #angular velocity(rad/s)\n", + "omegay=4; #angular velocity(rad/s)\n", + "omegaz=6; #angular velocity(rad/s)\n", + "domegaxbydt=domegaybydt=domegazbydt=0;\n", + "\n", + "#Calculation\n", + "Ixx=M*R**2/4; #principal inertia element(kg m**2)\n", + "Iyy=M*R**2/4; #principal inertia element(kg m**2)\n", + "Izz=M*R**2/2; #principal inertia element(kg m**2)\n", + "towx=(omegax*domegaxbydt)+(omegay*omegaz*(Izz-Iyy)); #torque on x(Nm)\n", + "towy=(omegay*domegaybydt)+(omegaz*omegax*(Ixx-Izz)); #torque on y(Nm)\n", + "towz=(omegaz*domegazbydt)+(omegax*omegay*(Iyy-Ixx)); #torque on x(Nm)\n", + "dTbydt=(omegax*towx)+(omegay*towy)+(omegaz*towz); #rate of change of kinetic energy\n", + "\n", + "#Result\n", + "print \"torque acting on it is (\",towx*10**4,\"i\",towy*10**4,\"j+\",towz,\"k)*10**-4 Nm\"\n", + "print \"rate of change of kinetic energy is\",int(dTbydt)\n", + "print \"hence kinetic energy is constant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 40 *math.pi rad/sec or 20 revolutions/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=1; #assume\n", + "R=1; #assume\n", + "omega=20*2*math.pi; #angular velocity(rad/sec)\n", + "\n", + "#Calculation\n", + "Ixx=Iyy=M*R**2/4; #moment of inertia about diametrical axis\n", + "Izz=M*R**2/2; #moment of inertia about axis normal to plane\n", + "omegap=(Izz-Ixx)*omega/Ixx; #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap/math.pi),\"*math.pi rad/sec or\",int(omegap/(2*math.pi)),\"revolutions/sec\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_fzQxngT.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_fzQxngT.ipynb new file mode 100644 index 00000000..37d67888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_fzQxngT.ipynb @@ -0,0 +1,425 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3: Rigid Body Dynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia through centre is 5 kg m**2\n", + "moment of inertia through length of rod is 10 kg m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "ma=mb=10; #mass(kg)\n", + "ra1=rb1=0.5; #radius(m)\n", + "ra2=1; #radius(m)\n", + "rb2=0; #radius(m)\n", + " \n", + "#Calculation\n", + "I0=(ma*ra1**2)+(mb*rb1**2); #moment of inertia through centre(kg m**2)\n", + "IA=IB=(ma*ra2**2)+(mb*rb2**2); #moment of inertia through length of rod(kg m**2)\n", + "\n", + "#Result\n", + "print \"moment of inertia through centre is\",int(I0),\"kg m**2\"\n", + "print \"moment of inertia through length of rod is\",IA,\"kg m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 117" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final angular velocity is 3 rev/sec\n", + "increase in kinetic energy 237.0 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I0=6; #initial moment of inertia(Kg m**2)\n", + "omega0=1; #initial angular velocity(rev/sec)\n", + "I=2; #final moment of inertia(Kg m**2)\n", + "\n", + "#Calculation\n", + "omega=I0*omega0/I; #final angular velocity(rev/sec)\n", + "K0=I0*(omega0*2*math.pi)**2/2; #initial kinetic energy(J)\n", + "K=I*(omega*2*math.pi)**2/2; #final kinetic energy(J)\n", + "deltaK=K-K0; #increase in kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"final angular velocity is\",int(omega),\"rev/sec\"\n", + "print \"increase in kinetic energy\",round(deltaK),\"J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 2 rad/sec in clockwise direction\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I=5*10**-4; #moment of inertia(Kg m**2)\n", + "omega=30*2*math.pi; #angular velocity(rad/sec)\n", + "m=0.5; #mass(Kg) \n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "r=0.04; #radius(m)\n", + "\n", + "#Calculation\n", + "J=I*omega; #angular momentum(Kg m**2/sec)\n", + "tow=m*g*r; #torque(Nm)\n", + "omegap=tow/J; #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap),\"rad/sec in clockwise direction\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "common speed is 250 revolutions/min\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I1=I2=1; #assume\n", + "omega1=500; #angular velocity(rev/min)\n", + "omega2=0; #angular velocity(rev/min)\n", + "\n", + "#Calculation\n", + "omega=((I1*omega1)+(I2*omega2))/(I1+I2); #common speed(revolutions/minute)\n", + "\n", + "#Result\n", + "print \"common speed is\",int(omega),\"revolutions/min\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 119" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 12.19 rad/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=50; #mass of sphere(g)\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=0.02; #radius(m)\n", + "l=0.005; #length(m)\n", + "n=20; #number of revolutions\n", + "\n", + "#Calculation\n", + "I=2*M*r**2/5; #moment of inertia of sphere(kg m**2)\n", + "L=r+l; #distance from pivot(m)\n", + "omega=n*2*math.pi; #angular velocity(rad/sec)\n", + "omegap=M*g*L*100/(I*10**4*omega); #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,2),\"rad/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia of ring is 1 *10**4 gram cm**2\n", + "angular momentum is 6.28 *10**5 erg sec\n", + "torque is 1 *10**4 dyne cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=100; #mass(gm)\n", + "R=10; #radius(cm)\n", + "omega=10*2*math.pi; #angular velocity(rad/sec)\n", + "t=10; #time(sec)\n", + "\n", + "#Calculation\n", + "I=M*R**2; #moment of inertia of ring(gram cm**2)\n", + "L=I*omega; #angular momentum(erg sec)\n", + "tow=L/(2*math.pi*t); #torque(dyne cm)\n", + "\n", + "#Result\n", + "print \"moment of inertia of ring is\",int(I/10**4),\"*10**4 gram cm**2\"\n", + "print \"angular momentum is\",round(L/10**5,2),\"*10**5 erg sec\"\n", + "print \"torque is\",int(tow/10**4),\"*10**4 dyne cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 1.2 radians/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=5; #radius(cm)\n", + "k=6; #radius of gyration(cm)\n", + "omega=2*math.pi*18; #angular velocity(revolutions/sec)\n", + "\n", + "#Calculation\n", + "omegap=g*r/(k**2*omega); #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,1),\"radians/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 128" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torque acting on it is ( 9.6 i -7.2 j+ 0.0 k)*10**-4 Nm\n", + "rate of change of kinetic energy is 0\n", + "hence kinetic energy is constant\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=0.1; #mass(kg)\n", + "R=0.04; #radius(m)\n", + "#omega=3i+4j+6k\n", + "omegax=3; #angular velocity(rad/s)\n", + "omegay=4; #angular velocity(rad/s)\n", + "omegaz=6; #angular velocity(rad/s)\n", + "domegaxbydt=domegaybydt=domegazbydt=0;\n", + "\n", + "#Calculation\n", + "Ixx=M*R**2/4; #principal inertia element(kg m**2)\n", + "Iyy=M*R**2/4; #principal inertia element(kg m**2)\n", + "Izz=M*R**2/2; #principal inertia element(kg m**2)\n", + "towx=(omegax*domegaxbydt)+(omegay*omegaz*(Izz-Iyy)); #torque on x(Nm)\n", + "towy=(omegay*domegaybydt)+(omegaz*omegax*(Ixx-Izz)); #torque on y(Nm)\n", + "towz=(omegaz*domegazbydt)+(omegax*omegay*(Iyy-Ixx)); #torque on x(Nm)\n", + "dTbydt=(omegax*towx)+(omegay*towy)+(omegaz*towz); #rate of change of kinetic energy\n", + "\n", + "#Result\n", + "print \"torque acting on it is (\",towx*10**4,\"i\",towy*10**4,\"j+\",towz,\"k)*10**-4 Nm\"\n", + "print \"rate of change of kinetic energy is\",int(dTbydt)\n", + "print \"hence kinetic energy is constant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 40 *math.pi rad/sec or 20 revolutions/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=1; #assume\n", + "R=1; #assume\n", + "omega=20*2*math.pi; #angular velocity(rad/sec)\n", + "\n", + "#Calculation\n", + "Ixx=Iyy=M*R**2/4; #moment of inertia about diametrical axis\n", + "Izz=M*R**2/2; #moment of inertia about axis normal to plane\n", + "omegap=(Izz-Ixx)*omega/Ixx; #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap/math.pi),\"*math.pi rad/sec or\",int(omegap/(2*math.pi)),\"revolutions/sec\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_maz8Mpx.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_maz8Mpx.ipynb new file mode 100644 index 00000000..37d67888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_maz8Mpx.ipynb @@ -0,0 +1,425 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3: Rigid Body Dynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia through centre is 5 kg m**2\n", + "moment of inertia through length of rod is 10 kg m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "ma=mb=10; #mass(kg)\n", + "ra1=rb1=0.5; #radius(m)\n", + "ra2=1; #radius(m)\n", + "rb2=0; #radius(m)\n", + " \n", + "#Calculation\n", + "I0=(ma*ra1**2)+(mb*rb1**2); #moment of inertia through centre(kg m**2)\n", + "IA=IB=(ma*ra2**2)+(mb*rb2**2); #moment of inertia through length of rod(kg m**2)\n", + "\n", + "#Result\n", + "print \"moment of inertia through centre is\",int(I0),\"kg m**2\"\n", + "print \"moment of inertia through length of rod is\",IA,\"kg m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 117" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final angular velocity is 3 rev/sec\n", + "increase in kinetic energy 237.0 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I0=6; #initial moment of inertia(Kg m**2)\n", + "omega0=1; #initial angular velocity(rev/sec)\n", + "I=2; #final moment of inertia(Kg m**2)\n", + "\n", + "#Calculation\n", + "omega=I0*omega0/I; #final angular velocity(rev/sec)\n", + "K0=I0*(omega0*2*math.pi)**2/2; #initial kinetic energy(J)\n", + "K=I*(omega*2*math.pi)**2/2; #final kinetic energy(J)\n", + "deltaK=K-K0; #increase in kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"final angular velocity is\",int(omega),\"rev/sec\"\n", + "print \"increase in kinetic energy\",round(deltaK),\"J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 2 rad/sec in clockwise direction\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I=5*10**-4; #moment of inertia(Kg m**2)\n", + "omega=30*2*math.pi; #angular velocity(rad/sec)\n", + "m=0.5; #mass(Kg) \n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "r=0.04; #radius(m)\n", + "\n", + "#Calculation\n", + "J=I*omega; #angular momentum(Kg m**2/sec)\n", + "tow=m*g*r; #torque(Nm)\n", + "omegap=tow/J; #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap),\"rad/sec in clockwise direction\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "common speed is 250 revolutions/min\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I1=I2=1; #assume\n", + "omega1=500; #angular velocity(rev/min)\n", + "omega2=0; #angular velocity(rev/min)\n", + "\n", + "#Calculation\n", + "omega=((I1*omega1)+(I2*omega2))/(I1+I2); #common speed(revolutions/minute)\n", + "\n", + "#Result\n", + "print \"common speed is\",int(omega),\"revolutions/min\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 119" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 12.19 rad/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=50; #mass of sphere(g)\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=0.02; #radius(m)\n", + "l=0.005; #length(m)\n", + "n=20; #number of revolutions\n", + "\n", + "#Calculation\n", + "I=2*M*r**2/5; #moment of inertia of sphere(kg m**2)\n", + "L=r+l; #distance from pivot(m)\n", + "omega=n*2*math.pi; #angular velocity(rad/sec)\n", + "omegap=M*g*L*100/(I*10**4*omega); #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,2),\"rad/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia of ring is 1 *10**4 gram cm**2\n", + "angular momentum is 6.28 *10**5 erg sec\n", + "torque is 1 *10**4 dyne cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=100; #mass(gm)\n", + "R=10; #radius(cm)\n", + "omega=10*2*math.pi; #angular velocity(rad/sec)\n", + "t=10; #time(sec)\n", + "\n", + "#Calculation\n", + "I=M*R**2; #moment of inertia of ring(gram cm**2)\n", + "L=I*omega; #angular momentum(erg sec)\n", + "tow=L/(2*math.pi*t); #torque(dyne cm)\n", + "\n", + "#Result\n", + "print \"moment of inertia of ring is\",int(I/10**4),\"*10**4 gram cm**2\"\n", + "print \"angular momentum is\",round(L/10**5,2),\"*10**5 erg sec\"\n", + "print \"torque is\",int(tow/10**4),\"*10**4 dyne cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 1.2 radians/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=5; #radius(cm)\n", + "k=6; #radius of gyration(cm)\n", + "omega=2*math.pi*18; #angular velocity(revolutions/sec)\n", + "\n", + "#Calculation\n", + "omegap=g*r/(k**2*omega); #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,1),\"radians/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 128" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torque acting on it is ( 9.6 i -7.2 j+ 0.0 k)*10**-4 Nm\n", + "rate of change of kinetic energy is 0\n", + "hence kinetic energy is constant\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=0.1; #mass(kg)\n", + "R=0.04; #radius(m)\n", + "#omega=3i+4j+6k\n", + "omegax=3; #angular velocity(rad/s)\n", + "omegay=4; #angular velocity(rad/s)\n", + "omegaz=6; #angular velocity(rad/s)\n", + "domegaxbydt=domegaybydt=domegazbydt=0;\n", + "\n", + "#Calculation\n", + "Ixx=M*R**2/4; #principal inertia element(kg m**2)\n", + "Iyy=M*R**2/4; #principal inertia element(kg m**2)\n", + "Izz=M*R**2/2; #principal inertia element(kg m**2)\n", + "towx=(omegax*domegaxbydt)+(omegay*omegaz*(Izz-Iyy)); #torque on x(Nm)\n", + "towy=(omegay*domegaybydt)+(omegaz*omegax*(Ixx-Izz)); #torque on y(Nm)\n", + "towz=(omegaz*domegazbydt)+(omegax*omegay*(Iyy-Ixx)); #torque on x(Nm)\n", + "dTbydt=(omegax*towx)+(omegay*towy)+(omegaz*towz); #rate of change of kinetic energy\n", + "\n", + "#Result\n", + "print \"torque acting on it is (\",towx*10**4,\"i\",towy*10**4,\"j+\",towz,\"k)*10**-4 Nm\"\n", + "print \"rate of change of kinetic energy is\",int(dTbydt)\n", + "print \"hence kinetic energy is constant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 40 *math.pi rad/sec or 20 revolutions/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=1; #assume\n", + "R=1; #assume\n", + "omega=20*2*math.pi; #angular velocity(rad/sec)\n", + "\n", + "#Calculation\n", + "Ixx=Iyy=M*R**2/4; #moment of inertia about diametrical axis\n", + "Izz=M*R**2/2; #moment of inertia about axis normal to plane\n", + "omegap=(Izz-Ixx)*omega/Ixx; #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap/math.pi),\"*math.pi rad/sec or\",int(omegap/(2*math.pi)),\"revolutions/sec\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_yrs8aD8.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_yrs8aD8.ipynb new file mode 100644 index 00000000..37d67888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_yrs8aD8.ipynb @@ -0,0 +1,425 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3: Rigid Body Dynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia through centre is 5 kg m**2\n", + "moment of inertia through length of rod is 10 kg m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "ma=mb=10; #mass(kg)\n", + "ra1=rb1=0.5; #radius(m)\n", + "ra2=1; #radius(m)\n", + "rb2=0; #radius(m)\n", + " \n", + "#Calculation\n", + "I0=(ma*ra1**2)+(mb*rb1**2); #moment of inertia through centre(kg m**2)\n", + "IA=IB=(ma*ra2**2)+(mb*rb2**2); #moment of inertia through length of rod(kg m**2)\n", + "\n", + "#Result\n", + "print \"moment of inertia through centre is\",int(I0),\"kg m**2\"\n", + "print \"moment of inertia through length of rod is\",IA,\"kg m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 117" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final angular velocity is 3 rev/sec\n", + "increase in kinetic energy 237.0 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I0=6; #initial moment of inertia(Kg m**2)\n", + "omega0=1; #initial angular velocity(rev/sec)\n", + "I=2; #final moment of inertia(Kg m**2)\n", + "\n", + "#Calculation\n", + "omega=I0*omega0/I; #final angular velocity(rev/sec)\n", + "K0=I0*(omega0*2*math.pi)**2/2; #initial kinetic energy(J)\n", + "K=I*(omega*2*math.pi)**2/2; #final kinetic energy(J)\n", + "deltaK=K-K0; #increase in kinetic energy(J)\n", + "\n", + "#Result\n", + "print \"final angular velocity is\",int(omega),\"rev/sec\"\n", + "print \"increase in kinetic energy\",round(deltaK),\"J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 2 rad/sec in clockwise direction\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I=5*10**-4; #moment of inertia(Kg m**2)\n", + "omega=30*2*math.pi; #angular velocity(rad/sec)\n", + "m=0.5; #mass(Kg) \n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "r=0.04; #radius(m)\n", + "\n", + "#Calculation\n", + "J=I*omega; #angular momentum(Kg m**2/sec)\n", + "tow=m*g*r; #torque(Nm)\n", + "omegap=tow/J; #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap),\"rad/sec in clockwise direction\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "common speed is 250 revolutions/min\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "I1=I2=1; #assume\n", + "omega1=500; #angular velocity(rev/min)\n", + "omega2=0; #angular velocity(rev/min)\n", + "\n", + "#Calculation\n", + "omega=((I1*omega1)+(I2*omega2))/(I1+I2); #common speed(revolutions/minute)\n", + "\n", + "#Result\n", + "print \"common speed is\",int(omega),\"revolutions/min\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 119" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 12.19 rad/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=50; #mass of sphere(g)\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=0.02; #radius(m)\n", + "l=0.005; #length(m)\n", + "n=20; #number of revolutions\n", + "\n", + "#Calculation\n", + "I=2*M*r**2/5; #moment of inertia of sphere(kg m**2)\n", + "L=r+l; #distance from pivot(m)\n", + "omega=n*2*math.pi; #angular velocity(rad/sec)\n", + "omegap=M*g*L*100/(I*10**4*omega); #precessional angular velocity(rad/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,2),\"rad/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "moment of inertia of ring is 1 *10**4 gram cm**2\n", + "angular momentum is 6.28 *10**5 erg sec\n", + "torque is 1 *10**4 dyne cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=100; #mass(gm)\n", + "R=10; #radius(cm)\n", + "omega=10*2*math.pi; #angular velocity(rad/sec)\n", + "t=10; #time(sec)\n", + "\n", + "#Calculation\n", + "I=M*R**2; #moment of inertia of ring(gram cm**2)\n", + "L=I*omega; #angular momentum(erg sec)\n", + "tow=L/(2*math.pi*t); #torque(dyne cm)\n", + "\n", + "#Result\n", + "print \"moment of inertia of ring is\",int(I/10**4),\"*10**4 gram cm**2\"\n", + "print \"angular momentum is\",round(L/10**5,2),\"*10**5 erg sec\"\n", + "print \"torque is\",int(tow/10**4),\"*10**4 dyne cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 120" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 1.2 radians/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=980; #acceleration due to gravity(gm/sec**2)\n", + "r=5; #radius(cm)\n", + "k=6; #radius of gyration(cm)\n", + "omega=2*math.pi*18; #angular velocity(revolutions/sec)\n", + "\n", + "#Calculation\n", + "omegap=g*r/(k**2*omega); #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",round(omegap,1),\"radians/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 128" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torque acting on it is ( 9.6 i -7.2 j+ 0.0 k)*10**-4 Nm\n", + "rate of change of kinetic energy is 0\n", + "hence kinetic energy is constant\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=0.1; #mass(kg)\n", + "R=0.04; #radius(m)\n", + "#omega=3i+4j+6k\n", + "omegax=3; #angular velocity(rad/s)\n", + "omegay=4; #angular velocity(rad/s)\n", + "omegaz=6; #angular velocity(rad/s)\n", + "domegaxbydt=domegaybydt=domegazbydt=0;\n", + "\n", + "#Calculation\n", + "Ixx=M*R**2/4; #principal inertia element(kg m**2)\n", + "Iyy=M*R**2/4; #principal inertia element(kg m**2)\n", + "Izz=M*R**2/2; #principal inertia element(kg m**2)\n", + "towx=(omegax*domegaxbydt)+(omegay*omegaz*(Izz-Iyy)); #torque on x(Nm)\n", + "towy=(omegay*domegaybydt)+(omegaz*omegax*(Ixx-Izz)); #torque on y(Nm)\n", + "towz=(omegaz*domegazbydt)+(omegax*omegay*(Iyy-Ixx)); #torque on x(Nm)\n", + "dTbydt=(omegax*towx)+(omegay*towy)+(omegaz*towz); #rate of change of kinetic energy\n", + "\n", + "#Result\n", + "print \"torque acting on it is (\",towx*10**4,\"i\",towy*10**4,\"j+\",towz,\"k)*10**-4 Nm\"\n", + "print \"rate of change of kinetic energy is\",int(dTbydt)\n", + "print \"hence kinetic energy is constant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "precessional angular velocity is 40 *math.pi rad/sec or 20 revolutions/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "M=1; #assume\n", + "R=1; #assume\n", + "omega=20*2*math.pi; #angular velocity(rad/sec)\n", + "\n", + "#Calculation\n", + "Ixx=Iyy=M*R**2/4; #moment of inertia about diametrical axis\n", + "Izz=M*R**2/2; #moment of inertia about axis normal to plane\n", + "omegap=(Izz-Ixx)*omega/Ixx; #precessional angular velocity(radians/sec)\n", + "\n", + "#Result\n", + "print \"precessional angular velocity is\",int(omegap/math.pi),\"*math.pi rad/sec or\",int(omegap/(2*math.pi)),\"revolutions/sec\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_Cj6lfrp.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_Cj6lfrp.ipynb new file mode 100644 index 00000000..d7a5d585 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_Cj6lfrp.ipynb @@ -0,0 +1,446 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4: Mechanics of Continuous Media" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 4.7 *10**12 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "F=1200*9.8; #tensile force(N)\n", + "A=0.025*10**-4; #area(m**2)\n", + "delta_l=0.003; #extension(m)\n", + "l=3; #length(m)\n", + "\n", + "#Calculation\n", + "Y=F*l/(A*delta_l); #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**12,1),\"*10**12 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "volume occupied at 25atm is 3499 cm**3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=3500; #volume(cm**3)\n", + "K=10*10**11; #bulk modulus(dyne/cm**2)\n", + "p=24*76*13.6*980; #change in pressure(dyne/cm**2)\n", + "\n", + "#Calculation\n", + "delta_v=p*v/K; #volume occupied(cm**3)\n", + "V=v-delta_v; #volume occupied at 25atm(cm**3)\n", + "\n", + "#Result\n", + "print \"volume occupied at 25atm is\",int(V),\"cm**3\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "eta=1; #assume\n", + "Y=2.5*eta; #youngs modulus\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bulk modulus is 1 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.1; #side of cube(m)\n", + "p=10**6; #static pressure(pa)\n", + "delta_v=10**-8; #change in volume(m**3)\n", + "\n", + "#Calculation\n", + "v=l**3; #volume of cube(m**3)\n", + "K=p*v/delta_v; #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"bulk modulus is\",int(K/10**11),\"*10**11 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n", + "bulk modulus is 1.33 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=2*10**11; #youngs modulus(N/m**2)\n", + "eta=8*10**10; #rigidity modulus(N/m**2)\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "K=Y/(3*(1-2*sigma)); #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma\n", + "print \"bulk modulus is\",round(K/10**11,2),\"*10**11 N/m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "increase in temperature is 0.01653 K\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "A=2*10**-6; #area(m**2)\n", + "e=5*10**-3; #elongation(m)\n", + "rho=9000; #density(Kg/m**3)\n", + "C=4200; #specific heat(J/Kg/K)\n", + "F=1000; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "W=F*e*v/(2*A*l); #work done(J)\n", + "m=rho*v; #mass(kg)\n", + "delta_t=W/(m*C); #increase in temperature(K)\n", + "\n", + "#Result\n", + "print \"increase in temperature is\",round(delta_t,5),\"K\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "potential energy is 1.125 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=3; #length(m)\n", + "A=2.5*10**-6; #area(m**2)\n", + "e=3*10**-3; #elongation(m)\n", + "F=750; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "E=F*e*v/(2*A*l); #potential energy(J)\n", + "\n", + "#Result\n", + "print \"potential energy is\",E,\"J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression of the rod from fixed end is 0.00648 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=0.5; #length(m)\n", + "x=0.5; #depression(m)\n", + "y=15*10**-3; #depression(m)\n", + "x1=0.3; #depression(m)\n", + "\n", + "#Calculation\n", + "A=(L*x**2/2)-(x**3/6); \n", + "y1=y*((L*x1**2/2)-(x1**3/6))/A; #depression of the rod from fixed end(m)\n", + "\n", + "#Result\n", + "print \"depression of the rod from fixed end is\",y1,\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "deformation strain is 0.24\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=0.4; #radius(cm)\n", + "l=100; #length(cm)\n", + "phi=60; #twisting angle(degree)\n", + "\n", + "#Calculation\n", + "theta=r*phi/l #deformation strain\n", + "\n", + "#Result\n", + "print \"deformation strain is\",theta" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression at the mid point is 8.124 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.1; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "L=1; #length(m)\n", + "Y=10**10; #youngs modulus(N/m**2)\n", + "r=0.02; #radius of wire(m)\n", + "\n", + "#Calculation\n", + "y1=5*m*g*L**3/(12*Y*math.pi*r**4); #depression at the mid point(m)\n", + "\n", + "#Result\n", + "print \"depression at the mid point is\",round(y1*10**5,3),\"*10**-5 m\"\n", + "print \"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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_dkmYc9u.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_dkmYc9u.ipynb new file mode 100644 index 00000000..d7a5d585 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_dkmYc9u.ipynb @@ -0,0 +1,446 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4: Mechanics of Continuous Media" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 4.7 *10**12 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "F=1200*9.8; #tensile force(N)\n", + "A=0.025*10**-4; #area(m**2)\n", + "delta_l=0.003; #extension(m)\n", + "l=3; #length(m)\n", + "\n", + "#Calculation\n", + "Y=F*l/(A*delta_l); #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**12,1),\"*10**12 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "volume occupied at 25atm is 3499 cm**3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=3500; #volume(cm**3)\n", + "K=10*10**11; #bulk modulus(dyne/cm**2)\n", + "p=24*76*13.6*980; #change in pressure(dyne/cm**2)\n", + "\n", + "#Calculation\n", + "delta_v=p*v/K; #volume occupied(cm**3)\n", + "V=v-delta_v; #volume occupied at 25atm(cm**3)\n", + "\n", + "#Result\n", + "print \"volume occupied at 25atm is\",int(V),\"cm**3\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "eta=1; #assume\n", + "Y=2.5*eta; #youngs modulus\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bulk modulus is 1 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.1; #side of cube(m)\n", + "p=10**6; #static pressure(pa)\n", + "delta_v=10**-8; #change in volume(m**3)\n", + "\n", + "#Calculation\n", + "v=l**3; #volume of cube(m**3)\n", + "K=p*v/delta_v; #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"bulk modulus is\",int(K/10**11),\"*10**11 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n", + "bulk modulus is 1.33 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=2*10**11; #youngs modulus(N/m**2)\n", + "eta=8*10**10; #rigidity modulus(N/m**2)\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "K=Y/(3*(1-2*sigma)); #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma\n", + "print \"bulk modulus is\",round(K/10**11,2),\"*10**11 N/m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "increase in temperature is 0.01653 K\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "A=2*10**-6; #area(m**2)\n", + "e=5*10**-3; #elongation(m)\n", + "rho=9000; #density(Kg/m**3)\n", + "C=4200; #specific heat(J/Kg/K)\n", + "F=1000; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "W=F*e*v/(2*A*l); #work done(J)\n", + "m=rho*v; #mass(kg)\n", + "delta_t=W/(m*C); #increase in temperature(K)\n", + "\n", + "#Result\n", + "print \"increase in temperature is\",round(delta_t,5),\"K\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "potential energy is 1.125 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=3; #length(m)\n", + "A=2.5*10**-6; #area(m**2)\n", + "e=3*10**-3; #elongation(m)\n", + "F=750; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "E=F*e*v/(2*A*l); #potential energy(J)\n", + "\n", + "#Result\n", + "print \"potential energy is\",E,\"J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression of the rod from fixed end is 0.00648 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=0.5; #length(m)\n", + "x=0.5; #depression(m)\n", + "y=15*10**-3; #depression(m)\n", + "x1=0.3; #depression(m)\n", + "\n", + "#Calculation\n", + "A=(L*x**2/2)-(x**3/6); \n", + "y1=y*((L*x1**2/2)-(x1**3/6))/A; #depression of the rod from fixed end(m)\n", + "\n", + "#Result\n", + "print \"depression of the rod from fixed end is\",y1,\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "deformation strain is 0.24\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=0.4; #radius(cm)\n", + "l=100; #length(cm)\n", + "phi=60; #twisting angle(degree)\n", + "\n", + "#Calculation\n", + "theta=r*phi/l #deformation strain\n", + "\n", + "#Result\n", + "print \"deformation strain is\",theta" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression at the mid point is 8.124 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.1; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "L=1; #length(m)\n", + "Y=10**10; #youngs modulus(N/m**2)\n", + "r=0.02; #radius of wire(m)\n", + "\n", + "#Calculation\n", + "y1=5*m*g*L**3/(12*Y*math.pi*r**4); #depression at the mid point(m)\n", + "\n", + "#Result\n", + "print \"depression at the mid point is\",round(y1*10**5,3),\"*10**-5 m\"\n", + "print \"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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_pVrZ16h.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_pVrZ16h.ipynb new file mode 100644 index 00000000..d7a5d585 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_pVrZ16h.ipynb @@ -0,0 +1,446 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4: Mechanics of Continuous Media" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 4.7 *10**12 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "F=1200*9.8; #tensile force(N)\n", + "A=0.025*10**-4; #area(m**2)\n", + "delta_l=0.003; #extension(m)\n", + "l=3; #length(m)\n", + "\n", + "#Calculation\n", + "Y=F*l/(A*delta_l); #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**12,1),\"*10**12 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "volume occupied at 25atm is 3499 cm**3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=3500; #volume(cm**3)\n", + "K=10*10**11; #bulk modulus(dyne/cm**2)\n", + "p=24*76*13.6*980; #change in pressure(dyne/cm**2)\n", + "\n", + "#Calculation\n", + "delta_v=p*v/K; #volume occupied(cm**3)\n", + "V=v-delta_v; #volume occupied at 25atm(cm**3)\n", + "\n", + "#Result\n", + "print \"volume occupied at 25atm is\",int(V),\"cm**3\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "eta=1; #assume\n", + "Y=2.5*eta; #youngs modulus\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bulk modulus is 1 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.1; #side of cube(m)\n", + "p=10**6; #static pressure(pa)\n", + "delta_v=10**-8; #change in volume(m**3)\n", + "\n", + "#Calculation\n", + "v=l**3; #volume of cube(m**3)\n", + "K=p*v/delta_v; #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"bulk modulus is\",int(K/10**11),\"*10**11 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n", + "bulk modulus is 1.33 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=2*10**11; #youngs modulus(N/m**2)\n", + "eta=8*10**10; #rigidity modulus(N/m**2)\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "K=Y/(3*(1-2*sigma)); #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma\n", + "print \"bulk modulus is\",round(K/10**11,2),\"*10**11 N/m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "increase in temperature is 0.01653 K\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "A=2*10**-6; #area(m**2)\n", + "e=5*10**-3; #elongation(m)\n", + "rho=9000; #density(Kg/m**3)\n", + "C=4200; #specific heat(J/Kg/K)\n", + "F=1000; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "W=F*e*v/(2*A*l); #work done(J)\n", + "m=rho*v; #mass(kg)\n", + "delta_t=W/(m*C); #increase in temperature(K)\n", + "\n", + "#Result\n", + "print \"increase in temperature is\",round(delta_t,5),\"K\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "potential energy is 1.125 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=3; #length(m)\n", + "A=2.5*10**-6; #area(m**2)\n", + "e=3*10**-3; #elongation(m)\n", + "F=750; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "E=F*e*v/(2*A*l); #potential energy(J)\n", + "\n", + "#Result\n", + "print \"potential energy is\",E,\"J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression of the rod from fixed end is 0.00648 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=0.5; #length(m)\n", + "x=0.5; #depression(m)\n", + "y=15*10**-3; #depression(m)\n", + "x1=0.3; #depression(m)\n", + "\n", + "#Calculation\n", + "A=(L*x**2/2)-(x**3/6); \n", + "y1=y*((L*x1**2/2)-(x1**3/6))/A; #depression of the rod from fixed end(m)\n", + "\n", + "#Result\n", + "print \"depression of the rod from fixed end is\",y1,\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "deformation strain is 0.24\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=0.4; #radius(cm)\n", + "l=100; #length(cm)\n", + "phi=60; #twisting angle(degree)\n", + "\n", + "#Calculation\n", + "theta=r*phi/l #deformation strain\n", + "\n", + "#Result\n", + "print \"deformation strain is\",theta" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression at the mid point is 8.124 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.1; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "L=1; #length(m)\n", + "Y=10**10; #youngs modulus(N/m**2)\n", + "r=0.02; #radius of wire(m)\n", + "\n", + "#Calculation\n", + "y1=5*m*g*L**3/(12*Y*math.pi*r**4); #depression at the mid point(m)\n", + "\n", + "#Result\n", + "print \"depression at the mid point is\",round(y1*10**5,3),\"*10**-5 m\"\n", + "print \"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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_rlB25DY.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_rlB25DY.ipynb new file mode 100644 index 00000000..d7a5d585 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_rlB25DY.ipynb @@ -0,0 +1,446 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4: Mechanics of Continuous Media" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 4.7 *10**12 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "F=1200*9.8; #tensile force(N)\n", + "A=0.025*10**-4; #area(m**2)\n", + "delta_l=0.003; #extension(m)\n", + "l=3; #length(m)\n", + "\n", + "#Calculation\n", + "Y=F*l/(A*delta_l); #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**12,1),\"*10**12 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "volume occupied at 25atm is 3499 cm**3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=3500; #volume(cm**3)\n", + "K=10*10**11; #bulk modulus(dyne/cm**2)\n", + "p=24*76*13.6*980; #change in pressure(dyne/cm**2)\n", + "\n", + "#Calculation\n", + "delta_v=p*v/K; #volume occupied(cm**3)\n", + "V=v-delta_v; #volume occupied at 25atm(cm**3)\n", + "\n", + "#Result\n", + "print \"volume occupied at 25atm is\",int(V),\"cm**3\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "eta=1; #assume\n", + "Y=2.5*eta; #youngs modulus\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bulk modulus is 1 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.1; #side of cube(m)\n", + "p=10**6; #static pressure(pa)\n", + "delta_v=10**-8; #change in volume(m**3)\n", + "\n", + "#Calculation\n", + "v=l**3; #volume of cube(m**3)\n", + "K=p*v/delta_v; #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"bulk modulus is\",int(K/10**11),\"*10**11 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n", + "bulk modulus is 1.33 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=2*10**11; #youngs modulus(N/m**2)\n", + "eta=8*10**10; #rigidity modulus(N/m**2)\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "K=Y/(3*(1-2*sigma)); #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma\n", + "print \"bulk modulus is\",round(K/10**11,2),\"*10**11 N/m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "increase in temperature is 0.01653 K\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "A=2*10**-6; #area(m**2)\n", + "e=5*10**-3; #elongation(m)\n", + "rho=9000; #density(Kg/m**3)\n", + "C=4200; #specific heat(J/Kg/K)\n", + "F=1000; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "W=F*e*v/(2*A*l); #work done(J)\n", + "m=rho*v; #mass(kg)\n", + "delta_t=W/(m*C); #increase in temperature(K)\n", + "\n", + "#Result\n", + "print \"increase in temperature is\",round(delta_t,5),\"K\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "potential energy is 1.125 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=3; #length(m)\n", + "A=2.5*10**-6; #area(m**2)\n", + "e=3*10**-3; #elongation(m)\n", + "F=750; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "E=F*e*v/(2*A*l); #potential energy(J)\n", + "\n", + "#Result\n", + "print \"potential energy is\",E,\"J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression of the rod from fixed end is 0.00648 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=0.5; #length(m)\n", + "x=0.5; #depression(m)\n", + "y=15*10**-3; #depression(m)\n", + "x1=0.3; #depression(m)\n", + "\n", + "#Calculation\n", + "A=(L*x**2/2)-(x**3/6); \n", + "y1=y*((L*x1**2/2)-(x1**3/6))/A; #depression of the rod from fixed end(m)\n", + "\n", + "#Result\n", + "print \"depression of the rod from fixed end is\",y1,\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "deformation strain is 0.24\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=0.4; #radius(cm)\n", + "l=100; #length(cm)\n", + "phi=60; #twisting angle(degree)\n", + "\n", + "#Calculation\n", + "theta=r*phi/l #deformation strain\n", + "\n", + "#Result\n", + "print \"deformation strain is\",theta" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression at the mid point is 8.124 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.1; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "L=1; #length(m)\n", + "Y=10**10; #youngs modulus(N/m**2)\n", + "r=0.02; #radius of wire(m)\n", + "\n", + "#Calculation\n", + "y1=5*m*g*L**3/(12*Y*math.pi*r**4); #depression at the mid point(m)\n", + "\n", + "#Result\n", + "print \"depression at the mid point is\",round(y1*10**5,3),\"*10**-5 m\"\n", + "print \"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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_v0NmXc1.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_v0NmXc1.ipynb new file mode 100644 index 00000000..d7a5d585 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_v0NmXc1.ipynb @@ -0,0 +1,446 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4: Mechanics of Continuous Media" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "youngs modulus is 4.7 *10**12 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "F=1200*9.8; #tensile force(N)\n", + "A=0.025*10**-4; #area(m**2)\n", + "delta_l=0.003; #extension(m)\n", + "l=3; #length(m)\n", + "\n", + "#Calculation\n", + "Y=F*l/(A*delta_l); #youngs modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"youngs modulus is\",round(Y/10**12,1),\"*10**12 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 162" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "volume occupied at 25atm is 3499 cm**3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "v=3500; #volume(cm**3)\n", + "K=10*10**11; #bulk modulus(dyne/cm**2)\n", + "p=24*76*13.6*980; #change in pressure(dyne/cm**2)\n", + "\n", + "#Calculation\n", + "delta_v=p*v/K; #volume occupied(cm**3)\n", + "V=v-delta_v; #volume occupied at 25atm(cm**3)\n", + "\n", + "#Result\n", + "print \"volume occupied at 25atm is\",int(V),\"cm**3\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "eta=1; #assume\n", + "Y=2.5*eta; #youngs modulus\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bulk modulus is 1 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=0.1; #side of cube(m)\n", + "p=10**6; #static pressure(pa)\n", + "delta_v=10**-8; #change in volume(m**3)\n", + "\n", + "#Calculation\n", + "v=l**3; #volume of cube(m**3)\n", + "K=p*v/delta_v; #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"bulk modulus is\",int(K/10**11),\"*10**11 N/m**2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poissons ratio is 0.25\n", + "bulk modulus is 1.33 *10**11 N/m**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Y=2*10**11; #youngs modulus(N/m**2)\n", + "eta=8*10**10; #rigidity modulus(N/m**2)\n", + "\n", + "#Calculation\n", + "sigma=Y/(2*eta)-1; #poissons ratio\n", + "K=Y/(3*(1-2*sigma)); #bulk modulus(N/m**2)\n", + "\n", + "#Result\n", + "print \"poissons ratio is\",sigma\n", + "print \"bulk modulus is\",round(K/10**11,2),\"*10**11 N/m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 163" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "increase in temperature is 0.01653 K\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=2; #length(m)\n", + "A=2*10**-6; #area(m**2)\n", + "e=5*10**-3; #elongation(m)\n", + "rho=9000; #density(Kg/m**3)\n", + "C=4200; #specific heat(J/Kg/K)\n", + "F=1000; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "W=F*e*v/(2*A*l); #work done(J)\n", + "m=rho*v; #mass(kg)\n", + "delta_t=W/(m*C); #increase in temperature(K)\n", + "\n", + "#Result\n", + "print \"increase in temperature is\",round(delta_t,5),\"K\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "potential energy is 1.125 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=3; #length(m)\n", + "A=2.5*10**-6; #area(m**2)\n", + "e=3*10**-3; #elongation(m)\n", + "F=750; #force(N)\n", + "\n", + "#Calculation\n", + "v=l*A; #volume(m**3)\n", + "E=F*e*v/(2*A*l); #potential energy(J)\n", + "\n", + "#Result\n", + "print \"potential energy is\",E,\"J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 164" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression of the rod from fixed end is 0.00648 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=0.5; #length(m)\n", + "x=0.5; #depression(m)\n", + "y=15*10**-3; #depression(m)\n", + "x1=0.3; #depression(m)\n", + "\n", + "#Calculation\n", + "A=(L*x**2/2)-(x**3/6); \n", + "y1=y*((L*x1**2/2)-(x1**3/6))/A; #depression of the rod from fixed end(m)\n", + "\n", + "#Result\n", + "print \"depression of the rod from fixed end is\",y1,\"m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "deformation strain is 0.24\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=0.4; #radius(cm)\n", + "l=100; #length(cm)\n", + "phi=60; #twisting angle(degree)\n", + "\n", + "#Calculation\n", + "theta=r*phi/l #deformation strain\n", + "\n", + "#Result\n", + "print \"deformation strain is\",theta" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 165" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "depression at the mid point is 8.124 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.1; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "L=1; #length(m)\n", + "Y=10**10; #youngs modulus(N/m**2)\n", + "r=0.02; #radius of wire(m)\n", + "\n", + "#Calculation\n", + "y1=5*m*g*L**3/(12*Y*math.pi*r**4); #depression at the mid point(m)\n", + "\n", + "#Result\n", + "print \"depression at the mid point is\",round(y1*10**5,3),\"*10**-5 m\"\n", + "print \"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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_9e9mp4v.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_9e9mp4v.ipynb new file mode 100644 index 00000000..3b038d09 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_9e9mp4v.ipynb @@ -0,0 +1,664 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5: Central Forces" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 200" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational energy is 1.6675 *10**-10 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=m2=0.5; #mass(kg)\n", + "r2=0.1; #distance(m)\n", + "r1=float(\"inf\"); #distance(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=G*m1*m2*((1/r2)-(1/r1)); #gravitational energy(J)\n", + "\n", + "#Result\n", + "print \"gravitational energy is\",delta_U*10**10,\"*10**-10 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "net energy is -146.74 *10**-11 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=1; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "m3=3; #mass(kg)\n", + "a=0.5; #side(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=-G*((m1*m2)+(m2*m3)+(m3*m1))/a; #net energy(J)\n", + "\n", + "#Result\n", + "print \"net energy is\",round(delta_U*10**11,2),\"*10**-11 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 203" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance where potential becomes zero is 3.6 *10**8 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=4*10**8; #distance(m)\n", + "M1=6*10**24; #mass of earth(kg)\n", + "M2=7.5*10**22; #mass of moon(kg)\n", + "\n", + "#Calculation\n", + "x=r/(1+math.sqrt(M2/M1)); #distance where potential becomes zero(m)\n", + "\n", + "#Result\n", + "print \"distance where potential becomes zero is\",round(x/10**8,1),\"*10**8 m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 204" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "initial velocity is 306.7 km/s\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(m/s**2)\n", + "R=6.4*10**3; #radius(km)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(3*g*R/2); #initial velocity(km/s)\n", + "\n", + "#Result\n", + "print \"initial velocity is\",round(v,1),\"km/s\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 205" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of particle is 5.77 *10**-14 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=10**-26; #mass(kg)\n", + "R=0.5*10**-10; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "V=math.sqrt(G*m/(4*R)); #velocity of particle(m/s)\n", + "\n", + "#Result\n", + "print \"velocity of particle is\",round(V*10**14,2),\"*10**-14 m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 206" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational potential is 6.67 *10**-10 J/kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(kg)\n", + "r=0.1; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "F=G*m/r**2; #force(N/kg)\n", + "U=F*r; #gravitational potential(J/kg)\n", + "\n", + "#Result\n", + "print \"gravitational potential is\",U*10**10,\"*10**-10 J/kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 15, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.9\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rmax=1.2*10**12; #semi minor axis(m)\n", + "rmin=0.06*10**12; #semi major axis(m)\n", + "\n", + "#Calculation\n", + "e=(rmax-rmin)/(rmax+rmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum velocity is 525 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=21; #minimum velocity(km/sec)\n", + "rmax=4*10**10; #apogee position(m)\n", + "rmin=1.6*10**9; #perigee position(m)\n", + "\n", + "#Calculation\n", + "Vmax=Vmin*rmax/rmin; #maximum velocity(km/sec)\n", + "\n", + "#Result\n", + "print \"maximum velocity is\",int(Vmax),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apogee position is 2.76 *10**10 m\n", + "velocity at apogee point is 32.57 km/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "e=0.05; #eccentricity of orbit\n", + "Vmin=36; #minimum velocity(km/sec)\n", + "rmin=2.5*10**10; #perigee position(m)\n", + "\n", + "#Calculation\n", + "rmax=rmin*((1+e)/(1-e)); #apogee position(m)\n", + "Vmax=Vmin*rmin/rmax; #velocity at apogee point(km/s) \n", + "\n", + "#Result\n", + "print \"apogee position is\",round(rmax/10**10,2),\"*10**10 m\"\n", + "print \"velocity at apogee point is\",round(Vmax,2),\"km/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 18, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.0417\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=23; #minimum velocity(km/sec)\n", + "Vmax=25; #velocity at apogee point(km/s) \n", + "\n", + "#Calculation\n", + "e=(Vmax-Vmin)/(Vmax+Vmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of earth is 5.968 *10**24 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=3.8*10**8; #radius(m)\n", + "T=27*24*3600; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*r**3/(G*T**2); #mass of earth(kg)\n", + "\n", + "#Result\n", + "print \"mass of earth is\",round(M/10**24,3),\"*10**24 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of semi major axis is 0.724\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "T1=225; #time period of venus(days)\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "a1bya2=(T1/T2)**(2/3); #ratio of semi major axis\n", + "\n", + "#Result\n", + "print \"ratio of semi major axis is\",round(a1bya2,3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time period of planet is 510 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a2=1; #assume\n", + "a1=1.25*a2; #axis of planet\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T2*math.sqrt((a1/a2)**3); #time period of planet(days)\n", + "\n", + "#Result\n", + "print \"time period of planet is\",int(T1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in time period is 15.36 hours\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r1=1; #assume\n", + "r2=1-(40/100); #radius of earth\n", + "T1=24; #time period of earth(hours)\n", + "\n", + "#Calculation\n", + "T2=T1-(T1*((r2/r1)**2)); #change in time period(hours)\n", + "\n", + "#Result\n", + "print \"change in time period is\",T2,\"hours\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time interval to reach sun is 64.5 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1; #assume\n", + "a1=R/2;\n", + "a=R;\n", + "T=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T*math.sqrt((a1/a)**3)/2; #time interval to reach sun(days)\n", + "\n", + "#Result\n", + "print \"time interval to reach sun is\",round(T1,1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 25, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of sun is 2 *10**30 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1.5*10**11; #radius(m)\n", + "T=86400*365; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*R**3/(G*T**2); #mass of sun(kg)\n", + "\n", + "#Result\n", + "print \"mass of sun is\",int(M/10**30),\"*10**30 kg\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_P4XexVb.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_P4XexVb.ipynb new file mode 100644 index 00000000..3b038d09 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_P4XexVb.ipynb @@ -0,0 +1,664 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5: Central Forces" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 200" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational energy is 1.6675 *10**-10 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=m2=0.5; #mass(kg)\n", + "r2=0.1; #distance(m)\n", + "r1=float(\"inf\"); #distance(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=G*m1*m2*((1/r2)-(1/r1)); #gravitational energy(J)\n", + "\n", + "#Result\n", + "print \"gravitational energy is\",delta_U*10**10,\"*10**-10 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "net energy is -146.74 *10**-11 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=1; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "m3=3; #mass(kg)\n", + "a=0.5; #side(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=-G*((m1*m2)+(m2*m3)+(m3*m1))/a; #net energy(J)\n", + "\n", + "#Result\n", + "print \"net energy is\",round(delta_U*10**11,2),\"*10**-11 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 203" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance where potential becomes zero is 3.6 *10**8 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=4*10**8; #distance(m)\n", + "M1=6*10**24; #mass of earth(kg)\n", + "M2=7.5*10**22; #mass of moon(kg)\n", + "\n", + "#Calculation\n", + "x=r/(1+math.sqrt(M2/M1)); #distance where potential becomes zero(m)\n", + "\n", + "#Result\n", + "print \"distance where potential becomes zero is\",round(x/10**8,1),\"*10**8 m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 204" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "initial velocity is 306.7 km/s\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(m/s**2)\n", + "R=6.4*10**3; #radius(km)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(3*g*R/2); #initial velocity(km/s)\n", + "\n", + "#Result\n", + "print \"initial velocity is\",round(v,1),\"km/s\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 205" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of particle is 5.77 *10**-14 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=10**-26; #mass(kg)\n", + "R=0.5*10**-10; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "V=math.sqrt(G*m/(4*R)); #velocity of particle(m/s)\n", + "\n", + "#Result\n", + "print \"velocity of particle is\",round(V*10**14,2),\"*10**-14 m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 206" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational potential is 6.67 *10**-10 J/kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(kg)\n", + "r=0.1; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "F=G*m/r**2; #force(N/kg)\n", + "U=F*r; #gravitational potential(J/kg)\n", + "\n", + "#Result\n", + "print \"gravitational potential is\",U*10**10,\"*10**-10 J/kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 15, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.9\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rmax=1.2*10**12; #semi minor axis(m)\n", + "rmin=0.06*10**12; #semi major axis(m)\n", + "\n", + "#Calculation\n", + "e=(rmax-rmin)/(rmax+rmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum velocity is 525 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=21; #minimum velocity(km/sec)\n", + "rmax=4*10**10; #apogee position(m)\n", + "rmin=1.6*10**9; #perigee position(m)\n", + "\n", + "#Calculation\n", + "Vmax=Vmin*rmax/rmin; #maximum velocity(km/sec)\n", + "\n", + "#Result\n", + "print \"maximum velocity is\",int(Vmax),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apogee position is 2.76 *10**10 m\n", + "velocity at apogee point is 32.57 km/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "e=0.05; #eccentricity of orbit\n", + "Vmin=36; #minimum velocity(km/sec)\n", + "rmin=2.5*10**10; #perigee position(m)\n", + "\n", + "#Calculation\n", + "rmax=rmin*((1+e)/(1-e)); #apogee position(m)\n", + "Vmax=Vmin*rmin/rmax; #velocity at apogee point(km/s) \n", + "\n", + "#Result\n", + "print \"apogee position is\",round(rmax/10**10,2),\"*10**10 m\"\n", + "print \"velocity at apogee point is\",round(Vmax,2),\"km/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 18, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.0417\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=23; #minimum velocity(km/sec)\n", + "Vmax=25; #velocity at apogee point(km/s) \n", + "\n", + "#Calculation\n", + "e=(Vmax-Vmin)/(Vmax+Vmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of earth is 5.968 *10**24 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=3.8*10**8; #radius(m)\n", + "T=27*24*3600; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*r**3/(G*T**2); #mass of earth(kg)\n", + "\n", + "#Result\n", + "print \"mass of earth is\",round(M/10**24,3),\"*10**24 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of semi major axis is 0.724\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "T1=225; #time period of venus(days)\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "a1bya2=(T1/T2)**(2/3); #ratio of semi major axis\n", + "\n", + "#Result\n", + "print \"ratio of semi major axis is\",round(a1bya2,3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time period of planet is 510 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a2=1; #assume\n", + "a1=1.25*a2; #axis of planet\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T2*math.sqrt((a1/a2)**3); #time period of planet(days)\n", + "\n", + "#Result\n", + "print \"time period of planet is\",int(T1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in time period is 15.36 hours\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r1=1; #assume\n", + "r2=1-(40/100); #radius of earth\n", + "T1=24; #time period of earth(hours)\n", + "\n", + "#Calculation\n", + "T2=T1-(T1*((r2/r1)**2)); #change in time period(hours)\n", + "\n", + "#Result\n", + "print \"change in time period is\",T2,\"hours\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time interval to reach sun is 64.5 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1; #assume\n", + "a1=R/2;\n", + "a=R;\n", + "T=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T*math.sqrt((a1/a)**3)/2; #time interval to reach sun(days)\n", + "\n", + "#Result\n", + "print \"time interval to reach sun is\",round(T1,1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 25, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of sun is 2 *10**30 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1.5*10**11; #radius(m)\n", + "T=86400*365; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*R**3/(G*T**2); #mass of sun(kg)\n", + "\n", + "#Result\n", + "print \"mass of sun is\",int(M/10**30),\"*10**30 kg\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_ZzjWlQd.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_ZzjWlQd.ipynb new file mode 100644 index 00000000..3b038d09 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_ZzjWlQd.ipynb @@ -0,0 +1,664 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5: Central Forces" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 200" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational energy is 1.6675 *10**-10 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=m2=0.5; #mass(kg)\n", + "r2=0.1; #distance(m)\n", + "r1=float(\"inf\"); #distance(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=G*m1*m2*((1/r2)-(1/r1)); #gravitational energy(J)\n", + "\n", + "#Result\n", + "print \"gravitational energy is\",delta_U*10**10,\"*10**-10 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "net energy is -146.74 *10**-11 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=1; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "m3=3; #mass(kg)\n", + "a=0.5; #side(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=-G*((m1*m2)+(m2*m3)+(m3*m1))/a; #net energy(J)\n", + "\n", + "#Result\n", + "print \"net energy is\",round(delta_U*10**11,2),\"*10**-11 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 203" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance where potential becomes zero is 3.6 *10**8 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=4*10**8; #distance(m)\n", + "M1=6*10**24; #mass of earth(kg)\n", + "M2=7.5*10**22; #mass of moon(kg)\n", + "\n", + "#Calculation\n", + "x=r/(1+math.sqrt(M2/M1)); #distance where potential becomes zero(m)\n", + "\n", + "#Result\n", + "print \"distance where potential becomes zero is\",round(x/10**8,1),\"*10**8 m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 204" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "initial velocity is 306.7 km/s\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(m/s**2)\n", + "R=6.4*10**3; #radius(km)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(3*g*R/2); #initial velocity(km/s)\n", + "\n", + "#Result\n", + "print \"initial velocity is\",round(v,1),\"km/s\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 205" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of particle is 5.77 *10**-14 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=10**-26; #mass(kg)\n", + "R=0.5*10**-10; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "V=math.sqrt(G*m/(4*R)); #velocity of particle(m/s)\n", + "\n", + "#Result\n", + "print \"velocity of particle is\",round(V*10**14,2),\"*10**-14 m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 206" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational potential is 6.67 *10**-10 J/kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(kg)\n", + "r=0.1; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "F=G*m/r**2; #force(N/kg)\n", + "U=F*r; #gravitational potential(J/kg)\n", + "\n", + "#Result\n", + "print \"gravitational potential is\",U*10**10,\"*10**-10 J/kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 15, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.9\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rmax=1.2*10**12; #semi minor axis(m)\n", + "rmin=0.06*10**12; #semi major axis(m)\n", + "\n", + "#Calculation\n", + "e=(rmax-rmin)/(rmax+rmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum velocity is 525 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=21; #minimum velocity(km/sec)\n", + "rmax=4*10**10; #apogee position(m)\n", + "rmin=1.6*10**9; #perigee position(m)\n", + "\n", + "#Calculation\n", + "Vmax=Vmin*rmax/rmin; #maximum velocity(km/sec)\n", + "\n", + "#Result\n", + "print \"maximum velocity is\",int(Vmax),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apogee position is 2.76 *10**10 m\n", + "velocity at apogee point is 32.57 km/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "e=0.05; #eccentricity of orbit\n", + "Vmin=36; #minimum velocity(km/sec)\n", + "rmin=2.5*10**10; #perigee position(m)\n", + "\n", + "#Calculation\n", + "rmax=rmin*((1+e)/(1-e)); #apogee position(m)\n", + "Vmax=Vmin*rmin/rmax; #velocity at apogee point(km/s) \n", + "\n", + "#Result\n", + "print \"apogee position is\",round(rmax/10**10,2),\"*10**10 m\"\n", + "print \"velocity at apogee point is\",round(Vmax,2),\"km/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 18, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.0417\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=23; #minimum velocity(km/sec)\n", + "Vmax=25; #velocity at apogee point(km/s) \n", + "\n", + "#Calculation\n", + "e=(Vmax-Vmin)/(Vmax+Vmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of earth is 5.968 *10**24 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=3.8*10**8; #radius(m)\n", + "T=27*24*3600; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*r**3/(G*T**2); #mass of earth(kg)\n", + "\n", + "#Result\n", + "print \"mass of earth is\",round(M/10**24,3),\"*10**24 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of semi major axis is 0.724\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "T1=225; #time period of venus(days)\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "a1bya2=(T1/T2)**(2/3); #ratio of semi major axis\n", + "\n", + "#Result\n", + "print \"ratio of semi major axis is\",round(a1bya2,3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time period of planet is 510 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a2=1; #assume\n", + "a1=1.25*a2; #axis of planet\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T2*math.sqrt((a1/a2)**3); #time period of planet(days)\n", + "\n", + "#Result\n", + "print \"time period of planet is\",int(T1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in time period is 15.36 hours\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r1=1; #assume\n", + "r2=1-(40/100); #radius of earth\n", + "T1=24; #time period of earth(hours)\n", + "\n", + "#Calculation\n", + "T2=T1-(T1*((r2/r1)**2)); #change in time period(hours)\n", + "\n", + "#Result\n", + "print \"change in time period is\",T2,\"hours\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time interval to reach sun is 64.5 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1; #assume\n", + "a1=R/2;\n", + "a=R;\n", + "T=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T*math.sqrt((a1/a)**3)/2; #time interval to reach sun(days)\n", + "\n", + "#Result\n", + "print \"time interval to reach sun is\",round(T1,1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 25, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of sun is 2 *10**30 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1.5*10**11; #radius(m)\n", + "T=86400*365; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*R**3/(G*T**2); #mass of sun(kg)\n", + "\n", + "#Result\n", + "print \"mass of sun is\",int(M/10**30),\"*10**30 kg\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_aODGM7T.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_aODGM7T.ipynb new file mode 100644 index 00000000..3b038d09 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_aODGM7T.ipynb @@ -0,0 +1,664 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5: Central Forces" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 200" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational energy is 1.6675 *10**-10 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=m2=0.5; #mass(kg)\n", + "r2=0.1; #distance(m)\n", + "r1=float(\"inf\"); #distance(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=G*m1*m2*((1/r2)-(1/r1)); #gravitational energy(J)\n", + "\n", + "#Result\n", + "print \"gravitational energy is\",delta_U*10**10,\"*10**-10 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "net energy is -146.74 *10**-11 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=1; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "m3=3; #mass(kg)\n", + "a=0.5; #side(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=-G*((m1*m2)+(m2*m3)+(m3*m1))/a; #net energy(J)\n", + "\n", + "#Result\n", + "print \"net energy is\",round(delta_U*10**11,2),\"*10**-11 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 203" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance where potential becomes zero is 3.6 *10**8 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=4*10**8; #distance(m)\n", + "M1=6*10**24; #mass of earth(kg)\n", + "M2=7.5*10**22; #mass of moon(kg)\n", + "\n", + "#Calculation\n", + "x=r/(1+math.sqrt(M2/M1)); #distance where potential becomes zero(m)\n", + "\n", + "#Result\n", + "print \"distance where potential becomes zero is\",round(x/10**8,1),\"*10**8 m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 204" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "initial velocity is 306.7 km/s\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(m/s**2)\n", + "R=6.4*10**3; #radius(km)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(3*g*R/2); #initial velocity(km/s)\n", + "\n", + "#Result\n", + "print \"initial velocity is\",round(v,1),\"km/s\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 205" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of particle is 5.77 *10**-14 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=10**-26; #mass(kg)\n", + "R=0.5*10**-10; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "V=math.sqrt(G*m/(4*R)); #velocity of particle(m/s)\n", + "\n", + "#Result\n", + "print \"velocity of particle is\",round(V*10**14,2),\"*10**-14 m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 206" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational potential is 6.67 *10**-10 J/kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(kg)\n", + "r=0.1; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "F=G*m/r**2; #force(N/kg)\n", + "U=F*r; #gravitational potential(J/kg)\n", + "\n", + "#Result\n", + "print \"gravitational potential is\",U*10**10,\"*10**-10 J/kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 15, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.9\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rmax=1.2*10**12; #semi minor axis(m)\n", + "rmin=0.06*10**12; #semi major axis(m)\n", + "\n", + "#Calculation\n", + "e=(rmax-rmin)/(rmax+rmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum velocity is 525 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=21; #minimum velocity(km/sec)\n", + "rmax=4*10**10; #apogee position(m)\n", + "rmin=1.6*10**9; #perigee position(m)\n", + "\n", + "#Calculation\n", + "Vmax=Vmin*rmax/rmin; #maximum velocity(km/sec)\n", + "\n", + "#Result\n", + "print \"maximum velocity is\",int(Vmax),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apogee position is 2.76 *10**10 m\n", + "velocity at apogee point is 32.57 km/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "e=0.05; #eccentricity of orbit\n", + "Vmin=36; #minimum velocity(km/sec)\n", + "rmin=2.5*10**10; #perigee position(m)\n", + "\n", + "#Calculation\n", + "rmax=rmin*((1+e)/(1-e)); #apogee position(m)\n", + "Vmax=Vmin*rmin/rmax; #velocity at apogee point(km/s) \n", + "\n", + "#Result\n", + "print \"apogee position is\",round(rmax/10**10,2),\"*10**10 m\"\n", + "print \"velocity at apogee point is\",round(Vmax,2),\"km/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 18, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.0417\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=23; #minimum velocity(km/sec)\n", + "Vmax=25; #velocity at apogee point(km/s) \n", + "\n", + "#Calculation\n", + "e=(Vmax-Vmin)/(Vmax+Vmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of earth is 5.968 *10**24 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=3.8*10**8; #radius(m)\n", + "T=27*24*3600; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*r**3/(G*T**2); #mass of earth(kg)\n", + "\n", + "#Result\n", + "print \"mass of earth is\",round(M/10**24,3),\"*10**24 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of semi major axis is 0.724\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "T1=225; #time period of venus(days)\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "a1bya2=(T1/T2)**(2/3); #ratio of semi major axis\n", + "\n", + "#Result\n", + "print \"ratio of semi major axis is\",round(a1bya2,3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time period of planet is 510 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a2=1; #assume\n", + "a1=1.25*a2; #axis of planet\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T2*math.sqrt((a1/a2)**3); #time period of planet(days)\n", + "\n", + "#Result\n", + "print \"time period of planet is\",int(T1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in time period is 15.36 hours\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r1=1; #assume\n", + "r2=1-(40/100); #radius of earth\n", + "T1=24; #time period of earth(hours)\n", + "\n", + "#Calculation\n", + "T2=T1-(T1*((r2/r1)**2)); #change in time period(hours)\n", + "\n", + "#Result\n", + "print \"change in time period is\",T2,\"hours\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time interval to reach sun is 64.5 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1; #assume\n", + "a1=R/2;\n", + "a=R;\n", + "T=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T*math.sqrt((a1/a)**3)/2; #time interval to reach sun(days)\n", + "\n", + "#Result\n", + "print \"time interval to reach sun is\",round(T1,1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 25, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of sun is 2 *10**30 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1.5*10**11; #radius(m)\n", + "T=86400*365; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*R**3/(G*T**2); #mass of sun(kg)\n", + "\n", + "#Result\n", + "print \"mass of sun is\",int(M/10**30),\"*10**30 kg\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_hefoBhO.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_hefoBhO.ipynb new file mode 100644 index 00000000..3b038d09 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_hefoBhO.ipynb @@ -0,0 +1,664 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5: Central Forces" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 200" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational energy is 1.6675 *10**-10 J\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=m2=0.5; #mass(kg)\n", + "r2=0.1; #distance(m)\n", + "r1=float(\"inf\"); #distance(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=G*m1*m2*((1/r2)-(1/r1)); #gravitational energy(J)\n", + "\n", + "#Result\n", + "print \"gravitational energy is\",delta_U*10**10,\"*10**-10 J\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "net energy is -146.74 *10**-11 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m1=1; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "m3=3; #mass(kg)\n", + "a=0.5; #side(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "delta_U=-G*((m1*m2)+(m2*m3)+(m3*m1))/a; #net energy(J)\n", + "\n", + "#Result\n", + "print \"net energy is\",round(delta_U*10**11,2),\"*10**-11 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 203" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance where potential becomes zero is 3.6 *10**8 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=4*10**8; #distance(m)\n", + "M1=6*10**24; #mass of earth(kg)\n", + "M2=7.5*10**22; #mass of moon(kg)\n", + "\n", + "#Calculation\n", + "x=r/(1+math.sqrt(M2/M1)); #distance where potential becomes zero(m)\n", + "\n", + "#Result\n", + "print \"distance where potential becomes zero is\",round(x/10**8,1),\"*10**8 m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 204" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "initial velocity is 306.7 km/s\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration due to gravity(m/s**2)\n", + "R=6.4*10**3; #radius(km)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(3*g*R/2); #initial velocity(km/s)\n", + "\n", + "#Result\n", + "print \"initial velocity is\",round(v,1),\"km/s\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 205" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of particle is 5.77 *10**-14 m/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=10**-26; #mass(kg)\n", + "R=0.5*10**-10; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "V=math.sqrt(G*m/(4*R)); #velocity of particle(m/s)\n", + "\n", + "#Result\n", + "print \"velocity of particle is\",round(V*10**14,2),\"*10**-14 m/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 206" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gravitational potential is 6.67 *10**-10 J/kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(kg)\n", + "r=0.1; #radius(m)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "F=G*m/r**2; #force(N/kg)\n", + "U=F*r; #gravitational potential(J/kg)\n", + "\n", + "#Result\n", + "print \"gravitational potential is\",U*10**10,\"*10**-10 J/kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 15, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.9\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "rmax=1.2*10**12; #semi minor axis(m)\n", + "rmin=0.06*10**12; #semi major axis(m)\n", + "\n", + "#Calculation\n", + "e=(rmax-rmin)/(rmax+rmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 207" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum velocity is 525 km/sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=21; #minimum velocity(km/sec)\n", + "rmax=4*10**10; #apogee position(m)\n", + "rmin=1.6*10**9; #perigee position(m)\n", + "\n", + "#Calculation\n", + "Vmax=Vmin*rmax/rmin; #maximum velocity(km/sec)\n", + "\n", + "#Result\n", + "print \"maximum velocity is\",int(Vmax),\"km/sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apogee position is 2.76 *10**10 m\n", + "velocity at apogee point is 32.57 km/s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "e=0.05; #eccentricity of orbit\n", + "Vmin=36; #minimum velocity(km/sec)\n", + "rmin=2.5*10**10; #perigee position(m)\n", + "\n", + "#Calculation\n", + "rmax=rmin*((1+e)/(1-e)); #apogee position(m)\n", + "Vmax=Vmin*rmin/rmax; #velocity at apogee point(km/s) \n", + "\n", + "#Result\n", + "print \"apogee position is\",round(rmax/10**10,2),\"*10**10 m\"\n", + "print \"velocity at apogee point is\",round(Vmax,2),\"km/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 18, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eccentricity of orbit is 0.0417\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Vmin=23; #minimum velocity(km/sec)\n", + "Vmax=25; #velocity at apogee point(km/s) \n", + "\n", + "#Calculation\n", + "e=(Vmax-Vmin)/(Vmax+Vmin); #eccentricity of orbit\n", + "\n", + "#Result\n", + "print \"eccentricity of orbit is\",round(e,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 208" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of earth is 5.968 *10**24 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r=3.8*10**8; #radius(m)\n", + "T=27*24*3600; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*r**3/(G*T**2); #mass of earth(kg)\n", + "\n", + "#Result\n", + "print \"mass of earth is\",round(M/10**24,3),\"*10**24 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of semi major axis is 0.724\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "T1=225; #time period of venus(days)\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "a1bya2=(T1/T2)**(2/3); #ratio of semi major axis\n", + "\n", + "#Result\n", + "print \"ratio of semi major axis is\",round(a1bya2,3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time period of planet is 510 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a2=1; #assume\n", + "a1=1.25*a2; #axis of planet\n", + "T2=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T2*math.sqrt((a1/a2)**3); #time period of planet(days)\n", + "\n", + "#Result\n", + "print \"time period of planet is\",int(T1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 209" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in time period is 15.36 hours\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "r1=1; #assume\n", + "r2=1-(40/100); #radius of earth\n", + "T1=24; #time period of earth(hours)\n", + "\n", + "#Calculation\n", + "T2=T1-(T1*((r2/r1)**2)); #change in time period(hours)\n", + "\n", + "#Result\n", + "print \"change in time period is\",T2,\"hours\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time interval to reach sun is 64.5 days\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1; #assume\n", + "a1=R/2;\n", + "a=R;\n", + "T=365; #time period of earth(days)\n", + "\n", + "#Calculation\n", + "T1=T*math.sqrt((a1/a)**3)/2; #time interval to reach sun(days)\n", + "\n", + "#Result\n", + "print \"time interval to reach sun is\",round(T1,1),\"days\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 25, Page number 210" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass of sun is 2 *10**30 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=1.5*10**11; #radius(m)\n", + "T=86400*365; #time period(sec)\n", + "G=6.67*10**-11; #gravitational constant\n", + "\n", + "#Calculation\n", + "M=4*math.pi**2*R**3/(G*T**2); #mass of sun(kg)\n", + "\n", + "#Result\n", + "print \"mass of sun is\",int(M/10**30),\"*10**30 kg\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_1gnNs9u.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_1gnNs9u.ipynb new file mode 100644 index 00000000..495cf888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_1gnNs9u.ipynb @@ -0,0 +1,844 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6: Special Theory of Relativity" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fringe shift is 0.2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=5; #length(m)\n", + "v=3*10**4; #velocity(m/sec)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "lamda=5000*10**-10; #wavelength(m)\n", + "\n", + "#Calculation\n", + "S=2*l*v**2/(c**2*lamda); #fringe shift\n", + "\n", + "#Result\n", + "print \"fringe shift is\",S" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "coordinates w.r.t moving observer are (x1,y1,z1,t1)=( 800 100 100 0 )\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=1000; #x-coordinate(m)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "t=2*10**-6; #time(s)\n", + "v1=0.6*c;\n", + "y1=y=100; #y-coordinate(m)\n", + "z1=z=100; #z-coordinate(m)\n", + "\n", + "#Calculation\n", + "x1=(x-(v1*t))/math.sqrt(1-((v1/c)**2)); #coordinate along x-axis\n", + "t1=(t-(x*v1/c**2))/math.sqrt(1-((v1/c)**2)); #time\n", + "\n", + "#Result\n", + "print \"coordinates w.r.t moving observer are (x1,y1,z1,t1)=(\",int(x1),int(y1),int(z1),int(t1),\")\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "decay time is 3.83 micro s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.3; #time(micro s)\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(micro s)\n", + "\n", + "#Result\n", + "print \"decay time is\",round(delta_t1,2),\"micro s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "space shuttle velocity is 0.515 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=24; #time(hours)\n", + "delta_t1=28; #decay time(hours)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(delta_t/delta_t1)**2); #space shuttle velocity(c)\n", + "\n", + "#Result\n", + "print \"space shuttle velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "observed displacement is 375.0 m\n", + "relative displacement is 433.01 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.5*10**-6; #time(s)\n", + "c=3*10**8; #velocity of light\n", + "v=c/2; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(s)\n", + "x=v*delta_t; #observed displacement(m)\n", + "x1=v*delta_t1; #relative displacement(m)\n", + "\n", + "#Result\n", + "print \"observed displacement is\",x,\"m\"\n", + "print \"relative displacement is\",round(x1,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative decay in earth diameter is 6.4 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=6400; #radius(km)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "v=30*10**3; #orbital velocity(m/sec)\n", + "\n", + "#Calculation\n", + "d=2*R; #diameter(km)\n", + "d1=d*math.sqrt(1-(v**2/c**2)); \n", + "delta_d=d-d1; #relative decay in earth diameter(m)\n", + "\n", + "#Result\n", + "print \"relative decay in earth diameter is\",round(delta_d*10**5,1),\"*10**-5 m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.28 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=1; #length(m)\n", + "L1=0.96; #recorded length(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(L1/L)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",v,\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in area is 0.0063 sq m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=0.1; #radius(m)\n", + "c=1; #assume\n", + "v=0.6*c; #velocity\n", + "\n", + "#Calculation\n", + "A=math.pi*R**2; #area(sq m)\n", + "R1=R*math.sqrt(1-(v**2/c**2)); \n", + "A1=math.pi*R*R1; #plate area in ellipse shape(sq m) \n", + "deltaA=A-A1; #change in area(sq m)\n", + "\n", + "#Result\n", + "print \"change in area is\",round(deltaA,4),\"sq m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in length is 28.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "theta=30*math.pi/180; #angle(rad)\n", + "L=1; #length(m)\n", + "\n", + "#Calculation\n", + "Ix=L*math.cos(theta)*math.sqrt(1-(v**2/c**2));\n", + "Iy=L*math.sin(theta);\n", + "L1=math.sqrt((Ix**2)+(Iy**2)); #changed length(m)\n", + "delta_L=L-L1; #change in length(m)\n", + "\n", + "#Result\n", + "print \"change in length is\",round(delta_L*100),\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 12, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of bacteria grown is 16\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=10; #time(days)\n", + "c=1; #assume\n", + "v=0.99*c; #velocity\n", + "d=280; #number of days \n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(days)\n", + "x=d/int(delta_t1); #number of folds\n", + "n=1*2**x; #number of bacteria grown \n", + "\n", + "#Result\n", + "print \"number of bacteria grown is\",int(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity of B w.r.t A is 0.538 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=c/3; #velocity\n", + "v=c/4; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity of B w.r.t A(c)\n", + "\n", + "#Result\n", + "print \"relative velocity of B w.r.t A is\",round(u,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity is 0.9286 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=0.8*c; #velocity\n", + "v=0.5*c; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity(c)\n", + "\n", + "#Result\n", + "print \"relative velocity is\",round(u,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.866 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=2*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.9428 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=3*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 19, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rest energy is 9 *10**17 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=10; #mass(kg)\n", + "c=3*10**8; #velocity of light(m/s)\n", + "\n", + "#Calculation\n", + "E=m0*c**2; #rest energy(J)\n", + "\n", + "#Result\n", + "print \"rest energy is\",int(E/10**17),\"*10**17 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is 0.1266 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of electron(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "v=0.6*c; #velocity of electron(m/sec)\n", + "e=1.6*10**-19; #conversion factor\n", + "\n", + "#Calculation\n", + "KE=m0*c**2*((1/math.sqrt(1-(v**2/c**2)))-1); #kinetic energy(J)\n", + "KE=KE/e; #kinetic energy(eV) \n", + "\n", + "#Result\n", + "print \"kinetic energy is\",round(KE/10**6,4),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loss in mass is 1.8667 *10**-13 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=50; #mass(gm)\n", + "L=80*4.2; #latent heat(cal/gm)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "\n", + "#Calculation\n", + "Q=m*L; #heat loss(J)\n", + "delta_m=Q/c**2; #loss in mass(kg)\n", + "\n", + "#Result\n", + "print \"loss in mass is\",round(delta_m*10**13,4),\"*10**-13 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of photon is 1.237 *10**20 Hz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9.1*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "h=6.62*10**-34; #planck's constant(Jsec)\n", + "\n", + "#Calculation\n", + "new=m0*c**2/h; #frequency of photon(Hz)\n", + "\n", + "#Result\n", + "print \"frequency of photon is\",round(new/10**20,3),\"*10**20 Hz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of electron is 0.506 MeV\n", + "kinetic energy of positron is 0.394 MeV\n", + "answer for kinetic energy of positron given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "e=1.6*10**-19; #conversion factor\n", + "E=1.8; #energy(MeV)\n", + "\n", + "#Calculation\n", + "E0=m0*c**2/(e*10**6); #kinetic energy of electron(MeV) \n", + "k=(E/2)-E0; #kinetic energy of positron(MeV) \n", + "\n", + "#Result\n", + "print \"kinetic energy of electron is\",round(E0,3),\"MeV\"\n", + "print \"kinetic energy of positron is\",round(k,3),\"MeV\"\n", + "print \"answer for kinetic energy of positron given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 242" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "binding energy is 106.9 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z=7; #atomic number of nitrogen\n", + "N=7; \n", + "mp=1.0086; #mass of proton(amu)\n", + "mn=1.0078; #mass of nucleus(amu)\n", + "amu=931.5; #energy(MeV)\n", + "A=14; #atomic mass \n", + "\n", + "#Calculation\n", + "EB=((Z*mp)+(N*mn)-A)*amu; #binding energy(MeV)\n", + "\n", + "#Result\n", + "print \"binding energy is\",round(EB,1),\"MeV\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_3jQe33P.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_3jQe33P.ipynb new file mode 100644 index 00000000..495cf888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_3jQe33P.ipynb @@ -0,0 +1,844 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6: Special Theory of Relativity" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fringe shift is 0.2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=5; #length(m)\n", + "v=3*10**4; #velocity(m/sec)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "lamda=5000*10**-10; #wavelength(m)\n", + "\n", + "#Calculation\n", + "S=2*l*v**2/(c**2*lamda); #fringe shift\n", + "\n", + "#Result\n", + "print \"fringe shift is\",S" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "coordinates w.r.t moving observer are (x1,y1,z1,t1)=( 800 100 100 0 )\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=1000; #x-coordinate(m)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "t=2*10**-6; #time(s)\n", + "v1=0.6*c;\n", + "y1=y=100; #y-coordinate(m)\n", + "z1=z=100; #z-coordinate(m)\n", + "\n", + "#Calculation\n", + "x1=(x-(v1*t))/math.sqrt(1-((v1/c)**2)); #coordinate along x-axis\n", + "t1=(t-(x*v1/c**2))/math.sqrt(1-((v1/c)**2)); #time\n", + "\n", + "#Result\n", + "print \"coordinates w.r.t moving observer are (x1,y1,z1,t1)=(\",int(x1),int(y1),int(z1),int(t1),\")\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "decay time is 3.83 micro s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.3; #time(micro s)\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(micro s)\n", + "\n", + "#Result\n", + "print \"decay time is\",round(delta_t1,2),\"micro s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "space shuttle velocity is 0.515 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=24; #time(hours)\n", + "delta_t1=28; #decay time(hours)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(delta_t/delta_t1)**2); #space shuttle velocity(c)\n", + "\n", + "#Result\n", + "print \"space shuttle velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "observed displacement is 375.0 m\n", + "relative displacement is 433.01 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.5*10**-6; #time(s)\n", + "c=3*10**8; #velocity of light\n", + "v=c/2; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(s)\n", + "x=v*delta_t; #observed displacement(m)\n", + "x1=v*delta_t1; #relative displacement(m)\n", + "\n", + "#Result\n", + "print \"observed displacement is\",x,\"m\"\n", + "print \"relative displacement is\",round(x1,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative decay in earth diameter is 6.4 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=6400; #radius(km)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "v=30*10**3; #orbital velocity(m/sec)\n", + "\n", + "#Calculation\n", + "d=2*R; #diameter(km)\n", + "d1=d*math.sqrt(1-(v**2/c**2)); \n", + "delta_d=d-d1; #relative decay in earth diameter(m)\n", + "\n", + "#Result\n", + "print \"relative decay in earth diameter is\",round(delta_d*10**5,1),\"*10**-5 m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.28 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=1; #length(m)\n", + "L1=0.96; #recorded length(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(L1/L)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",v,\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in area is 0.0063 sq m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=0.1; #radius(m)\n", + "c=1; #assume\n", + "v=0.6*c; #velocity\n", + "\n", + "#Calculation\n", + "A=math.pi*R**2; #area(sq m)\n", + "R1=R*math.sqrt(1-(v**2/c**2)); \n", + "A1=math.pi*R*R1; #plate area in ellipse shape(sq m) \n", + "deltaA=A-A1; #change in area(sq m)\n", + "\n", + "#Result\n", + "print \"change in area is\",round(deltaA,4),\"sq m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in length is 28.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "theta=30*math.pi/180; #angle(rad)\n", + "L=1; #length(m)\n", + "\n", + "#Calculation\n", + "Ix=L*math.cos(theta)*math.sqrt(1-(v**2/c**2));\n", + "Iy=L*math.sin(theta);\n", + "L1=math.sqrt((Ix**2)+(Iy**2)); #changed length(m)\n", + "delta_L=L-L1; #change in length(m)\n", + "\n", + "#Result\n", + "print \"change in length is\",round(delta_L*100),\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 12, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of bacteria grown is 16\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=10; #time(days)\n", + "c=1; #assume\n", + "v=0.99*c; #velocity\n", + "d=280; #number of days \n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(days)\n", + "x=d/int(delta_t1); #number of folds\n", + "n=1*2**x; #number of bacteria grown \n", + "\n", + "#Result\n", + "print \"number of bacteria grown is\",int(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity of B w.r.t A is 0.538 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=c/3; #velocity\n", + "v=c/4; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity of B w.r.t A(c)\n", + "\n", + "#Result\n", + "print \"relative velocity of B w.r.t A is\",round(u,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity is 0.9286 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=0.8*c; #velocity\n", + "v=0.5*c; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity(c)\n", + "\n", + "#Result\n", + "print \"relative velocity is\",round(u,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.866 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=2*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.9428 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=3*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 19, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rest energy is 9 *10**17 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=10; #mass(kg)\n", + "c=3*10**8; #velocity of light(m/s)\n", + "\n", + "#Calculation\n", + "E=m0*c**2; #rest energy(J)\n", + "\n", + "#Result\n", + "print \"rest energy is\",int(E/10**17),\"*10**17 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is 0.1266 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of electron(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "v=0.6*c; #velocity of electron(m/sec)\n", + "e=1.6*10**-19; #conversion factor\n", + "\n", + "#Calculation\n", + "KE=m0*c**2*((1/math.sqrt(1-(v**2/c**2)))-1); #kinetic energy(J)\n", + "KE=KE/e; #kinetic energy(eV) \n", + "\n", + "#Result\n", + "print \"kinetic energy is\",round(KE/10**6,4),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loss in mass is 1.8667 *10**-13 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=50; #mass(gm)\n", + "L=80*4.2; #latent heat(cal/gm)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "\n", + "#Calculation\n", + "Q=m*L; #heat loss(J)\n", + "delta_m=Q/c**2; #loss in mass(kg)\n", + "\n", + "#Result\n", + "print \"loss in mass is\",round(delta_m*10**13,4),\"*10**-13 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of photon is 1.237 *10**20 Hz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9.1*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "h=6.62*10**-34; #planck's constant(Jsec)\n", + "\n", + "#Calculation\n", + "new=m0*c**2/h; #frequency of photon(Hz)\n", + "\n", + "#Result\n", + "print \"frequency of photon is\",round(new/10**20,3),\"*10**20 Hz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of electron is 0.506 MeV\n", + "kinetic energy of positron is 0.394 MeV\n", + "answer for kinetic energy of positron given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "e=1.6*10**-19; #conversion factor\n", + "E=1.8; #energy(MeV)\n", + "\n", + "#Calculation\n", + "E0=m0*c**2/(e*10**6); #kinetic energy of electron(MeV) \n", + "k=(E/2)-E0; #kinetic energy of positron(MeV) \n", + "\n", + "#Result\n", + "print \"kinetic energy of electron is\",round(E0,3),\"MeV\"\n", + "print \"kinetic energy of positron is\",round(k,3),\"MeV\"\n", + "print \"answer for kinetic energy of positron given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 242" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "binding energy is 106.9 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z=7; #atomic number of nitrogen\n", + "N=7; \n", + "mp=1.0086; #mass of proton(amu)\n", + "mn=1.0078; #mass of nucleus(amu)\n", + "amu=931.5; #energy(MeV)\n", + "A=14; #atomic mass \n", + "\n", + "#Calculation\n", + "EB=((Z*mp)+(N*mn)-A)*amu; #binding energy(MeV)\n", + "\n", + "#Result\n", + "print \"binding energy is\",round(EB,1),\"MeV\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_82dKcIb.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_82dKcIb.ipynb new file mode 100644 index 00000000..495cf888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_82dKcIb.ipynb @@ -0,0 +1,844 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6: Special Theory of Relativity" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fringe shift is 0.2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=5; #length(m)\n", + "v=3*10**4; #velocity(m/sec)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "lamda=5000*10**-10; #wavelength(m)\n", + "\n", + "#Calculation\n", + "S=2*l*v**2/(c**2*lamda); #fringe shift\n", + "\n", + "#Result\n", + "print \"fringe shift is\",S" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "coordinates w.r.t moving observer are (x1,y1,z1,t1)=( 800 100 100 0 )\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=1000; #x-coordinate(m)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "t=2*10**-6; #time(s)\n", + "v1=0.6*c;\n", + "y1=y=100; #y-coordinate(m)\n", + "z1=z=100; #z-coordinate(m)\n", + "\n", + "#Calculation\n", + "x1=(x-(v1*t))/math.sqrt(1-((v1/c)**2)); #coordinate along x-axis\n", + "t1=(t-(x*v1/c**2))/math.sqrt(1-((v1/c)**2)); #time\n", + "\n", + "#Result\n", + "print \"coordinates w.r.t moving observer are (x1,y1,z1,t1)=(\",int(x1),int(y1),int(z1),int(t1),\")\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "decay time is 3.83 micro s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.3; #time(micro s)\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(micro s)\n", + "\n", + "#Result\n", + "print \"decay time is\",round(delta_t1,2),\"micro s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "space shuttle velocity is 0.515 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=24; #time(hours)\n", + "delta_t1=28; #decay time(hours)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(delta_t/delta_t1)**2); #space shuttle velocity(c)\n", + "\n", + "#Result\n", + "print \"space shuttle velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "observed displacement is 375.0 m\n", + "relative displacement is 433.01 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.5*10**-6; #time(s)\n", + "c=3*10**8; #velocity of light\n", + "v=c/2; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(s)\n", + "x=v*delta_t; #observed displacement(m)\n", + "x1=v*delta_t1; #relative displacement(m)\n", + "\n", + "#Result\n", + "print \"observed displacement is\",x,\"m\"\n", + "print \"relative displacement is\",round(x1,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative decay in earth diameter is 6.4 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=6400; #radius(km)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "v=30*10**3; #orbital velocity(m/sec)\n", + "\n", + "#Calculation\n", + "d=2*R; #diameter(km)\n", + "d1=d*math.sqrt(1-(v**2/c**2)); \n", + "delta_d=d-d1; #relative decay in earth diameter(m)\n", + "\n", + "#Result\n", + "print \"relative decay in earth diameter is\",round(delta_d*10**5,1),\"*10**-5 m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.28 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=1; #length(m)\n", + "L1=0.96; #recorded length(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(L1/L)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",v,\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in area is 0.0063 sq m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=0.1; #radius(m)\n", + "c=1; #assume\n", + "v=0.6*c; #velocity\n", + "\n", + "#Calculation\n", + "A=math.pi*R**2; #area(sq m)\n", + "R1=R*math.sqrt(1-(v**2/c**2)); \n", + "A1=math.pi*R*R1; #plate area in ellipse shape(sq m) \n", + "deltaA=A-A1; #change in area(sq m)\n", + "\n", + "#Result\n", + "print \"change in area is\",round(deltaA,4),\"sq m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in length is 28.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "theta=30*math.pi/180; #angle(rad)\n", + "L=1; #length(m)\n", + "\n", + "#Calculation\n", + "Ix=L*math.cos(theta)*math.sqrt(1-(v**2/c**2));\n", + "Iy=L*math.sin(theta);\n", + "L1=math.sqrt((Ix**2)+(Iy**2)); #changed length(m)\n", + "delta_L=L-L1; #change in length(m)\n", + "\n", + "#Result\n", + "print \"change in length is\",round(delta_L*100),\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 12, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of bacteria grown is 16\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=10; #time(days)\n", + "c=1; #assume\n", + "v=0.99*c; #velocity\n", + "d=280; #number of days \n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(days)\n", + "x=d/int(delta_t1); #number of folds\n", + "n=1*2**x; #number of bacteria grown \n", + "\n", + "#Result\n", + "print \"number of bacteria grown is\",int(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity of B w.r.t A is 0.538 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=c/3; #velocity\n", + "v=c/4; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity of B w.r.t A(c)\n", + "\n", + "#Result\n", + "print \"relative velocity of B w.r.t A is\",round(u,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity is 0.9286 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=0.8*c; #velocity\n", + "v=0.5*c; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity(c)\n", + "\n", + "#Result\n", + "print \"relative velocity is\",round(u,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.866 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=2*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.9428 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=3*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 19, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rest energy is 9 *10**17 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=10; #mass(kg)\n", + "c=3*10**8; #velocity of light(m/s)\n", + "\n", + "#Calculation\n", + "E=m0*c**2; #rest energy(J)\n", + "\n", + "#Result\n", + "print \"rest energy is\",int(E/10**17),\"*10**17 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is 0.1266 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of electron(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "v=0.6*c; #velocity of electron(m/sec)\n", + "e=1.6*10**-19; #conversion factor\n", + "\n", + "#Calculation\n", + "KE=m0*c**2*((1/math.sqrt(1-(v**2/c**2)))-1); #kinetic energy(J)\n", + "KE=KE/e; #kinetic energy(eV) \n", + "\n", + "#Result\n", + "print \"kinetic energy is\",round(KE/10**6,4),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loss in mass is 1.8667 *10**-13 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=50; #mass(gm)\n", + "L=80*4.2; #latent heat(cal/gm)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "\n", + "#Calculation\n", + "Q=m*L; #heat loss(J)\n", + "delta_m=Q/c**2; #loss in mass(kg)\n", + "\n", + "#Result\n", + "print \"loss in mass is\",round(delta_m*10**13,4),\"*10**-13 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of photon is 1.237 *10**20 Hz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9.1*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "h=6.62*10**-34; #planck's constant(Jsec)\n", + "\n", + "#Calculation\n", + "new=m0*c**2/h; #frequency of photon(Hz)\n", + "\n", + "#Result\n", + "print \"frequency of photon is\",round(new/10**20,3),\"*10**20 Hz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of electron is 0.506 MeV\n", + "kinetic energy of positron is 0.394 MeV\n", + "answer for kinetic energy of positron given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "e=1.6*10**-19; #conversion factor\n", + "E=1.8; #energy(MeV)\n", + "\n", + "#Calculation\n", + "E0=m0*c**2/(e*10**6); #kinetic energy of electron(MeV) \n", + "k=(E/2)-E0; #kinetic energy of positron(MeV) \n", + "\n", + "#Result\n", + "print \"kinetic energy of electron is\",round(E0,3),\"MeV\"\n", + "print \"kinetic energy of positron is\",round(k,3),\"MeV\"\n", + "print \"answer for kinetic energy of positron given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 242" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "binding energy is 106.9 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z=7; #atomic number of nitrogen\n", + "N=7; \n", + "mp=1.0086; #mass of proton(amu)\n", + "mn=1.0078; #mass of nucleus(amu)\n", + "amu=931.5; #energy(MeV)\n", + "A=14; #atomic mass \n", + "\n", + "#Calculation\n", + "EB=((Z*mp)+(N*mn)-A)*amu; #binding energy(MeV)\n", + "\n", + "#Result\n", + "print \"binding energy is\",round(EB,1),\"MeV\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_B9Rqa7w.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_B9Rqa7w.ipynb new file mode 100644 index 00000000..495cf888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_B9Rqa7w.ipynb @@ -0,0 +1,844 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6: Special Theory of Relativity" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fringe shift is 0.2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=5; #length(m)\n", + "v=3*10**4; #velocity(m/sec)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "lamda=5000*10**-10; #wavelength(m)\n", + "\n", + "#Calculation\n", + "S=2*l*v**2/(c**2*lamda); #fringe shift\n", + "\n", + "#Result\n", + "print \"fringe shift is\",S" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "coordinates w.r.t moving observer are (x1,y1,z1,t1)=( 800 100 100 0 )\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=1000; #x-coordinate(m)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "t=2*10**-6; #time(s)\n", + "v1=0.6*c;\n", + "y1=y=100; #y-coordinate(m)\n", + "z1=z=100; #z-coordinate(m)\n", + "\n", + "#Calculation\n", + "x1=(x-(v1*t))/math.sqrt(1-((v1/c)**2)); #coordinate along x-axis\n", + "t1=(t-(x*v1/c**2))/math.sqrt(1-((v1/c)**2)); #time\n", + "\n", + "#Result\n", + "print \"coordinates w.r.t moving observer are (x1,y1,z1,t1)=(\",int(x1),int(y1),int(z1),int(t1),\")\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "decay time is 3.83 micro s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.3; #time(micro s)\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(micro s)\n", + "\n", + "#Result\n", + "print \"decay time is\",round(delta_t1,2),\"micro s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "space shuttle velocity is 0.515 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=24; #time(hours)\n", + "delta_t1=28; #decay time(hours)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(delta_t/delta_t1)**2); #space shuttle velocity(c)\n", + "\n", + "#Result\n", + "print \"space shuttle velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "observed displacement is 375.0 m\n", + "relative displacement is 433.01 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.5*10**-6; #time(s)\n", + "c=3*10**8; #velocity of light\n", + "v=c/2; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(s)\n", + "x=v*delta_t; #observed displacement(m)\n", + "x1=v*delta_t1; #relative displacement(m)\n", + "\n", + "#Result\n", + "print \"observed displacement is\",x,\"m\"\n", + "print \"relative displacement is\",round(x1,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative decay in earth diameter is 6.4 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=6400; #radius(km)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "v=30*10**3; #orbital velocity(m/sec)\n", + "\n", + "#Calculation\n", + "d=2*R; #diameter(km)\n", + "d1=d*math.sqrt(1-(v**2/c**2)); \n", + "delta_d=d-d1; #relative decay in earth diameter(m)\n", + "\n", + "#Result\n", + "print \"relative decay in earth diameter is\",round(delta_d*10**5,1),\"*10**-5 m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.28 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=1; #length(m)\n", + "L1=0.96; #recorded length(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(L1/L)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",v,\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in area is 0.0063 sq m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=0.1; #radius(m)\n", + "c=1; #assume\n", + "v=0.6*c; #velocity\n", + "\n", + "#Calculation\n", + "A=math.pi*R**2; #area(sq m)\n", + "R1=R*math.sqrt(1-(v**2/c**2)); \n", + "A1=math.pi*R*R1; #plate area in ellipse shape(sq m) \n", + "deltaA=A-A1; #change in area(sq m)\n", + "\n", + "#Result\n", + "print \"change in area is\",round(deltaA,4),\"sq m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in length is 28.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "theta=30*math.pi/180; #angle(rad)\n", + "L=1; #length(m)\n", + "\n", + "#Calculation\n", + "Ix=L*math.cos(theta)*math.sqrt(1-(v**2/c**2));\n", + "Iy=L*math.sin(theta);\n", + "L1=math.sqrt((Ix**2)+(Iy**2)); #changed length(m)\n", + "delta_L=L-L1; #change in length(m)\n", + "\n", + "#Result\n", + "print \"change in length is\",round(delta_L*100),\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 12, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of bacteria grown is 16\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=10; #time(days)\n", + "c=1; #assume\n", + "v=0.99*c; #velocity\n", + "d=280; #number of days \n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(days)\n", + "x=d/int(delta_t1); #number of folds\n", + "n=1*2**x; #number of bacteria grown \n", + "\n", + "#Result\n", + "print \"number of bacteria grown is\",int(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity of B w.r.t A is 0.538 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=c/3; #velocity\n", + "v=c/4; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity of B w.r.t A(c)\n", + "\n", + "#Result\n", + "print \"relative velocity of B w.r.t A is\",round(u,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity is 0.9286 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=0.8*c; #velocity\n", + "v=0.5*c; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity(c)\n", + "\n", + "#Result\n", + "print \"relative velocity is\",round(u,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.866 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=2*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.9428 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=3*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 19, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rest energy is 9 *10**17 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=10; #mass(kg)\n", + "c=3*10**8; #velocity of light(m/s)\n", + "\n", + "#Calculation\n", + "E=m0*c**2; #rest energy(J)\n", + "\n", + "#Result\n", + "print \"rest energy is\",int(E/10**17),\"*10**17 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is 0.1266 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of electron(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "v=0.6*c; #velocity of electron(m/sec)\n", + "e=1.6*10**-19; #conversion factor\n", + "\n", + "#Calculation\n", + "KE=m0*c**2*((1/math.sqrt(1-(v**2/c**2)))-1); #kinetic energy(J)\n", + "KE=KE/e; #kinetic energy(eV) \n", + "\n", + "#Result\n", + "print \"kinetic energy is\",round(KE/10**6,4),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loss in mass is 1.8667 *10**-13 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=50; #mass(gm)\n", + "L=80*4.2; #latent heat(cal/gm)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "\n", + "#Calculation\n", + "Q=m*L; #heat loss(J)\n", + "delta_m=Q/c**2; #loss in mass(kg)\n", + "\n", + "#Result\n", + "print \"loss in mass is\",round(delta_m*10**13,4),\"*10**-13 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of photon is 1.237 *10**20 Hz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9.1*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "h=6.62*10**-34; #planck's constant(Jsec)\n", + "\n", + "#Calculation\n", + "new=m0*c**2/h; #frequency of photon(Hz)\n", + "\n", + "#Result\n", + "print \"frequency of photon is\",round(new/10**20,3),\"*10**20 Hz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of electron is 0.506 MeV\n", + "kinetic energy of positron is 0.394 MeV\n", + "answer for kinetic energy of positron given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "e=1.6*10**-19; #conversion factor\n", + "E=1.8; #energy(MeV)\n", + "\n", + "#Calculation\n", + "E0=m0*c**2/(e*10**6); #kinetic energy of electron(MeV) \n", + "k=(E/2)-E0; #kinetic energy of positron(MeV) \n", + "\n", + "#Result\n", + "print \"kinetic energy of electron is\",round(E0,3),\"MeV\"\n", + "print \"kinetic energy of positron is\",round(k,3),\"MeV\"\n", + "print \"answer for kinetic energy of positron given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 242" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "binding energy is 106.9 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z=7; #atomic number of nitrogen\n", + "N=7; \n", + "mp=1.0086; #mass of proton(amu)\n", + "mn=1.0078; #mass of nucleus(amu)\n", + "amu=931.5; #energy(MeV)\n", + "A=14; #atomic mass \n", + "\n", + "#Calculation\n", + "EB=((Z*mp)+(N*mn)-A)*amu; #binding energy(MeV)\n", + "\n", + "#Result\n", + "print \"binding energy is\",round(EB,1),\"MeV\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_sbBGzp3.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_sbBGzp3.ipynb new file mode 100644 index 00000000..495cf888 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_sbBGzp3.ipynb @@ -0,0 +1,844 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6: Special Theory of Relativity" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fringe shift is 0.2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "l=5; #length(m)\n", + "v=3*10**4; #velocity(m/sec)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "lamda=5000*10**-10; #wavelength(m)\n", + "\n", + "#Calculation\n", + "S=2*l*v**2/(c**2*lamda); #fringe shift\n", + "\n", + "#Result\n", + "print \"fringe shift is\",S" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 235" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "coordinates w.r.t moving observer are (x1,y1,z1,t1)=( 800 100 100 0 )\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "x=1000; #x-coordinate(m)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "t=2*10**-6; #time(s)\n", + "v1=0.6*c;\n", + "y1=y=100; #y-coordinate(m)\n", + "z1=z=100; #z-coordinate(m)\n", + "\n", + "#Calculation\n", + "x1=(x-(v1*t))/math.sqrt(1-((v1/c)**2)); #coordinate along x-axis\n", + "t1=(t-(x*v1/c**2))/math.sqrt(1-((v1/c)**2)); #time\n", + "\n", + "#Result\n", + "print \"coordinates w.r.t moving observer are (x1,y1,z1,t1)=(\",int(x1),int(y1),int(z1),int(t1),\")\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "decay time is 3.83 micro s\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.3; #time(micro s)\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(micro s)\n", + "\n", + "#Result\n", + "print \"decay time is\",round(delta_t1,2),\"micro s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "space shuttle velocity is 0.515 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=24; #time(hours)\n", + "delta_t1=28; #decay time(hours)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(delta_t/delta_t1)**2); #space shuttle velocity(c)\n", + "\n", + "#Result\n", + "print \"space shuttle velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 236" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "observed displacement is 375.0 m\n", + "relative displacement is 433.01 m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=2.5*10**-6; #time(s)\n", + "c=3*10**8; #velocity of light\n", + "v=c/2; #velocity\n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(s)\n", + "x=v*delta_t; #observed displacement(m)\n", + "x1=v*delta_t1; #relative displacement(m)\n", + "\n", + "#Result\n", + "print \"observed displacement is\",x,\"m\"\n", + "print \"relative displacement is\",round(x1,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 8, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative decay in earth diameter is 6.4 *10**-5 m\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=6400; #radius(km)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "v=30*10**3; #orbital velocity(m/sec)\n", + "\n", + "#Calculation\n", + "d=2*R; #diameter(km)\n", + "d1=d*math.sqrt(1-(v**2/c**2)); \n", + "delta_d=d-d1; #relative decay in earth diameter(m)\n", + "\n", + "#Result\n", + "print \"relative decay in earth diameter is\",round(delta_d*10**5,1),\"*10**-5 m\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 9, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.28 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "L=1; #length(m)\n", + "L1=0.96; #recorded length(m)\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(L1/L)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",v,\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 10, Page number 237" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in area is 0.0063 sq m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "R=0.1; #radius(m)\n", + "c=1; #assume\n", + "v=0.6*c; #velocity\n", + "\n", + "#Calculation\n", + "A=math.pi*R**2; #area(sq m)\n", + "R1=R*math.sqrt(1-(v**2/c**2)); \n", + "A1=math.pi*R*R1; #plate area in ellipse shape(sq m) \n", + "deltaA=A-A1; #change in area(sq m)\n", + "\n", + "#Result\n", + "print \"change in area is\",round(deltaA,4),\"sq m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 11, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "change in length is 28.0 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "v=0.8*c; #velocity\n", + "theta=30*math.pi/180; #angle(rad)\n", + "L=1; #length(m)\n", + "\n", + "#Calculation\n", + "Ix=L*math.cos(theta)*math.sqrt(1-(v**2/c**2));\n", + "Iy=L*math.sin(theta);\n", + "L1=math.sqrt((Ix**2)+(Iy**2)); #changed length(m)\n", + "delta_L=L-L1; #change in length(m)\n", + "\n", + "#Result\n", + "print \"change in length is\",round(delta_L*100),\"cm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 12, Page number 238" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of bacteria grown is 16\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "delta_t=10; #time(days)\n", + "c=1; #assume\n", + "v=0.99*c; #velocity\n", + "d=280; #number of days \n", + "\n", + "#Calculation\n", + "delta_t1=delta_t/math.sqrt(1-(v**2/c**2)); #decay time(days)\n", + "x=d/int(delta_t1); #number of folds\n", + "n=1*2**x; #number of bacteria grown \n", + "\n", + "#Result\n", + "print \"number of bacteria grown is\",int(n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 13, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity of B w.r.t A is 0.538 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=c/3; #velocity\n", + "v=c/4; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity of B w.r.t A(c)\n", + "\n", + "#Result\n", + "print \"relative velocity of B w.r.t A is\",round(u,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 14, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative velocity is 0.9286 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "c=1; #assume\n", + "u1=0.8*c; #velocity\n", + "v=0.5*c; #velocity\n", + "\n", + "#Calculation\n", + "u=(u1+v)/(1+(u1*v/c**2)); #relative velocity(c)\n", + "\n", + "#Result\n", + "print \"relative velocity is\",round(u,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 16, Page number 239" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.866 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=2*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,3),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 17, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity is 0.9428 c\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=1; #assume\n", + "m=3*m0;\n", + "\n", + "#Calculation\n", + "v=math.sqrt(1-(m0/m)**2); #velocity(c)\n", + "\n", + "#Result\n", + "print \"velocity is\",round(v,4),\"c\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 19, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rest energy is 9 *10**17 J\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=10; #mass(kg)\n", + "c=3*10**8; #velocity of light(m/s)\n", + "\n", + "#Calculation\n", + "E=m0*c**2; #rest energy(J)\n", + "\n", + "#Result\n", + "print \"rest energy is\",int(E/10**17),\"*10**17 J\"\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 20, Page number 240" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is 0.1266 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of electron(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "v=0.6*c; #velocity of electron(m/sec)\n", + "e=1.6*10**-19; #conversion factor\n", + "\n", + "#Calculation\n", + "KE=m0*c**2*((1/math.sqrt(1-(v**2/c**2)))-1); #kinetic energy(J)\n", + "KE=KE/e; #kinetic energy(eV) \n", + "\n", + "#Result\n", + "print \"kinetic energy is\",round(KE/10**6,4),\"MeV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 21, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "loss in mass is 1.8667 *10**-13 kg\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=50; #mass(gm)\n", + "L=80*4.2; #latent heat(cal/gm)\n", + "c=3*10**8; #velocity of light(m/sec)\n", + "\n", + "#Calculation\n", + "Q=m*L; #heat loss(J)\n", + "delta_m=Q/c**2; #loss in mass(kg)\n", + "\n", + "#Result\n", + "print \"loss in mass is\",round(delta_m*10**13,4),\"*10**-13 kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 22, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of photon is 1.237 *10**20 Hz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9.1*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "h=6.62*10**-34; #planck's constant(Jsec)\n", + "\n", + "#Calculation\n", + "new=m0*c**2/h; #frequency of photon(Hz)\n", + "\n", + "#Result\n", + "print \"frequency of photon is\",round(new/10**20,3),\"*10**20 Hz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 23, Page number 241" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of electron is 0.506 MeV\n", + "kinetic energy of positron is 0.394 MeV\n", + "answer for kinetic energy of positron given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m0=9*10**-31; #mass of photon(g)\n", + "c=3*10**8; #velocity of light(m/sec) \n", + "e=1.6*10**-19; #conversion factor\n", + "E=1.8; #energy(MeV)\n", + "\n", + "#Calculation\n", + "E0=m0*c**2/(e*10**6); #kinetic energy of electron(MeV) \n", + "k=(E/2)-E0; #kinetic energy of positron(MeV) \n", + "\n", + "#Result\n", + "print \"kinetic energy of electron is\",round(E0,3),\"MeV\"\n", + "print \"kinetic energy of positron is\",round(k,3),\"MeV\"\n", + "print \"answer for kinetic energy of positron given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 24, Page number 242" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "binding energy is 106.9 MeV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Z=7; #atomic number of nitrogen\n", + "N=7; \n", + "mp=1.0086; #mass of proton(amu)\n", + "mn=1.0078; #mass of nucleus(amu)\n", + "amu=931.5; #energy(MeV)\n", + "A=14; #atomic mass \n", + "\n", + "#Calculation\n", + "EB=((Z*mp)+(N*mn)-A)*amu; #binding energy(MeV)\n", + "\n", + "#Result\n", + "print \"binding energy is\",round(EB,1),\"MeV\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_48wEqkn.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_48wEqkn.ipynb new file mode 100644 index 00000000..13136d2a --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_48wEqkn.ipynb @@ -0,0 +1,172 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 7: Vibrations-Fundamental Concepts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force constant is 0.02 N/m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=-0.0176; #acceleration(m/s**2)\n", + "x=0.44; #displacement(m)\n", + "m=0.5; #mass(kg)\n", + "\n", + "#Calculation\n", + "omega0=math.sqrt(-a/x); #frequency\n", + "k=m*omega0**2; #force constant(N/m)\n", + "\n", + "#Result\n", + "print \"force constant is\",k,\"N/m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of oscillation is 1.114 Hertz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration(m/s**2)\n", + "x=0.5; #displacement(m)\n", + "m1=5; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "\n", + "#Calculation\n", + "k=m1*g/x; #spring constant(N/m)\n", + "omega=math.sqrt(k/m2)/(2*math.pi); #frequency of oscillation(Hertz)\n", + "\n", + "#Result\n", + "print \"frequency of oscillation is\",round(omega,3),\"Hertz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 272" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 0.3 m\n", + "frequency of oscillation is 1.0 /(2 math.pi) Hertz\n", + "initial phase is -2 *math.pi/6 rad\n", + "answer for initial phase given in the book is wrong\n", + "displacement is 0.3 m\n", + "velocity is -0.26 m/sec\n", + "acceleration is 0.15 m/s**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given y=0.3sin(t+pi/6)\n", + "A=0.3; #value of amplitude by comparing with the given equation\n", + "omega=1; #angular freuency(rad/sec)\n", + "theta=math.pi/6; #angle(rad)\n", + "t1=math.pi/3; #time(sec)\n", + "t2=2*math.pi/3; #time(sec)\n", + "t3=math.pi; #time(sec)\n", + "\n", + "#Calculation\n", + "new=omega/(2*math.pi); #frequency of oscillation(Hertz)\n", + "phi=theta-(math.pi/2); #initial phase(rad)\n", + "y=A*math.sin(theta+(math.pi/6)); #displacement(m)\n", + "V=omega*A*math.cos((omega*t2)+theta); #velocity(m/sec)\n", + "a=-A*omega**2*math.sin((omega*t3)+theta); #acceleration(m/s**2)\n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"m\"\n", + "print \"frequency of oscillation is\",new*2*math.pi,\"/(2 math.pi) Hertz\"\n", + "print \"initial phase is\",int(phi*6/math.pi),\"*math.pi/6 rad\"\n", + "print \"answer for initial phase given in the book is wrong\"\n", + "print \"displacement is\",round(y,1),\"m\"\n", + "print \"velocity is\",round(V,2),\"m/sec\"\n", + "print \"acceleration is\",a,\"m/s**2\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_4Sf4X8V.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_4Sf4X8V.ipynb new file mode 100644 index 00000000..13136d2a --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_4Sf4X8V.ipynb @@ -0,0 +1,172 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 7: Vibrations-Fundamental Concepts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force constant is 0.02 N/m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=-0.0176; #acceleration(m/s**2)\n", + "x=0.44; #displacement(m)\n", + "m=0.5; #mass(kg)\n", + "\n", + "#Calculation\n", + "omega0=math.sqrt(-a/x); #frequency\n", + "k=m*omega0**2; #force constant(N/m)\n", + "\n", + "#Result\n", + "print \"force constant is\",k,\"N/m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of oscillation is 1.114 Hertz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration(m/s**2)\n", + "x=0.5; #displacement(m)\n", + "m1=5; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "\n", + "#Calculation\n", + "k=m1*g/x; #spring constant(N/m)\n", + "omega=math.sqrt(k/m2)/(2*math.pi); #frequency of oscillation(Hertz)\n", + "\n", + "#Result\n", + "print \"frequency of oscillation is\",round(omega,3),\"Hertz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 272" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 0.3 m\n", + "frequency of oscillation is 1.0 /(2 math.pi) Hertz\n", + "initial phase is -2 *math.pi/6 rad\n", + "answer for initial phase given in the book is wrong\n", + "displacement is 0.3 m\n", + "velocity is -0.26 m/sec\n", + "acceleration is 0.15 m/s**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given y=0.3sin(t+pi/6)\n", + "A=0.3; #value of amplitude by comparing with the given equation\n", + "omega=1; #angular freuency(rad/sec)\n", + "theta=math.pi/6; #angle(rad)\n", + "t1=math.pi/3; #time(sec)\n", + "t2=2*math.pi/3; #time(sec)\n", + "t3=math.pi; #time(sec)\n", + "\n", + "#Calculation\n", + "new=omega/(2*math.pi); #frequency of oscillation(Hertz)\n", + "phi=theta-(math.pi/2); #initial phase(rad)\n", + "y=A*math.sin(theta+(math.pi/6)); #displacement(m)\n", + "V=omega*A*math.cos((omega*t2)+theta); #velocity(m/sec)\n", + "a=-A*omega**2*math.sin((omega*t3)+theta); #acceleration(m/s**2)\n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"m\"\n", + "print \"frequency of oscillation is\",new*2*math.pi,\"/(2 math.pi) Hertz\"\n", + "print \"initial phase is\",int(phi*6/math.pi),\"*math.pi/6 rad\"\n", + "print \"answer for initial phase given in the book is wrong\"\n", + "print \"displacement is\",round(y,1),\"m\"\n", + "print \"velocity is\",round(V,2),\"m/sec\"\n", + "print \"acceleration is\",a,\"m/s**2\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_K4XC4i4.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_K4XC4i4.ipynb new file mode 100644 index 00000000..13136d2a --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_K4XC4i4.ipynb @@ -0,0 +1,172 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 7: Vibrations-Fundamental Concepts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force constant is 0.02 N/m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=-0.0176; #acceleration(m/s**2)\n", + "x=0.44; #displacement(m)\n", + "m=0.5; #mass(kg)\n", + "\n", + "#Calculation\n", + "omega0=math.sqrt(-a/x); #frequency\n", + "k=m*omega0**2; #force constant(N/m)\n", + "\n", + "#Result\n", + "print \"force constant is\",k,\"N/m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of oscillation is 1.114 Hertz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration(m/s**2)\n", + "x=0.5; #displacement(m)\n", + "m1=5; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "\n", + "#Calculation\n", + "k=m1*g/x; #spring constant(N/m)\n", + "omega=math.sqrt(k/m2)/(2*math.pi); #frequency of oscillation(Hertz)\n", + "\n", + "#Result\n", + "print \"frequency of oscillation is\",round(omega,3),\"Hertz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 272" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 0.3 m\n", + "frequency of oscillation is 1.0 /(2 math.pi) Hertz\n", + "initial phase is -2 *math.pi/6 rad\n", + "answer for initial phase given in the book is wrong\n", + "displacement is 0.3 m\n", + "velocity is -0.26 m/sec\n", + "acceleration is 0.15 m/s**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given y=0.3sin(t+pi/6)\n", + "A=0.3; #value of amplitude by comparing with the given equation\n", + "omega=1; #angular freuency(rad/sec)\n", + "theta=math.pi/6; #angle(rad)\n", + "t1=math.pi/3; #time(sec)\n", + "t2=2*math.pi/3; #time(sec)\n", + "t3=math.pi; #time(sec)\n", + "\n", + "#Calculation\n", + "new=omega/(2*math.pi); #frequency of oscillation(Hertz)\n", + "phi=theta-(math.pi/2); #initial phase(rad)\n", + "y=A*math.sin(theta+(math.pi/6)); #displacement(m)\n", + "V=omega*A*math.cos((omega*t2)+theta); #velocity(m/sec)\n", + "a=-A*omega**2*math.sin((omega*t3)+theta); #acceleration(m/s**2)\n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"m\"\n", + "print \"frequency of oscillation is\",new*2*math.pi,\"/(2 math.pi) Hertz\"\n", + "print \"initial phase is\",int(phi*6/math.pi),\"*math.pi/6 rad\"\n", + "print \"answer for initial phase given in the book is wrong\"\n", + "print \"displacement is\",round(y,1),\"m\"\n", + "print \"velocity is\",round(V,2),\"m/sec\"\n", + "print \"acceleration is\",a,\"m/s**2\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_Lujuudw.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_Lujuudw.ipynb new file mode 100644 index 00000000..13136d2a --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_Lujuudw.ipynb @@ -0,0 +1,172 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 7: Vibrations-Fundamental Concepts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force constant is 0.02 N/m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=-0.0176; #acceleration(m/s**2)\n", + "x=0.44; #displacement(m)\n", + "m=0.5; #mass(kg)\n", + "\n", + "#Calculation\n", + "omega0=math.sqrt(-a/x); #frequency\n", + "k=m*omega0**2; #force constant(N/m)\n", + "\n", + "#Result\n", + "print \"force constant is\",k,\"N/m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of oscillation is 1.114 Hertz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration(m/s**2)\n", + "x=0.5; #displacement(m)\n", + "m1=5; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "\n", + "#Calculation\n", + "k=m1*g/x; #spring constant(N/m)\n", + "omega=math.sqrt(k/m2)/(2*math.pi); #frequency of oscillation(Hertz)\n", + "\n", + "#Result\n", + "print \"frequency of oscillation is\",round(omega,3),\"Hertz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 272" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 0.3 m\n", + "frequency of oscillation is 1.0 /(2 math.pi) Hertz\n", + "initial phase is -2 *math.pi/6 rad\n", + "answer for initial phase given in the book is wrong\n", + "displacement is 0.3 m\n", + "velocity is -0.26 m/sec\n", + "acceleration is 0.15 m/s**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given y=0.3sin(t+pi/6)\n", + "A=0.3; #value of amplitude by comparing with the given equation\n", + "omega=1; #angular freuency(rad/sec)\n", + "theta=math.pi/6; #angle(rad)\n", + "t1=math.pi/3; #time(sec)\n", + "t2=2*math.pi/3; #time(sec)\n", + "t3=math.pi; #time(sec)\n", + "\n", + "#Calculation\n", + "new=omega/(2*math.pi); #frequency of oscillation(Hertz)\n", + "phi=theta-(math.pi/2); #initial phase(rad)\n", + "y=A*math.sin(theta+(math.pi/6)); #displacement(m)\n", + "V=omega*A*math.cos((omega*t2)+theta); #velocity(m/sec)\n", + "a=-A*omega**2*math.sin((omega*t3)+theta); #acceleration(m/s**2)\n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"m\"\n", + "print \"frequency of oscillation is\",new*2*math.pi,\"/(2 math.pi) Hertz\"\n", + "print \"initial phase is\",int(phi*6/math.pi),\"*math.pi/6 rad\"\n", + "print \"answer for initial phase given in the book is wrong\"\n", + "print \"displacement is\",round(y,1),\"m\"\n", + "print \"velocity is\",round(V,2),\"m/sec\"\n", + "print \"acceleration is\",a,\"m/s**2\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_q7uuGrG.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_q7uuGrG.ipynb new file mode 100644 index 00000000..13136d2a --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_q7uuGrG.ipynb @@ -0,0 +1,172 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 7: Vibrations-Fundamental Concepts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force constant is 0.02 N/m\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=-0.0176; #acceleration(m/s**2)\n", + "x=0.44; #displacement(m)\n", + "m=0.5; #mass(kg)\n", + "\n", + "#Calculation\n", + "omega0=math.sqrt(-a/x); #frequency\n", + "k=m*omega0**2; #force constant(N/m)\n", + "\n", + "#Result\n", + "print \"force constant is\",k,\"N/m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "frequency of oscillation is 1.114 Hertz\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "g=9.8; #acceleration(m/s**2)\n", + "x=0.5; #displacement(m)\n", + "m1=5; #mass(kg)\n", + "m2=2; #mass(kg)\n", + "\n", + "#Calculation\n", + "k=m1*g/x; #spring constant(N/m)\n", + "omega=math.sqrt(k/m2)/(2*math.pi); #frequency of oscillation(Hertz)\n", + "\n", + "#Result\n", + "print \"frequency of oscillation is\",round(omega,3),\"Hertz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 272" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amplitude is 0.3 m\n", + "frequency of oscillation is 1.0 /(2 math.pi) Hertz\n", + "initial phase is -2 *math.pi/6 rad\n", + "answer for initial phase given in the book is wrong\n", + "displacement is 0.3 m\n", + "velocity is -0.26 m/sec\n", + "acceleration is 0.15 m/s**2\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "#given y=0.3sin(t+pi/6)\n", + "A=0.3; #value of amplitude by comparing with the given equation\n", + "omega=1; #angular freuency(rad/sec)\n", + "theta=math.pi/6; #angle(rad)\n", + "t1=math.pi/3; #time(sec)\n", + "t2=2*math.pi/3; #time(sec)\n", + "t3=math.pi; #time(sec)\n", + "\n", + "#Calculation\n", + "new=omega/(2*math.pi); #frequency of oscillation(Hertz)\n", + "phi=theta-(math.pi/2); #initial phase(rad)\n", + "y=A*math.sin(theta+(math.pi/6)); #displacement(m)\n", + "V=omega*A*math.cos((omega*t2)+theta); #velocity(m/sec)\n", + "a=-A*omega**2*math.sin((omega*t3)+theta); #acceleration(m/s**2)\n", + "\n", + "#Result\n", + "print \"amplitude is\",A,\"m\"\n", + "print \"frequency of oscillation is\",new*2*math.pi,\"/(2 math.pi) Hertz\"\n", + "print \"initial phase is\",int(phi*6/math.pi),\"*math.pi/6 rad\"\n", + "print \"answer for initial phase given in the book is wrong\"\n", + "print \"displacement is\",round(y,1),\"m\"\n", + "print \"velocity is\",round(V,2),\"m/sec\"\n", + "print \"acceleration is\",a,\"m/s**2\"" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_5IoMeUe.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_5IoMeUe.ipynb new file mode 100644 index 00000000..14a19e18 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_5IoMeUe.ipynb @@ -0,0 +1,306 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 8: Damped and Forced Oscillations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 300" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "restoration energy is 125000 erg\n", + "frequency is 5 /math.pi Hz\n", + "time taken for reduction of amplitude is 3.22 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "k=10**4; #Force constant(dyne/cm)\n", + "x=5; #displacement(cm)\n", + "m=100; #mass(gm)\n", + "R=100; #resistance(dyne/cm)\n", + "At=1; #amplitude(cm)\n", + "A0=5; #amplitude(cm)\n", + "\n", + "#Calculation\n", + "E=(1/2)*k*x**2; #restoration energy(erg)\n", + "v=1/(2*math.pi)*math.sqrt(k/m) #frequency(Hz)\n", + "b=R/(2*m); \n", + "t=math.log(A0/At)/b; #time taken for reduction of amplitude(sec)\n", + "\n", + "#Result\n", + "print \"restoration energy is\",int(E),\"erg\"\n", + "print \"frequency is\",int(v*math.pi),\"/math.pi Hz\"\n", + "print \"time taken for reduction of amplitude is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 61.08 sec\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "new=300; #frequency(Hz)\n", + "EbyE0=1/10; #ratio of energy\n", + "Q=5*10**4; #Q factor\n", + "\n", + "#Calculation\n", + "tbytow=math.log(1/EbyE0);\n", + "tow=Q/(2*math.pi*new); \n", + "t=tbytow*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",round(t,2),\"sec\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 6 sec\n", + "procedure followed in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Q=2.2*10**3; #Q value of sonometer wire\n", + "new=210; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "tow=Q/(2*math.pi*new); #torque(Nm)\n", + "t=4*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",int(t),\"sec\"\n", + "print \"procedure followed in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "damping factor is 0.0618 N/m\n", + "Q-factor is 113.3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.5; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "x=0.05; #displacement(m)\n", + "\n", + "#Calculation\n", + "k=m*g/x; \n", + "omega0=math.sqrt(k/m); #angular velocity\n", + "T=50*2*math.pi/omega0; #time taken for 50 oscillations(sec)\n", + "b=math.log(4)/T; #damping factor(N/m)\n", + "R=2*b*m; #resistance(ohm)\n", + "Q=m*omega0/R; #Q-factor\n", + "\n", + "#Result\n", + "print \"damping factor is\",round(b,4),\"N/m\"\n", + "print \"Q-factor is\",round(Q,1)\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of oscillations is 27.73\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(gm)\n", + "R=10; #damping constant\n", + "E=50; #energy(J)\n", + "E0=200; #energy(J)\n", + "new=200; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "b=R/(2*m);\n", + "t=math.log(E0/E)/(2*b); #time taken(sec)\n", + "n=new*t; #number of oscillations\n", + "\n", + "#Result\n", + "print \"number of oscillations is\",round(n,2)\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 303" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mechanical resistance is 0.0628 m/sec\n", + "damping constant is 0.209\n", + "spring constant 11.84 N/cm\n", + "answer for spring constant given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.3; #mass(kg)\n", + "new=2; #frequency(Hz)\n", + "Q=60; #Q-factor\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*new; #angular velocity\n", + "R=m*omega/Q; #mechanical resistance(m/sec)\n", + "b=R/m; #damping constant\n", + "k=4*(math.pi**2)*m; #spring constant(N/cm)\n", + "\n", + "#Result\n", + "print \"mechanical resistance is\",round(R,4),\"m/sec\"\n", + "print \"damping constant is\",round(b,3)\n", + "print \"spring constant\",round(k,2),\"N/cm\"\n", + "print \"answer for spring constant 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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_IAy71Ch.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_IAy71Ch.ipynb new file mode 100644 index 00000000..14a19e18 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_IAy71Ch.ipynb @@ -0,0 +1,306 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 8: Damped and Forced Oscillations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 300" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "restoration energy is 125000 erg\n", + "frequency is 5 /math.pi Hz\n", + "time taken for reduction of amplitude is 3.22 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "k=10**4; #Force constant(dyne/cm)\n", + "x=5; #displacement(cm)\n", + "m=100; #mass(gm)\n", + "R=100; #resistance(dyne/cm)\n", + "At=1; #amplitude(cm)\n", + "A0=5; #amplitude(cm)\n", + "\n", + "#Calculation\n", + "E=(1/2)*k*x**2; #restoration energy(erg)\n", + "v=1/(2*math.pi)*math.sqrt(k/m) #frequency(Hz)\n", + "b=R/(2*m); \n", + "t=math.log(A0/At)/b; #time taken for reduction of amplitude(sec)\n", + "\n", + "#Result\n", + "print \"restoration energy is\",int(E),\"erg\"\n", + "print \"frequency is\",int(v*math.pi),\"/math.pi Hz\"\n", + "print \"time taken for reduction of amplitude is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 61.08 sec\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "new=300; #frequency(Hz)\n", + "EbyE0=1/10; #ratio of energy\n", + "Q=5*10**4; #Q factor\n", + "\n", + "#Calculation\n", + "tbytow=math.log(1/EbyE0);\n", + "tow=Q/(2*math.pi*new); \n", + "t=tbytow*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",round(t,2),\"sec\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 6 sec\n", + "procedure followed in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Q=2.2*10**3; #Q value of sonometer wire\n", + "new=210; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "tow=Q/(2*math.pi*new); #torque(Nm)\n", + "t=4*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",int(t),\"sec\"\n", + "print \"procedure followed in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "damping factor is 0.0618 N/m\n", + "Q-factor is 113.3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.5; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "x=0.05; #displacement(m)\n", + "\n", + "#Calculation\n", + "k=m*g/x; \n", + "omega0=math.sqrt(k/m); #angular velocity\n", + "T=50*2*math.pi/omega0; #time taken for 50 oscillations(sec)\n", + "b=math.log(4)/T; #damping factor(N/m)\n", + "R=2*b*m; #resistance(ohm)\n", + "Q=m*omega0/R; #Q-factor\n", + "\n", + "#Result\n", + "print \"damping factor is\",round(b,4),\"N/m\"\n", + "print \"Q-factor is\",round(Q,1)\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of oscillations is 27.73\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(gm)\n", + "R=10; #damping constant\n", + "E=50; #energy(J)\n", + "E0=200; #energy(J)\n", + "new=200; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "b=R/(2*m);\n", + "t=math.log(E0/E)/(2*b); #time taken(sec)\n", + "n=new*t; #number of oscillations\n", + "\n", + "#Result\n", + "print \"number of oscillations is\",round(n,2)\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 303" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mechanical resistance is 0.0628 m/sec\n", + "damping constant is 0.209\n", + "spring constant 11.84 N/cm\n", + "answer for spring constant given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.3; #mass(kg)\n", + "new=2; #frequency(Hz)\n", + "Q=60; #Q-factor\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*new; #angular velocity\n", + "R=m*omega/Q; #mechanical resistance(m/sec)\n", + "b=R/m; #damping constant\n", + "k=4*(math.pi**2)*m; #spring constant(N/cm)\n", + "\n", + "#Result\n", + "print \"mechanical resistance is\",round(R,4),\"m/sec\"\n", + "print \"damping constant is\",round(b,3)\n", + "print \"spring constant\",round(k,2),\"N/cm\"\n", + "print \"answer for spring constant 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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_SxldOqQ.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_SxldOqQ.ipynb new file mode 100644 index 00000000..14a19e18 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_SxldOqQ.ipynb @@ -0,0 +1,306 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 8: Damped and Forced Oscillations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 300" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "restoration energy is 125000 erg\n", + "frequency is 5 /math.pi Hz\n", + "time taken for reduction of amplitude is 3.22 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "k=10**4; #Force constant(dyne/cm)\n", + "x=5; #displacement(cm)\n", + "m=100; #mass(gm)\n", + "R=100; #resistance(dyne/cm)\n", + "At=1; #amplitude(cm)\n", + "A0=5; #amplitude(cm)\n", + "\n", + "#Calculation\n", + "E=(1/2)*k*x**2; #restoration energy(erg)\n", + "v=1/(2*math.pi)*math.sqrt(k/m) #frequency(Hz)\n", + "b=R/(2*m); \n", + "t=math.log(A0/At)/b; #time taken for reduction of amplitude(sec)\n", + "\n", + "#Result\n", + "print \"restoration energy is\",int(E),\"erg\"\n", + "print \"frequency is\",int(v*math.pi),\"/math.pi Hz\"\n", + "print \"time taken for reduction of amplitude is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 61.08 sec\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "new=300; #frequency(Hz)\n", + "EbyE0=1/10; #ratio of energy\n", + "Q=5*10**4; #Q factor\n", + "\n", + "#Calculation\n", + "tbytow=math.log(1/EbyE0);\n", + "tow=Q/(2*math.pi*new); \n", + "t=tbytow*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",round(t,2),\"sec\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 6 sec\n", + "procedure followed in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Q=2.2*10**3; #Q value of sonometer wire\n", + "new=210; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "tow=Q/(2*math.pi*new); #torque(Nm)\n", + "t=4*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",int(t),\"sec\"\n", + "print \"procedure followed in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "damping factor is 0.0618 N/m\n", + "Q-factor is 113.3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.5; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "x=0.05; #displacement(m)\n", + "\n", + "#Calculation\n", + "k=m*g/x; \n", + "omega0=math.sqrt(k/m); #angular velocity\n", + "T=50*2*math.pi/omega0; #time taken for 50 oscillations(sec)\n", + "b=math.log(4)/T; #damping factor(N/m)\n", + "R=2*b*m; #resistance(ohm)\n", + "Q=m*omega0/R; #Q-factor\n", + "\n", + "#Result\n", + "print \"damping factor is\",round(b,4),\"N/m\"\n", + "print \"Q-factor is\",round(Q,1)\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of oscillations is 27.73\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(gm)\n", + "R=10; #damping constant\n", + "E=50; #energy(J)\n", + "E0=200; #energy(J)\n", + "new=200; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "b=R/(2*m);\n", + "t=math.log(E0/E)/(2*b); #time taken(sec)\n", + "n=new*t; #number of oscillations\n", + "\n", + "#Result\n", + "print \"number of oscillations is\",round(n,2)\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 303" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mechanical resistance is 0.0628 m/sec\n", + "damping constant is 0.209\n", + "spring constant 11.84 N/cm\n", + "answer for spring constant given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.3; #mass(kg)\n", + "new=2; #frequency(Hz)\n", + "Q=60; #Q-factor\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*new; #angular velocity\n", + "R=m*omega/Q; #mechanical resistance(m/sec)\n", + "b=R/m; #damping constant\n", + "k=4*(math.pi**2)*m; #spring constant(N/cm)\n", + "\n", + "#Result\n", + "print \"mechanical resistance is\",round(R,4),\"m/sec\"\n", + "print \"damping constant is\",round(b,3)\n", + "print \"spring constant\",round(k,2),\"N/cm\"\n", + "print \"answer for spring constant 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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_nKNv9Wk.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_nKNv9Wk.ipynb new file mode 100644 index 00000000..14a19e18 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_nKNv9Wk.ipynb @@ -0,0 +1,306 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 8: Damped and Forced Oscillations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 300" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "restoration energy is 125000 erg\n", + "frequency is 5 /math.pi Hz\n", + "time taken for reduction of amplitude is 3.22 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "k=10**4; #Force constant(dyne/cm)\n", + "x=5; #displacement(cm)\n", + "m=100; #mass(gm)\n", + "R=100; #resistance(dyne/cm)\n", + "At=1; #amplitude(cm)\n", + "A0=5; #amplitude(cm)\n", + "\n", + "#Calculation\n", + "E=(1/2)*k*x**2; #restoration energy(erg)\n", + "v=1/(2*math.pi)*math.sqrt(k/m) #frequency(Hz)\n", + "b=R/(2*m); \n", + "t=math.log(A0/At)/b; #time taken for reduction of amplitude(sec)\n", + "\n", + "#Result\n", + "print \"restoration energy is\",int(E),\"erg\"\n", + "print \"frequency is\",int(v*math.pi),\"/math.pi Hz\"\n", + "print \"time taken for reduction of amplitude is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 61.08 sec\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "new=300; #frequency(Hz)\n", + "EbyE0=1/10; #ratio of energy\n", + "Q=5*10**4; #Q factor\n", + "\n", + "#Calculation\n", + "tbytow=math.log(1/EbyE0);\n", + "tow=Q/(2*math.pi*new); \n", + "t=tbytow*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",round(t,2),\"sec\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 6 sec\n", + "procedure followed in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Q=2.2*10**3; #Q value of sonometer wire\n", + "new=210; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "tow=Q/(2*math.pi*new); #torque(Nm)\n", + "t=4*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",int(t),\"sec\"\n", + "print \"procedure followed in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "damping factor is 0.0618 N/m\n", + "Q-factor is 113.3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.5; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "x=0.05; #displacement(m)\n", + "\n", + "#Calculation\n", + "k=m*g/x; \n", + "omega0=math.sqrt(k/m); #angular velocity\n", + "T=50*2*math.pi/omega0; #time taken for 50 oscillations(sec)\n", + "b=math.log(4)/T; #damping factor(N/m)\n", + "R=2*b*m; #resistance(ohm)\n", + "Q=m*omega0/R; #Q-factor\n", + "\n", + "#Result\n", + "print \"damping factor is\",round(b,4),\"N/m\"\n", + "print \"Q-factor is\",round(Q,1)\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of oscillations is 27.73\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(gm)\n", + "R=10; #damping constant\n", + "E=50; #energy(J)\n", + "E0=200; #energy(J)\n", + "new=200; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "b=R/(2*m);\n", + "t=math.log(E0/E)/(2*b); #time taken(sec)\n", + "n=new*t; #number of oscillations\n", + "\n", + "#Result\n", + "print \"number of oscillations is\",round(n,2)\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 303" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mechanical resistance is 0.0628 m/sec\n", + "damping constant is 0.209\n", + "spring constant 11.84 N/cm\n", + "answer for spring constant given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.3; #mass(kg)\n", + "new=2; #frequency(Hz)\n", + "Q=60; #Q-factor\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*new; #angular velocity\n", + "R=m*omega/Q; #mechanical resistance(m/sec)\n", + "b=R/m; #damping constant\n", + "k=4*(math.pi**2)*m; #spring constant(N/cm)\n", + "\n", + "#Result\n", + "print \"mechanical resistance is\",round(R,4),\"m/sec\"\n", + "print \"damping constant is\",round(b,3)\n", + "print \"spring constant\",round(k,2),\"N/cm\"\n", + "print \"answer for spring constant 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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_vmNsUjP.ipynb b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_vmNsUjP.ipynb new file mode 100644 index 00000000..14a19e18 --- /dev/null +++ b/BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_vmNsUjP.ipynb @@ -0,0 +1,306 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 8: Damped and Forced Oscillations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 300" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "restoration energy is 125000 erg\n", + "frequency is 5 /math.pi Hz\n", + "time taken for reduction of amplitude is 3.22 sec\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "k=10**4; #Force constant(dyne/cm)\n", + "x=5; #displacement(cm)\n", + "m=100; #mass(gm)\n", + "R=100; #resistance(dyne/cm)\n", + "At=1; #amplitude(cm)\n", + "A0=5; #amplitude(cm)\n", + "\n", + "#Calculation\n", + "E=(1/2)*k*x**2; #restoration energy(erg)\n", + "v=1/(2*math.pi)*math.sqrt(k/m) #frequency(Hz)\n", + "b=R/(2*m); \n", + "t=math.log(A0/At)/b; #time taken for reduction of amplitude(sec)\n", + "\n", + "#Result\n", + "print \"restoration energy is\",int(E),\"erg\"\n", + "print \"frequency is\",int(v*math.pi),\"/math.pi Hz\"\n", + "print \"time taken for reduction of amplitude is\",round(t,2),\"sec\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 61.08 sec\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "new=300; #frequency(Hz)\n", + "EbyE0=1/10; #ratio of energy\n", + "Q=5*10**4; #Q factor\n", + "\n", + "#Calculation\n", + "tbytow=math.log(1/EbyE0);\n", + "tow=Q/(2*math.pi*new); \n", + "t=tbytow*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",round(t,2),\"sec\"\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 301" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time taken is 6 sec\n", + "procedure followed in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "Q=2.2*10**3; #Q value of sonometer wire\n", + "new=210; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "tow=Q/(2*math.pi*new); #torque(Nm)\n", + "t=4*tow; #time taken(sec)\n", + "\n", + "#Result\n", + "print \"time taken is\",int(t),\"sec\"\n", + "print \"procedure followed in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "damping factor is 0.0618 N/m\n", + "Q-factor is 113.3\n", + "answer given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.5; #mass(kg)\n", + "g=9.8; #acceleration due to gravity(m/sec**2)\n", + "x=0.05; #displacement(m)\n", + "\n", + "#Calculation\n", + "k=m*g/x; \n", + "omega0=math.sqrt(k/m); #angular velocity\n", + "T=50*2*math.pi/omega0; #time taken for 50 oscillations(sec)\n", + "b=math.log(4)/T; #damping factor(N/m)\n", + "R=2*b*m; #resistance(ohm)\n", + "Q=m*omega0/R; #Q-factor\n", + "\n", + "#Result\n", + "print \"damping factor is\",round(b,4),\"N/m\"\n", + "print \"Q-factor is\",round(Q,1)\n", + "print \"answer given in the book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 302" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of oscillations is 27.73\n", + "answer in the book varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=1; #mass(gm)\n", + "R=10; #damping constant\n", + "E=50; #energy(J)\n", + "E0=200; #energy(J)\n", + "new=200; #frequency(Hz)\n", + "\n", + "#Calculation\n", + "b=R/(2*m);\n", + "t=math.log(E0/E)/(2*b); #time taken(sec)\n", + "n=new*t; #number of oscillations\n", + "\n", + "#Result\n", + "print \"number of oscillations is\",round(n,2)\n", + "print \"answer in the book varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 303" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mechanical resistance is 0.0628 m/sec\n", + "damping constant is 0.209\n", + "spring constant 11.84 N/cm\n", + "answer for spring constant given in the book is wrong\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "m=0.3; #mass(kg)\n", + "new=2; #frequency(Hz)\n", + "Q=60; #Q-factor\n", + "\n", + "#Calculation\n", + "omega=2*math.pi*new; #angular velocity\n", + "R=m*omega/Q; #mechanical resistance(m/sec)\n", + "b=R/m; #damping constant\n", + "k=4*(math.pi**2)*m; #spring constant(N/cm)\n", + "\n", + "#Result\n", + "print \"mechanical resistance is\",round(R,4),\"m/sec\"\n", + "print \"damping constant is\",round(b,3)\n", + "print \"spring constant\",round(k,2),\"N/cm\"\n", + "print \"answer for spring constant 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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_AzBO5oY.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_AzBO5oY.ipynb new file mode 100644 index 00000000..e89d127d --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_AzBO5oY.ipynb @@ -0,0 +1,571 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter10-STRESSES IN BEAMS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.1 page number 319\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) w= 5.76 KN/m\n", + "(ii) P= 9.72 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#A simply supported beam of span 3.0 m has a cross-section 120 mm × 180 mm. If the permissible stress in the material of the beam is 10 N/mm^2\n", + "\n", + "b=float(120) \n", + "d=float(180) \n", + "\n", + "#I=(b*d^3)/12,Ymax=d/2\n", + "\n", + "Z=(b*pow(d,2))/6 \n", + "fper=float(10)\n", + "\n", + "L=3\n", + "Mmax=fper*Z\n", + "\n", + "#Let maximum udl beam can carry be w/metre length \n", + "#In this case, we know that maximum moment occurs at mid span and is equal to Mmax = (wL^2)/8\n", + "\n", + "w=(Mmax*8)/(pow(L,2)*1000000)\n", + "\n", + "print \"(i) w=\",round(w,2),\"KN/m\"\n", + "\n", + "# Concentrated load at distance 1 m from the support be P kN.\n", + "\n", + "a=float(1) #distance of point at which load is applied from left,m\n", + "b=float(2) #distance of point at which load is applied from right,m\n", + "\n", + "P=(L*Mmax)/(a*b*1000000)\n", + "\n", + "print \"(ii) P=\",round(P,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.2 page number 320" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " P= 4.52 KN\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A circular steel pipe of external diameter 60 mm and thickness 8 mm is used as a simply supported beam over an effective span of 2 m. If permissible stress in steel is 150 N/mm^2, \n", + "\n", + "D=float(60) #external diameter,mm\n", + "d=float(44) #Thickness,mm\n", + "\n", + "I=(pi*(pow(D,4)-pow(d,4)))/64 #Area moment of inertia,mm^4\n", + "Ymax=float(30) #extreme fibre distance,mm\n", + "\n", + "Z=I/Ymax \n", + "fper=float(150)\n", + "\n", + "Mmax=fper*Z\n", + "\n", + "#Let maximum load it can carry be P kN.\n", + "L=float(2)\n", + "P=(4*Mmax)/(L*1000000)\n", + "\n", + "print \" P=\",round(P,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.3 page number 321" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "w= 68.49 KN/m\n" + ] + } + ], + "source": [ + "\n", + "#the cross-section of a cantilever beam of 2.5 m span. Material used is steel for which maximum permissible stress is 150 N/mm^2\n", + " \n", + "#variable declaration\n", + "\n", + "A=float(180) #width of I-beam,mm\n", + "H=float(400) #height of I-beam,mm\n", + "a=float(170) #width of inter rectancle if I-beam consider as Rectangle with width 10,mm\n", + "h=float(380) #Height of inter rectancle if I-beam consider as Rectangle with width 10,mm\n", + "\n", + "I=((A*pow(H,3))/12)-((a*pow(h,3))/12)\n", + "ymax=float(200) #extreme fibre,mm\n", + "\n", + "Z=I/ymax\n", + "fper=float(150) \n", + "\n", + "Mmax=fper*Z\n", + "\n", + "#If udl is w kN/m, maximum moment in cantilever\n", + "\n", + "L=2 #m\n", + "\n", + "w=Mmax/(L*1000000)\n", + "print \"w=\",round(w,2),\"KN/m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.4 page number 323" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection= 8.608\n", + "(ii) Moment carryingcapacity of I-section/ Moment carryingcapacityof equivalent squaresection= 6.087\n", + "(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection= 10.171\n" + ] + } + ], + "source": [ + "#Compare the moment carrying capacity of the section given in example 10.3 with equivalent section of the same area but (i) square section (ii) rectangular section with depth twice the width and (iii) a circular section.\n", + "\n", + "from math import sqrt,pi\n", + "#variable declaration\n", + "\n", + "A=180.0*10.0+380.0*10.0+180.0*10.0\n", + "\n", + "#If ‘a’ is the size of the equivalent square section, \n", + "\n", + "a=float(sqrt(A)) #mm\n", + "\n", + "I=(a*pow(a,3))/12 #Moment of inertia of this section, mm^4\n", + "\n", + "ymax=a/2\n", + "\n", + "Z=I/ymax\n", + "\n", + "f=150.0 \n", + "\n", + "Mcc=f*Z #Moment carrying capacity\n", + "\n", + "MccI=136985000.0\n", + "\n", + "Ratio=MccI/Mcc\n", + "print \"(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection=\",round(Ratio,3)\n", + "\n", + "\n", + "#Equivalent rectangular section of depth twice the width. Let b be the width,Depth d = 2b. Equating its area to area of I-section,we get\n", + "b=sqrt(7400/2)\n", + "\n", + "ymax=b\n", + "\n", + "I=b*(pow((2*b),3))/12\n", + " \n", + "M=f*I/ymax\n", + "\n", + "\n", + "MccI=136985000\n", + "\n", + "Ratio=MccI/M\n", + "print \"(ii) Moment carryingcapacity of I-section/ Moment carryingcapacityof equivalent squaresection=\",round(Ratio,3)\n", + "\n", + "#Equivalent circular section. Let diameter be d.\n", + "\n", + "d=sqrt(7400*4/pi)\n", + "\n", + "I=(pi*pow(d,4))/64\n", + "ymax=d/2\n", + "Z=I/ymax\n", + "fper=float(150)\n", + "M=fper*Z\n", + "\n", + "MccI=136985000\n", + "\n", + "Ratio=MccI/M\n", + "print \"(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection=\",round(Ratio,3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.5 page number 324" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 127.632 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#A symmetric I-section of size 180 mm × 40 mm, 8 mm thick is strengthened with 240 mm × 10 mm rectangular plate on top flange. If permissible stress in the material is 150 N/mm^2, determine how much concentrated load the beam of this section can carry at centre of 4 m span. \n", + "\n", + "b1=float(240)\n", + "b=float(180)\n", + "t=float(10)\n", + "h=float(400)\n", + "w=float(8)\n", + " \n", + "A=float(240*10+180*8+384*8+180*8) #Area of section,A\n", + "\n", + "Y=(240*10*405+180*8*(400-4)+384*8*200+180*8*4)/A\n", + "\n", + "I=(b1*pow(t,3)/12)+(b1*t*(pow(((h+5)-Y),2)))+(b*pow(w,3)/12)+(b*w*(pow(((h-4)-Y),2)))+(w*pow((h-16),3)/12)+((h-16)*w*(pow(((h/2)-Y),2)))+(b*pow(w,3)/12)+(b*w*(pow((4-Y),2)))\n", + "\n", + "ytop=(h+t/2)-Y\n", + "ybottom=Y\n", + "ymax=Y\n", + "\n", + "Z=I/ymax\n", + "fper=150\n", + "M=fper*Z/1000000 #Momnent carrying capacity of the section\n", + "\n", + "#Let P kN be the central concentrated load the simply supported beam can carry. Then max bending movement in the beam\n", + "\n", + "P=M*4/(w/2)\n", + "\n", + "print \"P=\",round(P,3),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.6 page number 327" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "w= 2.734 KN/m\n", + "calculation mistake in book\n" + ] + } + ], + "source": [ + "#The cross-section of a cast iron beam. The top flange is in compression and bottom flange is in tension. Permissible stress in tension is 30 N/mm^2 and its value in compression is 90 N/mm^2\n", + "#variable declaration\n", + "from math import sqrt\n", + "b1=float(75)\n", + "h1=50\n", + "h2=50\n", + "b2=float(150)\n", + "t=float(25)\n", + "h=float(200)\n", + "\n", + " \n", + "A=float(75*50+25*100+150*50) #Area of section,A\n", + "\n", + "Y=(75*50*175+25*100*100+150*50*25)/A\n", + "\n", + "I=(b1*pow(h1,3)/12)+(b1*h1*(pow(((h-(h1/2))-Y),2)))+(t*pow((h-h1-h2),3)/12)+(t*(h-h1-h2)*(pow(((h/2)-Y),2)))+(b2*pow(h2,3)/12)+(b2*h2*(pow(((h2/2)-Y),2)))\n", + "\n", + "\n", + "\n", + "ytop=(h-Y)\n", + "ybottom=Y\n", + "\n", + "\n", + "Z1=I/ytop\n", + "fperc=90\n", + "#Top fibres are in compression. Hence from consideration of compression strength, moment carrying capacity of the beam is given by\n", + "\n", + "M1=fperc*Z1/1000000 #Momnent carrying capacity of the section,KN-m.\n", + "\n", + "#Bottom fibres are in tension. Hence from consideration of tension, moment carrying capacity of the section is given by\n", + "\n", + "Z2=I/ybottom\n", + "\n", + "fpert=30 \n", + "\n", + "M2=fpert*Z2/1000000 #Momnent carrying capacity of the section,KN-m.\n", + "\n", + "\n", + "#Actual moment carrying capacity is the lower value of the above two values. Hence moment carrying capacity of the section is \n", + "Mmax=min(M1,M2)\n", + "\n", + "L=float(5)\n", + "w=sqrt(Mmax*8/pow(L,2))\n", + "\n", + "print\"w=\",round(w,3),\"KN/m\"\n", + "print\"calculation mistake in book\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.7 page number 327" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "y= 5.0 m\n", + "f= 5.24 N/mm^2\n" + ] + } + ], + "source": [ + "#The diameter of a concrete flag post varies from 240 mm at base to 120 mm at top. The height of the post is 10 m. If the post is subjected to a horizontal force of 600 N at top\n", + "#Consider a section y metres from top. Diameter at this section is d.\n", + "#d=120+12*y\n", + "#I=pi*pow(d,4)/64\n", + "#Z=I*2/d=pi*pow(d,3)/32\n", + "#variable declaration \n", + "#M=600*1000*y #moment,N-mm\n", + "#f*Z=M,f is extreme fibre stress.\n", + "y=float(5) \n", + "print \"y=\",round(y,2),\"m\"\n", + "\n", + "#Stress at this section f is given by\n", + "P=600\n", + "M=P*y*1000\n", + "d=120+12*y\n", + "I=pi*pow(d,4)/64\n", + "Z=I*2/d\n", + "\n", + "f=M/Z\n", + "\n", + "print \"f=\",round(f,3),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.9 page number 329" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "b= 150.0 mm\n", + "d= 300.0 mm\n" + ] + } + ], + "source": [ + "#Design a timber beam is to carry a load of 5 kN/m over a simply supported span of 6 m. Permissible stress in timber is 10 N/mm2. Keep depth twice the width.\n", + "\n", + "#variable declaration\n", + "w=float(5) #KN/m\n", + "L=float(6) #m \n", + "\n", + "M=w*1000000*pow(L,2)/8 #Maximum bending moment,N-mm\n", + "\n", + "#Let b be the width and d the depth. Then in this problem d = 2b.\n", + "#Z=b*pow(d,2)/6=2*(b**3)/3\n", + "f=10 #N/mm^2\n", + "#f*Z=M\n", + "b=float(((M*3)/(2*f))**(0.3333))\n", + "print \"b=\",round(b),\"mm\"\n", + "\n", + "d=2*b\n", + "print \"d=\",round(d),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.10 page number 329\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d= 164.3 mm\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "#A cantilever of 3 m span, carrying uniformly distributed load of 3 kN/m is to be designed using cast iron rectangular section. Permissible stresses in cast iron are f = 30 N/mm^2 in tension and fc = 90 N/mm^2 in compression\n", + "\n", + "L=float(3) #Span of cantilever,m\n", + "w=float(3) #uniformly distributed load,KN/m\n", + "\n", + "M=w*1000000*pow(L,2)/2 #Maximum moment,N-mm\n", + "#let b be the width and d the depth\n", + "#Z=b*pow(d,2)/6\n", + "\n", + "#Since it is rectangular section, N-A lies at mid-depth, and stresses at top and bottom are same. Hence, permissible tensile stress value is reached earlier and it governs the design.\n", + "fper=30 #N/mm^2\n", + "b=100 #mm\n", + "f=30 \n", + "\n", + "#f*Z=M\n", + "\n", + "d=sqrt((M*6)/(b*f))\n", + "\n", + "print \"d=\",round(d,1),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.11 page number 330" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d= 23.11 mm\n", + "select 25mm bar \n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "# Let the diameter of the bar be ‘d’. Now, W = 800 N L = 1 m = 1000 mm\n", + "L=1000\n", + "W=800\n", + "M=W*L/4 #Maximum moment,N-mm\n", + "f=150 #permissible stress,N/mm^2\n", + "\n", + "d=float((((M*32)/(pi*f)))**(0.33))\n", + "\n", + "print \"d=\",round(d,2),\"mm\"\n", + "print \"select 25mm bar \"\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_r6Y8ULo.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_r6Y8ULo.ipynb new file mode 100644 index 00000000..e89d127d --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_r6Y8ULo.ipynb @@ -0,0 +1,571 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter10-STRESSES IN BEAMS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.1 page number 319\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) w= 5.76 KN/m\n", + "(ii) P= 9.72 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#A simply supported beam of span 3.0 m has a cross-section 120 mm × 180 mm. If the permissible stress in the material of the beam is 10 N/mm^2\n", + "\n", + "b=float(120) \n", + "d=float(180) \n", + "\n", + "#I=(b*d^3)/12,Ymax=d/2\n", + "\n", + "Z=(b*pow(d,2))/6 \n", + "fper=float(10)\n", + "\n", + "L=3\n", + "Mmax=fper*Z\n", + "\n", + "#Let maximum udl beam can carry be w/metre length \n", + "#In this case, we know that maximum moment occurs at mid span and is equal to Mmax = (wL^2)/8\n", + "\n", + "w=(Mmax*8)/(pow(L,2)*1000000)\n", + "\n", + "print \"(i) w=\",round(w,2),\"KN/m\"\n", + "\n", + "# Concentrated load at distance 1 m from the support be P kN.\n", + "\n", + "a=float(1) #distance of point at which load is applied from left,m\n", + "b=float(2) #distance of point at which load is applied from right,m\n", + "\n", + "P=(L*Mmax)/(a*b*1000000)\n", + "\n", + "print \"(ii) P=\",round(P,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.2 page number 320" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " P= 4.52 KN\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A circular steel pipe of external diameter 60 mm and thickness 8 mm is used as a simply supported beam over an effective span of 2 m. If permissible stress in steel is 150 N/mm^2, \n", + "\n", + "D=float(60) #external diameter,mm\n", + "d=float(44) #Thickness,mm\n", + "\n", + "I=(pi*(pow(D,4)-pow(d,4)))/64 #Area moment of inertia,mm^4\n", + "Ymax=float(30) #extreme fibre distance,mm\n", + "\n", + "Z=I/Ymax \n", + "fper=float(150)\n", + "\n", + "Mmax=fper*Z\n", + "\n", + "#Let maximum load it can carry be P kN.\n", + "L=float(2)\n", + "P=(4*Mmax)/(L*1000000)\n", + "\n", + "print \" P=\",round(P,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.3 page number 321" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "w= 68.49 KN/m\n" + ] + } + ], + "source": [ + "\n", + "#the cross-section of a cantilever beam of 2.5 m span. Material used is steel for which maximum permissible stress is 150 N/mm^2\n", + " \n", + "#variable declaration\n", + "\n", + "A=float(180) #width of I-beam,mm\n", + "H=float(400) #height of I-beam,mm\n", + "a=float(170) #width of inter rectancle if I-beam consider as Rectangle with width 10,mm\n", + "h=float(380) #Height of inter rectancle if I-beam consider as Rectangle with width 10,mm\n", + "\n", + "I=((A*pow(H,3))/12)-((a*pow(h,3))/12)\n", + "ymax=float(200) #extreme fibre,mm\n", + "\n", + "Z=I/ymax\n", + "fper=float(150) \n", + "\n", + "Mmax=fper*Z\n", + "\n", + "#If udl is w kN/m, maximum moment in cantilever\n", + "\n", + "L=2 #m\n", + "\n", + "w=Mmax/(L*1000000)\n", + "print \"w=\",round(w,2),\"KN/m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.4 page number 323" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection= 8.608\n", + "(ii) Moment carryingcapacity of I-section/ Moment carryingcapacityof equivalent squaresection= 6.087\n", + "(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection= 10.171\n" + ] + } + ], + "source": [ + "#Compare the moment carrying capacity of the section given in example 10.3 with equivalent section of the same area but (i) square section (ii) rectangular section with depth twice the width and (iii) a circular section.\n", + "\n", + "from math import sqrt,pi\n", + "#variable declaration\n", + "\n", + "A=180.0*10.0+380.0*10.0+180.0*10.0\n", + "\n", + "#If ‘a’ is the size of the equivalent square section, \n", + "\n", + "a=float(sqrt(A)) #mm\n", + "\n", + "I=(a*pow(a,3))/12 #Moment of inertia of this section, mm^4\n", + "\n", + "ymax=a/2\n", + "\n", + "Z=I/ymax\n", + "\n", + "f=150.0 \n", + "\n", + "Mcc=f*Z #Moment carrying capacity\n", + "\n", + "MccI=136985000.0\n", + "\n", + "Ratio=MccI/Mcc\n", + "print \"(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection=\",round(Ratio,3)\n", + "\n", + "\n", + "#Equivalent rectangular section of depth twice the width. Let b be the width,Depth d = 2b. Equating its area to area of I-section,we get\n", + "b=sqrt(7400/2)\n", + "\n", + "ymax=b\n", + "\n", + "I=b*(pow((2*b),3))/12\n", + " \n", + "M=f*I/ymax\n", + "\n", + "\n", + "MccI=136985000\n", + "\n", + "Ratio=MccI/M\n", + "print \"(ii) Moment carryingcapacity of I-section/ Moment carryingcapacityof equivalent squaresection=\",round(Ratio,3)\n", + "\n", + "#Equivalent circular section. Let diameter be d.\n", + "\n", + "d=sqrt(7400*4/pi)\n", + "\n", + "I=(pi*pow(d,4))/64\n", + "ymax=d/2\n", + "Z=I/ymax\n", + "fper=float(150)\n", + "M=fper*Z\n", + "\n", + "MccI=136985000\n", + "\n", + "Ratio=MccI/M\n", + "print \"(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection=\",round(Ratio,3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.5 page number 324" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 127.632 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#A symmetric I-section of size 180 mm × 40 mm, 8 mm thick is strengthened with 240 mm × 10 mm rectangular plate on top flange. If permissible stress in the material is 150 N/mm^2, determine how much concentrated load the beam of this section can carry at centre of 4 m span. \n", + "\n", + "b1=float(240)\n", + "b=float(180)\n", + "t=float(10)\n", + "h=float(400)\n", + "w=float(8)\n", + " \n", + "A=float(240*10+180*8+384*8+180*8) #Area of section,A\n", + "\n", + "Y=(240*10*405+180*8*(400-4)+384*8*200+180*8*4)/A\n", + "\n", + "I=(b1*pow(t,3)/12)+(b1*t*(pow(((h+5)-Y),2)))+(b*pow(w,3)/12)+(b*w*(pow(((h-4)-Y),2)))+(w*pow((h-16),3)/12)+((h-16)*w*(pow(((h/2)-Y),2)))+(b*pow(w,3)/12)+(b*w*(pow((4-Y),2)))\n", + "\n", + "ytop=(h+t/2)-Y\n", + "ybottom=Y\n", + "ymax=Y\n", + "\n", + "Z=I/ymax\n", + "fper=150\n", + "M=fper*Z/1000000 #Momnent carrying capacity of the section\n", + "\n", + "#Let P kN be the central concentrated load the simply supported beam can carry. Then max bending movement in the beam\n", + "\n", + "P=M*4/(w/2)\n", + "\n", + "print \"P=\",round(P,3),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.6 page number 327" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "w= 2.734 KN/m\n", + "calculation mistake in book\n" + ] + } + ], + "source": [ + "#The cross-section of a cast iron beam. The top flange is in compression and bottom flange is in tension. Permissible stress in tension is 30 N/mm^2 and its value in compression is 90 N/mm^2\n", + "#variable declaration\n", + "from math import sqrt\n", + "b1=float(75)\n", + "h1=50\n", + "h2=50\n", + "b2=float(150)\n", + "t=float(25)\n", + "h=float(200)\n", + "\n", + " \n", + "A=float(75*50+25*100+150*50) #Area of section,A\n", + "\n", + "Y=(75*50*175+25*100*100+150*50*25)/A\n", + "\n", + "I=(b1*pow(h1,3)/12)+(b1*h1*(pow(((h-(h1/2))-Y),2)))+(t*pow((h-h1-h2),3)/12)+(t*(h-h1-h2)*(pow(((h/2)-Y),2)))+(b2*pow(h2,3)/12)+(b2*h2*(pow(((h2/2)-Y),2)))\n", + "\n", + "\n", + "\n", + "ytop=(h-Y)\n", + "ybottom=Y\n", + "\n", + "\n", + "Z1=I/ytop\n", + "fperc=90\n", + "#Top fibres are in compression. Hence from consideration of compression strength, moment carrying capacity of the beam is given by\n", + "\n", + "M1=fperc*Z1/1000000 #Momnent carrying capacity of the section,KN-m.\n", + "\n", + "#Bottom fibres are in tension. Hence from consideration of tension, moment carrying capacity of the section is given by\n", + "\n", + "Z2=I/ybottom\n", + "\n", + "fpert=30 \n", + "\n", + "M2=fpert*Z2/1000000 #Momnent carrying capacity of the section,KN-m.\n", + "\n", + "\n", + "#Actual moment carrying capacity is the lower value of the above two values. Hence moment carrying capacity of the section is \n", + "Mmax=min(M1,M2)\n", + "\n", + "L=float(5)\n", + "w=sqrt(Mmax*8/pow(L,2))\n", + "\n", + "print\"w=\",round(w,3),\"KN/m\"\n", + "print\"calculation mistake in book\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example10.7 page number 327" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "y= 5.0 m\n", + "f= 5.24 N/mm^2\n" + ] + } + ], + "source": [ + "#The diameter of a concrete flag post varies from 240 mm at base to 120 mm at top. The height of the post is 10 m. If the post is subjected to a horizontal force of 600 N at top\n", + "#Consider a section y metres from top. Diameter at this section is d.\n", + "#d=120+12*y\n", + "#I=pi*pow(d,4)/64\n", + "#Z=I*2/d=pi*pow(d,3)/32\n", + "#variable declaration \n", + "#M=600*1000*y #moment,N-mm\n", + "#f*Z=M,f is extreme fibre stress.\n", + "y=float(5) \n", + "print \"y=\",round(y,2),\"m\"\n", + "\n", + "#Stress at this section f is given by\n", + "P=600\n", + "M=P*y*1000\n", + "d=120+12*y\n", + "I=pi*pow(d,4)/64\n", + "Z=I*2/d\n", + "\n", + "f=M/Z\n", + "\n", + "print \"f=\",round(f,3),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.9 page number 329" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "b= 150.0 mm\n", + "d= 300.0 mm\n" + ] + } + ], + "source": [ + "#Design a timber beam is to carry a load of 5 kN/m over a simply supported span of 6 m. Permissible stress in timber is 10 N/mm2. Keep depth twice the width.\n", + "\n", + "#variable declaration\n", + "w=float(5) #KN/m\n", + "L=float(6) #m \n", + "\n", + "M=w*1000000*pow(L,2)/8 #Maximum bending moment,N-mm\n", + "\n", + "#Let b be the width and d the depth. Then in this problem d = 2b.\n", + "#Z=b*pow(d,2)/6=2*(b**3)/3\n", + "f=10 #N/mm^2\n", + "#f*Z=M\n", + "b=float(((M*3)/(2*f))**(0.3333))\n", + "print \"b=\",round(b),\"mm\"\n", + "\n", + "d=2*b\n", + "print \"d=\",round(d),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.10 page number 329\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d= 164.3 mm\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "#A cantilever of 3 m span, carrying uniformly distributed load of 3 kN/m is to be designed using cast iron rectangular section. Permissible stresses in cast iron are f = 30 N/mm^2 in tension and fc = 90 N/mm^2 in compression\n", + "\n", + "L=float(3) #Span of cantilever,m\n", + "w=float(3) #uniformly distributed load,KN/m\n", + "\n", + "M=w*1000000*pow(L,2)/2 #Maximum moment,N-mm\n", + "#let b be the width and d the depth\n", + "#Z=b*pow(d,2)/6\n", + "\n", + "#Since it is rectangular section, N-A lies at mid-depth, and stresses at top and bottom are same. Hence, permissible tensile stress value is reached earlier and it governs the design.\n", + "fper=30 #N/mm^2\n", + "b=100 #mm\n", + "f=30 \n", + "\n", + "#f*Z=M\n", + "\n", + "d=sqrt((M*6)/(b*f))\n", + "\n", + "print \"d=\",round(d,1),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 10.11 page number 330" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d= 23.11 mm\n", + "select 25mm bar \n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "# Let the diameter of the bar be ‘d’. Now, W = 800 N L = 1 m = 1000 mm\n", + "L=1000\n", + "W=800\n", + "M=W*L/4 #Maximum moment,N-mm\n", + "f=150 #permissible stress,N/mm^2\n", + "\n", + "d=float((((M*32)/(pi*f)))**(0.33))\n", + "\n", + "print \"d=\",round(d,2),\"mm\"\n", + "print \"select 25mm bar \"\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_SOLVgXg.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_SOLVgXg.ipynb new file mode 100644 index 00000000..06fa6f21 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_SOLVgXg.ipynb @@ -0,0 +1,654 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter11-PRINCIPAL STRESSES AND STRAINS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.2 page number 352" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) P= 14726.22 N\n", + "(b) P= -44178.65 N compressive\n", + "Material fails because of maximum shear and not by axial compression.\n", + "P= 24544.0 N\n", + "The plane of qmax is at 45° to the plane of px. \n" + ] + } + ], + "source": [ + "from math import sqrt,pi\n", + "\n", + "#A material has strength in tension, compression and shear as 30N/mm2, 90 N/mm2 and 25 N/mm2, respectively. If a specimen of diameter 25 mm is tested in tension and compression identity the failure surfaces and loads. \n", + "\n", + "#variable declaration\n", + "\n", + "#In tension: Let axial direction be x direction. Since it is uniaxial loading, py = 0, q = 0 and only px exists.when the material is subjected to full tensile stress, px = 30 N/mm^2.\n", + "\n", + "pt=float(30)\n", + "pc=float(90)\n", + "ps=float(25)\n", + "\n", + "d=float(25)\n", + "px=float(30) #N/mm^2\n", + "py=0\n", + "q=0\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "qmax=(px-py)/2\n", + "\n", + "#Hence failure criteria is normal stress p1\n", + "\n", + "A=pi*pow(d,2)/4\n", + "\n", + "#Corresponding load P is obtained by\n", + "p=p1\n", + "P=p1*A\n", + "\n", + "print \"(a) P=\",round(P,2),\"N\"\n", + "\n", + "#In case of compression test,\n", + "\n", + "px=-pc\n", + "py=q=0\n", + "\n", + "P=-px*A\n", + "\n", + "print \"(b) P=\",round((-P),2),\"N compressive\"\n", + "\n", + "#at this stage\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print \"Material fails because of maximum shear and not by axial compression.\"\n", + "qmax=25\n", + "px=2*qmax\n", + "\n", + "P=px*A\n", + "print\"P=\",round(P),\"N\"\n", + "print \"The plane of qmax is at 45° to the plane of px. \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.3 page number 354" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pn= 30.0 N/mm^2\n", + "pt= 86.6 N/mm^2\n", + "p= 91.65 N/mm^2\n", + "alpha= 19.1 °\n" + ] + } + ], + "source": [ + "#The direct stresses at a point in the strained material are 120 N/mm2 compressive and 80 N/mm2 tensile. There is no shear stress.\n", + "\n", + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "\n", + "#The plane AC makes 30° (anticlockwise) to the plane of px (y-axis). Hence theta= 30°. px = 80 N/mm^2 py = – 120 N/mm^2 ,q = 0\n", + "\n", + "px=float(80)\n", + "py=float(-120)\n", + "q=float(0)\n", + "theta=30\n", + "pn=((px+py)/2)+((px-py)/2)*cos(2*theta*pi/180)+q*sin(2*theta*pi/180)\n", + "\n", + "print\"pn=\",round(pn),\"N/mm^2\"\n", + "\n", + "pt=((px-py)/2)*sin(2*theta*pi/180)-q*cos(2*theta*pi/180)\n", + "\n", + "print\"pt=\",round(pt,1),\"N/mm^2\"\n", + "p=sqrt(pow(pn,2)+pow(pt,2))\n", + "\n", + "print\"p=\",round(p,2),\"N/mm^2\"\n", + "\n", + "alpha=atan(pn/pt)*180/pi\n", + "\n", + "print \"alpha=\", round(alpha,1),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.4 page number 355" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 37.98 ° and 127.98 °\n", + "p1= 278.08 N/mm^2\n", + "p2= 71.92 N/mm^2\n", + "qmax= 103.08 N/mm^2\n" + ] + } + ], + "source": [ + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(200) #N/mm^2\n", + "py=float(150) #N/mm^2\n", + "q=float(100) #N/mm^2\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "theta2=90+theta1\n", + "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.5 page number 356" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "p1= 82.8 N/mm^2\n", + "p2= -62.8 N/mm^2\n", + "qmax= 72.8 N/mm^2\n", + "theta= 7.97 ° and 97.97 °\n", + "theta'= 37.03 ° and= 52.97 °\n", + "answer in book is wrong\n" + ] + } + ], + "source": [ + "\n", + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(80) #N/mm^2\n", + "py=float(-60) #N/mm^2\n", + "q=float(20) #N/mm^2\n", + "\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n", + "\n", + "#let theta be the inclination of principal stress to the plane of px.\n", + "\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "theta2=90+theta1\n", + "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n", + "\n", + "#Planes of maximum shear make 45° to the above planes.\n", + "theta11=45-theta1\n", + "theta22=theta2-45\n", + "print\"theta'=\",round(theta11,2),\"°\",\"and=\",round(theta22,2),\"°\"\n", + "\n", + "print\"answer in book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.6 page number 357" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "p1= -35.96 N/mm^2\n", + "p2= -139.04 N/mm^2\n", + "qmax= 51.54 N/mm^2\n", + "theta= 37.98 ° and 127.98 °\n" + ] + } + ], + "source": [ + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(-100) #N/mm^2\n", + "py=float(-75) #N/mm^2\n", + "q=float(-50) #N/mm^2\n", + "\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n", + "\n", + "#let theta be the inclination of principal stress to the plane of px.\n", + "\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "theta2=90+theta1\n", + "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.7 page number 358" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) p1= 131.07 N/mm^2\n", + "p2= -81.07 N/mm^2\n", + "(ii) qmax= 106.07 N/mm^2\n", + "theta= -22.5 ° clockwise\n", + "theta2= 22.5 °\n", + "p= 108.97 N/mm^2\n", + "phi= 13.3 °\n", + "mitake in book answer is wrong\n" + ] + } + ], + "source": [ + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(-50) #N/mm^2\n", + "py=float(100) #N/mm^2\n", + "q=float(75) #N/mm^2\n", + "\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"(i) p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"(ii) qmax=\",round(qmax,2),\"N/mm^2\"\n", + "\n", + "#let theta be the inclination of principal stress to the plane of px.\n", + "\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "\n", + "print\"theta=\",round(theta1,2),\"°\" \" clockwise\"\n", + "\n", + "#Plane of maximum shear makes 45° to it \n", + "\n", + "theta2=theta1+45\n", + "print\"theta2=\",round(theta2,2),\"°\" \n", + "\n", + "#Normal stress on this plane is given by\n", + "\n", + "pn=((px+py)/2)+((px-py)/2)*cos(2*theta2*pi/180)+q*sin(2*theta2*pi/180)\n", + "\n", + "pt=qmax\n", + "\n", + "#Resultant stress\n", + "p=sqrt(pow(pn,2)+pow(pt,2))\n", + "\n", + "print \"p=\",round(p,2),\"N/mm^2\"\n", + "\n", + "#Let ‘p’ make angle phi to tangential stress (maximum shear stress plane). \n", + "\n", + "phi=atan(pn/pt)*180/pi\n", + "\n", + "print \"phi=\",round(phi,1),\"°\"\n", + "\n", + "#there is mistake in book\n", + "print\"mitake in book answer is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.9 page number 361" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " p1= 0.17 N/mm^2\n", + " p2= -84.17 N/mm^2\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "w=float(100) #wide of rectangular beam,mm\n", + "h=float(200) #height or rectangular beam dude,mm\n", + "\n", + "I=w*pow(h,3)/12\n", + "\n", + "#At point A, which is at 30 mm below top fibre \n", + "y=100-30\n", + "M=float(80*1000000) #sagging moment,KN-m\n", + "\n", + "fx=M*y/I\n", + "\n", + "px=-fx\n", + "F=float(100*1000 ) #shear force,N\n", + "b=float(100)\n", + "A=b*30\n", + "y1=100-15\n", + "\n", + "q=(F*(A*y1))/(b*I) #shearing stress,N/mm^2\n", + "\n", + "py=0\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "print \" p1=\",round(p1,2),\"N/mm^2\"\n", + "print \" p2=\",round(p2,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.10 page number 362\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) p1= 0.8333 N/mm^2\n", + " p2= -0.8333 N/mm^2\n", + "theta= 45.0 ° and 135.0 °\n", + "(ii) p1= 0.0122 N/mm^2\n", + " p2= -32.4196 N/mm^2\n", + "theta= -1.0 ° and 89.0 °\n", + "mistake in book\n", + "(iii) p1= 0.0 N/mm^2\n", + " p2= -64.8148 N/mm^2\n", + "theta= -0.0 ° and 90.0 °\n" + ] + } + ], + "source": [ + "from math import sqrt,atan\n", + "\n", + "P1=float(20) #vertical loading from A at distance of 1m,KN.\n", + "P2=float(20) #vertical loading from A at distance of 2m,KN.\n", + "P3=float(20) #vertical loading from A at distance of 3m,KN.\n", + "Ra=(P1+P2+P3)/2 #Due to symmetry\n", + "\n", + "Rb=Ra \n", + "#At section 1.5 m from A\n", + "F=(Ra-P1)*1000\n", + "M=float((Ra*1.5-P1*0.5)*1000000)\n", + "b=float(100)\n", + "h=float(180)\n", + "\n", + "I=float((b*pow(h,3))/12)\n", + "\n", + "# Bending stress \n", + "#f=M*y/I\n", + "y11=0\n", + "f1=(-1)*M*y11/I\n", + "y22=45\n", + "f2=(-1)*M*y22/I\n", + "y33=90\n", + "f3=(-1)*M*y33/I\n", + "#Shearing stress at a fibre ‘y’ above N–A is\n", + "#q=(F/(b*I))*(A*y1)\n", + "#at y=0,\n", + "y1=45\n", + "A1=b*90\n", + "q1=(F/(b*I))*(A1*y1)\n", + "#at y=45\n", + "y2=float(90-45/2)\n", + "A2=b*45\n", + "q2=(F/(b*I))*(A2*y2)\n", + "#at y=90\n", + "q3=0\n", + "\n", + "#(a) At neutral axis (y = 0) : The element is under pure shear \n", + "\n", + "py=0\n", + "\n", + "p1=(f1+py)/2+sqrt(pow(((f1-py)/2),2)+pow(q1,2))\n", + "\n", + "p2=(f1+py)/2-sqrt(pow(((f1-py)/2),2)+pow(q1,2))\n", + "print \"(i) p1=\",round(p1,4),\"N/mm^2\"\n", + "print \" p2=\",round(p2,4),\"N/mm^2\"\n", + "\n", + "theta1=45\n", + "theta2=theta1+90\n", + "print\"theta=\",round(theta1),\"°\",\" and \",round(theta2),\"°\"\n", + "\n", + "#(b) At (y = 45)\n", + "py=0 \n", + "\n", + "p1=(f2+py)/2+sqrt(pow(((f2-py)/2),2)+pow(q2,2))\n", + "\n", + "p2=(f2+py)/2-sqrt(pow(((f2-py)/2),2)+pow(q2,2))\n", + "print \"(ii) p1=\",round(p1,4),\"N/mm^2\"\n", + "print \" p2=\",round(p2,4),\"N/mm^2\"\n", + "\n", + "thetab1=(atan((2*q2)/(f2-py))*180)/(pi*2)\n", + "thetab2=thetab1+90\n", + "print\"theta=\",round(thetab1),\"°\",\" and \",round(thetab2),\"°\"\n", + "#mistake in book\n", + "print\"mistake in book\"\n", + "\n", + "#(c) At Y=90\n", + "\n", + "py=0\n", + "\n", + "p1=(f3+py)/2+sqrt(pow(((f3-py)/2),2)+pow(q3,2))\n", + "\n", + "p2=(f3+py)/2-sqrt(pow(((f3-py)/2),2)+pow(q3,2))\n", + "print \"(iii) p1=\",round(p1,4),\"N/mm^2\"\n", + "print \" p2=\",round(p2,4),\"N/mm^2\"\n", + "\n", + "thetac1=(atan((2*q3)/(f3-py))*180)/(pi*2)\n", + "thetac2=thetac1+90\n", + "print\"theta=\",round(thetac1),\"°\",\" and \",round(thetac2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.11 page number 364\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " p1= 5.21 N/mm^2\n", + " p2= -107.56 N/mm^2\n", + "qmax= 56.38 N/mm^2\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "L=float(6) #m\n", + "w=float(60) #uniformly distributed load,KN/m\n", + "Rs=L*w/2 #Reaction at support,KN\n", + "\n", + "#Moment at 1.5 m from support\n", + "M =float( Rs*1.5-(w*pow(1.5,2)/2))\n", + "#Shear force at 1.5 m from support \n", + "F=Rs-1.5*w\n", + "\n", + "B=float(200) #width of I-beam,mm\n", + "H=float(400) #height or I-beam,mm\n", + "b=float(190)\n", + "h=float(380)\n", + "I= (B*pow(H,3)/12)-(b*pow(h,3)/12)\n", + "\n", + "#Bending stress at 100 mm above N–A\n", + "y=100\n", + "\n", + "f=M*1000000*y/I\n", + "\n", + "#Thus the state of stress on an element at y = 100 mm, as px = f,py=0\n", + "px=-f\n", + "py=0\n", + "A=200*10*195+10*90*145\n", + "q=(F*1000*(A))/(10*I) #shearing stress,N/mm^2\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "print \" p1=\",round(p1,2),\"N/mm^2\"\n", + "print \" p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_dWG3d2Y.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_dWG3d2Y.ipynb new file mode 100644 index 00000000..06fa6f21 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_dWG3d2Y.ipynb @@ -0,0 +1,654 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter11-PRINCIPAL STRESSES AND STRAINS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.2 page number 352" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) P= 14726.22 N\n", + "(b) P= -44178.65 N compressive\n", + "Material fails because of maximum shear and not by axial compression.\n", + "P= 24544.0 N\n", + "The plane of qmax is at 45° to the plane of px. \n" + ] + } + ], + "source": [ + "from math import sqrt,pi\n", + "\n", + "#A material has strength in tension, compression and shear as 30N/mm2, 90 N/mm2 and 25 N/mm2, respectively. If a specimen of diameter 25 mm is tested in tension and compression identity the failure surfaces and loads. \n", + "\n", + "#variable declaration\n", + "\n", + "#In tension: Let axial direction be x direction. Since it is uniaxial loading, py = 0, q = 0 and only px exists.when the material is subjected to full tensile stress, px = 30 N/mm^2.\n", + "\n", + "pt=float(30)\n", + "pc=float(90)\n", + "ps=float(25)\n", + "\n", + "d=float(25)\n", + "px=float(30) #N/mm^2\n", + "py=0\n", + "q=0\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "qmax=(px-py)/2\n", + "\n", + "#Hence failure criteria is normal stress p1\n", + "\n", + "A=pi*pow(d,2)/4\n", + "\n", + "#Corresponding load P is obtained by\n", + "p=p1\n", + "P=p1*A\n", + "\n", + "print \"(a) P=\",round(P,2),\"N\"\n", + "\n", + "#In case of compression test,\n", + "\n", + "px=-pc\n", + "py=q=0\n", + "\n", + "P=-px*A\n", + "\n", + "print \"(b) P=\",round((-P),2),\"N compressive\"\n", + "\n", + "#at this stage\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print \"Material fails because of maximum shear and not by axial compression.\"\n", + "qmax=25\n", + "px=2*qmax\n", + "\n", + "P=px*A\n", + "print\"P=\",round(P),\"N\"\n", + "print \"The plane of qmax is at 45° to the plane of px. \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.3 page number 354" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pn= 30.0 N/mm^2\n", + "pt= 86.6 N/mm^2\n", + "p= 91.65 N/mm^2\n", + "alpha= 19.1 °\n" + ] + } + ], + "source": [ + "#The direct stresses at a point in the strained material are 120 N/mm2 compressive and 80 N/mm2 tensile. There is no shear stress.\n", + "\n", + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "\n", + "#The plane AC makes 30° (anticlockwise) to the plane of px (y-axis). Hence theta= 30°. px = 80 N/mm^2 py = – 120 N/mm^2 ,q = 0\n", + "\n", + "px=float(80)\n", + "py=float(-120)\n", + "q=float(0)\n", + "theta=30\n", + "pn=((px+py)/2)+((px-py)/2)*cos(2*theta*pi/180)+q*sin(2*theta*pi/180)\n", + "\n", + "print\"pn=\",round(pn),\"N/mm^2\"\n", + "\n", + "pt=((px-py)/2)*sin(2*theta*pi/180)-q*cos(2*theta*pi/180)\n", + "\n", + "print\"pt=\",round(pt,1),\"N/mm^2\"\n", + "p=sqrt(pow(pn,2)+pow(pt,2))\n", + "\n", + "print\"p=\",round(p,2),\"N/mm^2\"\n", + "\n", + "alpha=atan(pn/pt)*180/pi\n", + "\n", + "print \"alpha=\", round(alpha,1),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.4 page number 355" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 37.98 ° and 127.98 °\n", + "p1= 278.08 N/mm^2\n", + "p2= 71.92 N/mm^2\n", + "qmax= 103.08 N/mm^2\n" + ] + } + ], + "source": [ + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(200) #N/mm^2\n", + "py=float(150) #N/mm^2\n", + "q=float(100) #N/mm^2\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "theta2=90+theta1\n", + "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.5 page number 356" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "p1= 82.8 N/mm^2\n", + "p2= -62.8 N/mm^2\n", + "qmax= 72.8 N/mm^2\n", + "theta= 7.97 ° and 97.97 °\n", + "theta'= 37.03 ° and= 52.97 °\n", + "answer in book is wrong\n" + ] + } + ], + "source": [ + "\n", + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(80) #N/mm^2\n", + "py=float(-60) #N/mm^2\n", + "q=float(20) #N/mm^2\n", + "\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n", + "\n", + "#let theta be the inclination of principal stress to the plane of px.\n", + "\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "theta2=90+theta1\n", + "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n", + "\n", + "#Planes of maximum shear make 45° to the above planes.\n", + "theta11=45-theta1\n", + "theta22=theta2-45\n", + "print\"theta'=\",round(theta11,2),\"°\",\"and=\",round(theta22,2),\"°\"\n", + "\n", + "print\"answer in book is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.6 page number 357" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "p1= -35.96 N/mm^2\n", + "p2= -139.04 N/mm^2\n", + "qmax= 51.54 N/mm^2\n", + "theta= 37.98 ° and 127.98 °\n" + ] + } + ], + "source": [ + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(-100) #N/mm^2\n", + "py=float(-75) #N/mm^2\n", + "q=float(-50) #N/mm^2\n", + "\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n", + "\n", + "#let theta be the inclination of principal stress to the plane of px.\n", + "\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "theta2=90+theta1\n", + "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.7 page number 358" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) p1= 131.07 N/mm^2\n", + "p2= -81.07 N/mm^2\n", + "(ii) qmax= 106.07 N/mm^2\n", + "theta= -22.5 ° clockwise\n", + "theta2= 22.5 °\n", + "p= 108.97 N/mm^2\n", + "phi= 13.3 °\n", + "mitake in book answer is wrong\n" + ] + } + ], + "source": [ + "from math import sqrt,cos,sin,atan,pi\n", + "#variable declaration\n", + "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n", + "\n", + "px=float(-50) #N/mm^2\n", + "py=float(100) #N/mm^2\n", + "q=float(75) #N/mm^2\n", + "\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"(i) p1=\",round(p1,2),\"N/mm^2\"\n", + "\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "\n", + "print \"p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"(ii) qmax=\",round(qmax,2),\"N/mm^2\"\n", + "\n", + "#let theta be the inclination of principal stress to the plane of px.\n", + "\n", + "\n", + "theta1=(atan((2*q)/(px-py))*180)/(pi*2) \n", + "\n", + "print\"theta=\",round(theta1,2),\"°\" \" clockwise\"\n", + "\n", + "#Plane of maximum shear makes 45° to it \n", + "\n", + "theta2=theta1+45\n", + "print\"theta2=\",round(theta2,2),\"°\" \n", + "\n", + "#Normal stress on this plane is given by\n", + "\n", + "pn=((px+py)/2)+((px-py)/2)*cos(2*theta2*pi/180)+q*sin(2*theta2*pi/180)\n", + "\n", + "pt=qmax\n", + "\n", + "#Resultant stress\n", + "p=sqrt(pow(pn,2)+pow(pt,2))\n", + "\n", + "print \"p=\",round(p,2),\"N/mm^2\"\n", + "\n", + "#Let ‘p’ make angle phi to tangential stress (maximum shear stress plane). \n", + "\n", + "phi=atan(pn/pt)*180/pi\n", + "\n", + "print \"phi=\",round(phi,1),\"°\"\n", + "\n", + "#there is mistake in book\n", + "print\"mitake in book answer is wrong\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.9 page number 361" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " p1= 0.17 N/mm^2\n", + " p2= -84.17 N/mm^2\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "w=float(100) #wide of rectangular beam,mm\n", + "h=float(200) #height or rectangular beam dude,mm\n", + "\n", + "I=w*pow(h,3)/12\n", + "\n", + "#At point A, which is at 30 mm below top fibre \n", + "y=100-30\n", + "M=float(80*1000000) #sagging moment,KN-m\n", + "\n", + "fx=M*y/I\n", + "\n", + "px=-fx\n", + "F=float(100*1000 ) #shear force,N\n", + "b=float(100)\n", + "A=b*30\n", + "y1=100-15\n", + "\n", + "q=(F*(A*y1))/(b*I) #shearing stress,N/mm^2\n", + "\n", + "py=0\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "print \" p1=\",round(p1,2),\"N/mm^2\"\n", + "print \" p2=\",round(p2,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.10 page number 362\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i) p1= 0.8333 N/mm^2\n", + " p2= -0.8333 N/mm^2\n", + "theta= 45.0 ° and 135.0 °\n", + "(ii) p1= 0.0122 N/mm^2\n", + " p2= -32.4196 N/mm^2\n", + "theta= -1.0 ° and 89.0 °\n", + "mistake in book\n", + "(iii) p1= 0.0 N/mm^2\n", + " p2= -64.8148 N/mm^2\n", + "theta= -0.0 ° and 90.0 °\n" + ] + } + ], + "source": [ + "from math import sqrt,atan\n", + "\n", + "P1=float(20) #vertical loading from A at distance of 1m,KN.\n", + "P2=float(20) #vertical loading from A at distance of 2m,KN.\n", + "P3=float(20) #vertical loading from A at distance of 3m,KN.\n", + "Ra=(P1+P2+P3)/2 #Due to symmetry\n", + "\n", + "Rb=Ra \n", + "#At section 1.5 m from A\n", + "F=(Ra-P1)*1000\n", + "M=float((Ra*1.5-P1*0.5)*1000000)\n", + "b=float(100)\n", + "h=float(180)\n", + "\n", + "I=float((b*pow(h,3))/12)\n", + "\n", + "# Bending stress \n", + "#f=M*y/I\n", + "y11=0\n", + "f1=(-1)*M*y11/I\n", + "y22=45\n", + "f2=(-1)*M*y22/I\n", + "y33=90\n", + "f3=(-1)*M*y33/I\n", + "#Shearing stress at a fibre ‘y’ above N–A is\n", + "#q=(F/(b*I))*(A*y1)\n", + "#at y=0,\n", + "y1=45\n", + "A1=b*90\n", + "q1=(F/(b*I))*(A1*y1)\n", + "#at y=45\n", + "y2=float(90-45/2)\n", + "A2=b*45\n", + "q2=(F/(b*I))*(A2*y2)\n", + "#at y=90\n", + "q3=0\n", + "\n", + "#(a) At neutral axis (y = 0) : The element is under pure shear \n", + "\n", + "py=0\n", + "\n", + "p1=(f1+py)/2+sqrt(pow(((f1-py)/2),2)+pow(q1,2))\n", + "\n", + "p2=(f1+py)/2-sqrt(pow(((f1-py)/2),2)+pow(q1,2))\n", + "print \"(i) p1=\",round(p1,4),\"N/mm^2\"\n", + "print \" p2=\",round(p2,4),\"N/mm^2\"\n", + "\n", + "theta1=45\n", + "theta2=theta1+90\n", + "print\"theta=\",round(theta1),\"°\",\" and \",round(theta2),\"°\"\n", + "\n", + "#(b) At (y = 45)\n", + "py=0 \n", + "\n", + "p1=(f2+py)/2+sqrt(pow(((f2-py)/2),2)+pow(q2,2))\n", + "\n", + "p2=(f2+py)/2-sqrt(pow(((f2-py)/2),2)+pow(q2,2))\n", + "print \"(ii) p1=\",round(p1,4),\"N/mm^2\"\n", + "print \" p2=\",round(p2,4),\"N/mm^2\"\n", + "\n", + "thetab1=(atan((2*q2)/(f2-py))*180)/(pi*2)\n", + "thetab2=thetab1+90\n", + "print\"theta=\",round(thetab1),\"°\",\" and \",round(thetab2),\"°\"\n", + "#mistake in book\n", + "print\"mistake in book\"\n", + "\n", + "#(c) At Y=90\n", + "\n", + "py=0\n", + "\n", + "p1=(f3+py)/2+sqrt(pow(((f3-py)/2),2)+pow(q3,2))\n", + "\n", + "p2=(f3+py)/2-sqrt(pow(((f3-py)/2),2)+pow(q3,2))\n", + "print \"(iii) p1=\",round(p1,4),\"N/mm^2\"\n", + "print \" p2=\",round(p2,4),\"N/mm^2\"\n", + "\n", + "thetac1=(atan((2*q3)/(f3-py))*180)/(pi*2)\n", + "thetac2=thetac1+90\n", + "print\"theta=\",round(thetac1),\"°\",\" and \",round(thetac2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 11.11 page number 364\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " p1= 5.21 N/mm^2\n", + " p2= -107.56 N/mm^2\n", + "qmax= 56.38 N/mm^2\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "L=float(6) #m\n", + "w=float(60) #uniformly distributed load,KN/m\n", + "Rs=L*w/2 #Reaction at support,KN\n", + "\n", + "#Moment at 1.5 m from support\n", + "M =float( Rs*1.5-(w*pow(1.5,2)/2))\n", + "#Shear force at 1.5 m from support \n", + "F=Rs-1.5*w\n", + "\n", + "B=float(200) #width of I-beam,mm\n", + "H=float(400) #height or I-beam,mm\n", + "b=float(190)\n", + "h=float(380)\n", + "I= (B*pow(H,3)/12)-(b*pow(h,3)/12)\n", + "\n", + "#Bending stress at 100 mm above N–A\n", + "y=100\n", + "\n", + "f=M*1000000*y/I\n", + "\n", + "#Thus the state of stress on an element at y = 100 mm, as px = f,py=0\n", + "px=-f\n", + "py=0\n", + "A=200*10*195+10*90*145\n", + "q=(F*1000*(A))/(10*I) #shearing stress,N/mm^2\n", + "\n", + "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n", + "print \" p1=\",round(p1,2),\"N/mm^2\"\n", + "print \" p2=\",round(p2,2),\"N/mm^2\"\n", + "\n", + "\n", + "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n", + "\n", + "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_D0ImquH.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_D0ImquH.ipynb new file mode 100644 index 00000000..080cbafb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_D0ImquH.ipynb @@ -0,0 +1,373 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1-INTRODUCTION TO MECHANICS OF SOLIDS " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_EeN8oH7.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_EeN8oH7.ipynb new file mode 100644 index 00000000..080cbafb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_EeN8oH7.ipynb @@ -0,0 +1,373 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1-INTRODUCTION TO MECHANICS OF SOLIDS " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_Z95iVp3.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_Z95iVp3.ipynb new file mode 100644 index 00000000..080cbafb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_Z95iVp3.ipynb @@ -0,0 +1,373 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1-INTRODUCTION TO MECHANICS OF SOLIDS " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_fdbb8ly.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_fdbb8ly.ipynb new file mode 100644 index 00000000..080cbafb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_fdbb8ly.ipynb @@ -0,0 +1,373 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1-INTRODUCTION TO MECHANICS OF SOLIDS " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_xobe83Y.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_xobe83Y.ipynb new file mode 100644 index 00000000..080cbafb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_xobe83Y.ipynb @@ -0,0 +1,373 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1-INTRODUCTION TO MECHANICS OF SOLIDS " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_yzunizs.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_yzunizs.ipynb new file mode 100644 index 00000000..080cbafb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_yzunizs.ipynb @@ -0,0 +1,373 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1-INTRODUCTION TO MECHANICS OF SOLIDS " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_42vnHw9.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_42vnHw9.ipynb new file mode 100644 index 00000000..a94760d2 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_42vnHw9.ipynb @@ -0,0 +1,1857 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2-FUNDAMENTALS OF STATICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.1 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Moment is = -9607.41 Nmm clockwise\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=100.0\n", + "hd=400.0\n", + "vd=500.0\n", + "o=60.0\n", + "M=F*(math.cos(o/180.0*3.14)*vd-math.sin(o/180.0*3.14)*hd)\n", + "print '%s %.2f %s' %(\"\\n \\n Moment is =\", M ,\" Nmm clockwise\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.2 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.3 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.4 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force = 161.52 N\n", + "\n", + " \n", + " Resultant angle = 0.33 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#R resultant force\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "#f1 force\n", + "#f2 force\n", + "#f3 force\n", + "#o1 angle with the line \n", + "#o2 angle with the line \n", + "#o3 angle with the line \n", + "#O angle of resultant force with line\n", + "f1=70.0\n", + "f2=80.0\n", + "f3=50.0 \n", + "o1=50.0\n", + "o2=25.0\n", + "o3=-45.0\n", + "Rx=(f1*math.cos(o1/180*3.14)+f2*math.cos(o2/180*3.14)+f3*math.cos(o3/180*3.14));\n", + "Ry=(f1*math.sin(o1/180*3.14)+f2*math.sin(o2/180*3.14)+f3*math.sin(o3/180*3.14));\n", + "R=math.sqrt(Rx**2+Ry**2)\n", + "O=math.atan(Ry/Rx)\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force =\", R ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant angle =\", O ,\"radians\");\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.5 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force along the incline plane = 234.24 N\n", + "\n", + " \n", + " Resultant Force vertical to the incline plane = -0.46 N\n" + ] + } + ], + "source": [ + "import math\n", + "#O angle of inclined plane\n", + "#N normal reaction\n", + "#W weight\n", + "#F,T forces\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "o = 60.0 \n", + "W = 1000.0\n", + "N = 500.0\n", + "F = 100.0\n", + "T = 1200.0\n", + "Rx = T-F-(W*math.sin(o/180*3.14))\n", + "Ry = N-(W*math.cos(o/180*3.14))\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force along the incline plane =\", Rx ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force vertical to the incline plane =\", Ry ,\"N\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.6 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force 467.201871561 N\n", + "At an angle 61.0805191269\n" + ] + } + ], + "source": [ + "import math\n", + "R=1000.0 #Resultant force\n", + "F1=500.0 #Force \n", + "F2=1000.0 #force\n", + "o=45.0*3.14/180.0 #angle resultant makes with x axis \n", + "o1=30.0*3.14/180.0 #angle F1 makes with x axis \n", + "o2=60.0*3.14/180.0 #angle F2 makes with x axis \n", + "#F3coso3=Rcoso-F1coso1-F2sino2\n", + "#F3sino=Rsino-F1sino1-F2coso2\n", + "F3=((R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2))**2+(R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))**2)**0.5\n", + "print \"Force\",F3,\"N\"\n", + "o3=180/3.14*math.atan((R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))/(R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2)))\n", + "print \"At an angle\",o3" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.7 Page number 27" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 6.32 °\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,pi,asin\n", + "\n", + "#variable declaration\n", + "\n", + "P1=300.0\n", + "P2=500.0\n", + "thetaI=30.0*pi/180.0\n", + "thetaP2=30.0*pi/180\n", + "thetaP1=40.0*pi/180\n", + "# Let the x and y axes be If the resultant is directed along the x axis, its component in y direction is zero.\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "F=(P2*sin(thetaP2))/(P1)\n", + "theta=(asin((F/(cos(20*pi/180)*2)))*180/pi)-20\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.8 page number 30\n" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 68.0592 KN\n", + "alpha= 81.55 °\n", + "x= 3.326 m\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt,pi\n", + "\n", + "#variable declaration\n", + "\n", + "P1=20.0\n", + "P2=30.0\n", + "P3=20.0\n", + "theta3=60.0*pi/180.0\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=20.0*cos(theta3)\n", + "Fy=P1+P2+P3*sin(theta3)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,4),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=P1*1.5+P2*3.0+P3*sin(theta3)*6.0\n", + "\n", + "#The distance of the resultant from point O is given by:\n", + "\n", + "d=MA/R\n", + "x=d/sin(alpha*pi/180)\n", + "print\"x=\",round(x,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.9 page number 31\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 91.19 KN\n", + "alpha= 35.84 °\n", + "x= 317.023 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=100.0 #inclined up loading at 60° at A, N\n", + "PB1=80.0 #Vertical down loading at B,N\n", + "PB2=80.0 #Horizontal right loading at at B,N \n", + "PC=120.0 #inclined down loading at 30° at C,N\n", + "\n", + "thetaA=60.0*pi/180.0\n", + "thetaB=30.0*pi/180.0\n", + "\n", + "\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=PB2-PA*cos(thetaA)-PC*cos(thetaB)\n", + "Rx=-Fx\n", + "\n", + "Fy=PB1+PC*sin(thetaB)-PA*sin(thetaA)\n", + "Ry=Fy\n", + "\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Let x be the distance from A at which the resultant cuts AC. Then taking A as moment centre,\n", + "\n", + "x=(PB1*100*sin(thetaA)+PB2*50+PC*sin(thetaB)*100)/Ry\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.10 page number 32" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 565.69 N\n", + "theta= 45.0 °\n", + "x= 2.5 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PA=800.0 #Vertical down loading at A,N\n", + "PC=400.0 #vertical up loading at B,N\n", + "HD=600.0 #Horizontal left loading at A,N\n", + "HB=200.0 #Horizontal right loading at B,N\n", + "a=1.0 #length of side,m\n", + " \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=HB-HD\n", + "Fy=PC-PA\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=PC*a+HD*a\n", + "\n", + "#Let x be the distance from A along x axis, where resultant cuts AB.\n", + "\n", + "x=MA/Fy\n", + "\n", + "print\"x=\",round((-x),1),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.11 page number 32\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 10.0 KN\n", + "theta= 0.0 ° i.e. , the resultant is in the direction x.\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=2.0 #loading at B,KN\n", + "PC=sqrt(3.0) #loading at C,KN\n", + "PD=5.0 #loading at D,KN\n", + "PE=PC #loading at E,KN\n", + "PF=PB #loading at F,KN\n", + "\n", + "#Let O be the centre of the encircling circle A, B, C, D, E and F. In regular hexagon each side is equal to the radius AO. Hence OAB is equilateral triangle.\n", + "\n", + "angleoab=60.0*pi/180\n", + "anglecab=angleoab/2.0\n", + "theta1=anglecab\n", + "theta2=(angleoab-theta1)\n", + "theta3=theta1\n", + "theta4=theta1\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PB*cos(theta1+theta2)+PC*cos(theta2)+PD+PE*cos(theta3)+PF*cos(theta3+theta4)\n", + "\n", + "Fy=-PB*sin(theta1+theta2)-PC*sin(theta2)+0+PE*sin(theta3)+PF*sin(theta3+theta4)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\",\"i.e.\",\",\",\"the resultant is in the direction x.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.12 page number 33" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 4.66 N\n", + "alpha= 28.99 °\n", + "d= 42.73 mm\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "P1=2.0 #loading at 1,KN\n", + "P2=1.5 #loading at 2,KN\n", + "P3=5.0 #loading at 3,KN\n", + "a=10.0 #side length,mm\n", + "\n", + "# If theta1, theta2 and theta3 are the slopes of the forces 2 kN, 5 kN and 1.5 kN forces with respect to x axis, then \n", + "\n", + "\n", + "theta1=atan(a/a)\n", + "theta2=atan((3*a)/(4*a))\n", + "theta3=atan((a)/(2*a))\n", + "\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=P1*cos(theta1)+P3*cos(theta2)-P2*cos(theta3)\n", + "\n", + "Fy=P1*sin(theta1)-P3*sin(theta2)-P2*sin(theta3)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Distance d of the resultant from O is given by\n", + "#Rd=sum of moment at A\n", + "\n", + "d=((a*3)*P1*cos(theta1)+(5*a)*P3*sin(theta2)+P2*(a)*sin(theta3))/(4.66)\n", + "print\"d=\",round(d,2),\"mm\"\n", + "\n", + "#Note: To find moment of forces about O, 2 kN force is resolved at it’s intersection with y axis and 5 kN and 1.5 kN forces are resolved at their intersection with x axis, and then Varignon theorem is used\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.13 page number 34" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 150.0 KN\n", + "MA= 270.0 KN-m\n", + "x= 1.8 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #loading at B,KN\n", + "PC=30.0 #loading at C,KN\n", + "PD=40.0 #loading at D,KN\n", + "PA=60.0 #loading at E,KN\n", + "AB=1.0\n", + "BC=2.0\n", + "CD=1.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA+PB+PC+PD\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA+(AB)*PB+PC*(AB+BC)+PD*(AB+BC+CD)\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x,1),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.14 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 100.0 KN in y-direction\n", + "MA= 300.0 KN-m\n", + "x= 3.0 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #up loading at B,KN\n", + "PC=40.0 #down loading at C,KN\n", + "PD=50.0 #up loading at D,KN\n", + "PA=80.0 #down loading at A,KN\n", + "PE=60.0 #down loading at E,KN\n", + "AB=2.0\n", + "BC=2.0\n", + "CD=4.0\n", + "DE=2.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA-PB+PC-PD+PE\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA-(AB)*PB+PC*(AB+BC)-PD*(AB+BC+CD)+PE*(AB+BC+CD+DE)\n", + "\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.15 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 2671.19 KN in y-direction\n", + "alpha 80.3 °\n", + "x= 141.195 mm\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=500.0 #Loading at inclined to 60.0°,N\n", + "P2=1000.0 #vertical loading at 150 distance from O,N\n", + "P3=1200.0 #vertical loading at 150 distance from O,N\n", + "H=700.0 #Horizontal loading at 300 ditance from O,N\n", + "a=150.0\n", + "theta=60.0*pi/180\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=P1*cos(theta)-H\n", + "Ry=-P3-P2-P1*sin(theta)\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "alpha=atan(Ry/Rx)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"\n", + " \n", + "#Let the point of application of the resultant be at a distance x from the point O along the horizontal arm. Then, \n", + "\n", + "x=(P1*sin(theta)*(2*a)+P2*a-P3*a*cos(theta)+H*a*2*sin(theta))/(-Ry)\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.16 page number 36" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ry= 1420.0 KN downward\n", + "x= 4.127 m\n", + "The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=1120.0 #vertical down Loading at 2m distance from O,KN\n", + "P2=120.0 #vertical up loading at 4m distance from O,KN\n", + "P3=420.0 #vertical downloading at 5m distance from O,KN\n", + "H=500.0 #Horizontal loading at 4m ditance from O,KN\n", + "ah=4.0\n", + "a1=2.0\n", + "a2=4.0\n", + "a3=5.0\n", + "a=7.0\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=H\n", + "Ry=P1-P2+P3\n", + "\n", + "print \"Ry=\",round(Ry,2),\"KN\",\"downward\"\n", + " \n", + "#Let x be the distance from O where the resultant cuts the base.\n", + "#moment at O\n", + "x=(H*ah+P1*a1-P2*a2+P3*a3)/(Ry)\n", + "\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "print \"The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.17 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 42.426 KN\n", + "d= 1.5 m Resultant is a horizontal force of magnitude 42.426 at 1.5 m below A.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=5.0 #Inclined at 45° down Loading at 3m distance from A,KN\n", + "P2=10.0 #Inclined at 45° down Loading at 2m distance from A,KN\n", + "P3=10.0 #Inclined at 45° down Loading at 1m distance from A,KN\n", + "P4=5.0 #Inclined at 45° down Loading A,KN\n", + "P8=5.0 #Inclined at 45° UP Loading at 3m distance from A,KN\n", + "P7=10.0 #Inclined at 45° UP Loading at 2m distance from A,KN\n", + "P6=10.0 #Inclined at 45° UP Loading at 1m distance from A,KN\n", + "P5=5.0 #Inclined at 45° UP Loading A,KN\n", + "a=1.0\n", + "\n", + "theta=45.0*pi/180.0\n", + "#The roof is inclined at 45° to horizontal and loads are at 90° to the roof. Hence, the loads are also inclined at 45° to vertical/horizontal. \n", + "\n", + "#assume Resulat R at distance d from A,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=(P1+P2+P3+P4+P5+P6+P7+P8)*cos(theta)\n", + "Ry=-(P1+P2+P3+P4)*sin(theta)+(P5+P6+P7+P8)*sin(theta)\n", + "\n", + "print \"R=\",round(Rx,3),\"KN\"\n", + "#and its direction is horizontal \n", + "#Let R be at a distance d from the ridge A\n", + "#moment at A\n", + "d=((P1*3*cos(theta)*a+P2*cos(theta)*2*a+P3*cos(theta)*a)*2)/(Rx)\n", + "\n", + "print\"d=\",round(d,1),\"m\",\" Resultant is a horizontal force of magnitude\",round(Rx,3),\" at\",round(d,1),\" m below A.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.18 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 116.52 KN\n", + "alpha= 76.82 °\n", + "x= 1.48 m\n", + "The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and x= 1.48 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "#The two 40 kN forces acting on the smooth pulley may be replaced by a pair of 40 kN forces acting at centre of pulley C and parallel to the given forces, since the sum of moments of the two given forces about C is zero\n", + "\n", + "PA=20.0 #inclined at 45° loading at A,KN\n", + "PB=30.0 #inclined at 60° loading at B,KN\n", + "\n", + "PC1=40.0 #inclined at 30° loading at C,KN\n", + "PC2=40.0 #inclined at 20° loading at C,KN\n", + "PD=50.0 #inclined at 30.0 at distance 2m form A,KN\n", + "PE=20.0 #inclined at alpha at distance xm form A,KN\n", + "P=20.0 #vertical loading at distance 4m,KN\n", + "\n", + "\n", + "\n", + "thetaA=45.0*pi/180.0\n", + "thetaB=60.0*pi/180.0\n", + "thetaC1=30.0*pi/180.0\n", + "thetaC2=20.0*pi/180.0\n", + "thetaD=30.0*pi/180.0\n", + "AD=2.0\n", + "AC=3.0\n", + "AB=6.0\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PA*cos(thetaA)-PB*cos(thetaB)-PD*cos(thetaD)-PC1*sin(thetaC1)+PC2*cos(thetaC2)\n", + "\n", + "Fy=-PA*sin(thetaA)-P+P-PB*sin(thetaB)-PD*sin(thetaD)-PC2*sin(thetaC2)-PC1*cos(thetaC1)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#Let the resultant intersect AB at a distance x from A. Then, \n", + "\n", + "\n", + "X=(-P*4+P*4+PB*sin(thetaB)*AB+PD*sin(thetaD)*AD-PD*cos(thetaD)*AD+PC2*AC*cos(thetaC2)-PC1*AC*sin(thetaC1))/R\n", + "\n", + "print\"x=\",round(X,2),\"m\"\n", + "\n", + "print\"The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and \",\"x=\",round(X,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.19 page number 42\n" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 103.53 N\n", + "R= 26.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Free body diagram of the sphere shows all the forces moving away from the centre of the ball. Applying Lami’s theorem to the system of forces.\n", + "\n", + "#variable declaration\n", + "W=100.0 #weight of sphere,N\n", + "theta=15.0*pi/180 #angle of inclination of string with wall\n", + "\n", + "T=(W*sin((pi/2)))/sin((pi/2)+theta)\n", + "R=(W*sin((pi-theta)))/sin((pi/2)+theta)\n", + "print\"T=\",round(T,2),\"N\"\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "#The above problem may be solved using equations of equilibrium also. Taking horizontal direction as x axis and vertical direction as y axis,\n", + "\n", + "#Notes: \n", + "#1. The string can have only tension in it (it can pull a body), but cannot have compression in it (cannot push a body). \n", + "#2. The wall reaction is a push, but cannot be a pull on the body. \n", + "#3. If the magnitude of reaction comes out to be negative, then assumed direction of reaction is wrong. It is acting exactly in the opposite to the assumed direction. However, the magnitude will be the same. Hence no further analysis is required. This advantage is not there in using Lami's equation. Hence, it is advisable for beginners to use equations of equilibrium, instead of Lami's theorem even if the body is in equilibrium under the action of only three forces. \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.20 page number 43" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 1732.05 N\n", + "P= 866.03 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#The body is in equilibrium under the action of applied force P, self-weight 1500 N and normal reaction R from the plane. Since R, which is normal to the plane, makes 30° with the vertical (or 60° with the horizontal), \n", + "\n", + "#variable declaration\n", + "W=1500.0 #weight of block,N\n", + "theta=30.0*pi/180 #angle of inclination \n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(theta)\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "P=R*sin(theta)\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Note: Since the body is in equilibrium under the action of only three forces the above problem can be solved using Lami’s theorem \n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.21 page number 42" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S= -0.058 N\n", + "Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude 0.058 kN.\n", + "R= 14.979 kN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#A bar can develop a tensile force or a compressive force. Let the force developed be a compressive force S (push on the cylinder). \n", + "\n", + "#variable declaration\n", + "W=10.0 #weight of Roller,KN\n", + "IL=7.0 #inclined loading at angle of 45°,KN\n", + "H=5.0 #Horizontal loading ,KN\n", + "\n", + "theta=45.0*pi/180 #angle of loading of IL\n", + "thetaS=30.0*pi/180.0 \n", + "\n", + "#Since there are more than three forces in the system, Lami’s equations cannot be applied. Consider the components in horizontal and vertical directions. \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "S=(-H+IL*cos(theta))/cos(thetaS)\n", + "print\"S=\",round(S,3),\"N\"\n", + "\n", + "print\"Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude\",round(-S,3) ,\"kN.\"\n", + " \n", + "R=W+IL*sin(theta)-S*sin(thetaS)\n", + "print\"R=\",round(R,3),\"kN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.22 page number 44" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x= 1.125 m\n", + "T= 125.0 N\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi,asin\n", + "\n", + "#The pulley C is in equilibrium under the action of tensile forces in CA and CB and vertical downward load 200 N. The tensile forces in segment CA and CB are the same since the pulley is frictionless. Now consider the equilibrium of pulley C \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "#variable declaration\n", + "L=200.0 #suspended load at C,N\n", + "AB=3.0\n", + "BI=1.0\n", + "ACB=5.0 #Length of cord,m\n", + "DE=3.0\n", + "BE=4.0\n", + "theta=asin(4.0/5.0)\n", + "#assume T is tension in string making angle theta1 & theta2,solving horizontal we find theta1=theta2,lets called them theta ,as triangleCFD=triangle=CFA.so, CD=AC\n", + "\n", + "HI=BI*DE/BE\n", + "AH=DE-HI\n", + "x=AH/2\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "T=L/(2*sin(theta))\n", + "print\"T=\",round(T),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.23 page number 45" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1154.7 N\n", + "P= 1732.05 N\n" + ] + } + ], + "source": [ + "from math import sin ,acos, pi\n", + "\n", + "#When the roller is about to turn over the curb, the contact with the floor is lost and hence there is no reaction from the floor. The reaction R from the curb must pass through the intersection of P and the line of action of self weight, since the body is in equilibrium under the action of only three forces (all the three forces must be concurrent). \n", + "\n", + "#variable declaration\n", + "W=2000.0 #weight of roller,N\n", + "r=300.0 #radius of roller,mm\n", + "h=150.0 # height of curb,mm\n", + "OC=r-h\n", + "AO=r\n", + "\n", + "alpha=acos(OC/AO)\n", + "\n", + "#angleOAB=angleOBA,Since OA=OB,\n", + "angleOBA=(alpha)/2\n", + "\n", + "#the reaction makes 30° with the vertical\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(angleOBA)\n", + "P=R*sin(angleOBA)\n", + "\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Least force through the centre of wheel: Now the reaction from the curb must pass through the centre of the wheel since the other two forces pass through that point. Its inclination to vertical is theta = 60°. If the triangle of forces ABC representing selfweight by AB, reaction R by BC and pull P by AC, it may be observed that AC to be least, it should be perpendicular to BC. In other words, P makes 90° with the line of action of R.\n", + "#From triangle of forces ABC, we get \n", + "P=W*sin(alpha)\n", + "print \"P=\",round(P,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.24 page number 47 " + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 224.14 N\n", + "T2= 183.01 N\n", + "T3= 336.6 N\n", + "T4= 326.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "PB=200.0 #Vertical loading at B,N\n", + "PD=250.0 #Vertical loading at D,N\n", + "thetabc=30.0*pi/180.0\n", + "thetabd=60.0*pi/180.0\n", + "thetaed=45.0*pi/180.0\n", + "#Free body diagrams of points B and D . Let the forces in the members be as shown in the figure. Applying Lami’s theorem to the system of forces at point D,\n", + "\n", + "T1=PD*sin(pi-thetabd)/sin(thetaed+(pi/2)-thetabd)\n", + "T2=PD*sin(pi-thetaed)/sin(thetaed+(pi/2)-thetabd)\n", + "\n", + "print \"T1=\",round(T1,2),\"N\"\n", + "print \"T2=\",round(T2,2),\"N\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "T3=(PB+T2*cos(thetabd))/cos(thetabc)\n", + "print \"T3=\",round(T3,2),\"N\"\n", + "\n", + "T4=(T2*sin(thetabd))+T3*sin(thetabc)\n", + "print \"T4=\",round(T4,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.25 page number 47\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 2863.64 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,acos\n", + "\n", + "#variable declaration\n", + "\n", + "PC=1500.0 #Vertical loading at C,N\n", + "CD=2.0 \n", + "AC=1.5\n", + "BD=1.0\n", + "AB=4.0\n", + "\n", + "x=((pow(AC,2)-pow(BD,2))/4)+1\n", + "y=sqrt(pow(AC,2)-pow(x,2))\n", + "\n", + "alpha=acos(x/AC)\n", + "beta=acos((CD-x)/BD)\n", + "\n", + "#Applying Lami’s theorem to the system of forces acting at point C \n", + "\n", + "T1=PC*sin(pi/2)/sin(pi-alpha)\n", + "T2=PC*sin((pi/2)+alpha)/sin(pi-alpha)\n", + "T3=T2*sin(pi/2)/sin((pi/2)+beta)\n", + "W=T2*sin(pi-beta)/sin((pi/2)+beta)\n", + "\n", + "\n", + "print \"W=\",round(W,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.26 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 44.8 KN\n", + "T2= 29.24 KN\n", + "theta= 63.42 °\n", + "T3= 25.04 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + "PC=30.0 #vertical loadng at point C,KN \n", + " \n", + "thetaab=30.0 *pi/180.0\n", + "thetabc=50.0*pi/180.0\n", + "\n", + "#applying lami's thereom\n", + "\n", + "T1=PB*sin(thetabc)/sin(pi-thetabc+thetaab)\n", + "T2=PB*sin(pi-thetaab)/sin(pi-thetabc+thetaab)\n", + "theta=atan((T2*sin(thetabc))/(PC-T2*cos(thetabc)))*180/pi\n", + "\n", + "\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "print \"T2=\",round(T2,2),\"KN\"\n", + "\n", + "#Writing equations of equilibrium for the system of forces at C \n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "T3=(PC-T2*cos(thetabc))/cos(theta*pi/180)\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "#mistake in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.27 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T3= 22.5 KN\n", + "T1= 38.97 KN\n", + "theta= 54.79 °\n", + "T2= 23.85 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + " \n", + "PC=25.0 #vertical loadng at point C,KN \n", + "\n", + "thetaab=30.0*pi/180.0\n", + "thetadc=60.0*pi/180.0\n", + "\n", + "#Writing equations of equilibrium for the system of forces at joints B and C \n", + "#T1*sin(thetaab)=T3*sin(thetadc)\n", + "\n", + "T3=(PB+PC)/((sin(thetadc)*cos(thetaab)/sin(thetaab))+cos(thetadc))\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "\n", + "T1=T3*sin(thetadc)/sin(thetaab)\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "theta=(atan((T3*sin(thetadc))/(PC-T3*cos(thetadc))))*180/pi\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "\n", + "T2=T3*sin(thetadc)/(sin(theta*pi/180))\n", + "print \"T2=\",round(T2,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.28 page number 50" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 600.0 N\n", + "alpha= 1.249 °\n", + "RD= 632.456 N\n", + "RC= 200.0 N\n", + "RA= 200.0 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,atan,pi\n", + "\n", + "#variable declaration\n", + "W=600.0 #weight of cyclinder,N\n", + "r=150.0 #radius of cylinder,mm\n", + "a=600.0 #mm\n", + "b=300.0 #mm\n", + "\n", + "#Free body diagram of sphere and frame\n", + "\n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "RB=600.0 \n", + "#As the frame is in equilibrium under the action of three forces only, they must be concurrent forces. In other words, reaction at D has line of action alone OD. Hence, its inclination to horizontal is given by: \n", + "print\"RB=\",round(RB,2),\"N\"\n", + "alpha=atan((a-r)/r)\n", + "print\"alpha=\",round(alpha,4),\"°\"\n", + "\n", + "RD=W/sin(alpha)\n", + "print\"RD=\",round(RD,3),\"N\"\n", + "\n", + "RC=RD*cos(alpha)\n", + "RA=RC\n", + "print\"RC=\",round(RC),\"N\"\n", + "print\"RA=\",round(RA),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.29 page number 51" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 166.67 N\n", + "RA= 133.33 N\n", + "RC= 200.0 N\n", + "RD= 133.33 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,asin\n", + "\n", + "\n", + "# Let O1 and O2 be the centres of the first and second spheres. Drop perpendicular O1P to the horizontal line through O2. show free body diagram of the sphere 1 and 2, respectively. Since the surface of contact are smooth, reaction of B is in the radial direction, i.e., in the direction O1O2. Let it make angle a with the horizontal. Then,\n", + "\n", + "#Variable declaration\n", + "\n", + "W=100.0 #weight of spheres,N\n", + "\n", + "r=100.0 #radius of spheres,mm\n", + "\n", + "d=360.0 # horizontal channel having vertical walls, the distance b/w,mm\n", + "\n", + "O1A=100.0\n", + "O2D=100.0\n", + "O1B=100.0\n", + "BO2=100.0\n", + "\n", + "O2P=360.0-O1A-O2D\n", + "O1O2=O1B+BO2\n", + "\n", + "alpha=acos(O2P/O1O2)\n", + "\n", + "###sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "RB=W/sin(alpha)\n", + "RA=RB*cos(alpha)\n", + "print\"RB=\",round(RB,2),\"N\"\n", + "print\"RA=\",round(RA,2),\"N\"\n", + "\n", + "RC=100+RB*sin(alpha)\n", + "\n", + "RD=RB*cos(alpha)\n", + "\n", + "print\"RC=\",round(RC),\"N\"\n", + "\n", + "print\"RD=\",round(RD,2),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.30 page number 52" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1071.8 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Two cylinders, A of weight 4000 N and B of weight 2000 N rest on smooth inclines. They are connected by a bar of negligible weight hinged to each cylinder at its geometric centre by smooth pins\n", + "\n", + "#variable declaration\n", + "\n", + "WA=4000.0 #weight of cylinder A,N\n", + "WB=2000.0 #weight of cylinder B,N\n", + "\n", + "thetaWA=60.0*pi/180.0 #inclination of wall with cylinderA,°\n", + "thetaWB=45.0*pi/180.0 #inclination of wall with cylinderB,°\n", + "thetaAb=15.0*pi/180.0 #angle inclination bar with cylinder A ,N\n", + "thetaBb=15.0*pi/180.0 #angle inclination bar with cylinder B ,N\n", + "\n", + "#he free body diagram of the two cylinders. Applying Lami’s theorem to the system of forces on cylinder A, we get\n", + "\n", + "C=WA*sin(thetaWA)/sin(thetaWA+(pi/2)-thetaAb)\n", + "\n", + "#Consider cylinder B. Summation of the forces parallel to the inclined plane \n", + "P=(-WB*cos(thetaWB)+C*cos(thetaWA))/cos(thetaBb)\n", + "print\"P=\",round(P,1),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.31 page number 55" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 10.0382 KN\n", + "RA= 188.56 KN\n", + "alpha 32.17 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "# The 12 m boom AB weighs 1 kN, the distance of the centre of gravity G being 6 m from A. For the position shown, determine the tension T in the cable and the reaction at B \n", + "\n", + "#variable declaration\n", + "PB=2.5 #vertical Loading at B,KN\n", + "WAB=1.0 #vertical loading at G,KN\n", + "\n", + "theta=15.0*pi/180\n", + "AG=6.0 #Length of boom AB is 12m\n", + "GB=6.0\n", + "thetaAB=30.0*pi/180.0\n", + "thetaABC=15.0*pi/180.0\n", + "#sum of moment at A\n", + "\n", + "T=(PB*(AG+GB)*cos(thetaAB)+WAB*AG*cos(thetaAB))/(sin(thetaABC)*12)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "HA=T*cos(thetaABC)\n", + "VA=WAB+PB+T*sin(thetaABC)\n", + "\n", + "RA=sqrt(pow(RA,2)+pow(RA,2))\n", + "print \"RA=\",round(RA,2),\"KN\"\n", + "\n", + "alpha=atan(VA/HA)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.32 page number 56" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 51.9615 KN\n", + "R1= 23.6603 KN\n", + "R2= 6.3397 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A cable car used for carrying materials in a hydroelectric project is at rest on a track formed at an angle of 30° with the vertical. The gross weight of the car and its load is 60 kN and its centroid is at a point 800 mm from the track half way between the axles. The car is held by a cable . The axles of the car are at a distance 1.2 m. Find the tension in the cables and reaction at each of the axles neglecting friction of the track.\n", + "\n", + "W=60.0 #gross weight of car,KN\n", + "theta=60.0*pi/180.0\n", + " \n", + " \n", + "T=W*sin(theta)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#Taking moment equilibrium condition about upper axle point on track, we get\n", + "\n", + "R1=(-T*600.0+W*sin(theta)*800.0+W*cos(theta)*600.0)/1200.0\n", + "print\"R1=\",round(R1,4),\"KN\"\n", + "\n", + "#Sum of forces normal to the plane = 0, gives \n", + "R2=W*cos(theta)-R1\n", + "print\"R2=\",round(R2,4),\"KN\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.33 page numnber 56" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 0.75 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,acos,pi\n", + "\n", + "# A hollow right circular cylinder of radius 800 mm is open at both ends and rests on a smooth horizontal plane. Inside the cylinder there are two spheres having weights 1 kN and 3 kN and radii 400 mm and 600 mm, respectively. The lower sphere also rests on the horizontal plane. \n", + "# Join the centres of spheres, O1 and O2 and drop O1D perpendicular to horizontal through O2. \n", + "\n", + "#variable declaration\n", + "R=800.0\n", + "W1=1.0\n", + "r1=400.0\n", + "W2=3.0\n", + "r2=600.0\n", + "O1O2=1000 #mm\n", + "O2D=600 #mm\n", + "\n", + "#If alpha is the inclination of O2O1 to horizontal\n", + "alpha=acos(O2D/O1O2)\n", + "\n", + "#Free body diagrams of cylinder and spheres are shown. Considering the equilibrium of the spheres.\n", + "#Sum of Moment at O2\n", + "\n", + "R1=W1*O2D/(O1O2*sin(alpha))\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R2=R1\n", + "R3=W1+W2\n", + "#Now consider the equilibrium of cylinder. When it is about to tip over A, there is no reaction from ground at B. The reaction will be only at A. \n", + "\n", + "#Sum of Moment at A\n", + "\n", + "W=R1*O1O2*sin(alpha)/R\n", + "\n", + "print\"W=\",round(W,2),\"KN\"\n", + "\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_F9Bz15n.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_F9Bz15n.ipynb new file mode 100644 index 00000000..a94760d2 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_F9Bz15n.ipynb @@ -0,0 +1,1857 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2-FUNDAMENTALS OF STATICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.1 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Moment is = -9607.41 Nmm clockwise\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=100.0\n", + "hd=400.0\n", + "vd=500.0\n", + "o=60.0\n", + "M=F*(math.cos(o/180.0*3.14)*vd-math.sin(o/180.0*3.14)*hd)\n", + "print '%s %.2f %s' %(\"\\n \\n Moment is =\", M ,\" Nmm clockwise\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.2 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.3 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.4 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force = 161.52 N\n", + "\n", + " \n", + " Resultant angle = 0.33 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#R resultant force\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "#f1 force\n", + "#f2 force\n", + "#f3 force\n", + "#o1 angle with the line \n", + "#o2 angle with the line \n", + "#o3 angle with the line \n", + "#O angle of resultant force with line\n", + "f1=70.0\n", + "f2=80.0\n", + "f3=50.0 \n", + "o1=50.0\n", + "o2=25.0\n", + "o3=-45.0\n", + "Rx=(f1*math.cos(o1/180*3.14)+f2*math.cos(o2/180*3.14)+f3*math.cos(o3/180*3.14));\n", + "Ry=(f1*math.sin(o1/180*3.14)+f2*math.sin(o2/180*3.14)+f3*math.sin(o3/180*3.14));\n", + "R=math.sqrt(Rx**2+Ry**2)\n", + "O=math.atan(Ry/Rx)\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force =\", R ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant angle =\", O ,\"radians\");\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.5 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force along the incline plane = 234.24 N\n", + "\n", + " \n", + " Resultant Force vertical to the incline plane = -0.46 N\n" + ] + } + ], + "source": [ + "import math\n", + "#O angle of inclined plane\n", + "#N normal reaction\n", + "#W weight\n", + "#F,T forces\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "o = 60.0 \n", + "W = 1000.0\n", + "N = 500.0\n", + "F = 100.0\n", + "T = 1200.0\n", + "Rx = T-F-(W*math.sin(o/180*3.14))\n", + "Ry = N-(W*math.cos(o/180*3.14))\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force along the incline plane =\", Rx ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force vertical to the incline plane =\", Ry ,\"N\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.6 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force 467.201871561 N\n", + "At an angle 61.0805191269\n" + ] + } + ], + "source": [ + "import math\n", + "R=1000.0 #Resultant force\n", + "F1=500.0 #Force \n", + "F2=1000.0 #force\n", + "o=45.0*3.14/180.0 #angle resultant makes with x axis \n", + "o1=30.0*3.14/180.0 #angle F1 makes with x axis \n", + "o2=60.0*3.14/180.0 #angle F2 makes with x axis \n", + "#F3coso3=Rcoso-F1coso1-F2sino2\n", + "#F3sino=Rsino-F1sino1-F2coso2\n", + "F3=((R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2))**2+(R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))**2)**0.5\n", + "print \"Force\",F3,\"N\"\n", + "o3=180/3.14*math.atan((R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))/(R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2)))\n", + "print \"At an angle\",o3" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.7 Page number 27" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 6.32 °\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,pi,asin\n", + "\n", + "#variable declaration\n", + "\n", + "P1=300.0\n", + "P2=500.0\n", + "thetaI=30.0*pi/180.0\n", + "thetaP2=30.0*pi/180\n", + "thetaP1=40.0*pi/180\n", + "# Let the x and y axes be If the resultant is directed along the x axis, its component in y direction is zero.\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "F=(P2*sin(thetaP2))/(P1)\n", + "theta=(asin((F/(cos(20*pi/180)*2)))*180/pi)-20\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.8 page number 30\n" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 68.0592 KN\n", + "alpha= 81.55 °\n", + "x= 3.326 m\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt,pi\n", + "\n", + "#variable declaration\n", + "\n", + "P1=20.0\n", + "P2=30.0\n", + "P3=20.0\n", + "theta3=60.0*pi/180.0\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=20.0*cos(theta3)\n", + "Fy=P1+P2+P3*sin(theta3)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,4),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=P1*1.5+P2*3.0+P3*sin(theta3)*6.0\n", + "\n", + "#The distance of the resultant from point O is given by:\n", + "\n", + "d=MA/R\n", + "x=d/sin(alpha*pi/180)\n", + "print\"x=\",round(x,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.9 page number 31\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 91.19 KN\n", + "alpha= 35.84 °\n", + "x= 317.023 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=100.0 #inclined up loading at 60° at A, N\n", + "PB1=80.0 #Vertical down loading at B,N\n", + "PB2=80.0 #Horizontal right loading at at B,N \n", + "PC=120.0 #inclined down loading at 30° at C,N\n", + "\n", + "thetaA=60.0*pi/180.0\n", + "thetaB=30.0*pi/180.0\n", + "\n", + "\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=PB2-PA*cos(thetaA)-PC*cos(thetaB)\n", + "Rx=-Fx\n", + "\n", + "Fy=PB1+PC*sin(thetaB)-PA*sin(thetaA)\n", + "Ry=Fy\n", + "\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Let x be the distance from A at which the resultant cuts AC. Then taking A as moment centre,\n", + "\n", + "x=(PB1*100*sin(thetaA)+PB2*50+PC*sin(thetaB)*100)/Ry\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.10 page number 32" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 565.69 N\n", + "theta= 45.0 °\n", + "x= 2.5 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PA=800.0 #Vertical down loading at A,N\n", + "PC=400.0 #vertical up loading at B,N\n", + "HD=600.0 #Horizontal left loading at A,N\n", + "HB=200.0 #Horizontal right loading at B,N\n", + "a=1.0 #length of side,m\n", + " \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=HB-HD\n", + "Fy=PC-PA\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=PC*a+HD*a\n", + "\n", + "#Let x be the distance from A along x axis, where resultant cuts AB.\n", + "\n", + "x=MA/Fy\n", + "\n", + "print\"x=\",round((-x),1),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.11 page number 32\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 10.0 KN\n", + "theta= 0.0 ° i.e. , the resultant is in the direction x.\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=2.0 #loading at B,KN\n", + "PC=sqrt(3.0) #loading at C,KN\n", + "PD=5.0 #loading at D,KN\n", + "PE=PC #loading at E,KN\n", + "PF=PB #loading at F,KN\n", + "\n", + "#Let O be the centre of the encircling circle A, B, C, D, E and F. In regular hexagon each side is equal to the radius AO. Hence OAB is equilateral triangle.\n", + "\n", + "angleoab=60.0*pi/180\n", + "anglecab=angleoab/2.0\n", + "theta1=anglecab\n", + "theta2=(angleoab-theta1)\n", + "theta3=theta1\n", + "theta4=theta1\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PB*cos(theta1+theta2)+PC*cos(theta2)+PD+PE*cos(theta3)+PF*cos(theta3+theta4)\n", + "\n", + "Fy=-PB*sin(theta1+theta2)-PC*sin(theta2)+0+PE*sin(theta3)+PF*sin(theta3+theta4)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\",\"i.e.\",\",\",\"the resultant is in the direction x.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.12 page number 33" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 4.66 N\n", + "alpha= 28.99 °\n", + "d= 42.73 mm\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "P1=2.0 #loading at 1,KN\n", + "P2=1.5 #loading at 2,KN\n", + "P3=5.0 #loading at 3,KN\n", + "a=10.0 #side length,mm\n", + "\n", + "# If theta1, theta2 and theta3 are the slopes of the forces 2 kN, 5 kN and 1.5 kN forces with respect to x axis, then \n", + "\n", + "\n", + "theta1=atan(a/a)\n", + "theta2=atan((3*a)/(4*a))\n", + "theta3=atan((a)/(2*a))\n", + "\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=P1*cos(theta1)+P3*cos(theta2)-P2*cos(theta3)\n", + "\n", + "Fy=P1*sin(theta1)-P3*sin(theta2)-P2*sin(theta3)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Distance d of the resultant from O is given by\n", + "#Rd=sum of moment at A\n", + "\n", + "d=((a*3)*P1*cos(theta1)+(5*a)*P3*sin(theta2)+P2*(a)*sin(theta3))/(4.66)\n", + "print\"d=\",round(d,2),\"mm\"\n", + "\n", + "#Note: To find moment of forces about O, 2 kN force is resolved at it’s intersection with y axis and 5 kN and 1.5 kN forces are resolved at their intersection with x axis, and then Varignon theorem is used\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.13 page number 34" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 150.0 KN\n", + "MA= 270.0 KN-m\n", + "x= 1.8 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #loading at B,KN\n", + "PC=30.0 #loading at C,KN\n", + "PD=40.0 #loading at D,KN\n", + "PA=60.0 #loading at E,KN\n", + "AB=1.0\n", + "BC=2.0\n", + "CD=1.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA+PB+PC+PD\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA+(AB)*PB+PC*(AB+BC)+PD*(AB+BC+CD)\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x,1),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.14 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 100.0 KN in y-direction\n", + "MA= 300.0 KN-m\n", + "x= 3.0 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #up loading at B,KN\n", + "PC=40.0 #down loading at C,KN\n", + "PD=50.0 #up loading at D,KN\n", + "PA=80.0 #down loading at A,KN\n", + "PE=60.0 #down loading at E,KN\n", + "AB=2.0\n", + "BC=2.0\n", + "CD=4.0\n", + "DE=2.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA-PB+PC-PD+PE\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA-(AB)*PB+PC*(AB+BC)-PD*(AB+BC+CD)+PE*(AB+BC+CD+DE)\n", + "\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.15 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 2671.19 KN in y-direction\n", + "alpha 80.3 °\n", + "x= 141.195 mm\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=500.0 #Loading at inclined to 60.0°,N\n", + "P2=1000.0 #vertical loading at 150 distance from O,N\n", + "P3=1200.0 #vertical loading at 150 distance from O,N\n", + "H=700.0 #Horizontal loading at 300 ditance from O,N\n", + "a=150.0\n", + "theta=60.0*pi/180\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=P1*cos(theta)-H\n", + "Ry=-P3-P2-P1*sin(theta)\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "alpha=atan(Ry/Rx)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"\n", + " \n", + "#Let the point of application of the resultant be at a distance x from the point O along the horizontal arm. Then, \n", + "\n", + "x=(P1*sin(theta)*(2*a)+P2*a-P3*a*cos(theta)+H*a*2*sin(theta))/(-Ry)\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.16 page number 36" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ry= 1420.0 KN downward\n", + "x= 4.127 m\n", + "The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=1120.0 #vertical down Loading at 2m distance from O,KN\n", + "P2=120.0 #vertical up loading at 4m distance from O,KN\n", + "P3=420.0 #vertical downloading at 5m distance from O,KN\n", + "H=500.0 #Horizontal loading at 4m ditance from O,KN\n", + "ah=4.0\n", + "a1=2.0\n", + "a2=4.0\n", + "a3=5.0\n", + "a=7.0\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=H\n", + "Ry=P1-P2+P3\n", + "\n", + "print \"Ry=\",round(Ry,2),\"KN\",\"downward\"\n", + " \n", + "#Let x be the distance from O where the resultant cuts the base.\n", + "#moment at O\n", + "x=(H*ah+P1*a1-P2*a2+P3*a3)/(Ry)\n", + "\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "print \"The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.17 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 42.426 KN\n", + "d= 1.5 m Resultant is a horizontal force of magnitude 42.426 at 1.5 m below A.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=5.0 #Inclined at 45° down Loading at 3m distance from A,KN\n", + "P2=10.0 #Inclined at 45° down Loading at 2m distance from A,KN\n", + "P3=10.0 #Inclined at 45° down Loading at 1m distance from A,KN\n", + "P4=5.0 #Inclined at 45° down Loading A,KN\n", + "P8=5.0 #Inclined at 45° UP Loading at 3m distance from A,KN\n", + "P7=10.0 #Inclined at 45° UP Loading at 2m distance from A,KN\n", + "P6=10.0 #Inclined at 45° UP Loading at 1m distance from A,KN\n", + "P5=5.0 #Inclined at 45° UP Loading A,KN\n", + "a=1.0\n", + "\n", + "theta=45.0*pi/180.0\n", + "#The roof is inclined at 45° to horizontal and loads are at 90° to the roof. Hence, the loads are also inclined at 45° to vertical/horizontal. \n", + "\n", + "#assume Resulat R at distance d from A,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=(P1+P2+P3+P4+P5+P6+P7+P8)*cos(theta)\n", + "Ry=-(P1+P2+P3+P4)*sin(theta)+(P5+P6+P7+P8)*sin(theta)\n", + "\n", + "print \"R=\",round(Rx,3),\"KN\"\n", + "#and its direction is horizontal \n", + "#Let R be at a distance d from the ridge A\n", + "#moment at A\n", + "d=((P1*3*cos(theta)*a+P2*cos(theta)*2*a+P3*cos(theta)*a)*2)/(Rx)\n", + "\n", + "print\"d=\",round(d,1),\"m\",\" Resultant is a horizontal force of magnitude\",round(Rx,3),\" at\",round(d,1),\" m below A.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.18 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 116.52 KN\n", + "alpha= 76.82 °\n", + "x= 1.48 m\n", + "The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and x= 1.48 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "#The two 40 kN forces acting on the smooth pulley may be replaced by a pair of 40 kN forces acting at centre of pulley C and parallel to the given forces, since the sum of moments of the two given forces about C is zero\n", + "\n", + "PA=20.0 #inclined at 45° loading at A,KN\n", + "PB=30.0 #inclined at 60° loading at B,KN\n", + "\n", + "PC1=40.0 #inclined at 30° loading at C,KN\n", + "PC2=40.0 #inclined at 20° loading at C,KN\n", + "PD=50.0 #inclined at 30.0 at distance 2m form A,KN\n", + "PE=20.0 #inclined at alpha at distance xm form A,KN\n", + "P=20.0 #vertical loading at distance 4m,KN\n", + "\n", + "\n", + "\n", + "thetaA=45.0*pi/180.0\n", + "thetaB=60.0*pi/180.0\n", + "thetaC1=30.0*pi/180.0\n", + "thetaC2=20.0*pi/180.0\n", + "thetaD=30.0*pi/180.0\n", + "AD=2.0\n", + "AC=3.0\n", + "AB=6.0\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PA*cos(thetaA)-PB*cos(thetaB)-PD*cos(thetaD)-PC1*sin(thetaC1)+PC2*cos(thetaC2)\n", + "\n", + "Fy=-PA*sin(thetaA)-P+P-PB*sin(thetaB)-PD*sin(thetaD)-PC2*sin(thetaC2)-PC1*cos(thetaC1)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#Let the resultant intersect AB at a distance x from A. Then, \n", + "\n", + "\n", + "X=(-P*4+P*4+PB*sin(thetaB)*AB+PD*sin(thetaD)*AD-PD*cos(thetaD)*AD+PC2*AC*cos(thetaC2)-PC1*AC*sin(thetaC1))/R\n", + "\n", + "print\"x=\",round(X,2),\"m\"\n", + "\n", + "print\"The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and \",\"x=\",round(X,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.19 page number 42\n" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 103.53 N\n", + "R= 26.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Free body diagram of the sphere shows all the forces moving away from the centre of the ball. Applying Lami’s theorem to the system of forces.\n", + "\n", + "#variable declaration\n", + "W=100.0 #weight of sphere,N\n", + "theta=15.0*pi/180 #angle of inclination of string with wall\n", + "\n", + "T=(W*sin((pi/2)))/sin((pi/2)+theta)\n", + "R=(W*sin((pi-theta)))/sin((pi/2)+theta)\n", + "print\"T=\",round(T,2),\"N\"\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "#The above problem may be solved using equations of equilibrium also. Taking horizontal direction as x axis and vertical direction as y axis,\n", + "\n", + "#Notes: \n", + "#1. The string can have only tension in it (it can pull a body), but cannot have compression in it (cannot push a body). \n", + "#2. The wall reaction is a push, but cannot be a pull on the body. \n", + "#3. If the magnitude of reaction comes out to be negative, then assumed direction of reaction is wrong. It is acting exactly in the opposite to the assumed direction. However, the magnitude will be the same. Hence no further analysis is required. This advantage is not there in using Lami's equation. Hence, it is advisable for beginners to use equations of equilibrium, instead of Lami's theorem even if the body is in equilibrium under the action of only three forces. \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.20 page number 43" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 1732.05 N\n", + "P= 866.03 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#The body is in equilibrium under the action of applied force P, self-weight 1500 N and normal reaction R from the plane. Since R, which is normal to the plane, makes 30° with the vertical (or 60° with the horizontal), \n", + "\n", + "#variable declaration\n", + "W=1500.0 #weight of block,N\n", + "theta=30.0*pi/180 #angle of inclination \n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(theta)\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "P=R*sin(theta)\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Note: Since the body is in equilibrium under the action of only three forces the above problem can be solved using Lami’s theorem \n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.21 page number 42" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S= -0.058 N\n", + "Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude 0.058 kN.\n", + "R= 14.979 kN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#A bar can develop a tensile force or a compressive force. Let the force developed be a compressive force S (push on the cylinder). \n", + "\n", + "#variable declaration\n", + "W=10.0 #weight of Roller,KN\n", + "IL=7.0 #inclined loading at angle of 45°,KN\n", + "H=5.0 #Horizontal loading ,KN\n", + "\n", + "theta=45.0*pi/180 #angle of loading of IL\n", + "thetaS=30.0*pi/180.0 \n", + "\n", + "#Since there are more than three forces in the system, Lami’s equations cannot be applied. Consider the components in horizontal and vertical directions. \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "S=(-H+IL*cos(theta))/cos(thetaS)\n", + "print\"S=\",round(S,3),\"N\"\n", + "\n", + "print\"Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude\",round(-S,3) ,\"kN.\"\n", + " \n", + "R=W+IL*sin(theta)-S*sin(thetaS)\n", + "print\"R=\",round(R,3),\"kN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.22 page number 44" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x= 1.125 m\n", + "T= 125.0 N\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi,asin\n", + "\n", + "#The pulley C is in equilibrium under the action of tensile forces in CA and CB and vertical downward load 200 N. The tensile forces in segment CA and CB are the same since the pulley is frictionless. Now consider the equilibrium of pulley C \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "#variable declaration\n", + "L=200.0 #suspended load at C,N\n", + "AB=3.0\n", + "BI=1.0\n", + "ACB=5.0 #Length of cord,m\n", + "DE=3.0\n", + "BE=4.0\n", + "theta=asin(4.0/5.0)\n", + "#assume T is tension in string making angle theta1 & theta2,solving horizontal we find theta1=theta2,lets called them theta ,as triangleCFD=triangle=CFA.so, CD=AC\n", + "\n", + "HI=BI*DE/BE\n", + "AH=DE-HI\n", + "x=AH/2\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "T=L/(2*sin(theta))\n", + "print\"T=\",round(T),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.23 page number 45" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1154.7 N\n", + "P= 1732.05 N\n" + ] + } + ], + "source": [ + "from math import sin ,acos, pi\n", + "\n", + "#When the roller is about to turn over the curb, the contact with the floor is lost and hence there is no reaction from the floor. The reaction R from the curb must pass through the intersection of P and the line of action of self weight, since the body is in equilibrium under the action of only three forces (all the three forces must be concurrent). \n", + "\n", + "#variable declaration\n", + "W=2000.0 #weight of roller,N\n", + "r=300.0 #radius of roller,mm\n", + "h=150.0 # height of curb,mm\n", + "OC=r-h\n", + "AO=r\n", + "\n", + "alpha=acos(OC/AO)\n", + "\n", + "#angleOAB=angleOBA,Since OA=OB,\n", + "angleOBA=(alpha)/2\n", + "\n", + "#the reaction makes 30° with the vertical\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(angleOBA)\n", + "P=R*sin(angleOBA)\n", + "\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Least force through the centre of wheel: Now the reaction from the curb must pass through the centre of the wheel since the other two forces pass through that point. Its inclination to vertical is theta = 60°. If the triangle of forces ABC representing selfweight by AB, reaction R by BC and pull P by AC, it may be observed that AC to be least, it should be perpendicular to BC. In other words, P makes 90° with the line of action of R.\n", + "#From triangle of forces ABC, we get \n", + "P=W*sin(alpha)\n", + "print \"P=\",round(P,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.24 page number 47 " + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 224.14 N\n", + "T2= 183.01 N\n", + "T3= 336.6 N\n", + "T4= 326.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "PB=200.0 #Vertical loading at B,N\n", + "PD=250.0 #Vertical loading at D,N\n", + "thetabc=30.0*pi/180.0\n", + "thetabd=60.0*pi/180.0\n", + "thetaed=45.0*pi/180.0\n", + "#Free body diagrams of points B and D . Let the forces in the members be as shown in the figure. Applying Lami’s theorem to the system of forces at point D,\n", + "\n", + "T1=PD*sin(pi-thetabd)/sin(thetaed+(pi/2)-thetabd)\n", + "T2=PD*sin(pi-thetaed)/sin(thetaed+(pi/2)-thetabd)\n", + "\n", + "print \"T1=\",round(T1,2),\"N\"\n", + "print \"T2=\",round(T2,2),\"N\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "T3=(PB+T2*cos(thetabd))/cos(thetabc)\n", + "print \"T3=\",round(T3,2),\"N\"\n", + "\n", + "T4=(T2*sin(thetabd))+T3*sin(thetabc)\n", + "print \"T4=\",round(T4,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.25 page number 47\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 2863.64 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,acos\n", + "\n", + "#variable declaration\n", + "\n", + "PC=1500.0 #Vertical loading at C,N\n", + "CD=2.0 \n", + "AC=1.5\n", + "BD=1.0\n", + "AB=4.0\n", + "\n", + "x=((pow(AC,2)-pow(BD,2))/4)+1\n", + "y=sqrt(pow(AC,2)-pow(x,2))\n", + "\n", + "alpha=acos(x/AC)\n", + "beta=acos((CD-x)/BD)\n", + "\n", + "#Applying Lami’s theorem to the system of forces acting at point C \n", + "\n", + "T1=PC*sin(pi/2)/sin(pi-alpha)\n", + "T2=PC*sin((pi/2)+alpha)/sin(pi-alpha)\n", + "T3=T2*sin(pi/2)/sin((pi/2)+beta)\n", + "W=T2*sin(pi-beta)/sin((pi/2)+beta)\n", + "\n", + "\n", + "print \"W=\",round(W,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.26 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 44.8 KN\n", + "T2= 29.24 KN\n", + "theta= 63.42 °\n", + "T3= 25.04 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + "PC=30.0 #vertical loadng at point C,KN \n", + " \n", + "thetaab=30.0 *pi/180.0\n", + "thetabc=50.0*pi/180.0\n", + "\n", + "#applying lami's thereom\n", + "\n", + "T1=PB*sin(thetabc)/sin(pi-thetabc+thetaab)\n", + "T2=PB*sin(pi-thetaab)/sin(pi-thetabc+thetaab)\n", + "theta=atan((T2*sin(thetabc))/(PC-T2*cos(thetabc)))*180/pi\n", + "\n", + "\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "print \"T2=\",round(T2,2),\"KN\"\n", + "\n", + "#Writing equations of equilibrium for the system of forces at C \n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "T3=(PC-T2*cos(thetabc))/cos(theta*pi/180)\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "#mistake in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.27 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T3= 22.5 KN\n", + "T1= 38.97 KN\n", + "theta= 54.79 °\n", + "T2= 23.85 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + " \n", + "PC=25.0 #vertical loadng at point C,KN \n", + "\n", + "thetaab=30.0*pi/180.0\n", + "thetadc=60.0*pi/180.0\n", + "\n", + "#Writing equations of equilibrium for the system of forces at joints B and C \n", + "#T1*sin(thetaab)=T3*sin(thetadc)\n", + "\n", + "T3=(PB+PC)/((sin(thetadc)*cos(thetaab)/sin(thetaab))+cos(thetadc))\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "\n", + "T1=T3*sin(thetadc)/sin(thetaab)\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "theta=(atan((T3*sin(thetadc))/(PC-T3*cos(thetadc))))*180/pi\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "\n", + "T2=T3*sin(thetadc)/(sin(theta*pi/180))\n", + "print \"T2=\",round(T2,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.28 page number 50" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 600.0 N\n", + "alpha= 1.249 °\n", + "RD= 632.456 N\n", + "RC= 200.0 N\n", + "RA= 200.0 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,atan,pi\n", + "\n", + "#variable declaration\n", + "W=600.0 #weight of cyclinder,N\n", + "r=150.0 #radius of cylinder,mm\n", + "a=600.0 #mm\n", + "b=300.0 #mm\n", + "\n", + "#Free body diagram of sphere and frame\n", + "\n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "RB=600.0 \n", + "#As the frame is in equilibrium under the action of three forces only, they must be concurrent forces. In other words, reaction at D has line of action alone OD. Hence, its inclination to horizontal is given by: \n", + "print\"RB=\",round(RB,2),\"N\"\n", + "alpha=atan((a-r)/r)\n", + "print\"alpha=\",round(alpha,4),\"°\"\n", + "\n", + "RD=W/sin(alpha)\n", + "print\"RD=\",round(RD,3),\"N\"\n", + "\n", + "RC=RD*cos(alpha)\n", + "RA=RC\n", + "print\"RC=\",round(RC),\"N\"\n", + "print\"RA=\",round(RA),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.29 page number 51" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 166.67 N\n", + "RA= 133.33 N\n", + "RC= 200.0 N\n", + "RD= 133.33 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,asin\n", + "\n", + "\n", + "# Let O1 and O2 be the centres of the first and second spheres. Drop perpendicular O1P to the horizontal line through O2. show free body diagram of the sphere 1 and 2, respectively. Since the surface of contact are smooth, reaction of B is in the radial direction, i.e., in the direction O1O2. Let it make angle a with the horizontal. Then,\n", + "\n", + "#Variable declaration\n", + "\n", + "W=100.0 #weight of spheres,N\n", + "\n", + "r=100.0 #radius of spheres,mm\n", + "\n", + "d=360.0 # horizontal channel having vertical walls, the distance b/w,mm\n", + "\n", + "O1A=100.0\n", + "O2D=100.0\n", + "O1B=100.0\n", + "BO2=100.0\n", + "\n", + "O2P=360.0-O1A-O2D\n", + "O1O2=O1B+BO2\n", + "\n", + "alpha=acos(O2P/O1O2)\n", + "\n", + "###sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "RB=W/sin(alpha)\n", + "RA=RB*cos(alpha)\n", + "print\"RB=\",round(RB,2),\"N\"\n", + "print\"RA=\",round(RA,2),\"N\"\n", + "\n", + "RC=100+RB*sin(alpha)\n", + "\n", + "RD=RB*cos(alpha)\n", + "\n", + "print\"RC=\",round(RC),\"N\"\n", + "\n", + "print\"RD=\",round(RD,2),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.30 page number 52" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1071.8 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Two cylinders, A of weight 4000 N and B of weight 2000 N rest on smooth inclines. They are connected by a bar of negligible weight hinged to each cylinder at its geometric centre by smooth pins\n", + "\n", + "#variable declaration\n", + "\n", + "WA=4000.0 #weight of cylinder A,N\n", + "WB=2000.0 #weight of cylinder B,N\n", + "\n", + "thetaWA=60.0*pi/180.0 #inclination of wall with cylinderA,°\n", + "thetaWB=45.0*pi/180.0 #inclination of wall with cylinderB,°\n", + "thetaAb=15.0*pi/180.0 #angle inclination bar with cylinder A ,N\n", + "thetaBb=15.0*pi/180.0 #angle inclination bar with cylinder B ,N\n", + "\n", + "#he free body diagram of the two cylinders. Applying Lami’s theorem to the system of forces on cylinder A, we get\n", + "\n", + "C=WA*sin(thetaWA)/sin(thetaWA+(pi/2)-thetaAb)\n", + "\n", + "#Consider cylinder B. Summation of the forces parallel to the inclined plane \n", + "P=(-WB*cos(thetaWB)+C*cos(thetaWA))/cos(thetaBb)\n", + "print\"P=\",round(P,1),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.31 page number 55" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 10.0382 KN\n", + "RA= 188.56 KN\n", + "alpha 32.17 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "# The 12 m boom AB weighs 1 kN, the distance of the centre of gravity G being 6 m from A. For the position shown, determine the tension T in the cable and the reaction at B \n", + "\n", + "#variable declaration\n", + "PB=2.5 #vertical Loading at B,KN\n", + "WAB=1.0 #vertical loading at G,KN\n", + "\n", + "theta=15.0*pi/180\n", + "AG=6.0 #Length of boom AB is 12m\n", + "GB=6.0\n", + "thetaAB=30.0*pi/180.0\n", + "thetaABC=15.0*pi/180.0\n", + "#sum of moment at A\n", + "\n", + "T=(PB*(AG+GB)*cos(thetaAB)+WAB*AG*cos(thetaAB))/(sin(thetaABC)*12)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "HA=T*cos(thetaABC)\n", + "VA=WAB+PB+T*sin(thetaABC)\n", + "\n", + "RA=sqrt(pow(RA,2)+pow(RA,2))\n", + "print \"RA=\",round(RA,2),\"KN\"\n", + "\n", + "alpha=atan(VA/HA)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.32 page number 56" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 51.9615 KN\n", + "R1= 23.6603 KN\n", + "R2= 6.3397 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A cable car used for carrying materials in a hydroelectric project is at rest on a track formed at an angle of 30° with the vertical. The gross weight of the car and its load is 60 kN and its centroid is at a point 800 mm from the track half way between the axles. The car is held by a cable . The axles of the car are at a distance 1.2 m. Find the tension in the cables and reaction at each of the axles neglecting friction of the track.\n", + "\n", + "W=60.0 #gross weight of car,KN\n", + "theta=60.0*pi/180.0\n", + " \n", + " \n", + "T=W*sin(theta)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#Taking moment equilibrium condition about upper axle point on track, we get\n", + "\n", + "R1=(-T*600.0+W*sin(theta)*800.0+W*cos(theta)*600.0)/1200.0\n", + "print\"R1=\",round(R1,4),\"KN\"\n", + "\n", + "#Sum of forces normal to the plane = 0, gives \n", + "R2=W*cos(theta)-R1\n", + "print\"R2=\",round(R2,4),\"KN\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.33 page numnber 56" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 0.75 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,acos,pi\n", + "\n", + "# A hollow right circular cylinder of radius 800 mm is open at both ends and rests on a smooth horizontal plane. Inside the cylinder there are two spheres having weights 1 kN and 3 kN and radii 400 mm and 600 mm, respectively. The lower sphere also rests on the horizontal plane. \n", + "# Join the centres of spheres, O1 and O2 and drop O1D perpendicular to horizontal through O2. \n", + "\n", + "#variable declaration\n", + "R=800.0\n", + "W1=1.0\n", + "r1=400.0\n", + "W2=3.0\n", + "r2=600.0\n", + "O1O2=1000 #mm\n", + "O2D=600 #mm\n", + "\n", + "#If alpha is the inclination of O2O1 to horizontal\n", + "alpha=acos(O2D/O1O2)\n", + "\n", + "#Free body diagrams of cylinder and spheres are shown. Considering the equilibrium of the spheres.\n", + "#Sum of Moment at O2\n", + "\n", + "R1=W1*O2D/(O1O2*sin(alpha))\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R2=R1\n", + "R3=W1+W2\n", + "#Now consider the equilibrium of cylinder. When it is about to tip over A, there is no reaction from ground at B. The reaction will be only at A. \n", + "\n", + "#Sum of Moment at A\n", + "\n", + "W=R1*O1O2*sin(alpha)/R\n", + "\n", + "print\"W=\",round(W,2),\"KN\"\n", + "\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_KLSq0oK.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_KLSq0oK.ipynb new file mode 100644 index 00000000..a94760d2 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_KLSq0oK.ipynb @@ -0,0 +1,1857 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2-FUNDAMENTALS OF STATICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.1 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Moment is = -9607.41 Nmm clockwise\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=100.0\n", + "hd=400.0\n", + "vd=500.0\n", + "o=60.0\n", + "M=F*(math.cos(o/180.0*3.14)*vd-math.sin(o/180.0*3.14)*hd)\n", + "print '%s %.2f %s' %(\"\\n \\n Moment is =\", M ,\" Nmm clockwise\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.2 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.3 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.4 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force = 161.52 N\n", + "\n", + " \n", + " Resultant angle = 0.33 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#R resultant force\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "#f1 force\n", + "#f2 force\n", + "#f3 force\n", + "#o1 angle with the line \n", + "#o2 angle with the line \n", + "#o3 angle with the line \n", + "#O angle of resultant force with line\n", + "f1=70.0\n", + "f2=80.0\n", + "f3=50.0 \n", + "o1=50.0\n", + "o2=25.0\n", + "o3=-45.0\n", + "Rx=(f1*math.cos(o1/180*3.14)+f2*math.cos(o2/180*3.14)+f3*math.cos(o3/180*3.14));\n", + "Ry=(f1*math.sin(o1/180*3.14)+f2*math.sin(o2/180*3.14)+f3*math.sin(o3/180*3.14));\n", + "R=math.sqrt(Rx**2+Ry**2)\n", + "O=math.atan(Ry/Rx)\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force =\", R ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant angle =\", O ,\"radians\");\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.5 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force along the incline plane = 234.24 N\n", + "\n", + " \n", + " Resultant Force vertical to the incline plane = -0.46 N\n" + ] + } + ], + "source": [ + "import math\n", + "#O angle of inclined plane\n", + "#N normal reaction\n", + "#W weight\n", + "#F,T forces\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "o = 60.0 \n", + "W = 1000.0\n", + "N = 500.0\n", + "F = 100.0\n", + "T = 1200.0\n", + "Rx = T-F-(W*math.sin(o/180*3.14))\n", + "Ry = N-(W*math.cos(o/180*3.14))\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force along the incline plane =\", Rx ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force vertical to the incline plane =\", Ry ,\"N\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.6 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force 467.201871561 N\n", + "At an angle 61.0805191269\n" + ] + } + ], + "source": [ + "import math\n", + "R=1000.0 #Resultant force\n", + "F1=500.0 #Force \n", + "F2=1000.0 #force\n", + "o=45.0*3.14/180.0 #angle resultant makes with x axis \n", + "o1=30.0*3.14/180.0 #angle F1 makes with x axis \n", + "o2=60.0*3.14/180.0 #angle F2 makes with x axis \n", + "#F3coso3=Rcoso-F1coso1-F2sino2\n", + "#F3sino=Rsino-F1sino1-F2coso2\n", + "F3=((R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2))**2+(R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))**2)**0.5\n", + "print \"Force\",F3,\"N\"\n", + "o3=180/3.14*math.atan((R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))/(R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2)))\n", + "print \"At an angle\",o3" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.7 Page number 27" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 6.32 °\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,pi,asin\n", + "\n", + "#variable declaration\n", + "\n", + "P1=300.0\n", + "P2=500.0\n", + "thetaI=30.0*pi/180.0\n", + "thetaP2=30.0*pi/180\n", + "thetaP1=40.0*pi/180\n", + "# Let the x and y axes be If the resultant is directed along the x axis, its component in y direction is zero.\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "F=(P2*sin(thetaP2))/(P1)\n", + "theta=(asin((F/(cos(20*pi/180)*2)))*180/pi)-20\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.8 page number 30\n" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 68.0592 KN\n", + "alpha= 81.55 °\n", + "x= 3.326 m\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt,pi\n", + "\n", + "#variable declaration\n", + "\n", + "P1=20.0\n", + "P2=30.0\n", + "P3=20.0\n", + "theta3=60.0*pi/180.0\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=20.0*cos(theta3)\n", + "Fy=P1+P2+P3*sin(theta3)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,4),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=P1*1.5+P2*3.0+P3*sin(theta3)*6.0\n", + "\n", + "#The distance of the resultant from point O is given by:\n", + "\n", + "d=MA/R\n", + "x=d/sin(alpha*pi/180)\n", + "print\"x=\",round(x,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.9 page number 31\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 91.19 KN\n", + "alpha= 35.84 °\n", + "x= 317.023 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=100.0 #inclined up loading at 60° at A, N\n", + "PB1=80.0 #Vertical down loading at B,N\n", + "PB2=80.0 #Horizontal right loading at at B,N \n", + "PC=120.0 #inclined down loading at 30° at C,N\n", + "\n", + "thetaA=60.0*pi/180.0\n", + "thetaB=30.0*pi/180.0\n", + "\n", + "\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=PB2-PA*cos(thetaA)-PC*cos(thetaB)\n", + "Rx=-Fx\n", + "\n", + "Fy=PB1+PC*sin(thetaB)-PA*sin(thetaA)\n", + "Ry=Fy\n", + "\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Let x be the distance from A at which the resultant cuts AC. Then taking A as moment centre,\n", + "\n", + "x=(PB1*100*sin(thetaA)+PB2*50+PC*sin(thetaB)*100)/Ry\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.10 page number 32" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 565.69 N\n", + "theta= 45.0 °\n", + "x= 2.5 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PA=800.0 #Vertical down loading at A,N\n", + "PC=400.0 #vertical up loading at B,N\n", + "HD=600.0 #Horizontal left loading at A,N\n", + "HB=200.0 #Horizontal right loading at B,N\n", + "a=1.0 #length of side,m\n", + " \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=HB-HD\n", + "Fy=PC-PA\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=PC*a+HD*a\n", + "\n", + "#Let x be the distance from A along x axis, where resultant cuts AB.\n", + "\n", + "x=MA/Fy\n", + "\n", + "print\"x=\",round((-x),1),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.11 page number 32\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 10.0 KN\n", + "theta= 0.0 ° i.e. , the resultant is in the direction x.\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=2.0 #loading at B,KN\n", + "PC=sqrt(3.0) #loading at C,KN\n", + "PD=5.0 #loading at D,KN\n", + "PE=PC #loading at E,KN\n", + "PF=PB #loading at F,KN\n", + "\n", + "#Let O be the centre of the encircling circle A, B, C, D, E and F. In regular hexagon each side is equal to the radius AO. Hence OAB is equilateral triangle.\n", + "\n", + "angleoab=60.0*pi/180\n", + "anglecab=angleoab/2.0\n", + "theta1=anglecab\n", + "theta2=(angleoab-theta1)\n", + "theta3=theta1\n", + "theta4=theta1\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PB*cos(theta1+theta2)+PC*cos(theta2)+PD+PE*cos(theta3)+PF*cos(theta3+theta4)\n", + "\n", + "Fy=-PB*sin(theta1+theta2)-PC*sin(theta2)+0+PE*sin(theta3)+PF*sin(theta3+theta4)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\",\"i.e.\",\",\",\"the resultant is in the direction x.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.12 page number 33" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 4.66 N\n", + "alpha= 28.99 °\n", + "d= 42.73 mm\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "P1=2.0 #loading at 1,KN\n", + "P2=1.5 #loading at 2,KN\n", + "P3=5.0 #loading at 3,KN\n", + "a=10.0 #side length,mm\n", + "\n", + "# If theta1, theta2 and theta3 are the slopes of the forces 2 kN, 5 kN and 1.5 kN forces with respect to x axis, then \n", + "\n", + "\n", + "theta1=atan(a/a)\n", + "theta2=atan((3*a)/(4*a))\n", + "theta3=atan((a)/(2*a))\n", + "\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=P1*cos(theta1)+P3*cos(theta2)-P2*cos(theta3)\n", + "\n", + "Fy=P1*sin(theta1)-P3*sin(theta2)-P2*sin(theta3)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Distance d of the resultant from O is given by\n", + "#Rd=sum of moment at A\n", + "\n", + "d=((a*3)*P1*cos(theta1)+(5*a)*P3*sin(theta2)+P2*(a)*sin(theta3))/(4.66)\n", + "print\"d=\",round(d,2),\"mm\"\n", + "\n", + "#Note: To find moment of forces about O, 2 kN force is resolved at it’s intersection with y axis and 5 kN and 1.5 kN forces are resolved at their intersection with x axis, and then Varignon theorem is used\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.13 page number 34" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 150.0 KN\n", + "MA= 270.0 KN-m\n", + "x= 1.8 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #loading at B,KN\n", + "PC=30.0 #loading at C,KN\n", + "PD=40.0 #loading at D,KN\n", + "PA=60.0 #loading at E,KN\n", + "AB=1.0\n", + "BC=2.0\n", + "CD=1.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA+PB+PC+PD\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA+(AB)*PB+PC*(AB+BC)+PD*(AB+BC+CD)\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x,1),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.14 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 100.0 KN in y-direction\n", + "MA= 300.0 KN-m\n", + "x= 3.0 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #up loading at B,KN\n", + "PC=40.0 #down loading at C,KN\n", + "PD=50.0 #up loading at D,KN\n", + "PA=80.0 #down loading at A,KN\n", + "PE=60.0 #down loading at E,KN\n", + "AB=2.0\n", + "BC=2.0\n", + "CD=4.0\n", + "DE=2.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA-PB+PC-PD+PE\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA-(AB)*PB+PC*(AB+BC)-PD*(AB+BC+CD)+PE*(AB+BC+CD+DE)\n", + "\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.15 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 2671.19 KN in y-direction\n", + "alpha 80.3 °\n", + "x= 141.195 mm\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=500.0 #Loading at inclined to 60.0°,N\n", + "P2=1000.0 #vertical loading at 150 distance from O,N\n", + "P3=1200.0 #vertical loading at 150 distance from O,N\n", + "H=700.0 #Horizontal loading at 300 ditance from O,N\n", + "a=150.0\n", + "theta=60.0*pi/180\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=P1*cos(theta)-H\n", + "Ry=-P3-P2-P1*sin(theta)\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "alpha=atan(Ry/Rx)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"\n", + " \n", + "#Let the point of application of the resultant be at a distance x from the point O along the horizontal arm. Then, \n", + "\n", + "x=(P1*sin(theta)*(2*a)+P2*a-P3*a*cos(theta)+H*a*2*sin(theta))/(-Ry)\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.16 page number 36" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ry= 1420.0 KN downward\n", + "x= 4.127 m\n", + "The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=1120.0 #vertical down Loading at 2m distance from O,KN\n", + "P2=120.0 #vertical up loading at 4m distance from O,KN\n", + "P3=420.0 #vertical downloading at 5m distance from O,KN\n", + "H=500.0 #Horizontal loading at 4m ditance from O,KN\n", + "ah=4.0\n", + "a1=2.0\n", + "a2=4.0\n", + "a3=5.0\n", + "a=7.0\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=H\n", + "Ry=P1-P2+P3\n", + "\n", + "print \"Ry=\",round(Ry,2),\"KN\",\"downward\"\n", + " \n", + "#Let x be the distance from O where the resultant cuts the base.\n", + "#moment at O\n", + "x=(H*ah+P1*a1-P2*a2+P3*a3)/(Ry)\n", + "\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "print \"The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.17 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 42.426 KN\n", + "d= 1.5 m Resultant is a horizontal force of magnitude 42.426 at 1.5 m below A.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=5.0 #Inclined at 45° down Loading at 3m distance from A,KN\n", + "P2=10.0 #Inclined at 45° down Loading at 2m distance from A,KN\n", + "P3=10.0 #Inclined at 45° down Loading at 1m distance from A,KN\n", + "P4=5.0 #Inclined at 45° down Loading A,KN\n", + "P8=5.0 #Inclined at 45° UP Loading at 3m distance from A,KN\n", + "P7=10.0 #Inclined at 45° UP Loading at 2m distance from A,KN\n", + "P6=10.0 #Inclined at 45° UP Loading at 1m distance from A,KN\n", + "P5=5.0 #Inclined at 45° UP Loading A,KN\n", + "a=1.0\n", + "\n", + "theta=45.0*pi/180.0\n", + "#The roof is inclined at 45° to horizontal and loads are at 90° to the roof. Hence, the loads are also inclined at 45° to vertical/horizontal. \n", + "\n", + "#assume Resulat R at distance d from A,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=(P1+P2+P3+P4+P5+P6+P7+P8)*cos(theta)\n", + "Ry=-(P1+P2+P3+P4)*sin(theta)+(P5+P6+P7+P8)*sin(theta)\n", + "\n", + "print \"R=\",round(Rx,3),\"KN\"\n", + "#and its direction is horizontal \n", + "#Let R be at a distance d from the ridge A\n", + "#moment at A\n", + "d=((P1*3*cos(theta)*a+P2*cos(theta)*2*a+P3*cos(theta)*a)*2)/(Rx)\n", + "\n", + "print\"d=\",round(d,1),\"m\",\" Resultant is a horizontal force of magnitude\",round(Rx,3),\" at\",round(d,1),\" m below A.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.18 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 116.52 KN\n", + "alpha= 76.82 °\n", + "x= 1.48 m\n", + "The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and x= 1.48 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "#The two 40 kN forces acting on the smooth pulley may be replaced by a pair of 40 kN forces acting at centre of pulley C and parallel to the given forces, since the sum of moments of the two given forces about C is zero\n", + "\n", + "PA=20.0 #inclined at 45° loading at A,KN\n", + "PB=30.0 #inclined at 60° loading at B,KN\n", + "\n", + "PC1=40.0 #inclined at 30° loading at C,KN\n", + "PC2=40.0 #inclined at 20° loading at C,KN\n", + "PD=50.0 #inclined at 30.0 at distance 2m form A,KN\n", + "PE=20.0 #inclined at alpha at distance xm form A,KN\n", + "P=20.0 #vertical loading at distance 4m,KN\n", + "\n", + "\n", + "\n", + "thetaA=45.0*pi/180.0\n", + "thetaB=60.0*pi/180.0\n", + "thetaC1=30.0*pi/180.0\n", + "thetaC2=20.0*pi/180.0\n", + "thetaD=30.0*pi/180.0\n", + "AD=2.0\n", + "AC=3.0\n", + "AB=6.0\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PA*cos(thetaA)-PB*cos(thetaB)-PD*cos(thetaD)-PC1*sin(thetaC1)+PC2*cos(thetaC2)\n", + "\n", + "Fy=-PA*sin(thetaA)-P+P-PB*sin(thetaB)-PD*sin(thetaD)-PC2*sin(thetaC2)-PC1*cos(thetaC1)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#Let the resultant intersect AB at a distance x from A. Then, \n", + "\n", + "\n", + "X=(-P*4+P*4+PB*sin(thetaB)*AB+PD*sin(thetaD)*AD-PD*cos(thetaD)*AD+PC2*AC*cos(thetaC2)-PC1*AC*sin(thetaC1))/R\n", + "\n", + "print\"x=\",round(X,2),\"m\"\n", + "\n", + "print\"The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and \",\"x=\",round(X,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.19 page number 42\n" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 103.53 N\n", + "R= 26.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Free body diagram of the sphere shows all the forces moving away from the centre of the ball. Applying Lami’s theorem to the system of forces.\n", + "\n", + "#variable declaration\n", + "W=100.0 #weight of sphere,N\n", + "theta=15.0*pi/180 #angle of inclination of string with wall\n", + "\n", + "T=(W*sin((pi/2)))/sin((pi/2)+theta)\n", + "R=(W*sin((pi-theta)))/sin((pi/2)+theta)\n", + "print\"T=\",round(T,2),\"N\"\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "#The above problem may be solved using equations of equilibrium also. Taking horizontal direction as x axis and vertical direction as y axis,\n", + "\n", + "#Notes: \n", + "#1. The string can have only tension in it (it can pull a body), but cannot have compression in it (cannot push a body). \n", + "#2. The wall reaction is a push, but cannot be a pull on the body. \n", + "#3. If the magnitude of reaction comes out to be negative, then assumed direction of reaction is wrong. It is acting exactly in the opposite to the assumed direction. However, the magnitude will be the same. Hence no further analysis is required. This advantage is not there in using Lami's equation. Hence, it is advisable for beginners to use equations of equilibrium, instead of Lami's theorem even if the body is in equilibrium under the action of only three forces. \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.20 page number 43" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 1732.05 N\n", + "P= 866.03 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#The body is in equilibrium under the action of applied force P, self-weight 1500 N and normal reaction R from the plane. Since R, which is normal to the plane, makes 30° with the vertical (or 60° with the horizontal), \n", + "\n", + "#variable declaration\n", + "W=1500.0 #weight of block,N\n", + "theta=30.0*pi/180 #angle of inclination \n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(theta)\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "P=R*sin(theta)\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Note: Since the body is in equilibrium under the action of only three forces the above problem can be solved using Lami’s theorem \n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.21 page number 42" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S= -0.058 N\n", + "Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude 0.058 kN.\n", + "R= 14.979 kN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#A bar can develop a tensile force or a compressive force. Let the force developed be a compressive force S (push on the cylinder). \n", + "\n", + "#variable declaration\n", + "W=10.0 #weight of Roller,KN\n", + "IL=7.0 #inclined loading at angle of 45°,KN\n", + "H=5.0 #Horizontal loading ,KN\n", + "\n", + "theta=45.0*pi/180 #angle of loading of IL\n", + "thetaS=30.0*pi/180.0 \n", + "\n", + "#Since there are more than three forces in the system, Lami’s equations cannot be applied. Consider the components in horizontal and vertical directions. \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "S=(-H+IL*cos(theta))/cos(thetaS)\n", + "print\"S=\",round(S,3),\"N\"\n", + "\n", + "print\"Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude\",round(-S,3) ,\"kN.\"\n", + " \n", + "R=W+IL*sin(theta)-S*sin(thetaS)\n", + "print\"R=\",round(R,3),\"kN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.22 page number 44" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x= 1.125 m\n", + "T= 125.0 N\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi,asin\n", + "\n", + "#The pulley C is in equilibrium under the action of tensile forces in CA and CB and vertical downward load 200 N. The tensile forces in segment CA and CB are the same since the pulley is frictionless. Now consider the equilibrium of pulley C \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "#variable declaration\n", + "L=200.0 #suspended load at C,N\n", + "AB=3.0\n", + "BI=1.0\n", + "ACB=5.0 #Length of cord,m\n", + "DE=3.0\n", + "BE=4.0\n", + "theta=asin(4.0/5.0)\n", + "#assume T is tension in string making angle theta1 & theta2,solving horizontal we find theta1=theta2,lets called them theta ,as triangleCFD=triangle=CFA.so, CD=AC\n", + "\n", + "HI=BI*DE/BE\n", + "AH=DE-HI\n", + "x=AH/2\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "T=L/(2*sin(theta))\n", + "print\"T=\",round(T),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.23 page number 45" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1154.7 N\n", + "P= 1732.05 N\n" + ] + } + ], + "source": [ + "from math import sin ,acos, pi\n", + "\n", + "#When the roller is about to turn over the curb, the contact with the floor is lost and hence there is no reaction from the floor. The reaction R from the curb must pass through the intersection of P and the line of action of self weight, since the body is in equilibrium under the action of only three forces (all the three forces must be concurrent). \n", + "\n", + "#variable declaration\n", + "W=2000.0 #weight of roller,N\n", + "r=300.0 #radius of roller,mm\n", + "h=150.0 # height of curb,mm\n", + "OC=r-h\n", + "AO=r\n", + "\n", + "alpha=acos(OC/AO)\n", + "\n", + "#angleOAB=angleOBA,Since OA=OB,\n", + "angleOBA=(alpha)/2\n", + "\n", + "#the reaction makes 30° with the vertical\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(angleOBA)\n", + "P=R*sin(angleOBA)\n", + "\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Least force through the centre of wheel: Now the reaction from the curb must pass through the centre of the wheel since the other two forces pass through that point. Its inclination to vertical is theta = 60°. If the triangle of forces ABC representing selfweight by AB, reaction R by BC and pull P by AC, it may be observed that AC to be least, it should be perpendicular to BC. In other words, P makes 90° with the line of action of R.\n", + "#From triangle of forces ABC, we get \n", + "P=W*sin(alpha)\n", + "print \"P=\",round(P,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.24 page number 47 " + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 224.14 N\n", + "T2= 183.01 N\n", + "T3= 336.6 N\n", + "T4= 326.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "PB=200.0 #Vertical loading at B,N\n", + "PD=250.0 #Vertical loading at D,N\n", + "thetabc=30.0*pi/180.0\n", + "thetabd=60.0*pi/180.0\n", + "thetaed=45.0*pi/180.0\n", + "#Free body diagrams of points B and D . Let the forces in the members be as shown in the figure. Applying Lami’s theorem to the system of forces at point D,\n", + "\n", + "T1=PD*sin(pi-thetabd)/sin(thetaed+(pi/2)-thetabd)\n", + "T2=PD*sin(pi-thetaed)/sin(thetaed+(pi/2)-thetabd)\n", + "\n", + "print \"T1=\",round(T1,2),\"N\"\n", + "print \"T2=\",round(T2,2),\"N\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "T3=(PB+T2*cos(thetabd))/cos(thetabc)\n", + "print \"T3=\",round(T3,2),\"N\"\n", + "\n", + "T4=(T2*sin(thetabd))+T3*sin(thetabc)\n", + "print \"T4=\",round(T4,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.25 page number 47\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 2863.64 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,acos\n", + "\n", + "#variable declaration\n", + "\n", + "PC=1500.0 #Vertical loading at C,N\n", + "CD=2.0 \n", + "AC=1.5\n", + "BD=1.0\n", + "AB=4.0\n", + "\n", + "x=((pow(AC,2)-pow(BD,2))/4)+1\n", + "y=sqrt(pow(AC,2)-pow(x,2))\n", + "\n", + "alpha=acos(x/AC)\n", + "beta=acos((CD-x)/BD)\n", + "\n", + "#Applying Lami’s theorem to the system of forces acting at point C \n", + "\n", + "T1=PC*sin(pi/2)/sin(pi-alpha)\n", + "T2=PC*sin((pi/2)+alpha)/sin(pi-alpha)\n", + "T3=T2*sin(pi/2)/sin((pi/2)+beta)\n", + "W=T2*sin(pi-beta)/sin((pi/2)+beta)\n", + "\n", + "\n", + "print \"W=\",round(W,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.26 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 44.8 KN\n", + "T2= 29.24 KN\n", + "theta= 63.42 °\n", + "T3= 25.04 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + "PC=30.0 #vertical loadng at point C,KN \n", + " \n", + "thetaab=30.0 *pi/180.0\n", + "thetabc=50.0*pi/180.0\n", + "\n", + "#applying lami's thereom\n", + "\n", + "T1=PB*sin(thetabc)/sin(pi-thetabc+thetaab)\n", + "T2=PB*sin(pi-thetaab)/sin(pi-thetabc+thetaab)\n", + "theta=atan((T2*sin(thetabc))/(PC-T2*cos(thetabc)))*180/pi\n", + "\n", + "\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "print \"T2=\",round(T2,2),\"KN\"\n", + "\n", + "#Writing equations of equilibrium for the system of forces at C \n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "T3=(PC-T2*cos(thetabc))/cos(theta*pi/180)\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "#mistake in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.27 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T3= 22.5 KN\n", + "T1= 38.97 KN\n", + "theta= 54.79 °\n", + "T2= 23.85 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + " \n", + "PC=25.0 #vertical loadng at point C,KN \n", + "\n", + "thetaab=30.0*pi/180.0\n", + "thetadc=60.0*pi/180.0\n", + "\n", + "#Writing equations of equilibrium for the system of forces at joints B and C \n", + "#T1*sin(thetaab)=T3*sin(thetadc)\n", + "\n", + "T3=(PB+PC)/((sin(thetadc)*cos(thetaab)/sin(thetaab))+cos(thetadc))\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "\n", + "T1=T3*sin(thetadc)/sin(thetaab)\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "theta=(atan((T3*sin(thetadc))/(PC-T3*cos(thetadc))))*180/pi\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "\n", + "T2=T3*sin(thetadc)/(sin(theta*pi/180))\n", + "print \"T2=\",round(T2,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.28 page number 50" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 600.0 N\n", + "alpha= 1.249 °\n", + "RD= 632.456 N\n", + "RC= 200.0 N\n", + "RA= 200.0 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,atan,pi\n", + "\n", + "#variable declaration\n", + "W=600.0 #weight of cyclinder,N\n", + "r=150.0 #radius of cylinder,mm\n", + "a=600.0 #mm\n", + "b=300.0 #mm\n", + "\n", + "#Free body diagram of sphere and frame\n", + "\n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "RB=600.0 \n", + "#As the frame is in equilibrium under the action of three forces only, they must be concurrent forces. In other words, reaction at D has line of action alone OD. Hence, its inclination to horizontal is given by: \n", + "print\"RB=\",round(RB,2),\"N\"\n", + "alpha=atan((a-r)/r)\n", + "print\"alpha=\",round(alpha,4),\"°\"\n", + "\n", + "RD=W/sin(alpha)\n", + "print\"RD=\",round(RD,3),\"N\"\n", + "\n", + "RC=RD*cos(alpha)\n", + "RA=RC\n", + "print\"RC=\",round(RC),\"N\"\n", + "print\"RA=\",round(RA),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.29 page number 51" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 166.67 N\n", + "RA= 133.33 N\n", + "RC= 200.0 N\n", + "RD= 133.33 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,asin\n", + "\n", + "\n", + "# Let O1 and O2 be the centres of the first and second spheres. Drop perpendicular O1P to the horizontal line through O2. show free body diagram of the sphere 1 and 2, respectively. Since the surface of contact are smooth, reaction of B is in the radial direction, i.e., in the direction O1O2. Let it make angle a with the horizontal. Then,\n", + "\n", + "#Variable declaration\n", + "\n", + "W=100.0 #weight of spheres,N\n", + "\n", + "r=100.0 #radius of spheres,mm\n", + "\n", + "d=360.0 # horizontal channel having vertical walls, the distance b/w,mm\n", + "\n", + "O1A=100.0\n", + "O2D=100.0\n", + "O1B=100.0\n", + "BO2=100.0\n", + "\n", + "O2P=360.0-O1A-O2D\n", + "O1O2=O1B+BO2\n", + "\n", + "alpha=acos(O2P/O1O2)\n", + "\n", + "###sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "RB=W/sin(alpha)\n", + "RA=RB*cos(alpha)\n", + "print\"RB=\",round(RB,2),\"N\"\n", + "print\"RA=\",round(RA,2),\"N\"\n", + "\n", + "RC=100+RB*sin(alpha)\n", + "\n", + "RD=RB*cos(alpha)\n", + "\n", + "print\"RC=\",round(RC),\"N\"\n", + "\n", + "print\"RD=\",round(RD,2),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.30 page number 52" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1071.8 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Two cylinders, A of weight 4000 N and B of weight 2000 N rest on smooth inclines. They are connected by a bar of negligible weight hinged to each cylinder at its geometric centre by smooth pins\n", + "\n", + "#variable declaration\n", + "\n", + "WA=4000.0 #weight of cylinder A,N\n", + "WB=2000.0 #weight of cylinder B,N\n", + "\n", + "thetaWA=60.0*pi/180.0 #inclination of wall with cylinderA,°\n", + "thetaWB=45.0*pi/180.0 #inclination of wall with cylinderB,°\n", + "thetaAb=15.0*pi/180.0 #angle inclination bar with cylinder A ,N\n", + "thetaBb=15.0*pi/180.0 #angle inclination bar with cylinder B ,N\n", + "\n", + "#he free body diagram of the two cylinders. Applying Lami’s theorem to the system of forces on cylinder A, we get\n", + "\n", + "C=WA*sin(thetaWA)/sin(thetaWA+(pi/2)-thetaAb)\n", + "\n", + "#Consider cylinder B. Summation of the forces parallel to the inclined plane \n", + "P=(-WB*cos(thetaWB)+C*cos(thetaWA))/cos(thetaBb)\n", + "print\"P=\",round(P,1),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.31 page number 55" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 10.0382 KN\n", + "RA= 188.56 KN\n", + "alpha 32.17 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "# The 12 m boom AB weighs 1 kN, the distance of the centre of gravity G being 6 m from A. For the position shown, determine the tension T in the cable and the reaction at B \n", + "\n", + "#variable declaration\n", + "PB=2.5 #vertical Loading at B,KN\n", + "WAB=1.0 #vertical loading at G,KN\n", + "\n", + "theta=15.0*pi/180\n", + "AG=6.0 #Length of boom AB is 12m\n", + "GB=6.0\n", + "thetaAB=30.0*pi/180.0\n", + "thetaABC=15.0*pi/180.0\n", + "#sum of moment at A\n", + "\n", + "T=(PB*(AG+GB)*cos(thetaAB)+WAB*AG*cos(thetaAB))/(sin(thetaABC)*12)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "HA=T*cos(thetaABC)\n", + "VA=WAB+PB+T*sin(thetaABC)\n", + "\n", + "RA=sqrt(pow(RA,2)+pow(RA,2))\n", + "print \"RA=\",round(RA,2),\"KN\"\n", + "\n", + "alpha=atan(VA/HA)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.32 page number 56" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 51.9615 KN\n", + "R1= 23.6603 KN\n", + "R2= 6.3397 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A cable car used for carrying materials in a hydroelectric project is at rest on a track formed at an angle of 30° with the vertical. The gross weight of the car and its load is 60 kN and its centroid is at a point 800 mm from the track half way between the axles. The car is held by a cable . The axles of the car are at a distance 1.2 m. Find the tension in the cables and reaction at each of the axles neglecting friction of the track.\n", + "\n", + "W=60.0 #gross weight of car,KN\n", + "theta=60.0*pi/180.0\n", + " \n", + " \n", + "T=W*sin(theta)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#Taking moment equilibrium condition about upper axle point on track, we get\n", + "\n", + "R1=(-T*600.0+W*sin(theta)*800.0+W*cos(theta)*600.0)/1200.0\n", + "print\"R1=\",round(R1,4),\"KN\"\n", + "\n", + "#Sum of forces normal to the plane = 0, gives \n", + "R2=W*cos(theta)-R1\n", + "print\"R2=\",round(R2,4),\"KN\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.33 page numnber 56" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 0.75 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,acos,pi\n", + "\n", + "# A hollow right circular cylinder of radius 800 mm is open at both ends and rests on a smooth horizontal plane. Inside the cylinder there are two spheres having weights 1 kN and 3 kN and radii 400 mm and 600 mm, respectively. The lower sphere also rests on the horizontal plane. \n", + "# Join the centres of spheres, O1 and O2 and drop O1D perpendicular to horizontal through O2. \n", + "\n", + "#variable declaration\n", + "R=800.0\n", + "W1=1.0\n", + "r1=400.0\n", + "W2=3.0\n", + "r2=600.0\n", + "O1O2=1000 #mm\n", + "O2D=600 #mm\n", + "\n", + "#If alpha is the inclination of O2O1 to horizontal\n", + "alpha=acos(O2D/O1O2)\n", + "\n", + "#Free body diagrams of cylinder and spheres are shown. Considering the equilibrium of the spheres.\n", + "#Sum of Moment at O2\n", + "\n", + "R1=W1*O2D/(O1O2*sin(alpha))\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R2=R1\n", + "R3=W1+W2\n", + "#Now consider the equilibrium of cylinder. When it is about to tip over A, there is no reaction from ground at B. The reaction will be only at A. \n", + "\n", + "#Sum of Moment at A\n", + "\n", + "W=R1*O1O2*sin(alpha)/R\n", + "\n", + "print\"W=\",round(W,2),\"KN\"\n", + "\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_MoXnaf4.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_MoXnaf4.ipynb new file mode 100644 index 00000000..a94760d2 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_MoXnaf4.ipynb @@ -0,0 +1,1857 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2-FUNDAMENTALS OF STATICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.1 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Moment is = -9607.41 Nmm clockwise\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=100.0\n", + "hd=400.0\n", + "vd=500.0\n", + "o=60.0\n", + "M=F*(math.cos(o/180.0*3.14)*vd-math.sin(o/180.0*3.14)*hd)\n", + "print '%s %.2f %s' %(\"\\n \\n Moment is =\", M ,\" Nmm clockwise\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.2 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.3 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.4 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force = 161.52 N\n", + "\n", + " \n", + " Resultant angle = 0.33 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#R resultant force\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "#f1 force\n", + "#f2 force\n", + "#f3 force\n", + "#o1 angle with the line \n", + "#o2 angle with the line \n", + "#o3 angle with the line \n", + "#O angle of resultant force with line\n", + "f1=70.0\n", + "f2=80.0\n", + "f3=50.0 \n", + "o1=50.0\n", + "o2=25.0\n", + "o3=-45.0\n", + "Rx=(f1*math.cos(o1/180*3.14)+f2*math.cos(o2/180*3.14)+f3*math.cos(o3/180*3.14));\n", + "Ry=(f1*math.sin(o1/180*3.14)+f2*math.sin(o2/180*3.14)+f3*math.sin(o3/180*3.14));\n", + "R=math.sqrt(Rx**2+Ry**2)\n", + "O=math.atan(Ry/Rx)\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force =\", R ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant angle =\", O ,\"radians\");\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.5 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force along the incline plane = 234.24 N\n", + "\n", + " \n", + " Resultant Force vertical to the incline plane = -0.46 N\n" + ] + } + ], + "source": [ + "import math\n", + "#O angle of inclined plane\n", + "#N normal reaction\n", + "#W weight\n", + "#F,T forces\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "o = 60.0 \n", + "W = 1000.0\n", + "N = 500.0\n", + "F = 100.0\n", + "T = 1200.0\n", + "Rx = T-F-(W*math.sin(o/180*3.14))\n", + "Ry = N-(W*math.cos(o/180*3.14))\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force along the incline plane =\", Rx ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force vertical to the incline plane =\", Ry ,\"N\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.6 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force 467.201871561 N\n", + "At an angle 61.0805191269\n" + ] + } + ], + "source": [ + "import math\n", + "R=1000.0 #Resultant force\n", + "F1=500.0 #Force \n", + "F2=1000.0 #force\n", + "o=45.0*3.14/180.0 #angle resultant makes with x axis \n", + "o1=30.0*3.14/180.0 #angle F1 makes with x axis \n", + "o2=60.0*3.14/180.0 #angle F2 makes with x axis \n", + "#F3coso3=Rcoso-F1coso1-F2sino2\n", + "#F3sino=Rsino-F1sino1-F2coso2\n", + "F3=((R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2))**2+(R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))**2)**0.5\n", + "print \"Force\",F3,\"N\"\n", + "o3=180/3.14*math.atan((R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))/(R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2)))\n", + "print \"At an angle\",o3" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.7 Page number 27" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 6.32 °\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,pi,asin\n", + "\n", + "#variable declaration\n", + "\n", + "P1=300.0\n", + "P2=500.0\n", + "thetaI=30.0*pi/180.0\n", + "thetaP2=30.0*pi/180\n", + "thetaP1=40.0*pi/180\n", + "# Let the x and y axes be If the resultant is directed along the x axis, its component in y direction is zero.\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "F=(P2*sin(thetaP2))/(P1)\n", + "theta=(asin((F/(cos(20*pi/180)*2)))*180/pi)-20\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.8 page number 30\n" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 68.0592 KN\n", + "alpha= 81.55 °\n", + "x= 3.326 m\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt,pi\n", + "\n", + "#variable declaration\n", + "\n", + "P1=20.0\n", + "P2=30.0\n", + "P3=20.0\n", + "theta3=60.0*pi/180.0\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=20.0*cos(theta3)\n", + "Fy=P1+P2+P3*sin(theta3)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,4),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=P1*1.5+P2*3.0+P3*sin(theta3)*6.0\n", + "\n", + "#The distance of the resultant from point O is given by:\n", + "\n", + "d=MA/R\n", + "x=d/sin(alpha*pi/180)\n", + "print\"x=\",round(x,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.9 page number 31\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 91.19 KN\n", + "alpha= 35.84 °\n", + "x= 317.023 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=100.0 #inclined up loading at 60° at A, N\n", + "PB1=80.0 #Vertical down loading at B,N\n", + "PB2=80.0 #Horizontal right loading at at B,N \n", + "PC=120.0 #inclined down loading at 30° at C,N\n", + "\n", + "thetaA=60.0*pi/180.0\n", + "thetaB=30.0*pi/180.0\n", + "\n", + "\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=PB2-PA*cos(thetaA)-PC*cos(thetaB)\n", + "Rx=-Fx\n", + "\n", + "Fy=PB1+PC*sin(thetaB)-PA*sin(thetaA)\n", + "Ry=Fy\n", + "\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Let x be the distance from A at which the resultant cuts AC. Then taking A as moment centre,\n", + "\n", + "x=(PB1*100*sin(thetaA)+PB2*50+PC*sin(thetaB)*100)/Ry\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.10 page number 32" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 565.69 N\n", + "theta= 45.0 °\n", + "x= 2.5 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PA=800.0 #Vertical down loading at A,N\n", + "PC=400.0 #vertical up loading at B,N\n", + "HD=600.0 #Horizontal left loading at A,N\n", + "HB=200.0 #Horizontal right loading at B,N\n", + "a=1.0 #length of side,m\n", + " \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=HB-HD\n", + "Fy=PC-PA\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=PC*a+HD*a\n", + "\n", + "#Let x be the distance from A along x axis, where resultant cuts AB.\n", + "\n", + "x=MA/Fy\n", + "\n", + "print\"x=\",round((-x),1),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.11 page number 32\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 10.0 KN\n", + "theta= 0.0 ° i.e. , the resultant is in the direction x.\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=2.0 #loading at B,KN\n", + "PC=sqrt(3.0) #loading at C,KN\n", + "PD=5.0 #loading at D,KN\n", + "PE=PC #loading at E,KN\n", + "PF=PB #loading at F,KN\n", + "\n", + "#Let O be the centre of the encircling circle A, B, C, D, E and F. In regular hexagon each side is equal to the radius AO. Hence OAB is equilateral triangle.\n", + "\n", + "angleoab=60.0*pi/180\n", + "anglecab=angleoab/2.0\n", + "theta1=anglecab\n", + "theta2=(angleoab-theta1)\n", + "theta3=theta1\n", + "theta4=theta1\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PB*cos(theta1+theta2)+PC*cos(theta2)+PD+PE*cos(theta3)+PF*cos(theta3+theta4)\n", + "\n", + "Fy=-PB*sin(theta1+theta2)-PC*sin(theta2)+0+PE*sin(theta3)+PF*sin(theta3+theta4)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\",\"i.e.\",\",\",\"the resultant is in the direction x.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.12 page number 33" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 4.66 N\n", + "alpha= 28.99 °\n", + "d= 42.73 mm\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "P1=2.0 #loading at 1,KN\n", + "P2=1.5 #loading at 2,KN\n", + "P3=5.0 #loading at 3,KN\n", + "a=10.0 #side length,mm\n", + "\n", + "# If theta1, theta2 and theta3 are the slopes of the forces 2 kN, 5 kN and 1.5 kN forces with respect to x axis, then \n", + "\n", + "\n", + "theta1=atan(a/a)\n", + "theta2=atan((3*a)/(4*a))\n", + "theta3=atan((a)/(2*a))\n", + "\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=P1*cos(theta1)+P3*cos(theta2)-P2*cos(theta3)\n", + "\n", + "Fy=P1*sin(theta1)-P3*sin(theta2)-P2*sin(theta3)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Distance d of the resultant from O is given by\n", + "#Rd=sum of moment at A\n", + "\n", + "d=((a*3)*P1*cos(theta1)+(5*a)*P3*sin(theta2)+P2*(a)*sin(theta3))/(4.66)\n", + "print\"d=\",round(d,2),\"mm\"\n", + "\n", + "#Note: To find moment of forces about O, 2 kN force is resolved at it’s intersection with y axis and 5 kN and 1.5 kN forces are resolved at their intersection with x axis, and then Varignon theorem is used\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.13 page number 34" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 150.0 KN\n", + "MA= 270.0 KN-m\n", + "x= 1.8 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #loading at B,KN\n", + "PC=30.0 #loading at C,KN\n", + "PD=40.0 #loading at D,KN\n", + "PA=60.0 #loading at E,KN\n", + "AB=1.0\n", + "BC=2.0\n", + "CD=1.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA+PB+PC+PD\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA+(AB)*PB+PC*(AB+BC)+PD*(AB+BC+CD)\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x,1),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.14 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 100.0 KN in y-direction\n", + "MA= 300.0 KN-m\n", + "x= 3.0 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #up loading at B,KN\n", + "PC=40.0 #down loading at C,KN\n", + "PD=50.0 #up loading at D,KN\n", + "PA=80.0 #down loading at A,KN\n", + "PE=60.0 #down loading at E,KN\n", + "AB=2.0\n", + "BC=2.0\n", + "CD=4.0\n", + "DE=2.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA-PB+PC-PD+PE\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA-(AB)*PB+PC*(AB+BC)-PD*(AB+BC+CD)+PE*(AB+BC+CD+DE)\n", + "\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.15 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 2671.19 KN in y-direction\n", + "alpha 80.3 °\n", + "x= 141.195 mm\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=500.0 #Loading at inclined to 60.0°,N\n", + "P2=1000.0 #vertical loading at 150 distance from O,N\n", + "P3=1200.0 #vertical loading at 150 distance from O,N\n", + "H=700.0 #Horizontal loading at 300 ditance from O,N\n", + "a=150.0\n", + "theta=60.0*pi/180\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=P1*cos(theta)-H\n", + "Ry=-P3-P2-P1*sin(theta)\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "alpha=atan(Ry/Rx)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"\n", + " \n", + "#Let the point of application of the resultant be at a distance x from the point O along the horizontal arm. Then, \n", + "\n", + "x=(P1*sin(theta)*(2*a)+P2*a-P3*a*cos(theta)+H*a*2*sin(theta))/(-Ry)\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.16 page number 36" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ry= 1420.0 KN downward\n", + "x= 4.127 m\n", + "The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=1120.0 #vertical down Loading at 2m distance from O,KN\n", + "P2=120.0 #vertical up loading at 4m distance from O,KN\n", + "P3=420.0 #vertical downloading at 5m distance from O,KN\n", + "H=500.0 #Horizontal loading at 4m ditance from O,KN\n", + "ah=4.0\n", + "a1=2.0\n", + "a2=4.0\n", + "a3=5.0\n", + "a=7.0\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=H\n", + "Ry=P1-P2+P3\n", + "\n", + "print \"Ry=\",round(Ry,2),\"KN\",\"downward\"\n", + " \n", + "#Let x be the distance from O where the resultant cuts the base.\n", + "#moment at O\n", + "x=(H*ah+P1*a1-P2*a2+P3*a3)/(Ry)\n", + "\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "print \"The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.17 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 42.426 KN\n", + "d= 1.5 m Resultant is a horizontal force of magnitude 42.426 at 1.5 m below A.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=5.0 #Inclined at 45° down Loading at 3m distance from A,KN\n", + "P2=10.0 #Inclined at 45° down Loading at 2m distance from A,KN\n", + "P3=10.0 #Inclined at 45° down Loading at 1m distance from A,KN\n", + "P4=5.0 #Inclined at 45° down Loading A,KN\n", + "P8=5.0 #Inclined at 45° UP Loading at 3m distance from A,KN\n", + "P7=10.0 #Inclined at 45° UP Loading at 2m distance from A,KN\n", + "P6=10.0 #Inclined at 45° UP Loading at 1m distance from A,KN\n", + "P5=5.0 #Inclined at 45° UP Loading A,KN\n", + "a=1.0\n", + "\n", + "theta=45.0*pi/180.0\n", + "#The roof is inclined at 45° to horizontal and loads are at 90° to the roof. Hence, the loads are also inclined at 45° to vertical/horizontal. \n", + "\n", + "#assume Resulat R at distance d from A,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=(P1+P2+P3+P4+P5+P6+P7+P8)*cos(theta)\n", + "Ry=-(P1+P2+P3+P4)*sin(theta)+(P5+P6+P7+P8)*sin(theta)\n", + "\n", + "print \"R=\",round(Rx,3),\"KN\"\n", + "#and its direction is horizontal \n", + "#Let R be at a distance d from the ridge A\n", + "#moment at A\n", + "d=((P1*3*cos(theta)*a+P2*cos(theta)*2*a+P3*cos(theta)*a)*2)/(Rx)\n", + "\n", + "print\"d=\",round(d,1),\"m\",\" Resultant is a horizontal force of magnitude\",round(Rx,3),\" at\",round(d,1),\" m below A.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.18 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 116.52 KN\n", + "alpha= 76.82 °\n", + "x= 1.48 m\n", + "The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and x= 1.48 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "#The two 40 kN forces acting on the smooth pulley may be replaced by a pair of 40 kN forces acting at centre of pulley C and parallel to the given forces, since the sum of moments of the two given forces about C is zero\n", + "\n", + "PA=20.0 #inclined at 45° loading at A,KN\n", + "PB=30.0 #inclined at 60° loading at B,KN\n", + "\n", + "PC1=40.0 #inclined at 30° loading at C,KN\n", + "PC2=40.0 #inclined at 20° loading at C,KN\n", + "PD=50.0 #inclined at 30.0 at distance 2m form A,KN\n", + "PE=20.0 #inclined at alpha at distance xm form A,KN\n", + "P=20.0 #vertical loading at distance 4m,KN\n", + "\n", + "\n", + "\n", + "thetaA=45.0*pi/180.0\n", + "thetaB=60.0*pi/180.0\n", + "thetaC1=30.0*pi/180.0\n", + "thetaC2=20.0*pi/180.0\n", + "thetaD=30.0*pi/180.0\n", + "AD=2.0\n", + "AC=3.0\n", + "AB=6.0\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PA*cos(thetaA)-PB*cos(thetaB)-PD*cos(thetaD)-PC1*sin(thetaC1)+PC2*cos(thetaC2)\n", + "\n", + "Fy=-PA*sin(thetaA)-P+P-PB*sin(thetaB)-PD*sin(thetaD)-PC2*sin(thetaC2)-PC1*cos(thetaC1)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#Let the resultant intersect AB at a distance x from A. Then, \n", + "\n", + "\n", + "X=(-P*4+P*4+PB*sin(thetaB)*AB+PD*sin(thetaD)*AD-PD*cos(thetaD)*AD+PC2*AC*cos(thetaC2)-PC1*AC*sin(thetaC1))/R\n", + "\n", + "print\"x=\",round(X,2),\"m\"\n", + "\n", + "print\"The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and \",\"x=\",round(X,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.19 page number 42\n" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 103.53 N\n", + "R= 26.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Free body diagram of the sphere shows all the forces moving away from the centre of the ball. Applying Lami’s theorem to the system of forces.\n", + "\n", + "#variable declaration\n", + "W=100.0 #weight of sphere,N\n", + "theta=15.0*pi/180 #angle of inclination of string with wall\n", + "\n", + "T=(W*sin((pi/2)))/sin((pi/2)+theta)\n", + "R=(W*sin((pi-theta)))/sin((pi/2)+theta)\n", + "print\"T=\",round(T,2),\"N\"\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "#The above problem may be solved using equations of equilibrium also. Taking horizontal direction as x axis and vertical direction as y axis,\n", + "\n", + "#Notes: \n", + "#1. The string can have only tension in it (it can pull a body), but cannot have compression in it (cannot push a body). \n", + "#2. The wall reaction is a push, but cannot be a pull on the body. \n", + "#3. If the magnitude of reaction comes out to be negative, then assumed direction of reaction is wrong. It is acting exactly in the opposite to the assumed direction. However, the magnitude will be the same. Hence no further analysis is required. This advantage is not there in using Lami's equation. Hence, it is advisable for beginners to use equations of equilibrium, instead of Lami's theorem even if the body is in equilibrium under the action of only three forces. \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.20 page number 43" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 1732.05 N\n", + "P= 866.03 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#The body is in equilibrium under the action of applied force P, self-weight 1500 N and normal reaction R from the plane. Since R, which is normal to the plane, makes 30° with the vertical (or 60° with the horizontal), \n", + "\n", + "#variable declaration\n", + "W=1500.0 #weight of block,N\n", + "theta=30.0*pi/180 #angle of inclination \n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(theta)\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "P=R*sin(theta)\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Note: Since the body is in equilibrium under the action of only three forces the above problem can be solved using Lami’s theorem \n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.21 page number 42" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S= -0.058 N\n", + "Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude 0.058 kN.\n", + "R= 14.979 kN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#A bar can develop a tensile force or a compressive force. Let the force developed be a compressive force S (push on the cylinder). \n", + "\n", + "#variable declaration\n", + "W=10.0 #weight of Roller,KN\n", + "IL=7.0 #inclined loading at angle of 45°,KN\n", + "H=5.0 #Horizontal loading ,KN\n", + "\n", + "theta=45.0*pi/180 #angle of loading of IL\n", + "thetaS=30.0*pi/180.0 \n", + "\n", + "#Since there are more than three forces in the system, Lami’s equations cannot be applied. Consider the components in horizontal and vertical directions. \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "S=(-H+IL*cos(theta))/cos(thetaS)\n", + "print\"S=\",round(S,3),\"N\"\n", + "\n", + "print\"Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude\",round(-S,3) ,\"kN.\"\n", + " \n", + "R=W+IL*sin(theta)-S*sin(thetaS)\n", + "print\"R=\",round(R,3),\"kN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.22 page number 44" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x= 1.125 m\n", + "T= 125.0 N\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi,asin\n", + "\n", + "#The pulley C is in equilibrium under the action of tensile forces in CA and CB and vertical downward load 200 N. The tensile forces in segment CA and CB are the same since the pulley is frictionless. Now consider the equilibrium of pulley C \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "#variable declaration\n", + "L=200.0 #suspended load at C,N\n", + "AB=3.0\n", + "BI=1.0\n", + "ACB=5.0 #Length of cord,m\n", + "DE=3.0\n", + "BE=4.0\n", + "theta=asin(4.0/5.0)\n", + "#assume T is tension in string making angle theta1 & theta2,solving horizontal we find theta1=theta2,lets called them theta ,as triangleCFD=triangle=CFA.so, CD=AC\n", + "\n", + "HI=BI*DE/BE\n", + "AH=DE-HI\n", + "x=AH/2\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "T=L/(2*sin(theta))\n", + "print\"T=\",round(T),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.23 page number 45" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1154.7 N\n", + "P= 1732.05 N\n" + ] + } + ], + "source": [ + "from math import sin ,acos, pi\n", + "\n", + "#When the roller is about to turn over the curb, the contact with the floor is lost and hence there is no reaction from the floor. The reaction R from the curb must pass through the intersection of P and the line of action of self weight, since the body is in equilibrium under the action of only three forces (all the three forces must be concurrent). \n", + "\n", + "#variable declaration\n", + "W=2000.0 #weight of roller,N\n", + "r=300.0 #radius of roller,mm\n", + "h=150.0 # height of curb,mm\n", + "OC=r-h\n", + "AO=r\n", + "\n", + "alpha=acos(OC/AO)\n", + "\n", + "#angleOAB=angleOBA,Since OA=OB,\n", + "angleOBA=(alpha)/2\n", + "\n", + "#the reaction makes 30° with the vertical\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(angleOBA)\n", + "P=R*sin(angleOBA)\n", + "\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Least force through the centre of wheel: Now the reaction from the curb must pass through the centre of the wheel since the other two forces pass through that point. Its inclination to vertical is theta = 60°. If the triangle of forces ABC representing selfweight by AB, reaction R by BC and pull P by AC, it may be observed that AC to be least, it should be perpendicular to BC. In other words, P makes 90° with the line of action of R.\n", + "#From triangle of forces ABC, we get \n", + "P=W*sin(alpha)\n", + "print \"P=\",round(P,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.24 page number 47 " + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 224.14 N\n", + "T2= 183.01 N\n", + "T3= 336.6 N\n", + "T4= 326.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "PB=200.0 #Vertical loading at B,N\n", + "PD=250.0 #Vertical loading at D,N\n", + "thetabc=30.0*pi/180.0\n", + "thetabd=60.0*pi/180.0\n", + "thetaed=45.0*pi/180.0\n", + "#Free body diagrams of points B and D . Let the forces in the members be as shown in the figure. Applying Lami’s theorem to the system of forces at point D,\n", + "\n", + "T1=PD*sin(pi-thetabd)/sin(thetaed+(pi/2)-thetabd)\n", + "T2=PD*sin(pi-thetaed)/sin(thetaed+(pi/2)-thetabd)\n", + "\n", + "print \"T1=\",round(T1,2),\"N\"\n", + "print \"T2=\",round(T2,2),\"N\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "T3=(PB+T2*cos(thetabd))/cos(thetabc)\n", + "print \"T3=\",round(T3,2),\"N\"\n", + "\n", + "T4=(T2*sin(thetabd))+T3*sin(thetabc)\n", + "print \"T4=\",round(T4,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.25 page number 47\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 2863.64 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,acos\n", + "\n", + "#variable declaration\n", + "\n", + "PC=1500.0 #Vertical loading at C,N\n", + "CD=2.0 \n", + "AC=1.5\n", + "BD=1.0\n", + "AB=4.0\n", + "\n", + "x=((pow(AC,2)-pow(BD,2))/4)+1\n", + "y=sqrt(pow(AC,2)-pow(x,2))\n", + "\n", + "alpha=acos(x/AC)\n", + "beta=acos((CD-x)/BD)\n", + "\n", + "#Applying Lami’s theorem to the system of forces acting at point C \n", + "\n", + "T1=PC*sin(pi/2)/sin(pi-alpha)\n", + "T2=PC*sin((pi/2)+alpha)/sin(pi-alpha)\n", + "T3=T2*sin(pi/2)/sin((pi/2)+beta)\n", + "W=T2*sin(pi-beta)/sin((pi/2)+beta)\n", + "\n", + "\n", + "print \"W=\",round(W,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.26 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 44.8 KN\n", + "T2= 29.24 KN\n", + "theta= 63.42 °\n", + "T3= 25.04 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + "PC=30.0 #vertical loadng at point C,KN \n", + " \n", + "thetaab=30.0 *pi/180.0\n", + "thetabc=50.0*pi/180.0\n", + "\n", + "#applying lami's thereom\n", + "\n", + "T1=PB*sin(thetabc)/sin(pi-thetabc+thetaab)\n", + "T2=PB*sin(pi-thetaab)/sin(pi-thetabc+thetaab)\n", + "theta=atan((T2*sin(thetabc))/(PC-T2*cos(thetabc)))*180/pi\n", + "\n", + "\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "print \"T2=\",round(T2,2),\"KN\"\n", + "\n", + "#Writing equations of equilibrium for the system of forces at C \n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "T3=(PC-T2*cos(thetabc))/cos(theta*pi/180)\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "#mistake in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.27 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T3= 22.5 KN\n", + "T1= 38.97 KN\n", + "theta= 54.79 °\n", + "T2= 23.85 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + " \n", + "PC=25.0 #vertical loadng at point C,KN \n", + "\n", + "thetaab=30.0*pi/180.0\n", + "thetadc=60.0*pi/180.0\n", + "\n", + "#Writing equations of equilibrium for the system of forces at joints B and C \n", + "#T1*sin(thetaab)=T3*sin(thetadc)\n", + "\n", + "T3=(PB+PC)/((sin(thetadc)*cos(thetaab)/sin(thetaab))+cos(thetadc))\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "\n", + "T1=T3*sin(thetadc)/sin(thetaab)\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "theta=(atan((T3*sin(thetadc))/(PC-T3*cos(thetadc))))*180/pi\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "\n", + "T2=T3*sin(thetadc)/(sin(theta*pi/180))\n", + "print \"T2=\",round(T2,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.28 page number 50" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 600.0 N\n", + "alpha= 1.249 °\n", + "RD= 632.456 N\n", + "RC= 200.0 N\n", + "RA= 200.0 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,atan,pi\n", + "\n", + "#variable declaration\n", + "W=600.0 #weight of cyclinder,N\n", + "r=150.0 #radius of cylinder,mm\n", + "a=600.0 #mm\n", + "b=300.0 #mm\n", + "\n", + "#Free body diagram of sphere and frame\n", + "\n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "RB=600.0 \n", + "#As the frame is in equilibrium under the action of three forces only, they must be concurrent forces. In other words, reaction at D has line of action alone OD. Hence, its inclination to horizontal is given by: \n", + "print\"RB=\",round(RB,2),\"N\"\n", + "alpha=atan((a-r)/r)\n", + "print\"alpha=\",round(alpha,4),\"°\"\n", + "\n", + "RD=W/sin(alpha)\n", + "print\"RD=\",round(RD,3),\"N\"\n", + "\n", + "RC=RD*cos(alpha)\n", + "RA=RC\n", + "print\"RC=\",round(RC),\"N\"\n", + "print\"RA=\",round(RA),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.29 page number 51" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 166.67 N\n", + "RA= 133.33 N\n", + "RC= 200.0 N\n", + "RD= 133.33 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,asin\n", + "\n", + "\n", + "# Let O1 and O2 be the centres of the first and second spheres. Drop perpendicular O1P to the horizontal line through O2. show free body diagram of the sphere 1 and 2, respectively. Since the surface of contact are smooth, reaction of B is in the radial direction, i.e., in the direction O1O2. Let it make angle a with the horizontal. Then,\n", + "\n", + "#Variable declaration\n", + "\n", + "W=100.0 #weight of spheres,N\n", + "\n", + "r=100.0 #radius of spheres,mm\n", + "\n", + "d=360.0 # horizontal channel having vertical walls, the distance b/w,mm\n", + "\n", + "O1A=100.0\n", + "O2D=100.0\n", + "O1B=100.0\n", + "BO2=100.0\n", + "\n", + "O2P=360.0-O1A-O2D\n", + "O1O2=O1B+BO2\n", + "\n", + "alpha=acos(O2P/O1O2)\n", + "\n", + "###sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "RB=W/sin(alpha)\n", + "RA=RB*cos(alpha)\n", + "print\"RB=\",round(RB,2),\"N\"\n", + "print\"RA=\",round(RA,2),\"N\"\n", + "\n", + "RC=100+RB*sin(alpha)\n", + "\n", + "RD=RB*cos(alpha)\n", + "\n", + "print\"RC=\",round(RC),\"N\"\n", + "\n", + "print\"RD=\",round(RD,2),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.30 page number 52" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1071.8 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Two cylinders, A of weight 4000 N and B of weight 2000 N rest on smooth inclines. They are connected by a bar of negligible weight hinged to each cylinder at its geometric centre by smooth pins\n", + "\n", + "#variable declaration\n", + "\n", + "WA=4000.0 #weight of cylinder A,N\n", + "WB=2000.0 #weight of cylinder B,N\n", + "\n", + "thetaWA=60.0*pi/180.0 #inclination of wall with cylinderA,°\n", + "thetaWB=45.0*pi/180.0 #inclination of wall with cylinderB,°\n", + "thetaAb=15.0*pi/180.0 #angle inclination bar with cylinder A ,N\n", + "thetaBb=15.0*pi/180.0 #angle inclination bar with cylinder B ,N\n", + "\n", + "#he free body diagram of the two cylinders. Applying Lami’s theorem to the system of forces on cylinder A, we get\n", + "\n", + "C=WA*sin(thetaWA)/sin(thetaWA+(pi/2)-thetaAb)\n", + "\n", + "#Consider cylinder B. Summation of the forces parallel to the inclined plane \n", + "P=(-WB*cos(thetaWB)+C*cos(thetaWA))/cos(thetaBb)\n", + "print\"P=\",round(P,1),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.31 page number 55" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 10.0382 KN\n", + "RA= 188.56 KN\n", + "alpha 32.17 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "# The 12 m boom AB weighs 1 kN, the distance of the centre of gravity G being 6 m from A. For the position shown, determine the tension T in the cable and the reaction at B \n", + "\n", + "#variable declaration\n", + "PB=2.5 #vertical Loading at B,KN\n", + "WAB=1.0 #vertical loading at G,KN\n", + "\n", + "theta=15.0*pi/180\n", + "AG=6.0 #Length of boom AB is 12m\n", + "GB=6.0\n", + "thetaAB=30.0*pi/180.0\n", + "thetaABC=15.0*pi/180.0\n", + "#sum of moment at A\n", + "\n", + "T=(PB*(AG+GB)*cos(thetaAB)+WAB*AG*cos(thetaAB))/(sin(thetaABC)*12)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "HA=T*cos(thetaABC)\n", + "VA=WAB+PB+T*sin(thetaABC)\n", + "\n", + "RA=sqrt(pow(RA,2)+pow(RA,2))\n", + "print \"RA=\",round(RA,2),\"KN\"\n", + "\n", + "alpha=atan(VA/HA)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.32 page number 56" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 51.9615 KN\n", + "R1= 23.6603 KN\n", + "R2= 6.3397 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A cable car used for carrying materials in a hydroelectric project is at rest on a track formed at an angle of 30° with the vertical. The gross weight of the car and its load is 60 kN and its centroid is at a point 800 mm from the track half way between the axles. The car is held by a cable . The axles of the car are at a distance 1.2 m. Find the tension in the cables and reaction at each of the axles neglecting friction of the track.\n", + "\n", + "W=60.0 #gross weight of car,KN\n", + "theta=60.0*pi/180.0\n", + " \n", + " \n", + "T=W*sin(theta)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#Taking moment equilibrium condition about upper axle point on track, we get\n", + "\n", + "R1=(-T*600.0+W*sin(theta)*800.0+W*cos(theta)*600.0)/1200.0\n", + "print\"R1=\",round(R1,4),\"KN\"\n", + "\n", + "#Sum of forces normal to the plane = 0, gives \n", + "R2=W*cos(theta)-R1\n", + "print\"R2=\",round(R2,4),\"KN\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.33 page numnber 56" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 0.75 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,acos,pi\n", + "\n", + "# A hollow right circular cylinder of radius 800 mm is open at both ends and rests on a smooth horizontal plane. Inside the cylinder there are two spheres having weights 1 kN and 3 kN and radii 400 mm and 600 mm, respectively. The lower sphere also rests on the horizontal plane. \n", + "# Join the centres of spheres, O1 and O2 and drop O1D perpendicular to horizontal through O2. \n", + "\n", + "#variable declaration\n", + "R=800.0\n", + "W1=1.0\n", + "r1=400.0\n", + "W2=3.0\n", + "r2=600.0\n", + "O1O2=1000 #mm\n", + "O2D=600 #mm\n", + "\n", + "#If alpha is the inclination of O2O1 to horizontal\n", + "alpha=acos(O2D/O1O2)\n", + "\n", + "#Free body diagrams of cylinder and spheres are shown. Considering the equilibrium of the spheres.\n", + "#Sum of Moment at O2\n", + "\n", + "R1=W1*O2D/(O1O2*sin(alpha))\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R2=R1\n", + "R3=W1+W2\n", + "#Now consider the equilibrium of cylinder. When it is about to tip over A, there is no reaction from ground at B. The reaction will be only at A. \n", + "\n", + "#Sum of Moment at A\n", + "\n", + "W=R1*O1O2*sin(alpha)/R\n", + "\n", + "print\"W=\",round(W,2),\"KN\"\n", + "\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_mHtlO6a.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_mHtlO6a.ipynb new file mode 100644 index 00000000..a94760d2 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_mHtlO6a.ipynb @@ -0,0 +1,1857 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2-FUNDAMENTALS OF STATICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.1 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Moment is = -9607.41 Nmm clockwise\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=100.0\n", + "hd=400.0\n", + "vd=500.0\n", + "o=60.0\n", + "M=F*(math.cos(o/180.0*3.14)*vd-math.sin(o/180.0*3.14)*hd)\n", + "print '%s %.2f %s' %(\"\\n \\n Moment is =\", M ,\" Nmm clockwise\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.2 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.3 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.4 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force = 161.52 N\n", + "\n", + " \n", + " Resultant angle = 0.33 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#R resultant force\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "#f1 force\n", + "#f2 force\n", + "#f3 force\n", + "#o1 angle with the line \n", + "#o2 angle with the line \n", + "#o3 angle with the line \n", + "#O angle of resultant force with line\n", + "f1=70.0\n", + "f2=80.0\n", + "f3=50.0 \n", + "o1=50.0\n", + "o2=25.0\n", + "o3=-45.0\n", + "Rx=(f1*math.cos(o1/180*3.14)+f2*math.cos(o2/180*3.14)+f3*math.cos(o3/180*3.14));\n", + "Ry=(f1*math.sin(o1/180*3.14)+f2*math.sin(o2/180*3.14)+f3*math.sin(o3/180*3.14));\n", + "R=math.sqrt(Rx**2+Ry**2)\n", + "O=math.atan(Ry/Rx)\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force =\", R ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant angle =\", O ,\"radians\");\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.5 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force along the incline plane = 234.24 N\n", + "\n", + " \n", + " Resultant Force vertical to the incline plane = -0.46 N\n" + ] + } + ], + "source": [ + "import math\n", + "#O angle of inclined plane\n", + "#N normal reaction\n", + "#W weight\n", + "#F,T forces\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "o = 60.0 \n", + "W = 1000.0\n", + "N = 500.0\n", + "F = 100.0\n", + "T = 1200.0\n", + "Rx = T-F-(W*math.sin(o/180*3.14))\n", + "Ry = N-(W*math.cos(o/180*3.14))\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force along the incline plane =\", Rx ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force vertical to the incline plane =\", Ry ,\"N\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.6 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force 467.201871561 N\n", + "At an angle 61.0805191269\n" + ] + } + ], + "source": [ + "import math\n", + "R=1000.0 #Resultant force\n", + "F1=500.0 #Force \n", + "F2=1000.0 #force\n", + "o=45.0*3.14/180.0 #angle resultant makes with x axis \n", + "o1=30.0*3.14/180.0 #angle F1 makes with x axis \n", + "o2=60.0*3.14/180.0 #angle F2 makes with x axis \n", + "#F3coso3=Rcoso-F1coso1-F2sino2\n", + "#F3sino=Rsino-F1sino1-F2coso2\n", + "F3=((R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2))**2+(R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))**2)**0.5\n", + "print \"Force\",F3,\"N\"\n", + "o3=180/3.14*math.atan((R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))/(R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2)))\n", + "print \"At an angle\",o3" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.7 Page number 27" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 6.32 °\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,pi,asin\n", + "\n", + "#variable declaration\n", + "\n", + "P1=300.0\n", + "P2=500.0\n", + "thetaI=30.0*pi/180.0\n", + "thetaP2=30.0*pi/180\n", + "thetaP1=40.0*pi/180\n", + "# Let the x and y axes be If the resultant is directed along the x axis, its component in y direction is zero.\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "F=(P2*sin(thetaP2))/(P1)\n", + "theta=(asin((F/(cos(20*pi/180)*2)))*180/pi)-20\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.8 page number 30\n" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 68.0592 KN\n", + "alpha= 81.55 °\n", + "x= 3.326 m\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt,pi\n", + "\n", + "#variable declaration\n", + "\n", + "P1=20.0\n", + "P2=30.0\n", + "P3=20.0\n", + "theta3=60.0*pi/180.0\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=20.0*cos(theta3)\n", + "Fy=P1+P2+P3*sin(theta3)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,4),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=P1*1.5+P2*3.0+P3*sin(theta3)*6.0\n", + "\n", + "#The distance of the resultant from point O is given by:\n", + "\n", + "d=MA/R\n", + "x=d/sin(alpha*pi/180)\n", + "print\"x=\",round(x,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.9 page number 31\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 91.19 KN\n", + "alpha= 35.84 °\n", + "x= 317.023 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=100.0 #inclined up loading at 60° at A, N\n", + "PB1=80.0 #Vertical down loading at B,N\n", + "PB2=80.0 #Horizontal right loading at at B,N \n", + "PC=120.0 #inclined down loading at 30° at C,N\n", + "\n", + "thetaA=60.0*pi/180.0\n", + "thetaB=30.0*pi/180.0\n", + "\n", + "\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=PB2-PA*cos(thetaA)-PC*cos(thetaB)\n", + "Rx=-Fx\n", + "\n", + "Fy=PB1+PC*sin(thetaB)-PA*sin(thetaA)\n", + "Ry=Fy\n", + "\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Let x be the distance from A at which the resultant cuts AC. Then taking A as moment centre,\n", + "\n", + "x=(PB1*100*sin(thetaA)+PB2*50+PC*sin(thetaB)*100)/Ry\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.10 page number 32" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 565.69 N\n", + "theta= 45.0 °\n", + "x= 2.5 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PA=800.0 #Vertical down loading at A,N\n", + "PC=400.0 #vertical up loading at B,N\n", + "HD=600.0 #Horizontal left loading at A,N\n", + "HB=200.0 #Horizontal right loading at B,N\n", + "a=1.0 #length of side,m\n", + " \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=HB-HD\n", + "Fy=PC-PA\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=PC*a+HD*a\n", + "\n", + "#Let x be the distance from A along x axis, where resultant cuts AB.\n", + "\n", + "x=MA/Fy\n", + "\n", + "print\"x=\",round((-x),1),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.11 page number 32\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 10.0 KN\n", + "theta= 0.0 ° i.e. , the resultant is in the direction x.\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=2.0 #loading at B,KN\n", + "PC=sqrt(3.0) #loading at C,KN\n", + "PD=5.0 #loading at D,KN\n", + "PE=PC #loading at E,KN\n", + "PF=PB #loading at F,KN\n", + "\n", + "#Let O be the centre of the encircling circle A, B, C, D, E and F. In regular hexagon each side is equal to the radius AO. Hence OAB is equilateral triangle.\n", + "\n", + "angleoab=60.0*pi/180\n", + "anglecab=angleoab/2.0\n", + "theta1=anglecab\n", + "theta2=(angleoab-theta1)\n", + "theta3=theta1\n", + "theta4=theta1\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PB*cos(theta1+theta2)+PC*cos(theta2)+PD+PE*cos(theta3)+PF*cos(theta3+theta4)\n", + "\n", + "Fy=-PB*sin(theta1+theta2)-PC*sin(theta2)+0+PE*sin(theta3)+PF*sin(theta3+theta4)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\",\"i.e.\",\",\",\"the resultant is in the direction x.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.12 page number 33" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 4.66 N\n", + "alpha= 28.99 °\n", + "d= 42.73 mm\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "P1=2.0 #loading at 1,KN\n", + "P2=1.5 #loading at 2,KN\n", + "P3=5.0 #loading at 3,KN\n", + "a=10.0 #side length,mm\n", + "\n", + "# If theta1, theta2 and theta3 are the slopes of the forces 2 kN, 5 kN and 1.5 kN forces with respect to x axis, then \n", + "\n", + "\n", + "theta1=atan(a/a)\n", + "theta2=atan((3*a)/(4*a))\n", + "theta3=atan((a)/(2*a))\n", + "\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=P1*cos(theta1)+P3*cos(theta2)-P2*cos(theta3)\n", + "\n", + "Fy=P1*sin(theta1)-P3*sin(theta2)-P2*sin(theta3)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Distance d of the resultant from O is given by\n", + "#Rd=sum of moment at A\n", + "\n", + "d=((a*3)*P1*cos(theta1)+(5*a)*P3*sin(theta2)+P2*(a)*sin(theta3))/(4.66)\n", + "print\"d=\",round(d,2),\"mm\"\n", + "\n", + "#Note: To find moment of forces about O, 2 kN force is resolved at it’s intersection with y axis and 5 kN and 1.5 kN forces are resolved at their intersection with x axis, and then Varignon theorem is used\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.13 page number 34" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 150.0 KN\n", + "MA= 270.0 KN-m\n", + "x= 1.8 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #loading at B,KN\n", + "PC=30.0 #loading at C,KN\n", + "PD=40.0 #loading at D,KN\n", + "PA=60.0 #loading at E,KN\n", + "AB=1.0\n", + "BC=2.0\n", + "CD=1.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA+PB+PC+PD\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA+(AB)*PB+PC*(AB+BC)+PD*(AB+BC+CD)\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x,1),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.14 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 100.0 KN in y-direction\n", + "MA= 300.0 KN-m\n", + "x= 3.0 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #up loading at B,KN\n", + "PC=40.0 #down loading at C,KN\n", + "PD=50.0 #up loading at D,KN\n", + "PA=80.0 #down loading at A,KN\n", + "PE=60.0 #down loading at E,KN\n", + "AB=2.0\n", + "BC=2.0\n", + "CD=4.0\n", + "DE=2.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA-PB+PC-PD+PE\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA-(AB)*PB+PC*(AB+BC)-PD*(AB+BC+CD)+PE*(AB+BC+CD+DE)\n", + "\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.15 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 2671.19 KN in y-direction\n", + "alpha 80.3 °\n", + "x= 141.195 mm\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=500.0 #Loading at inclined to 60.0°,N\n", + "P2=1000.0 #vertical loading at 150 distance from O,N\n", + "P3=1200.0 #vertical loading at 150 distance from O,N\n", + "H=700.0 #Horizontal loading at 300 ditance from O,N\n", + "a=150.0\n", + "theta=60.0*pi/180\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=P1*cos(theta)-H\n", + "Ry=-P3-P2-P1*sin(theta)\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "alpha=atan(Ry/Rx)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"\n", + " \n", + "#Let the point of application of the resultant be at a distance x from the point O along the horizontal arm. Then, \n", + "\n", + "x=(P1*sin(theta)*(2*a)+P2*a-P3*a*cos(theta)+H*a*2*sin(theta))/(-Ry)\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.16 page number 36" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ry= 1420.0 KN downward\n", + "x= 4.127 m\n", + "The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=1120.0 #vertical down Loading at 2m distance from O,KN\n", + "P2=120.0 #vertical up loading at 4m distance from O,KN\n", + "P3=420.0 #vertical downloading at 5m distance from O,KN\n", + "H=500.0 #Horizontal loading at 4m ditance from O,KN\n", + "ah=4.0\n", + "a1=2.0\n", + "a2=4.0\n", + "a3=5.0\n", + "a=7.0\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=H\n", + "Ry=P1-P2+P3\n", + "\n", + "print \"Ry=\",round(Ry,2),\"KN\",\"downward\"\n", + " \n", + "#Let x be the distance from O where the resultant cuts the base.\n", + "#moment at O\n", + "x=(H*ah+P1*a1-P2*a2+P3*a3)/(Ry)\n", + "\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "print \"The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.17 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 42.426 KN\n", + "d= 1.5 m Resultant is a horizontal force of magnitude 42.426 at 1.5 m below A.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=5.0 #Inclined at 45° down Loading at 3m distance from A,KN\n", + "P2=10.0 #Inclined at 45° down Loading at 2m distance from A,KN\n", + "P3=10.0 #Inclined at 45° down Loading at 1m distance from A,KN\n", + "P4=5.0 #Inclined at 45° down Loading A,KN\n", + "P8=5.0 #Inclined at 45° UP Loading at 3m distance from A,KN\n", + "P7=10.0 #Inclined at 45° UP Loading at 2m distance from A,KN\n", + "P6=10.0 #Inclined at 45° UP Loading at 1m distance from A,KN\n", + "P5=5.0 #Inclined at 45° UP Loading A,KN\n", + "a=1.0\n", + "\n", + "theta=45.0*pi/180.0\n", + "#The roof is inclined at 45° to horizontal and loads are at 90° to the roof. Hence, the loads are also inclined at 45° to vertical/horizontal. \n", + "\n", + "#assume Resulat R at distance d from A,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=(P1+P2+P3+P4+P5+P6+P7+P8)*cos(theta)\n", + "Ry=-(P1+P2+P3+P4)*sin(theta)+(P5+P6+P7+P8)*sin(theta)\n", + "\n", + "print \"R=\",round(Rx,3),\"KN\"\n", + "#and its direction is horizontal \n", + "#Let R be at a distance d from the ridge A\n", + "#moment at A\n", + "d=((P1*3*cos(theta)*a+P2*cos(theta)*2*a+P3*cos(theta)*a)*2)/(Rx)\n", + "\n", + "print\"d=\",round(d,1),\"m\",\" Resultant is a horizontal force of magnitude\",round(Rx,3),\" at\",round(d,1),\" m below A.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.18 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 116.52 KN\n", + "alpha= 76.82 °\n", + "x= 1.48 m\n", + "The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and x= 1.48 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "#The two 40 kN forces acting on the smooth pulley may be replaced by a pair of 40 kN forces acting at centre of pulley C and parallel to the given forces, since the sum of moments of the two given forces about C is zero\n", + "\n", + "PA=20.0 #inclined at 45° loading at A,KN\n", + "PB=30.0 #inclined at 60° loading at B,KN\n", + "\n", + "PC1=40.0 #inclined at 30° loading at C,KN\n", + "PC2=40.0 #inclined at 20° loading at C,KN\n", + "PD=50.0 #inclined at 30.0 at distance 2m form A,KN\n", + "PE=20.0 #inclined at alpha at distance xm form A,KN\n", + "P=20.0 #vertical loading at distance 4m,KN\n", + "\n", + "\n", + "\n", + "thetaA=45.0*pi/180.0\n", + "thetaB=60.0*pi/180.0\n", + "thetaC1=30.0*pi/180.0\n", + "thetaC2=20.0*pi/180.0\n", + "thetaD=30.0*pi/180.0\n", + "AD=2.0\n", + "AC=3.0\n", + "AB=6.0\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PA*cos(thetaA)-PB*cos(thetaB)-PD*cos(thetaD)-PC1*sin(thetaC1)+PC2*cos(thetaC2)\n", + "\n", + "Fy=-PA*sin(thetaA)-P+P-PB*sin(thetaB)-PD*sin(thetaD)-PC2*sin(thetaC2)-PC1*cos(thetaC1)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#Let the resultant intersect AB at a distance x from A. Then, \n", + "\n", + "\n", + "X=(-P*4+P*4+PB*sin(thetaB)*AB+PD*sin(thetaD)*AD-PD*cos(thetaD)*AD+PC2*AC*cos(thetaC2)-PC1*AC*sin(thetaC1))/R\n", + "\n", + "print\"x=\",round(X,2),\"m\"\n", + "\n", + "print\"The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and \",\"x=\",round(X,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.19 page number 42\n" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 103.53 N\n", + "R= 26.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Free body diagram of the sphere shows all the forces moving away from the centre of the ball. Applying Lami’s theorem to the system of forces.\n", + "\n", + "#variable declaration\n", + "W=100.0 #weight of sphere,N\n", + "theta=15.0*pi/180 #angle of inclination of string with wall\n", + "\n", + "T=(W*sin((pi/2)))/sin((pi/2)+theta)\n", + "R=(W*sin((pi-theta)))/sin((pi/2)+theta)\n", + "print\"T=\",round(T,2),\"N\"\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "#The above problem may be solved using equations of equilibrium also. Taking horizontal direction as x axis and vertical direction as y axis,\n", + "\n", + "#Notes: \n", + "#1. The string can have only tension in it (it can pull a body), but cannot have compression in it (cannot push a body). \n", + "#2. The wall reaction is a push, but cannot be a pull on the body. \n", + "#3. If the magnitude of reaction comes out to be negative, then assumed direction of reaction is wrong. It is acting exactly in the opposite to the assumed direction. However, the magnitude will be the same. Hence no further analysis is required. This advantage is not there in using Lami's equation. Hence, it is advisable for beginners to use equations of equilibrium, instead of Lami's theorem even if the body is in equilibrium under the action of only three forces. \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.20 page number 43" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 1732.05 N\n", + "P= 866.03 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#The body is in equilibrium under the action of applied force P, self-weight 1500 N and normal reaction R from the plane. Since R, which is normal to the plane, makes 30° with the vertical (or 60° with the horizontal), \n", + "\n", + "#variable declaration\n", + "W=1500.0 #weight of block,N\n", + "theta=30.0*pi/180 #angle of inclination \n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(theta)\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "P=R*sin(theta)\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Note: Since the body is in equilibrium under the action of only three forces the above problem can be solved using Lami’s theorem \n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.21 page number 42" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S= -0.058 N\n", + "Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude 0.058 kN.\n", + "R= 14.979 kN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#A bar can develop a tensile force or a compressive force. Let the force developed be a compressive force S (push on the cylinder). \n", + "\n", + "#variable declaration\n", + "W=10.0 #weight of Roller,KN\n", + "IL=7.0 #inclined loading at angle of 45°,KN\n", + "H=5.0 #Horizontal loading ,KN\n", + "\n", + "theta=45.0*pi/180 #angle of loading of IL\n", + "thetaS=30.0*pi/180.0 \n", + "\n", + "#Since there are more than three forces in the system, Lami’s equations cannot be applied. Consider the components in horizontal and vertical directions. \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "S=(-H+IL*cos(theta))/cos(thetaS)\n", + "print\"S=\",round(S,3),\"N\"\n", + "\n", + "print\"Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude\",round(-S,3) ,\"kN.\"\n", + " \n", + "R=W+IL*sin(theta)-S*sin(thetaS)\n", + "print\"R=\",round(R,3),\"kN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.22 page number 44" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x= 1.125 m\n", + "T= 125.0 N\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi,asin\n", + "\n", + "#The pulley C is in equilibrium under the action of tensile forces in CA and CB and vertical downward load 200 N. The tensile forces in segment CA and CB are the same since the pulley is frictionless. Now consider the equilibrium of pulley C \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "#variable declaration\n", + "L=200.0 #suspended load at C,N\n", + "AB=3.0\n", + "BI=1.0\n", + "ACB=5.0 #Length of cord,m\n", + "DE=3.0\n", + "BE=4.0\n", + "theta=asin(4.0/5.0)\n", + "#assume T is tension in string making angle theta1 & theta2,solving horizontal we find theta1=theta2,lets called them theta ,as triangleCFD=triangle=CFA.so, CD=AC\n", + "\n", + "HI=BI*DE/BE\n", + "AH=DE-HI\n", + "x=AH/2\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "T=L/(2*sin(theta))\n", + "print\"T=\",round(T),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.23 page number 45" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1154.7 N\n", + "P= 1732.05 N\n" + ] + } + ], + "source": [ + "from math import sin ,acos, pi\n", + "\n", + "#When the roller is about to turn over the curb, the contact with the floor is lost and hence there is no reaction from the floor. The reaction R from the curb must pass through the intersection of P and the line of action of self weight, since the body is in equilibrium under the action of only three forces (all the three forces must be concurrent). \n", + "\n", + "#variable declaration\n", + "W=2000.0 #weight of roller,N\n", + "r=300.0 #radius of roller,mm\n", + "h=150.0 # height of curb,mm\n", + "OC=r-h\n", + "AO=r\n", + "\n", + "alpha=acos(OC/AO)\n", + "\n", + "#angleOAB=angleOBA,Since OA=OB,\n", + "angleOBA=(alpha)/2\n", + "\n", + "#the reaction makes 30° with the vertical\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(angleOBA)\n", + "P=R*sin(angleOBA)\n", + "\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Least force through the centre of wheel: Now the reaction from the curb must pass through the centre of the wheel since the other two forces pass through that point. Its inclination to vertical is theta = 60°. If the triangle of forces ABC representing selfweight by AB, reaction R by BC and pull P by AC, it may be observed that AC to be least, it should be perpendicular to BC. In other words, P makes 90° with the line of action of R.\n", + "#From triangle of forces ABC, we get \n", + "P=W*sin(alpha)\n", + "print \"P=\",round(P,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.24 page number 47 " + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 224.14 N\n", + "T2= 183.01 N\n", + "T3= 336.6 N\n", + "T4= 326.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "PB=200.0 #Vertical loading at B,N\n", + "PD=250.0 #Vertical loading at D,N\n", + "thetabc=30.0*pi/180.0\n", + "thetabd=60.0*pi/180.0\n", + "thetaed=45.0*pi/180.0\n", + "#Free body diagrams of points B and D . Let the forces in the members be as shown in the figure. Applying Lami’s theorem to the system of forces at point D,\n", + "\n", + "T1=PD*sin(pi-thetabd)/sin(thetaed+(pi/2)-thetabd)\n", + "T2=PD*sin(pi-thetaed)/sin(thetaed+(pi/2)-thetabd)\n", + "\n", + "print \"T1=\",round(T1,2),\"N\"\n", + "print \"T2=\",round(T2,2),\"N\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "T3=(PB+T2*cos(thetabd))/cos(thetabc)\n", + "print \"T3=\",round(T3,2),\"N\"\n", + "\n", + "T4=(T2*sin(thetabd))+T3*sin(thetabc)\n", + "print \"T4=\",round(T4,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.25 page number 47\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 2863.64 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,acos\n", + "\n", + "#variable declaration\n", + "\n", + "PC=1500.0 #Vertical loading at C,N\n", + "CD=2.0 \n", + "AC=1.5\n", + "BD=1.0\n", + "AB=4.0\n", + "\n", + "x=((pow(AC,2)-pow(BD,2))/4)+1\n", + "y=sqrt(pow(AC,2)-pow(x,2))\n", + "\n", + "alpha=acos(x/AC)\n", + "beta=acos((CD-x)/BD)\n", + "\n", + "#Applying Lami’s theorem to the system of forces acting at point C \n", + "\n", + "T1=PC*sin(pi/2)/sin(pi-alpha)\n", + "T2=PC*sin((pi/2)+alpha)/sin(pi-alpha)\n", + "T3=T2*sin(pi/2)/sin((pi/2)+beta)\n", + "W=T2*sin(pi-beta)/sin((pi/2)+beta)\n", + "\n", + "\n", + "print \"W=\",round(W,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.26 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 44.8 KN\n", + "T2= 29.24 KN\n", + "theta= 63.42 °\n", + "T3= 25.04 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + "PC=30.0 #vertical loadng at point C,KN \n", + " \n", + "thetaab=30.0 *pi/180.0\n", + "thetabc=50.0*pi/180.0\n", + "\n", + "#applying lami's thereom\n", + "\n", + "T1=PB*sin(thetabc)/sin(pi-thetabc+thetaab)\n", + "T2=PB*sin(pi-thetaab)/sin(pi-thetabc+thetaab)\n", + "theta=atan((T2*sin(thetabc))/(PC-T2*cos(thetabc)))*180/pi\n", + "\n", + "\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "print \"T2=\",round(T2,2),\"KN\"\n", + "\n", + "#Writing equations of equilibrium for the system of forces at C \n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "T3=(PC-T2*cos(thetabc))/cos(theta*pi/180)\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "#mistake in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.27 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T3= 22.5 KN\n", + "T1= 38.97 KN\n", + "theta= 54.79 °\n", + "T2= 23.85 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + " \n", + "PC=25.0 #vertical loadng at point C,KN \n", + "\n", + "thetaab=30.0*pi/180.0\n", + "thetadc=60.0*pi/180.0\n", + "\n", + "#Writing equations of equilibrium for the system of forces at joints B and C \n", + "#T1*sin(thetaab)=T3*sin(thetadc)\n", + "\n", + "T3=(PB+PC)/((sin(thetadc)*cos(thetaab)/sin(thetaab))+cos(thetadc))\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "\n", + "T1=T3*sin(thetadc)/sin(thetaab)\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "theta=(atan((T3*sin(thetadc))/(PC-T3*cos(thetadc))))*180/pi\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "\n", + "T2=T3*sin(thetadc)/(sin(theta*pi/180))\n", + "print \"T2=\",round(T2,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.28 page number 50" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 600.0 N\n", + "alpha= 1.249 °\n", + "RD= 632.456 N\n", + "RC= 200.0 N\n", + "RA= 200.0 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,atan,pi\n", + "\n", + "#variable declaration\n", + "W=600.0 #weight of cyclinder,N\n", + "r=150.0 #radius of cylinder,mm\n", + "a=600.0 #mm\n", + "b=300.0 #mm\n", + "\n", + "#Free body diagram of sphere and frame\n", + "\n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "RB=600.0 \n", + "#As the frame is in equilibrium under the action of three forces only, they must be concurrent forces. In other words, reaction at D has line of action alone OD. Hence, its inclination to horizontal is given by: \n", + "print\"RB=\",round(RB,2),\"N\"\n", + "alpha=atan((a-r)/r)\n", + "print\"alpha=\",round(alpha,4),\"°\"\n", + "\n", + "RD=W/sin(alpha)\n", + "print\"RD=\",round(RD,3),\"N\"\n", + "\n", + "RC=RD*cos(alpha)\n", + "RA=RC\n", + "print\"RC=\",round(RC),\"N\"\n", + "print\"RA=\",round(RA),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.29 page number 51" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 166.67 N\n", + "RA= 133.33 N\n", + "RC= 200.0 N\n", + "RD= 133.33 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,asin\n", + "\n", + "\n", + "# Let O1 and O2 be the centres of the first and second spheres. Drop perpendicular O1P to the horizontal line through O2. show free body diagram of the sphere 1 and 2, respectively. Since the surface of contact are smooth, reaction of B is in the radial direction, i.e., in the direction O1O2. Let it make angle a with the horizontal. Then,\n", + "\n", + "#Variable declaration\n", + "\n", + "W=100.0 #weight of spheres,N\n", + "\n", + "r=100.0 #radius of spheres,mm\n", + "\n", + "d=360.0 # horizontal channel having vertical walls, the distance b/w,mm\n", + "\n", + "O1A=100.0\n", + "O2D=100.0\n", + "O1B=100.0\n", + "BO2=100.0\n", + "\n", + "O2P=360.0-O1A-O2D\n", + "O1O2=O1B+BO2\n", + "\n", + "alpha=acos(O2P/O1O2)\n", + "\n", + "###sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "RB=W/sin(alpha)\n", + "RA=RB*cos(alpha)\n", + "print\"RB=\",round(RB,2),\"N\"\n", + "print\"RA=\",round(RA,2),\"N\"\n", + "\n", + "RC=100+RB*sin(alpha)\n", + "\n", + "RD=RB*cos(alpha)\n", + "\n", + "print\"RC=\",round(RC),\"N\"\n", + "\n", + "print\"RD=\",round(RD,2),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.30 page number 52" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1071.8 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Two cylinders, A of weight 4000 N and B of weight 2000 N rest on smooth inclines. They are connected by a bar of negligible weight hinged to each cylinder at its geometric centre by smooth pins\n", + "\n", + "#variable declaration\n", + "\n", + "WA=4000.0 #weight of cylinder A,N\n", + "WB=2000.0 #weight of cylinder B,N\n", + "\n", + "thetaWA=60.0*pi/180.0 #inclination of wall with cylinderA,°\n", + "thetaWB=45.0*pi/180.0 #inclination of wall with cylinderB,°\n", + "thetaAb=15.0*pi/180.0 #angle inclination bar with cylinder A ,N\n", + "thetaBb=15.0*pi/180.0 #angle inclination bar with cylinder B ,N\n", + "\n", + "#he free body diagram of the two cylinders. Applying Lami’s theorem to the system of forces on cylinder A, we get\n", + "\n", + "C=WA*sin(thetaWA)/sin(thetaWA+(pi/2)-thetaAb)\n", + "\n", + "#Consider cylinder B. Summation of the forces parallel to the inclined plane \n", + "P=(-WB*cos(thetaWB)+C*cos(thetaWA))/cos(thetaBb)\n", + "print\"P=\",round(P,1),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.31 page number 55" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 10.0382 KN\n", + "RA= 188.56 KN\n", + "alpha 32.17 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "# The 12 m boom AB weighs 1 kN, the distance of the centre of gravity G being 6 m from A. For the position shown, determine the tension T in the cable and the reaction at B \n", + "\n", + "#variable declaration\n", + "PB=2.5 #vertical Loading at B,KN\n", + "WAB=1.0 #vertical loading at G,KN\n", + "\n", + "theta=15.0*pi/180\n", + "AG=6.0 #Length of boom AB is 12m\n", + "GB=6.0\n", + "thetaAB=30.0*pi/180.0\n", + "thetaABC=15.0*pi/180.0\n", + "#sum of moment at A\n", + "\n", + "T=(PB*(AG+GB)*cos(thetaAB)+WAB*AG*cos(thetaAB))/(sin(thetaABC)*12)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "HA=T*cos(thetaABC)\n", + "VA=WAB+PB+T*sin(thetaABC)\n", + "\n", + "RA=sqrt(pow(RA,2)+pow(RA,2))\n", + "print \"RA=\",round(RA,2),\"KN\"\n", + "\n", + "alpha=atan(VA/HA)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.32 page number 56" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 51.9615 KN\n", + "R1= 23.6603 KN\n", + "R2= 6.3397 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A cable car used for carrying materials in a hydroelectric project is at rest on a track formed at an angle of 30° with the vertical. The gross weight of the car and its load is 60 kN and its centroid is at a point 800 mm from the track half way between the axles. The car is held by a cable . The axles of the car are at a distance 1.2 m. Find the tension in the cables and reaction at each of the axles neglecting friction of the track.\n", + "\n", + "W=60.0 #gross weight of car,KN\n", + "theta=60.0*pi/180.0\n", + " \n", + " \n", + "T=W*sin(theta)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#Taking moment equilibrium condition about upper axle point on track, we get\n", + "\n", + "R1=(-T*600.0+W*sin(theta)*800.0+W*cos(theta)*600.0)/1200.0\n", + "print\"R1=\",round(R1,4),\"KN\"\n", + "\n", + "#Sum of forces normal to the plane = 0, gives \n", + "R2=W*cos(theta)-R1\n", + "print\"R2=\",round(R2,4),\"KN\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.33 page numnber 56" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 0.75 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,acos,pi\n", + "\n", + "# A hollow right circular cylinder of radius 800 mm is open at both ends and rests on a smooth horizontal plane. Inside the cylinder there are two spheres having weights 1 kN and 3 kN and radii 400 mm and 600 mm, respectively. The lower sphere also rests on the horizontal plane. \n", + "# Join the centres of spheres, O1 and O2 and drop O1D perpendicular to horizontal through O2. \n", + "\n", + "#variable declaration\n", + "R=800.0\n", + "W1=1.0\n", + "r1=400.0\n", + "W2=3.0\n", + "r2=600.0\n", + "O1O2=1000 #mm\n", + "O2D=600 #mm\n", + "\n", + "#If alpha is the inclination of O2O1 to horizontal\n", + "alpha=acos(O2D/O1O2)\n", + "\n", + "#Free body diagrams of cylinder and spheres are shown. Considering the equilibrium of the spheres.\n", + "#Sum of Moment at O2\n", + "\n", + "R1=W1*O2D/(O1O2*sin(alpha))\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R2=R1\n", + "R3=W1+W2\n", + "#Now consider the equilibrium of cylinder. When it is about to tip over A, there is no reaction from ground at B. The reaction will be only at A. \n", + "\n", + "#Sum of Moment at A\n", + "\n", + "W=R1*O1O2*sin(alpha)/R\n", + "\n", + "print\"W=\",round(W,2),\"KN\"\n", + "\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_xHYwxJ4.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_xHYwxJ4.ipynb new file mode 100644 index 00000000..a94760d2 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_xHYwxJ4.ipynb @@ -0,0 +1,1857 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2-FUNDAMENTALS OF STATICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.1 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Moment is = -9607.41 Nmm clockwise\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=100.0\n", + "hd=400.0\n", + "vd=500.0\n", + "o=60.0\n", + "M=F*(math.cos(o/180.0*3.14)*vd-math.sin(o/180.0*3.14)*hd)\n", + "print '%s %.2f %s' %(\"\\n \\n Moment is =\", M ,\" Nmm clockwise\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.2 Page number 21" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.3 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Distance = 2.00 m\n" + ] + } + ], + "source": [ + "import math\n", + "#F force \n", + "#hd horizontal distance \n", + "#vd vertical distance\n", + "#O angle\n", + "#M moment of force\n", + "#Taking clockwise moment as positive\n", + "#calculations\n", + "F=5000.0\n", + "o=37\n", + "M=8000.0\n", + "hd=M/(F*math.cos(o*3.14/180))\n", + "print '%s %.2f %s' %(\"\\n \\n Distance =\", hd ,\"m\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 2.4 Page number 25" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force = 161.52 N\n", + "\n", + " \n", + " Resultant angle = 0.33 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#R resultant force\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "#f1 force\n", + "#f2 force\n", + "#f3 force\n", + "#o1 angle with the line \n", + "#o2 angle with the line \n", + "#o3 angle with the line \n", + "#O angle of resultant force with line\n", + "f1=70.0\n", + "f2=80.0\n", + "f3=50.0 \n", + "o1=50.0\n", + "o2=25.0\n", + "o3=-45.0\n", + "Rx=(f1*math.cos(o1/180*3.14)+f2*math.cos(o2/180*3.14)+f3*math.cos(o3/180*3.14));\n", + "Ry=(f1*math.sin(o1/180*3.14)+f2*math.sin(o2/180*3.14)+f3*math.sin(o3/180*3.14));\n", + "R=math.sqrt(Rx**2+Ry**2)\n", + "O=math.atan(Ry/Rx)\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force =\", R ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant angle =\", O ,\"radians\");\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.5 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " \n", + " Resultant Force along the incline plane = 234.24 N\n", + "\n", + " \n", + " Resultant Force vertical to the incline plane = -0.46 N\n" + ] + } + ], + "source": [ + "import math\n", + "#O angle of inclined plane\n", + "#N normal reaction\n", + "#W weight\n", + "#F,T forces\n", + "#Rx resultant horizontal component\n", + "#Ry resultant vertical component\n", + "o = 60.0 \n", + "W = 1000.0\n", + "N = 500.0\n", + "F = 100.0\n", + "T = 1200.0\n", + "Rx = T-F-(W*math.sin(o/180*3.14))\n", + "Ry = N-(W*math.cos(o/180*3.14))\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force along the incline plane =\", Rx ,\"N\");\n", + "print '%s %.2f %s' %(\"\\n \\n Resultant Force vertical to the incline plane =\", Ry ,\"N\");\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.6 Page number 26" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force 467.201871561 N\n", + "At an angle 61.0805191269\n" + ] + } + ], + "source": [ + "import math\n", + "R=1000.0 #Resultant force\n", + "F1=500.0 #Force \n", + "F2=1000.0 #force\n", + "o=45.0*3.14/180.0 #angle resultant makes with x axis \n", + "o1=30.0*3.14/180.0 #angle F1 makes with x axis \n", + "o2=60.0*3.14/180.0 #angle F2 makes with x axis \n", + "#F3coso3=Rcoso-F1coso1-F2sino2\n", + "#F3sino=Rsino-F1sino1-F2coso2\n", + "F3=((R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2))**2+(R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))**2)**0.5\n", + "print \"Force\",F3,\"N\"\n", + "o3=180/3.14*math.atan((R*math.sin(o)-F1*math.sin(o1)-F2*math.sin(o2))/(R*math.cos(o)-F1*math.cos(o1)-F2*math.cos(o2)))\n", + "print \"At an angle\",o3" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 2.7 Page number 27" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 6.32 °\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,pi,asin\n", + "\n", + "#variable declaration\n", + "\n", + "P1=300.0\n", + "P2=500.0\n", + "thetaI=30.0*pi/180.0\n", + "thetaP2=30.0*pi/180\n", + "thetaP1=40.0*pi/180\n", + "# Let the x and y axes be If the resultant is directed along the x axis, its component in y direction is zero.\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "F=(P2*sin(thetaP2))/(P1)\n", + "theta=(asin((F/(cos(20*pi/180)*2)))*180/pi)-20\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.8 page number 30\n" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 68.0592 KN\n", + "alpha= 81.55 °\n", + "x= 3.326 m\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt,pi\n", + "\n", + "#variable declaration\n", + "\n", + "P1=20.0\n", + "P2=30.0\n", + "P3=20.0\n", + "theta3=60.0*pi/180.0\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=20.0*cos(theta3)\n", + "Fy=P1+P2+P3*sin(theta3)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,4),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=P1*1.5+P2*3.0+P3*sin(theta3)*6.0\n", + "\n", + "#The distance of the resultant from point O is given by:\n", + "\n", + "d=MA/R\n", + "x=d/sin(alpha*pi/180)\n", + "print\"x=\",round(x,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.9 page number 31\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 91.19 KN\n", + "alpha= 35.84 °\n", + "x= 317.023 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,atan,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=100.0 #inclined up loading at 60° at A, N\n", + "PB1=80.0 #Vertical down loading at B,N\n", + "PB2=80.0 #Horizontal right loading at at B,N \n", + "PC=120.0 #inclined down loading at 30° at C,N\n", + "\n", + "thetaA=60.0*pi/180.0\n", + "thetaB=30.0*pi/180.0\n", + "\n", + "\n", + "\n", + "#Taking horizontal direction towards left as x axis and the vertical downward direction as y axis. \n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "Fx=PB2-PA*cos(thetaA)-PC*cos(thetaB)\n", + "Rx=-Fx\n", + "\n", + "Fy=PB1+PC*sin(thetaB)-PA*sin(thetaA)\n", + "Ry=Fy\n", + "\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Let x be the distance from A at which the resultant cuts AC. Then taking A as moment centre,\n", + "\n", + "x=(PB1*100*sin(thetaA)+PB2*50+PC*sin(thetaB)*100)/Ry\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.10 page number 32" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 565.69 N\n", + "theta= 45.0 °\n", + "x= 2.5 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PA=800.0 #Vertical down loading at A,N\n", + "PC=400.0 #vertical up loading at B,N\n", + "HD=600.0 #Horizontal left loading at A,N\n", + "HB=200.0 #Horizontal right loading at B,N\n", + "a=1.0 #length of side,m\n", + " \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=HB-HD\n", + "Fy=PC-PA\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at A\n", + "\n", + "MA=PC*a+HD*a\n", + "\n", + "#Let x be the distance from A along x axis, where resultant cuts AB.\n", + "\n", + "x=MA/Fy\n", + "\n", + "print\"x=\",round((-x),1),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.11 page number 32\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 10.0 KN\n", + "theta= 0.0 ° i.e. , the resultant is in the direction x.\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=2.0 #loading at B,KN\n", + "PC=sqrt(3.0) #loading at C,KN\n", + "PD=5.0 #loading at D,KN\n", + "PE=PC #loading at E,KN\n", + "PF=PB #loading at F,KN\n", + "\n", + "#Let O be the centre of the encircling circle A, B, C, D, E and F. In regular hexagon each side is equal to the radius AO. Hence OAB is equilateral triangle.\n", + "\n", + "angleoab=60.0*pi/180\n", + "anglecab=angleoab/2.0\n", + "theta1=anglecab\n", + "theta2=(angleoab-theta1)\n", + "theta3=theta1\n", + "theta4=theta1\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PB*cos(theta1+theta2)+PC*cos(theta2)+PD+PE*cos(theta3)+PF*cos(theta3+theta4)\n", + "\n", + "Fy=-PB*sin(theta1+theta2)-PC*sin(theta2)+0+PE*sin(theta3)+PF*sin(theta3+theta4)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "theta=atan(Fy/Fx)*180/pi\n", + "print\"theta=\",round(theta),\"°\",\"i.e.\",\",\",\"the resultant is in the direction x.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.12 page number 33" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 4.66 N\n", + "alpha= 28.99 °\n", + "d= 42.73 mm\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "P1=2.0 #loading at 1,KN\n", + "P2=1.5 #loading at 2,KN\n", + "P3=5.0 #loading at 3,KN\n", + "a=10.0 #side length,mm\n", + "\n", + "# If theta1, theta2 and theta3 are the slopes of the forces 2 kN, 5 kN and 1.5 kN forces with respect to x axis, then \n", + "\n", + "\n", + "theta1=atan(a/a)\n", + "theta2=atan((3*a)/(4*a))\n", + "theta3=atan((a)/(2*a))\n", + "\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=P1*cos(theta1)+P3*cos(theta2)-P2*cos(theta3)\n", + "\n", + "Fy=P1*sin(theta1)-P3*sin(theta2)-P2*sin(theta3)\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"N\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round((-alpha),2),\"°\"\n", + "\n", + "#Distance d of the resultant from O is given by\n", + "#Rd=sum of moment at A\n", + "\n", + "d=((a*3)*P1*cos(theta1)+(5*a)*P3*sin(theta2)+P2*(a)*sin(theta3))/(4.66)\n", + "print\"d=\",round(d,2),\"mm\"\n", + "\n", + "#Note: To find moment of forces about O, 2 kN force is resolved at it’s intersection with y axis and 5 kN and 1.5 kN forces are resolved at their intersection with x axis, and then Varignon theorem is used\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.13 page number 34" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 150.0 KN\n", + "MA= 270.0 KN-m\n", + "x= 1.8 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #loading at B,KN\n", + "PC=30.0 #loading at C,KN\n", + "PD=40.0 #loading at D,KN\n", + "PA=60.0 #loading at E,KN\n", + "AB=1.0\n", + "BC=2.0\n", + "CD=1.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA+PB+PC+PD\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA+(AB)*PB+PC*(AB+BC)+PD*(AB+BC+CD)\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x,1),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.14 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 100.0 KN in y-direction\n", + "MA= 300.0 KN-m\n", + "x= 3.0 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #up loading at B,KN\n", + "PC=40.0 #down loading at C,KN\n", + "PD=50.0 #up loading at D,KN\n", + "PA=80.0 #down loading at A,KN\n", + "PE=60.0 #down loading at E,KN\n", + "AB=2.0\n", + "BC=2.0\n", + "CD=4.0\n", + "DE=2.0\n", + "#length are in m\n", + "\n", + "# Let x and y axes be selected\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=0\n", + "Ry=PA-PB+PC-PD+PE\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "\n", + "#Taking clockwise moment as positive, \n", + "#sum of moment at A\n", + "\n", + "MA=(0)*PA-(AB)*PB+PC*(AB+BC)-PD*(AB+BC+CD)+PE*(AB+BC+CD+DE)\n", + "\n", + "print\"MA=\",round(MA,2),\"KN-m\"\n", + "\n", + "# The distance of resultant from A is,\n", + "\n", + "x=MA/R\n", + "print \"x=\",round(x),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.15 page number 35" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 2671.19 KN in y-direction\n", + "alpha 80.3 °\n", + "x= 141.195 mm\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=500.0 #Loading at inclined to 60.0°,N\n", + "P2=1000.0 #vertical loading at 150 distance from O,N\n", + "P3=1200.0 #vertical loading at 150 distance from O,N\n", + "H=700.0 #Horizontal loading at 300 ditance from O,N\n", + "a=150.0\n", + "theta=60.0*pi/180\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=P1*cos(theta)-H\n", + "Ry=-P3-P2-P1*sin(theta)\n", + "\n", + "R=sqrt(pow(Rx,2)+pow(Ry,2))\n", + "print \"R=\",round(R,2),\"KN\",\"in y-direction\"\n", + "\n", + "alpha=atan(Ry/Rx)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"\n", + " \n", + "#Let the point of application of the resultant be at a distance x from the point O along the horizontal arm. Then, \n", + "\n", + "x=(P1*sin(theta)*(2*a)+P2*a-P3*a*cos(theta)+H*a*2*sin(theta))/(-Ry)\n", + "print\"x=\",round(x,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.16 page number 36" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ry= 1420.0 KN downward\n", + "x= 4.127 m\n", + "The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=1120.0 #vertical down Loading at 2m distance from O,KN\n", + "P2=120.0 #vertical up loading at 4m distance from O,KN\n", + "P3=420.0 #vertical downloading at 5m distance from O,KN\n", + "H=500.0 #Horizontal loading at 4m ditance from O,KN\n", + "ah=4.0\n", + "a1=2.0\n", + "a2=4.0\n", + "a3=5.0\n", + "a=7.0\n", + "#assume Resulat R at distance x from O,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=H\n", + "Ry=P1-P2+P3\n", + "\n", + "print \"Ry=\",round(Ry,2),\"KN\",\"downward\"\n", + " \n", + "#Let x be the distance from O where the resultant cuts the base.\n", + "#moment at O\n", + "x=(H*ah+P1*a1-P2*a2+P3*a3)/(Ry)\n", + "\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "print \"The resultant passes through the middle third of the base i.e., between 7/3m, and 2*7/3 m.Hence, the dam is safe.\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.17 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 42.426 KN\n", + "d= 1.5 m Resultant is a horizontal force of magnitude 42.426 at 1.5 m below A.\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "#variable declaration\n", + "P1=5.0 #Inclined at 45° down Loading at 3m distance from A,KN\n", + "P2=10.0 #Inclined at 45° down Loading at 2m distance from A,KN\n", + "P3=10.0 #Inclined at 45° down Loading at 1m distance from A,KN\n", + "P4=5.0 #Inclined at 45° down Loading A,KN\n", + "P8=5.0 #Inclined at 45° UP Loading at 3m distance from A,KN\n", + "P7=10.0 #Inclined at 45° UP Loading at 2m distance from A,KN\n", + "P6=10.0 #Inclined at 45° UP Loading at 1m distance from A,KN\n", + "P5=5.0 #Inclined at 45° UP Loading A,KN\n", + "a=1.0\n", + "\n", + "theta=45.0*pi/180.0\n", + "#The roof is inclined at 45° to horizontal and loads are at 90° to the roof. Hence, the loads are also inclined at 45° to vertical/horizontal. \n", + "\n", + "#assume Resulat R at distance d from A,\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Rx=(P1+P2+P3+P4+P5+P6+P7+P8)*cos(theta)\n", + "Ry=-(P1+P2+P3+P4)*sin(theta)+(P5+P6+P7+P8)*sin(theta)\n", + "\n", + "print \"R=\",round(Rx,3),\"KN\"\n", + "#and its direction is horizontal \n", + "#Let R be at a distance d from the ridge A\n", + "#moment at A\n", + "d=((P1*3*cos(theta)*a+P2*cos(theta)*2*a+P3*cos(theta)*a)*2)/(Rx)\n", + "\n", + "print\"d=\",round(d,1),\"m\",\" Resultant is a horizontal force of magnitude\",round(Rx,3),\" at\",round(d,1),\" m below A.\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.18 page number 37" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 116.52 KN\n", + "alpha= 76.82 °\n", + "x= 1.48 m\n", + "The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and x= 1.48 m\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,atan\n", + "\n", + "#variable declaration\n", + "#The two 40 kN forces acting on the smooth pulley may be replaced by a pair of 40 kN forces acting at centre of pulley C and parallel to the given forces, since the sum of moments of the two given forces about C is zero\n", + "\n", + "PA=20.0 #inclined at 45° loading at A,KN\n", + "PB=30.0 #inclined at 60° loading at B,KN\n", + "\n", + "PC1=40.0 #inclined at 30° loading at C,KN\n", + "PC2=40.0 #inclined at 20° loading at C,KN\n", + "PD=50.0 #inclined at 30.0 at distance 2m form A,KN\n", + "PE=20.0 #inclined at alpha at distance xm form A,KN\n", + "P=20.0 #vertical loading at distance 4m,KN\n", + "\n", + "\n", + "\n", + "thetaA=45.0*pi/180.0\n", + "thetaB=60.0*pi/180.0\n", + "thetaC1=30.0*pi/180.0\n", + "thetaC2=20.0*pi/180.0\n", + "thetaD=30.0*pi/180.0\n", + "AD=2.0\n", + "AC=3.0\n", + "AB=6.0\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "Fx=PA*cos(thetaA)-PB*cos(thetaB)-PD*cos(thetaD)-PC1*sin(thetaC1)+PC2*cos(thetaC2)\n", + "\n", + "Fy=-PA*sin(thetaA)-P+P-PB*sin(thetaB)-PD*sin(thetaD)-PC2*sin(thetaC2)-PC1*cos(thetaC1)\n", + "\n", + "\n", + "R=sqrt(pow(Fx,2)+pow(Fy,2))\n", + "print \"R=\",round(R,2),\"KN\"\n", + "\n", + "alpha=atan(Fy/Fx)*180/pi\n", + "print\"alpha=\",round(alpha,2),\"°\"\n", + "\n", + "#Let the resultant intersect AB at a distance x from A. Then, \n", + "\n", + "\n", + "X=(-P*4+P*4+PB*sin(thetaB)*AB+PD*sin(thetaD)*AD-PD*cos(thetaD)*AD+PC2*AC*cos(thetaC2)-PC1*AC*sin(thetaC1))/R\n", + "\n", + "print\"x=\",round(X,2),\"m\"\n", + "\n", + "print\"The equilibriant is equal and opposite to the resultant in which E = 116.515 kN, alpha= 76.82° and \",\"x=\",round(X,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.19 page number 42\n" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 103.53 N\n", + "R= 26.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Free body diagram of the sphere shows all the forces moving away from the centre of the ball. Applying Lami’s theorem to the system of forces.\n", + "\n", + "#variable declaration\n", + "W=100.0 #weight of sphere,N\n", + "theta=15.0*pi/180 #angle of inclination of string with wall\n", + "\n", + "T=(W*sin((pi/2)))/sin((pi/2)+theta)\n", + "R=(W*sin((pi-theta)))/sin((pi/2)+theta)\n", + "print\"T=\",round(T,2),\"N\"\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "#The above problem may be solved using equations of equilibrium also. Taking horizontal direction as x axis and vertical direction as y axis,\n", + "\n", + "#Notes: \n", + "#1. The string can have only tension in it (it can pull a body), but cannot have compression in it (cannot push a body). \n", + "#2. The wall reaction is a push, but cannot be a pull on the body. \n", + "#3. If the magnitude of reaction comes out to be negative, then assumed direction of reaction is wrong. It is acting exactly in the opposite to the assumed direction. However, the magnitude will be the same. Hence no further analysis is required. This advantage is not there in using Lami's equation. Hence, it is advisable for beginners to use equations of equilibrium, instead of Lami's theorem even if the body is in equilibrium under the action of only three forces. \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.20 page number 43" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R= 1732.05 N\n", + "P= 866.03 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#The body is in equilibrium under the action of applied force P, self-weight 1500 N and normal reaction R from the plane. Since R, which is normal to the plane, makes 30° with the vertical (or 60° with the horizontal), \n", + "\n", + "#variable declaration\n", + "W=1500.0 #weight of block,N\n", + "theta=30.0*pi/180 #angle of inclination \n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(theta)\n", + "print\"R=\",round(R,2),\"N\"\n", + "\n", + "P=R*sin(theta)\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Note: Since the body is in equilibrium under the action of only three forces the above problem can be solved using Lami’s theorem \n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 2.21 page number 42" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S= -0.058 N\n", + "Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude 0.058 kN.\n", + "R= 14.979 kN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#A bar can develop a tensile force or a compressive force. Let the force developed be a compressive force S (push on the cylinder). \n", + "\n", + "#variable declaration\n", + "W=10.0 #weight of Roller,KN\n", + "IL=7.0 #inclined loading at angle of 45°,KN\n", + "H=5.0 #Horizontal loading ,KN\n", + "\n", + "theta=45.0*pi/180 #angle of loading of IL\n", + "thetaS=30.0*pi/180.0 \n", + "\n", + "#Since there are more than three forces in the system, Lami’s equations cannot be applied. Consider the components in horizontal and vertical directions. \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "S=(-H+IL*cos(theta))/cos(thetaS)\n", + "print\"S=\",round(S,3),\"N\"\n", + "\n", + "print\"Since the value of S is negative the force exerted by the bar is not a push, but it is pull (tensile force in bar) of magnitude\",round(-S,3) ,\"kN.\"\n", + " \n", + "R=W+IL*sin(theta)-S*sin(thetaS)\n", + "print\"R=\",round(R,3),\"kN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.22 page number 44" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x= 1.125 m\n", + "T= 125.0 N\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi,asin\n", + "\n", + "#The pulley C is in equilibrium under the action of tensile forces in CA and CB and vertical downward load 200 N. The tensile forces in segment CA and CB are the same since the pulley is frictionless. Now consider the equilibrium of pulley C \n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "#variable declaration\n", + "L=200.0 #suspended load at C,N\n", + "AB=3.0\n", + "BI=1.0\n", + "ACB=5.0 #Length of cord,m\n", + "DE=3.0\n", + "BE=4.0\n", + "theta=asin(4.0/5.0)\n", + "#assume T is tension in string making angle theta1 & theta2,solving horizontal we find theta1=theta2,lets called them theta ,as triangleCFD=triangle=CFA.so, CD=AC\n", + "\n", + "HI=BI*DE/BE\n", + "AH=DE-HI\n", + "x=AH/2\n", + "print\"x=\",round(x,3),\"m\"\n", + "\n", + "T=L/(2*sin(theta))\n", + "print\"T=\",round(T),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.23 page number 45" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1154.7 N\n", + "P= 1732.05 N\n" + ] + } + ], + "source": [ + "from math import sin ,acos, pi\n", + "\n", + "#When the roller is about to turn over the curb, the contact with the floor is lost and hence there is no reaction from the floor. The reaction R from the curb must pass through the intersection of P and the line of action of self weight, since the body is in equilibrium under the action of only three forces (all the three forces must be concurrent). \n", + "\n", + "#variable declaration\n", + "W=2000.0 #weight of roller,N\n", + "r=300.0 #radius of roller,mm\n", + "h=150.0 # height of curb,mm\n", + "OC=r-h\n", + "AO=r\n", + "\n", + "alpha=acos(OC/AO)\n", + "\n", + "#angleOAB=angleOBA,Since OA=OB,\n", + "angleOBA=(alpha)/2\n", + "\n", + "#the reaction makes 30° with the vertical\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R=W/cos(angleOBA)\n", + "P=R*sin(angleOBA)\n", + "\n", + "print\"P=\",round(P,2),\"N\"\n", + "\n", + "#Least force through the centre of wheel: Now the reaction from the curb must pass through the centre of the wheel since the other two forces pass through that point. Its inclination to vertical is theta = 60°. If the triangle of forces ABC representing selfweight by AB, reaction R by BC and pull P by AC, it may be observed that AC to be least, it should be perpendicular to BC. In other words, P makes 90° with the line of action of R.\n", + "#From triangle of forces ABC, we get \n", + "P=W*sin(alpha)\n", + "print \"P=\",round(P,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.24 page number 47 " + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 224.14 N\n", + "T2= 183.01 N\n", + "T3= 336.6 N\n", + "T4= 326.79 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "PB=200.0 #Vertical loading at B,N\n", + "PD=250.0 #Vertical loading at D,N\n", + "thetabc=30.0*pi/180.0\n", + "thetabd=60.0*pi/180.0\n", + "thetaed=45.0*pi/180.0\n", + "#Free body diagrams of points B and D . Let the forces in the members be as shown in the figure. Applying Lami’s theorem to the system of forces at point D,\n", + "\n", + "T1=PD*sin(pi-thetabd)/sin(thetaed+(pi/2)-thetabd)\n", + "T2=PD*sin(pi-thetaed)/sin(thetaed+(pi/2)-thetabd)\n", + "\n", + "print \"T1=\",round(T1,2),\"N\"\n", + "print \"T2=\",round(T2,2),\"N\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "T3=(PB+T2*cos(thetabd))/cos(thetabc)\n", + "print \"T3=\",round(T3,2),\"N\"\n", + "\n", + "T4=(T2*sin(thetabd))+T3*sin(thetabc)\n", + "print \"T4=\",round(T4,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.25 page number 47\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 2863.64 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,acos\n", + "\n", + "#variable declaration\n", + "\n", + "PC=1500.0 #Vertical loading at C,N\n", + "CD=2.0 \n", + "AC=1.5\n", + "BD=1.0\n", + "AB=4.0\n", + "\n", + "x=((pow(AC,2)-pow(BD,2))/4)+1\n", + "y=sqrt(pow(AC,2)-pow(x,2))\n", + "\n", + "alpha=acos(x/AC)\n", + "beta=acos((CD-x)/BD)\n", + "\n", + "#Applying Lami’s theorem to the system of forces acting at point C \n", + "\n", + "T1=PC*sin(pi/2)/sin(pi-alpha)\n", + "T2=PC*sin((pi/2)+alpha)/sin(pi-alpha)\n", + "T3=T2*sin(pi/2)/sin((pi/2)+beta)\n", + "W=T2*sin(pi-beta)/sin((pi/2)+beta)\n", + "\n", + "\n", + "print \"W=\",round(W,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.26 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T1= 44.8 KN\n", + "T2= 29.24 KN\n", + "theta= 63.42 °\n", + "T3= 25.04 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + "PC=30.0 #vertical loadng at point C,KN \n", + " \n", + "thetaab=30.0 *pi/180.0\n", + "thetabc=50.0*pi/180.0\n", + "\n", + "#applying lami's thereom\n", + "\n", + "T1=PB*sin(thetabc)/sin(pi-thetabc+thetaab)\n", + "T2=PB*sin(pi-thetaab)/sin(pi-thetabc+thetaab)\n", + "theta=atan((T2*sin(thetabc))/(PC-T2*cos(thetabc)))*180/pi\n", + "\n", + "\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "print \"T2=\",round(T2,2),\"KN\"\n", + "\n", + "#Writing equations of equilibrium for the system of forces at C \n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "T3=(PC-T2*cos(thetabc))/cos(theta*pi/180)\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "#mistake in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.27 page number 49" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T3= 22.5 KN\n", + "T1= 38.97 KN\n", + "theta= 54.79 °\n", + "T2= 23.85 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,atan\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #vertical loadng at point B,KN \n", + " \n", + "PC=25.0 #vertical loadng at point C,KN \n", + "\n", + "thetaab=30.0*pi/180.0\n", + "thetadc=60.0*pi/180.0\n", + "\n", + "#Writing equations of equilibrium for the system of forces at joints B and C \n", + "#T1*sin(thetaab)=T3*sin(thetadc)\n", + "\n", + "T3=(PB+PC)/((sin(thetadc)*cos(thetaab)/sin(thetaab))+cos(thetadc))\n", + "print \"T3=\",round(T3,2),\"KN\"\n", + "\n", + "T1=T3*sin(thetadc)/sin(thetaab)\n", + "print \"T1=\",round(T1,2),\"KN\"\n", + "\n", + "theta=(atan((T3*sin(thetadc))/(PC-T3*cos(thetadc))))*180/pi\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "\n", + "T2=T3*sin(thetadc)/(sin(theta*pi/180))\n", + "print \"T2=\",round(T2,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.28 page number 50" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 600.0 N\n", + "alpha= 1.249 °\n", + "RD= 632.456 N\n", + "RC= 200.0 N\n", + "RA= 200.0 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,atan,pi\n", + "\n", + "#variable declaration\n", + "W=600.0 #weight of cyclinder,N\n", + "r=150.0 #radius of cylinder,mm\n", + "a=600.0 #mm\n", + "b=300.0 #mm\n", + "\n", + "#Free body diagram of sphere and frame\n", + "\n", + "##sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "RB=600.0 \n", + "#As the frame is in equilibrium under the action of three forces only, they must be concurrent forces. In other words, reaction at D has line of action alone OD. Hence, its inclination to horizontal is given by: \n", + "print\"RB=\",round(RB,2),\"N\"\n", + "alpha=atan((a-r)/r)\n", + "print\"alpha=\",round(alpha,4),\"°\"\n", + "\n", + "RD=W/sin(alpha)\n", + "print\"RD=\",round(RD,3),\"N\"\n", + "\n", + "RC=RD*cos(alpha)\n", + "RA=RC\n", + "print\"RC=\",round(RC),\"N\"\n", + "print\"RA=\",round(RA),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.29 page number 51" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 166.67 N\n", + "RA= 133.33 N\n", + "RC= 200.0 N\n", + "RD= 133.33 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,acos,asin\n", + "\n", + "\n", + "# Let O1 and O2 be the centres of the first and second spheres. Drop perpendicular O1P to the horizontal line through O2. show free body diagram of the sphere 1 and 2, respectively. Since the surface of contact are smooth, reaction of B is in the radial direction, i.e., in the direction O1O2. Let it make angle a with the horizontal. Then,\n", + "\n", + "#Variable declaration\n", + "\n", + "W=100.0 #weight of spheres,N\n", + "\n", + "r=100.0 #radius of spheres,mm\n", + "\n", + "d=360.0 # horizontal channel having vertical walls, the distance b/w,mm\n", + "\n", + "O1A=100.0\n", + "O2D=100.0\n", + "O1B=100.0\n", + "BO2=100.0\n", + "\n", + "O2P=360.0-O1A-O2D\n", + "O1O2=O1B+BO2\n", + "\n", + "alpha=acos(O2P/O1O2)\n", + "\n", + "###sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "RB=W/sin(alpha)\n", + "RA=RB*cos(alpha)\n", + "print\"RB=\",round(RB,2),\"N\"\n", + "print\"RA=\",round(RA,2),\"N\"\n", + "\n", + "RC=100+RB*sin(alpha)\n", + "\n", + "RD=RB*cos(alpha)\n", + "\n", + "print\"RC=\",round(RC),\"N\"\n", + "\n", + "print\"RD=\",round(RD,2),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example2.30 page number 52" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1071.8 N\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Two cylinders, A of weight 4000 N and B of weight 2000 N rest on smooth inclines. They are connected by a bar of negligible weight hinged to each cylinder at its geometric centre by smooth pins\n", + "\n", + "#variable declaration\n", + "\n", + "WA=4000.0 #weight of cylinder A,N\n", + "WB=2000.0 #weight of cylinder B,N\n", + "\n", + "thetaWA=60.0*pi/180.0 #inclination of wall with cylinderA,°\n", + "thetaWB=45.0*pi/180.0 #inclination of wall with cylinderB,°\n", + "thetaAb=15.0*pi/180.0 #angle inclination bar with cylinder A ,N\n", + "thetaBb=15.0*pi/180.0 #angle inclination bar with cylinder B ,N\n", + "\n", + "#he free body diagram of the two cylinders. Applying Lami’s theorem to the system of forces on cylinder A, we get\n", + "\n", + "C=WA*sin(thetaWA)/sin(thetaWA+(pi/2)-thetaAb)\n", + "\n", + "#Consider cylinder B. Summation of the forces parallel to the inclined plane \n", + "P=(-WB*cos(thetaWB)+C*cos(thetaWA))/cos(thetaBb)\n", + "print\"P=\",round(P,1),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.31 page number 55" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 10.0382 KN\n", + "RA= 188.56 KN\n", + "alpha 32.17 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sin ,cos,sqrt\n", + "\n", + "# The 12 m boom AB weighs 1 kN, the distance of the centre of gravity G being 6 m from A. For the position shown, determine the tension T in the cable and the reaction at B \n", + "\n", + "#variable declaration\n", + "PB=2.5 #vertical Loading at B,KN\n", + "WAB=1.0 #vertical loading at G,KN\n", + "\n", + "theta=15.0*pi/180\n", + "AG=6.0 #Length of boom AB is 12m\n", + "GB=6.0\n", + "thetaAB=30.0*pi/180.0\n", + "thetaABC=15.0*pi/180.0\n", + "#sum of moment at A\n", + "\n", + "T=(PB*(AG+GB)*cos(thetaAB)+WAB*AG*cos(thetaAB))/(sin(thetaABC)*12)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "HA=T*cos(thetaABC)\n", + "VA=WAB+PB+T*sin(thetaABC)\n", + "\n", + "RA=sqrt(pow(RA,2)+pow(RA,2))\n", + "print \"RA=\",round(RA,2),\"KN\"\n", + "\n", + "alpha=atan(VA/HA)*180/pi\n", + "print\"alpha\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example2.32 page number 56" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T= 51.9615 KN\n", + "R1= 23.6603 KN\n", + "R2= 6.3397 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#variable declaration\n", + "\n", + "#A cable car used for carrying materials in a hydroelectric project is at rest on a track formed at an angle of 30° with the vertical. The gross weight of the car and its load is 60 kN and its centroid is at a point 800 mm from the track half way between the axles. The car is held by a cable . The axles of the car are at a distance 1.2 m. Find the tension in the cables and reaction at each of the axles neglecting friction of the track.\n", + "\n", + "W=60.0 #gross weight of car,KN\n", + "theta=60.0*pi/180.0\n", + " \n", + " \n", + "T=W*sin(theta)\n", + "print\"T=\",round(T,4),\"KN\"\n", + "\n", + "#Taking moment equilibrium condition about upper axle point on track, we get\n", + "\n", + "R1=(-T*600.0+W*sin(theta)*800.0+W*cos(theta)*600.0)/1200.0\n", + "print\"R1=\",round(R1,4),\"KN\"\n", + "\n", + "#Sum of forces normal to the plane = 0, gives \n", + "R2=W*cos(theta)-R1\n", + "print\"R2=\",round(R2,4),\"KN\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 2.33 page numnber 56" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W= 0.75 KN\n" + ] + } + ], + "source": [ + "from math import sin,cos,acos,pi\n", + "\n", + "# A hollow right circular cylinder of radius 800 mm is open at both ends and rests on a smooth horizontal plane. Inside the cylinder there are two spheres having weights 1 kN and 3 kN and radii 400 mm and 600 mm, respectively. The lower sphere also rests on the horizontal plane. \n", + "# Join the centres of spheres, O1 and O2 and drop O1D perpendicular to horizontal through O2. \n", + "\n", + "#variable declaration\n", + "R=800.0\n", + "W1=1.0\n", + "r1=400.0\n", + "W2=3.0\n", + "r2=600.0\n", + "O1O2=1000 #mm\n", + "O2D=600 #mm\n", + "\n", + "#If alpha is the inclination of O2O1 to horizontal\n", + "alpha=acos(O2D/O1O2)\n", + "\n", + "#Free body diagrams of cylinder and spheres are shown. Considering the equilibrium of the spheres.\n", + "#Sum of Moment at O2\n", + "\n", + "R1=W1*O2D/(O1O2*sin(alpha))\n", + "#sum of vertical Fy & sum of horizontal forces Fx is zero\n", + "#Assume direction of Fx is right\n", + "#Assume direction of Fy is up\n", + "\n", + "R2=R1\n", + "R3=W1+W2\n", + "#Now consider the equilibrium of cylinder. When it is about to tip over A, there is no reaction from ground at B. The reaction will be only at A. \n", + "\n", + "#Sum of Moment at A\n", + "\n", + "W=R1*O1O2*sin(alpha)/R\n", + "\n", + "print\"W=\",round(W,2),\"KN\"\n", + "\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_EZKiqPL.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_EZKiqPL.ipynb new file mode 100644 index 00000000..09420950 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_EZKiqPL.ipynb @@ -0,0 +1,1030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3-TRUSSES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.1 Page number68" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 45.0 °\n", + "FCB= 56.57 KN\n", + "FCD= 40.0 KN\n", + "FDB= 40.0 KN\n", + "FDE= 40.0 KN\n", + "FBE= 113.14 KN\n", + "FBA= 120.0 KN\n", + "Member , Magnitude of Force in KN , Nature\n", + "AB , 120.0 , Tension\n", + "BC , 56.57 , Tension\n", + "CD , 40.0 , Compresion\n", + "DE , 40.0 , Compresion\n", + "BE , 113.14 , Compresion\n", + "BD , 40.0 , Tension\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "#Determine the inclinations of all inclined members\n", + "\n", + "theta=atan(1)*180/pi\n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "#Now at joints C, there are only two unknowns,forces in members CB and CD, say FCB and FCD.\n", + "#Now there are two equations of equilibrium for the forces meeting at the joint and two unknown forces. Hence, the unknown forces can be determined. At joint C sum V= 0 condition shows that the force FCB should act away from the joint C so that its vertical component balances the vertical downward load at C.\n", + " \n", + "P=40.0\n", + "FCB=P/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\"\n", + "\n", + "#Now sum H=0 indicates that FCD should act towards C.\n", + "\n", + "FCD=FCB*cos(theta*pi/180)\n", + "\n", + "print \"FCD=\",round(FCD,2),\"KN\"\n", + "\n", + "#In the present case, near the joint C, the arrows are marked on the members CB and CD to indicate forces FCB and FCD directions as found in the analysis of joint C. Then reversed directions are marked in the members CB and CD near joints B and D, respectively.\n", + "\n", + "FDB=40.0\n", + "FDE=40.0\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\"\n", + "\n", + "print \"FDE=\",round(FDE,2),\"KN\"\n", + "\n", + "#In the present case, after marking the forces in the members DB and DE, we find that analysis of joint B can be taken up.\n", + "\n", + "FBE=(FCB*sin(theta*pi/180)+P)/(sin(theta*pi/180))\n", + "\n", + "FBA=FCB*cos(theta*pi/180)+FBE*cos(theta*pi/180)\n", + "\n", + "print \"FBE=\", round(FBE,2),\"KN\"\n", + "print \"FBA=\", round(FBA,2),\"KN\"\n", + "#Determine the nature of forces in each member and tabulate the results. Note that if the arrow marks on a member are towards each other, then the member is in tension and if the arrow marks are away from each other, the member is in compression.\n", + "\n", + "print \"Member\",\",\",\"Magnitude of Force in KN\",\",\",\"Nature\"\n", + "print \"AB\",\",\", round(FBA,2) ,\",\",\"Tension\"\n", + "print \"BC\",\",\", round(FCB,2) ,\",\",\"Tension\"\n", + "print \"CD\",\",\", round(FCD,2) ,\",\",\"Compresion\"\n", + "print \"DE\",\",\", round(FDE,2) ,\",\",\"Compresion\"\n", + "print \"BE\",\",\", round(FBE,2) ,\",\",\"Compresion\"\n", + "print \"BD\",\",\", round(P,2) ,\",\",\"Tension\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.2 Page number70" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 83.7158 KN (Comp.)\n", + "FAE= 41.8579 KN (Tension)\n", + "FDC= 89.4893 KN (Comp.)\n", + "FDE= 44.7446 KN (Tension)\n", + "FBC= 60.6218 KN (Comp.)\n", + "FCE= 31.7543 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=40.0\n", + "PC=50.0\n", + "PE=60.0\n", + "\n", + "theta=60.0\n", + "\n", + "RD=(PC*3+PE*2+PB*1)/(4.0)\n", + "\n", + "RA=PB+PC+PE-RD\n", + "\n", + "FAB=RA/sin(theta*pi/180)\n", + "\n", + "print\"FAB=\",round(FAB,4),\"KN\" ,\"(Comp.)\"\n", + "\n", + "FAE=FAB*cos(theta*pi/180)\n", + "\n", + "print\"FAE=\",round(FAE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FDC=RD/sin(theta*pi/180)\n", + "\n", + "print\"FDC=\",round(FDC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FDE=FDC*cos(theta*pi/180)\n", + "\n", + "print\"FDE=\",round(FDE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBE=(FAB*sin(theta*pi/180)-PB)/sin(theta*pi/180)\n", + "\n", + "FBC=(FAB+FBE)*(0.5)\n", + "print\"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "FCE=(FDC*sin(theta*pi/180)-PC)/(sin(theta*pi/180))\n", + "print\"FCE=\",round(FCE,4),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.3 Page number72" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 23.09 KN [Comp.]\n", + "FAC= 11.55 KN [Tensile]\n", + "FDB= 20.0 KN [Comp.]\n", + "FDC= 17.32 KN [Tensile]\n", + "FCB= 11.55 KN FCB= 11.55 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #Load at point B,KN\n", + "PC=10.0 #Load at point C,KN \n", + "thetaA=60.0 #angleBAC\n", + "thetaD=30.0 #angleBDC\n", + "\n", + "AC=3.0 #length,m\n", + "CD=3.0 #length,m\n", + "\n", + "AB=(AC+CD)*cos(thetaA*pi/180)\n", + "BD=(AC+CD)*cos(thetaD*pi/180)\n", + "#mistake in book\n", + "#angleBCA=angleABC=theta\n", + "\n", + "theta=(180.0-thetaA)/(2.0) \n", + "\n", + "#Taking moment about A, we get\n", + "\n", + "RD=(PC*AC+PB*AC*cos(thetaA*pi/180))/(AC+CD)\n", + "\n", + "RA=PC+PB-RD\n", + "#Joint A\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FAB=RA/sin(thetaA*pi/180)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"[Comp.]\"\n", + "FAC=FAB*cos(thetaA*pi/180)\n", + "print \"FAC=\",round(FAC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint D\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FDB=RD/sin(thetaD*pi/180)\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\",\"[Comp.]\"\n", + "FDC=FDB*cos(thetaD*pi/180)\n", + "print \"FDC=\",round(FDC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint C\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FCB=PC/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\",\n", + "\n", + "#CHECK\n", + "\n", + "FCB=(FDC-FAC)/cos(theta*pi/180)\n", + "print \"FCB=\",round(FCB,2),\"KN\",\"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.4 Page number74\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FBF= 42.4264 KN (Tension)\n", + "FBC= 30.0 KN (Comp.)\n", + "FCF= 50.0 KN (Comp.)\n", + "FCD= 30.0 KN (Comp.)\n", + "FDF= 70.7107 KN (Tensile)\n", + "FDF= 70.7107 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #vertical load at point B,KN\n", + "PC=50.0 #vertical load at point C,KN \n", + "PDv=40.0 #vertical load at point D,KN\n", + "PDh=20.0 #Horizontal load at point D,KN\n", + "PF=30.0 #vertical load at point F,KN\n", + "HA=PDh\n", + "\n", + "RE=(PC*4+PDv*8+PDh*4+PF*4)/(8.0)\n", + "\n", + "VA=PB+PC+PDv+PF-RE\n", + "\n", + "#joint A\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FAB=VA\n", + "FAF=HA\n", + "\n", + "#joint E\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FED=RE\n", + "FEF=0\n", + "\n", + "#Joint B: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FBF=(VA-PB)/sin(theta*pi/180)\n", + "\n", + "print\"FBF=\",round(FBF,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBC=FBF*cos(theta*pi/180)\n", + "\n", + "print\"FBC=\",round(FBC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint C: \n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "\n", + "FCF=PC\n", + "\n", + "print\"FCF=\",round(FCF,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FCD=FBC\n", + "\n", + "print\"FCD=\",round(FCD,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint D: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FDF=(RE-PDv)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"(Tensile)\"\n", + "\n", + "#check\n", + "\n", + "FDF=(FCD+PDh)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.5 Page number75" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FED= 25.0 KN (Tension)\n", + "FEF= 15.0 KN (Comp.)\n", + "FAB= 20.0 KN (Comp.)\n", + "FAF= 15.0 KN (Comp.)\n", + "FCB= 25.0 KN (Comp.)\n", + "FCD= 20.0 KN (Tension)\n", + "FBF= 0.0\n", + "FBD= 15.0 KN (Tension)\n", + "FFD= 0.0\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,sin,cos\n", + "\n", + "#All inclined members have the same inclination to horizontal. Now, length of an inclined member is BF\n", + "\n", + "#variable declaration\n", + "\n", + "PE=20.0\n", + "AF=3.0\n", + "FE=3.0\n", + "AB=4.0\n", + "FD=4.0\n", + "BD=3.0\n", + "CD=4.0\n", + "\n", + "BF=sqrt(pow(AF,2)+pow(AB,2))\n", + "DE=BF\n", + "BC=DE\n", + "\n", + "#sin(theta)=AB/BF\n", + "#cos(theta)=AF/BF\n", + "\n", + "theta=asin(AB/BF)\n", + "#As soon as a joint is analysed the forces on the joint are marked on members \n", + "\n", + "#Joint E\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "FED=PE/sin(theta)\n", + "print\"FED=\",round(FED),\"KN\",\"(Tension)\"\n", + "\n", + "FEF=FED*cos(theta)\n", + "print\"FEF=\",round(FEF),\"KN\",\"(Comp.)\"\n", + "\n", + "#At this stage as no other joint is having only two unknowns, no further progress is possible. Let us find the reactions at the supports considering the whole structure. Let the reaction be RC HORIZONTAL at point C,VA,HA at point A Vertically & Horizontally respectively.\n", + "#Taking moment at point A,\n", + "\n", + "RC=PE*6/8 \n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "VA=PE\n", + "HA=RC\n", + "\n", + "#Joint A\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FAB=VA\n", + "print\"FAB=\",round(FAB),\"KN\",\"(Comp.)\"\n", + "\n", + "FAF=HA\n", + "print\"FAF=\",round(FAF),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint C\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FCB=RC/cos(theta)\n", + "print\"FCB=\",round(FCB),\"KN\",\"(Comp.)\"\n", + "\n", + "FCD=FCB*sin(theta)\n", + "print\"FCD=\",round(FCD),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint B\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FBF=(FCB*sin(theta)-FAB)/sin(theta)\n", + "\n", + "print\"FBF=\",round(FBF)\n", + "\n", + "FBD=FCB*cos(theta)\n", + "print\"FBD=\",round(FBD),\"KN\",\"(Tension)\"\n", + "\n", + "#joint F\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FFD=FBF\n", + "print\"FFD=\",round(FFD)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 3.6 page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FHG= 25.0 KN (Comp.)\n", + "FHF= 15.0 KN (Tension)\n", + "FAC= 18.0278 KN (Comp.)\n", + "FAB= 15.0 KN (Tension)\n", + "FBC= 0.0\n", + "FBD=FBA 15.0 KN (Tension)\n", + "FCE=FCA 18.0278 KN (Comp.)\n", + "FDE= 0.0\n", + "FDF=FDB 15.0 KN (Tension)\n", + "FEF= 0\n", + "FEG=FCE= 18.0278 KN (Comp.)\n", + "FFG= 12.0 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan, cos , sin, pi\n", + "\n", + "#variable declaration\n", + "\n", + "AB=2.0 #length of beam AB,m\n", + "BD=2.0 #length of beam BD,m\n", + "DF=2.0 #length of beam DF,m\n", + "FH=3.0 #length of beam FH,m\n", + "FG=4.0 #length of beam FG,m\n", + "PF=12.0 #Vertical Load at point F,KN\n", + "PH=20.0 #Vertical Load at point H,KN\n", + "\n", + "#mistake in book FG=4.0 , given FG=2.0 \n", + "\n", + "theta1=atan(FG/(AB+BD+DF))\n", + "theta3=atan(FG/FH)\n", + "theta2=theta3\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "#joint H\n", + "\n", + "FHG=PH/sin(theta3)\n", + "print \"FHG=\",round(FHG),\"KN\",\"(Comp.)\" \n", + "\n", + "FHF=FHG*cos(theta2)\n", + "print \"FHF=\",round(FHF),\"KN\",\"(Tension)\"\n", + "\n", + "#taking moment at G\n", + "\n", + "RA=PH*FH/(AB+BD+DF)\n", + "\n", + "RG=RA+PF+PH\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAC=RA/sin(theta1)\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Comp.)\" \n", + "\n", + "FAB=FAC*cos(theta1)\n", + "print \"FAB=\",round(FAB),\"KN\",\"(Tension)\"\n", + " \n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=0\n", + "print \"FBC=\",round(FBC) \n", + "FBA=FAB\n", + "FBD=FBA\n", + "print \"FBD=FBA\",round(FBD),\"KN\",\"(Tension)\"\n", + " \n", + "#Joint C: Sum of Forces normal to AC = 0, gives FCD =0 since FBC = 0 ,sum of Forces parallel to CE =0 \n", + "\n", + "FCA=FAC\n", + "FCE=FCA\n", + "print \"FCE=FCA\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=0\n", + "print \"FDE=\",round(FDE) \n", + "\n", + "FDB=FBD\n", + "FDF=FDB\n", + "\n", + "print \"FDF=FDB\",round(FDF),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint E: sum of Forces normal to CG = 0, gives FEF = 0 and sum of Forces in the direction of CG = 0, gives \n", + "\n", + "FEF=0\n", + "\n", + "print \"FEF=\",FEF\n", + "\n", + "FEG=FCE\n", + "\n", + "print \"FEG=FCE=\", round(FEG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint F:\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=PF\n", + "\n", + "print \"FFG=\",round(FFG),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.7 page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FGF= 23.094 KN (Tension)\n", + "FGE= 11.547 KN (Comp.)\n", + "FFG= 23.094 KN (Comp.)\n", + "FFD= 13.094 KN (Tension)\n", + "FAB= 36.7543 KN (Comp.)\n", + "FAC= 8.3771 KN (Tension)\n", + "FBC= 9.4338 KN (Comp.)\n", + "FBD= 13.6603 KN (Comp.)\n", + "FCD= 9.4338 KN (Tension)\n", + "FCE= 1.0566 KN (Comp.)\n", + "FDE= 44.0748 KN (Comp.)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Since all members are 3 m long, all triangles are equilateral and hence all inclined members are at 60° to horizontal. Joint-by-joint analysis is carried out . Then nature of the force is determined. \n", + "\n", + "#variable declaration\n", + "\n", + "AB=3.0\n", + "BC=AB\n", + "AC=AB\n", + "BD=BC\n", + "CD=BD\n", + "CE=CD\n", + "DE=CE\n", + "EF=DE\n", + "DF=DE\n", + "EG=DE\n", + "FG=DF\n", + "\n", + "theta=60.0*pi/180 #angles BAC,BCA,DCE,DEC,FEG,FGE,°\n", + "\n", + "PB=40.0 #Vertical Loading at point B,KN\n", + "PD=30.0 #Vertical Loading at point D,KN\n", + "HF=10.0 #Horizontal Loading at point F,KN\n", + "PG=20.0 #Vertical Loading at point G,KN\n", + "\n", + "#joint G\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGF=PG/sin(theta)\n", + "\n", + "print \"FGF=\",round(FGF,4),\"KN\",\"(Tension)\"\n", + "\n", + "FGE=FGF*cos(theta)\n", + "\n", + "print \"FGE=\",round(FGE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint F\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=FGF\n", + "\n", + "print \"FFG=\",round(FFG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FFE=FGF\n", + "FFD=FGF*cos(theta)+FFE*cos(theta)-HF\n", + "print \"FFD=\",round(FFD,4),\"KN\",\"(Tension)\"\n", + "\n", + "#Now, without finding reaction we cannot proceed. Hence, consider equilibrium of the entire truss\n", + "#moment about point A\n", + "\n", + "RE=((PB*AC/2)-(HF*EF*sin(theta))+(PD*(AC+CE/2))+(PG*(AC+CE+EG)))/(AC+CE)\n", + "\n", + "VA=PB+PD+PG-RE\n", + "\n", + "HA=HF\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAB=VA/sin(theta)\n", + "\n", + "print \"FAB=\",round(FAB,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FAC=FAB*cos(theta)-HF\n", + "\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Tension)\"\n", + "\n", + "\n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=(PB-FAB*sin(theta))/sin(theta)\n", + "\n", + "print \"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FBA=FAB\n", + "FBD=-FBC*cos(theta)+FBA*cos(theta)\n", + "\n", + "print \"FBD=\",round(FBD,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint C\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FCD=FBC*sin(theta)/sin(theta)\n", + "\n", + "print \"FCD=\",round(FCD,4),\"KN\",\"(Tension)\"\n", + "\n", + "FCE=FCD*cos(theta)+FBC*cos(theta)-FAC\n", + "\n", + "print \"FCE=\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=(PD+FCD*sin(theta))/sin(theta)\n", + "\n", + "print \"FDE=\",round(FDE,4),\"KN\",\"(Comp.)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.8 page number82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FFH= 69.282 KN (Comp.)\n", + "FGH= 5.7735 KN (Comp.)\n", + "FGI= 72.1688 KN (Tensile)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Each load is 10 kN and all triangles are equilateral with sides 4 m.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=10.0\n", + "PD=PB\n", + "PF=PD\n", + "AB=4.0\n", + "BC=AB\n", + "AC=BC\n", + "BD=BC\n", + "CD=BC\n", + "DE=CD\n", + "CE=CD\n", + "DF=DE\n", + "EF=DE\n", + "EG=DE\n", + "FG=EF\n", + "#Take section (A)–(A), which cuts the members FH, GH and GI and separates the truss into two parts. \n", + "AG=AC+CE+EG\n", + "BG=CE+EG+AC/2\n", + "DG=EG+CE/2\n", + "FG1=EG/2\n", + "RA=PB*7/2\n", + "RO=RA\n", + "theta=60.0*pi/180\n", + "#moment at point G\n", + "FFH=(RA*AG-PB*BG-PD*DG-PF*FG1)/(FG*sin(theta))\n", + "print \"FFH=\",round(FFH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGH=(RA-PB-PD-PF)/(sin(theta))\n", + "print \"FGH=\",round(FGH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FGI=FFH+FGH*cos(theta)\n", + "print \"FGI=\",round(FGI,4),\"KN\",\"(Tensile)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.9 page number 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL3L4= 412.5 KN (Tension)\n", + "FU4U3= 456.2 KN (Comp.)\n", + "FU4L3= 62.5 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import asin,acos,sin,cos,sqrt\n", + "\n", + "#To determine reactions, consider equilibrium equations\n", + "\n", + "#variable declaration\n", + " #all Vertical loading are in KN\n", + "PL1=200.0 \n", + "PL2=200.0\n", + "PL3=150.0\n", + "PL4=100.0\n", + "PL5=100.0\n", + "\n", + "#length in m\n", + "UL1=6.0\n", + "UL2=8.0\n", + "UL3=9.0\n", + "UL4=UL2\n", + "UL5=UL1\n", + "\n", + "L1=6.0\n", + "L2=6.0\n", + "L3=6.0\n", + "L4=6.0\n", + "L5=6.0\n", + "L6=6.0\n", + "\n", + "#moment at point LO\n", + "\n", + "R2=(PL1*L1+PL2*(L1+L2)+PL3*(L1+L2+L3)+PL4*(L1+L2+L3+L4)+PL5*(L1+L2+L3+L4+L5))/(L1+L2+L3+L4+L5+L6)\n", + "\n", + "R1=PL1+PL2+PL3+PL4+PL5-R2\n", + "\n", + "#Take the section (1)–(1) and consider the right hand side part.\n", + "\n", + "U3U4=sqrt(pow(1,2)+pow(UL1,2))\n", + "theta1=asin(1/U3U4)\n", + "\n", + "L3U4=sqrt(pow(UL1,2)+pow(UL2,2))\n", + "theta2=asin(6/L3U4)\n", + "\n", + "#moment at U4\n", + "\n", + "FL3L4=(R2*(L5+L6)-PL4*L4)/UL4\n", + "\n", + "print \"FL3L4=\", round(FL3L4,1),\"KN\",\"(Tension)\"\n", + "\n", + "#moment at L3\n", + "FU4U3=(-PL4*L4-PL5*(L4+L5)+R2*(L4+L5+L6))/(cos(theta1)*UL3)\n", + "print \"FU4U3=\", round(FU4U3,1),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of horizontal forces \n", + "FL4L3=FL3L4\n", + "FU4L3=(-FL4L3+FU4U3*cos(theta1))/sin(theta2)\n", + "print \"FU4L3=\", round(FU4L3,1),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.10 page number84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 60.0 °\n", + "F2= 51.9615 KN (Tension)\n", + "F1= 110.0 KN (Comp.)\n", + "F3= 69.282 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan,tan,sin,cos,pi\n", + "\n", + "#Each load is 20 kN.\n", + "\n", + "#variable declaration\n", + "\n", + "P=20.0\n", + "AB=18.0\n", + "A=3.0\n", + "\n", + "RA=P*7/2\n", + "RB=RA\n", + "\n", + "theta1=30.0*pi/180\n", + "a=(3*A)/(4*cos(theta1))\n", + "#Take Section (A)–(A) and consider the equilibrium of left hand side part of the French Truss\n", + "#Drop perpendicular CE on AB. \n", + "\n", + "CE=3*A*tan(theta1)\n", + "DE=A\n", + "\n", + "theta=atan(CE/DE)*180/pi\n", + "print \"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at point A\n", + "\n", + "F2=(P*a*cos(theta1)*6)/(A*2*sin(theta*pi/180))\n", + "print \"F2=\",round(F2,4),\"KN\",\"(Tension)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "F1=(F2*sin(theta*pi/180)+RA-P*3)/(sin(theta1))\n", + "print \"F1=\",round(F1,4),\"KN\",\"(Comp.)\"\n", + "\n", + "F3=F1*cos(theta1)-F2*cos(theta*pi/180)\n", + "print \"F3=\",round(F3,4),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.11 page number 85" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAE= 30.0 KN (Tension)\n", + "FBC= 71.4 KN (Comp.)\n", + "FFC= 40.98 KN (Tension)\n", + "FAB= 92.62 KN (Comp.)\n", + "FAF= 40.98 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=15.0 #vertical loading at point A,KN\n", + "PB=30.0 #vertical loading at point B,KN\n", + "PC=30.0 #vertical loading at point C,KN\n", + "PD=30.0 #vertical loading at point D,KN\n", + "PE=15.0 #vertical loading at point E,KN\n", + "\n", + "#Due to symmetry, the reactions are equal\n", + "RA=(PA+PB+PC+PD+PE)/2\n", + "RB=RA\n", + "#Drop perpendicular CH on AF. \n", + "#in traingle ACH\n", + "\n", + "angleACH=45.0*pi/180 #angleACH,°\n", + "angleFCV=30.0*pi/180 # FC is inclined at 30° to vertical i.e., 60° to horizontal and CH = 5 m \n", + "CH=5.0\n", + "angleFCH=60.0*pi/180\n", + "\n", + "#It is not possible to find a joint where there are only two unknowns. Hence, consider section (1)–(1). \n", + "#For left hand side part of the frame\n", + "#moment at C\n", + "\n", + "FAE=(RA*CH-PA*CH-PB*CH/2)/(CH)\n", + "print \"FAE=\",round(FAE),\"KN\",\"(Tension)\"\n", + "\n", + "#Assuming the directions for FFC and FBC \n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "#FFC=FBC*sqrt(2)-RA\n", + "\n", + "FBC=(RA*sin(angleFCH)-PA)/(sqrt(2)*sin(angleFCH)-(1/sqrt(2)))\n", + "print \"FBC=\",round(FBC,2),\"KN\",\"(Comp.)\"\n", + "\n", + "FFC=FBC*sqrt(2)-RA\n", + "print \"FFC=\",round(FFC,2),\"KN\",\"(Tension)\"\n", + "\n", + "#Assumed directions of FBC and FFC are correct. Therefore, FBC is in compression and FFC is in tension. Now we can proceed with method of joints to find the forces in other members. Since it is a symmetric truss, analysis of half the truss is sufficient. Other values may be written down by making use of symmetrry.\n", + "\n", + "#Joint B: sum of forces normal to AC = 0, gives \n", + "\n", + "FBF=PC*cos(angleACH)\n", + "\n", + "#sum of forces parallel to AC = 0, gives \n", + "\n", + "FAB=FBC+PC*sin(angleACH)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "\n", + "#JOINT A\n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "FAF=(FAB*sin(angleACH)+PA-RA)/sin(angleFCV)\n", + "\n", + "print \"FAF=\",round(FAF,2),\"KN\",\"(Tension)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_VkfH2oR.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_VkfH2oR.ipynb new file mode 100644 index 00000000..09420950 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_VkfH2oR.ipynb @@ -0,0 +1,1030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3-TRUSSES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.1 Page number68" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 45.0 °\n", + "FCB= 56.57 KN\n", + "FCD= 40.0 KN\n", + "FDB= 40.0 KN\n", + "FDE= 40.0 KN\n", + "FBE= 113.14 KN\n", + "FBA= 120.0 KN\n", + "Member , Magnitude of Force in KN , Nature\n", + "AB , 120.0 , Tension\n", + "BC , 56.57 , Tension\n", + "CD , 40.0 , Compresion\n", + "DE , 40.0 , Compresion\n", + "BE , 113.14 , Compresion\n", + "BD , 40.0 , Tension\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "#Determine the inclinations of all inclined members\n", + "\n", + "theta=atan(1)*180/pi\n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "#Now at joints C, there are only two unknowns,forces in members CB and CD, say FCB and FCD.\n", + "#Now there are two equations of equilibrium for the forces meeting at the joint and two unknown forces. Hence, the unknown forces can be determined. At joint C sum V= 0 condition shows that the force FCB should act away from the joint C so that its vertical component balances the vertical downward load at C.\n", + " \n", + "P=40.0\n", + "FCB=P/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\"\n", + "\n", + "#Now sum H=0 indicates that FCD should act towards C.\n", + "\n", + "FCD=FCB*cos(theta*pi/180)\n", + "\n", + "print \"FCD=\",round(FCD,2),\"KN\"\n", + "\n", + "#In the present case, near the joint C, the arrows are marked on the members CB and CD to indicate forces FCB and FCD directions as found in the analysis of joint C. Then reversed directions are marked in the members CB and CD near joints B and D, respectively.\n", + "\n", + "FDB=40.0\n", + "FDE=40.0\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\"\n", + "\n", + "print \"FDE=\",round(FDE,2),\"KN\"\n", + "\n", + "#In the present case, after marking the forces in the members DB and DE, we find that analysis of joint B can be taken up.\n", + "\n", + "FBE=(FCB*sin(theta*pi/180)+P)/(sin(theta*pi/180))\n", + "\n", + "FBA=FCB*cos(theta*pi/180)+FBE*cos(theta*pi/180)\n", + "\n", + "print \"FBE=\", round(FBE,2),\"KN\"\n", + "print \"FBA=\", round(FBA,2),\"KN\"\n", + "#Determine the nature of forces in each member and tabulate the results. Note that if the arrow marks on a member are towards each other, then the member is in tension and if the arrow marks are away from each other, the member is in compression.\n", + "\n", + "print \"Member\",\",\",\"Magnitude of Force in KN\",\",\",\"Nature\"\n", + "print \"AB\",\",\", round(FBA,2) ,\",\",\"Tension\"\n", + "print \"BC\",\",\", round(FCB,2) ,\",\",\"Tension\"\n", + "print \"CD\",\",\", round(FCD,2) ,\",\",\"Compresion\"\n", + "print \"DE\",\",\", round(FDE,2) ,\",\",\"Compresion\"\n", + "print \"BE\",\",\", round(FBE,2) ,\",\",\"Compresion\"\n", + "print \"BD\",\",\", round(P,2) ,\",\",\"Tension\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.2 Page number70" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 83.7158 KN (Comp.)\n", + "FAE= 41.8579 KN (Tension)\n", + "FDC= 89.4893 KN (Comp.)\n", + "FDE= 44.7446 KN (Tension)\n", + "FBC= 60.6218 KN (Comp.)\n", + "FCE= 31.7543 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=40.0\n", + "PC=50.0\n", + "PE=60.0\n", + "\n", + "theta=60.0\n", + "\n", + "RD=(PC*3+PE*2+PB*1)/(4.0)\n", + "\n", + "RA=PB+PC+PE-RD\n", + "\n", + "FAB=RA/sin(theta*pi/180)\n", + "\n", + "print\"FAB=\",round(FAB,4),\"KN\" ,\"(Comp.)\"\n", + "\n", + "FAE=FAB*cos(theta*pi/180)\n", + "\n", + "print\"FAE=\",round(FAE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FDC=RD/sin(theta*pi/180)\n", + "\n", + "print\"FDC=\",round(FDC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FDE=FDC*cos(theta*pi/180)\n", + "\n", + "print\"FDE=\",round(FDE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBE=(FAB*sin(theta*pi/180)-PB)/sin(theta*pi/180)\n", + "\n", + "FBC=(FAB+FBE)*(0.5)\n", + "print\"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "FCE=(FDC*sin(theta*pi/180)-PC)/(sin(theta*pi/180))\n", + "print\"FCE=\",round(FCE,4),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.3 Page number72" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 23.09 KN [Comp.]\n", + "FAC= 11.55 KN [Tensile]\n", + "FDB= 20.0 KN [Comp.]\n", + "FDC= 17.32 KN [Tensile]\n", + "FCB= 11.55 KN FCB= 11.55 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #Load at point B,KN\n", + "PC=10.0 #Load at point C,KN \n", + "thetaA=60.0 #angleBAC\n", + "thetaD=30.0 #angleBDC\n", + "\n", + "AC=3.0 #length,m\n", + "CD=3.0 #length,m\n", + "\n", + "AB=(AC+CD)*cos(thetaA*pi/180)\n", + "BD=(AC+CD)*cos(thetaD*pi/180)\n", + "#mistake in book\n", + "#angleBCA=angleABC=theta\n", + "\n", + "theta=(180.0-thetaA)/(2.0) \n", + "\n", + "#Taking moment about A, we get\n", + "\n", + "RD=(PC*AC+PB*AC*cos(thetaA*pi/180))/(AC+CD)\n", + "\n", + "RA=PC+PB-RD\n", + "#Joint A\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FAB=RA/sin(thetaA*pi/180)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"[Comp.]\"\n", + "FAC=FAB*cos(thetaA*pi/180)\n", + "print \"FAC=\",round(FAC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint D\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FDB=RD/sin(thetaD*pi/180)\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\",\"[Comp.]\"\n", + "FDC=FDB*cos(thetaD*pi/180)\n", + "print \"FDC=\",round(FDC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint C\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FCB=PC/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\",\n", + "\n", + "#CHECK\n", + "\n", + "FCB=(FDC-FAC)/cos(theta*pi/180)\n", + "print \"FCB=\",round(FCB,2),\"KN\",\"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.4 Page number74\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FBF= 42.4264 KN (Tension)\n", + "FBC= 30.0 KN (Comp.)\n", + "FCF= 50.0 KN (Comp.)\n", + "FCD= 30.0 KN (Comp.)\n", + "FDF= 70.7107 KN (Tensile)\n", + "FDF= 70.7107 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #vertical load at point B,KN\n", + "PC=50.0 #vertical load at point C,KN \n", + "PDv=40.0 #vertical load at point D,KN\n", + "PDh=20.0 #Horizontal load at point D,KN\n", + "PF=30.0 #vertical load at point F,KN\n", + "HA=PDh\n", + "\n", + "RE=(PC*4+PDv*8+PDh*4+PF*4)/(8.0)\n", + "\n", + "VA=PB+PC+PDv+PF-RE\n", + "\n", + "#joint A\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FAB=VA\n", + "FAF=HA\n", + "\n", + "#joint E\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FED=RE\n", + "FEF=0\n", + "\n", + "#Joint B: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FBF=(VA-PB)/sin(theta*pi/180)\n", + "\n", + "print\"FBF=\",round(FBF,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBC=FBF*cos(theta*pi/180)\n", + "\n", + "print\"FBC=\",round(FBC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint C: \n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "\n", + "FCF=PC\n", + "\n", + "print\"FCF=\",round(FCF,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FCD=FBC\n", + "\n", + "print\"FCD=\",round(FCD,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint D: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FDF=(RE-PDv)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"(Tensile)\"\n", + "\n", + "#check\n", + "\n", + "FDF=(FCD+PDh)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.5 Page number75" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FED= 25.0 KN (Tension)\n", + "FEF= 15.0 KN (Comp.)\n", + "FAB= 20.0 KN (Comp.)\n", + "FAF= 15.0 KN (Comp.)\n", + "FCB= 25.0 KN (Comp.)\n", + "FCD= 20.0 KN (Tension)\n", + "FBF= 0.0\n", + "FBD= 15.0 KN (Tension)\n", + "FFD= 0.0\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,sin,cos\n", + "\n", + "#All inclined members have the same inclination to horizontal. Now, length of an inclined member is BF\n", + "\n", + "#variable declaration\n", + "\n", + "PE=20.0\n", + "AF=3.0\n", + "FE=3.0\n", + "AB=4.0\n", + "FD=4.0\n", + "BD=3.0\n", + "CD=4.0\n", + "\n", + "BF=sqrt(pow(AF,2)+pow(AB,2))\n", + "DE=BF\n", + "BC=DE\n", + "\n", + "#sin(theta)=AB/BF\n", + "#cos(theta)=AF/BF\n", + "\n", + "theta=asin(AB/BF)\n", + "#As soon as a joint is analysed the forces on the joint are marked on members \n", + "\n", + "#Joint E\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "FED=PE/sin(theta)\n", + "print\"FED=\",round(FED),\"KN\",\"(Tension)\"\n", + "\n", + "FEF=FED*cos(theta)\n", + "print\"FEF=\",round(FEF),\"KN\",\"(Comp.)\"\n", + "\n", + "#At this stage as no other joint is having only two unknowns, no further progress is possible. Let us find the reactions at the supports considering the whole structure. Let the reaction be RC HORIZONTAL at point C,VA,HA at point A Vertically & Horizontally respectively.\n", + "#Taking moment at point A,\n", + "\n", + "RC=PE*6/8 \n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "VA=PE\n", + "HA=RC\n", + "\n", + "#Joint A\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FAB=VA\n", + "print\"FAB=\",round(FAB),\"KN\",\"(Comp.)\"\n", + "\n", + "FAF=HA\n", + "print\"FAF=\",round(FAF),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint C\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FCB=RC/cos(theta)\n", + "print\"FCB=\",round(FCB),\"KN\",\"(Comp.)\"\n", + "\n", + "FCD=FCB*sin(theta)\n", + "print\"FCD=\",round(FCD),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint B\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FBF=(FCB*sin(theta)-FAB)/sin(theta)\n", + "\n", + "print\"FBF=\",round(FBF)\n", + "\n", + "FBD=FCB*cos(theta)\n", + "print\"FBD=\",round(FBD),\"KN\",\"(Tension)\"\n", + "\n", + "#joint F\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FFD=FBF\n", + "print\"FFD=\",round(FFD)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 3.6 page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FHG= 25.0 KN (Comp.)\n", + "FHF= 15.0 KN (Tension)\n", + "FAC= 18.0278 KN (Comp.)\n", + "FAB= 15.0 KN (Tension)\n", + "FBC= 0.0\n", + "FBD=FBA 15.0 KN (Tension)\n", + "FCE=FCA 18.0278 KN (Comp.)\n", + "FDE= 0.0\n", + "FDF=FDB 15.0 KN (Tension)\n", + "FEF= 0\n", + "FEG=FCE= 18.0278 KN (Comp.)\n", + "FFG= 12.0 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan, cos , sin, pi\n", + "\n", + "#variable declaration\n", + "\n", + "AB=2.0 #length of beam AB,m\n", + "BD=2.0 #length of beam BD,m\n", + "DF=2.0 #length of beam DF,m\n", + "FH=3.0 #length of beam FH,m\n", + "FG=4.0 #length of beam FG,m\n", + "PF=12.0 #Vertical Load at point F,KN\n", + "PH=20.0 #Vertical Load at point H,KN\n", + "\n", + "#mistake in book FG=4.0 , given FG=2.0 \n", + "\n", + "theta1=atan(FG/(AB+BD+DF))\n", + "theta3=atan(FG/FH)\n", + "theta2=theta3\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "#joint H\n", + "\n", + "FHG=PH/sin(theta3)\n", + "print \"FHG=\",round(FHG),\"KN\",\"(Comp.)\" \n", + "\n", + "FHF=FHG*cos(theta2)\n", + "print \"FHF=\",round(FHF),\"KN\",\"(Tension)\"\n", + "\n", + "#taking moment at G\n", + "\n", + "RA=PH*FH/(AB+BD+DF)\n", + "\n", + "RG=RA+PF+PH\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAC=RA/sin(theta1)\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Comp.)\" \n", + "\n", + "FAB=FAC*cos(theta1)\n", + "print \"FAB=\",round(FAB),\"KN\",\"(Tension)\"\n", + " \n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=0\n", + "print \"FBC=\",round(FBC) \n", + "FBA=FAB\n", + "FBD=FBA\n", + "print \"FBD=FBA\",round(FBD),\"KN\",\"(Tension)\"\n", + " \n", + "#Joint C: Sum of Forces normal to AC = 0, gives FCD =0 since FBC = 0 ,sum of Forces parallel to CE =0 \n", + "\n", + "FCA=FAC\n", + "FCE=FCA\n", + "print \"FCE=FCA\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=0\n", + "print \"FDE=\",round(FDE) \n", + "\n", + "FDB=FBD\n", + "FDF=FDB\n", + "\n", + "print \"FDF=FDB\",round(FDF),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint E: sum of Forces normal to CG = 0, gives FEF = 0 and sum of Forces in the direction of CG = 0, gives \n", + "\n", + "FEF=0\n", + "\n", + "print \"FEF=\",FEF\n", + "\n", + "FEG=FCE\n", + "\n", + "print \"FEG=FCE=\", round(FEG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint F:\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=PF\n", + "\n", + "print \"FFG=\",round(FFG),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.7 page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FGF= 23.094 KN (Tension)\n", + "FGE= 11.547 KN (Comp.)\n", + "FFG= 23.094 KN (Comp.)\n", + "FFD= 13.094 KN (Tension)\n", + "FAB= 36.7543 KN (Comp.)\n", + "FAC= 8.3771 KN (Tension)\n", + "FBC= 9.4338 KN (Comp.)\n", + "FBD= 13.6603 KN (Comp.)\n", + "FCD= 9.4338 KN (Tension)\n", + "FCE= 1.0566 KN (Comp.)\n", + "FDE= 44.0748 KN (Comp.)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Since all members are 3 m long, all triangles are equilateral and hence all inclined members are at 60° to horizontal. Joint-by-joint analysis is carried out . Then nature of the force is determined. \n", + "\n", + "#variable declaration\n", + "\n", + "AB=3.0\n", + "BC=AB\n", + "AC=AB\n", + "BD=BC\n", + "CD=BD\n", + "CE=CD\n", + "DE=CE\n", + "EF=DE\n", + "DF=DE\n", + "EG=DE\n", + "FG=DF\n", + "\n", + "theta=60.0*pi/180 #angles BAC,BCA,DCE,DEC,FEG,FGE,°\n", + "\n", + "PB=40.0 #Vertical Loading at point B,KN\n", + "PD=30.0 #Vertical Loading at point D,KN\n", + "HF=10.0 #Horizontal Loading at point F,KN\n", + "PG=20.0 #Vertical Loading at point G,KN\n", + "\n", + "#joint G\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGF=PG/sin(theta)\n", + "\n", + "print \"FGF=\",round(FGF,4),\"KN\",\"(Tension)\"\n", + "\n", + "FGE=FGF*cos(theta)\n", + "\n", + "print \"FGE=\",round(FGE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint F\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=FGF\n", + "\n", + "print \"FFG=\",round(FFG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FFE=FGF\n", + "FFD=FGF*cos(theta)+FFE*cos(theta)-HF\n", + "print \"FFD=\",round(FFD,4),\"KN\",\"(Tension)\"\n", + "\n", + "#Now, without finding reaction we cannot proceed. Hence, consider equilibrium of the entire truss\n", + "#moment about point A\n", + "\n", + "RE=((PB*AC/2)-(HF*EF*sin(theta))+(PD*(AC+CE/2))+(PG*(AC+CE+EG)))/(AC+CE)\n", + "\n", + "VA=PB+PD+PG-RE\n", + "\n", + "HA=HF\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAB=VA/sin(theta)\n", + "\n", + "print \"FAB=\",round(FAB,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FAC=FAB*cos(theta)-HF\n", + "\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Tension)\"\n", + "\n", + "\n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=(PB-FAB*sin(theta))/sin(theta)\n", + "\n", + "print \"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FBA=FAB\n", + "FBD=-FBC*cos(theta)+FBA*cos(theta)\n", + "\n", + "print \"FBD=\",round(FBD,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint C\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FCD=FBC*sin(theta)/sin(theta)\n", + "\n", + "print \"FCD=\",round(FCD,4),\"KN\",\"(Tension)\"\n", + "\n", + "FCE=FCD*cos(theta)+FBC*cos(theta)-FAC\n", + "\n", + "print \"FCE=\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=(PD+FCD*sin(theta))/sin(theta)\n", + "\n", + "print \"FDE=\",round(FDE,4),\"KN\",\"(Comp.)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.8 page number82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FFH= 69.282 KN (Comp.)\n", + "FGH= 5.7735 KN (Comp.)\n", + "FGI= 72.1688 KN (Tensile)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Each load is 10 kN and all triangles are equilateral with sides 4 m.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=10.0\n", + "PD=PB\n", + "PF=PD\n", + "AB=4.0\n", + "BC=AB\n", + "AC=BC\n", + "BD=BC\n", + "CD=BC\n", + "DE=CD\n", + "CE=CD\n", + "DF=DE\n", + "EF=DE\n", + "EG=DE\n", + "FG=EF\n", + "#Take section (A)–(A), which cuts the members FH, GH and GI and separates the truss into two parts. \n", + "AG=AC+CE+EG\n", + "BG=CE+EG+AC/2\n", + "DG=EG+CE/2\n", + "FG1=EG/2\n", + "RA=PB*7/2\n", + "RO=RA\n", + "theta=60.0*pi/180\n", + "#moment at point G\n", + "FFH=(RA*AG-PB*BG-PD*DG-PF*FG1)/(FG*sin(theta))\n", + "print \"FFH=\",round(FFH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGH=(RA-PB-PD-PF)/(sin(theta))\n", + "print \"FGH=\",round(FGH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FGI=FFH+FGH*cos(theta)\n", + "print \"FGI=\",round(FGI,4),\"KN\",\"(Tensile)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.9 page number 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL3L4= 412.5 KN (Tension)\n", + "FU4U3= 456.2 KN (Comp.)\n", + "FU4L3= 62.5 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import asin,acos,sin,cos,sqrt\n", + "\n", + "#To determine reactions, consider equilibrium equations\n", + "\n", + "#variable declaration\n", + " #all Vertical loading are in KN\n", + "PL1=200.0 \n", + "PL2=200.0\n", + "PL3=150.0\n", + "PL4=100.0\n", + "PL5=100.0\n", + "\n", + "#length in m\n", + "UL1=6.0\n", + "UL2=8.0\n", + "UL3=9.0\n", + "UL4=UL2\n", + "UL5=UL1\n", + "\n", + "L1=6.0\n", + "L2=6.0\n", + "L3=6.0\n", + "L4=6.0\n", + "L5=6.0\n", + "L6=6.0\n", + "\n", + "#moment at point LO\n", + "\n", + "R2=(PL1*L1+PL2*(L1+L2)+PL3*(L1+L2+L3)+PL4*(L1+L2+L3+L4)+PL5*(L1+L2+L3+L4+L5))/(L1+L2+L3+L4+L5+L6)\n", + "\n", + "R1=PL1+PL2+PL3+PL4+PL5-R2\n", + "\n", + "#Take the section (1)–(1) and consider the right hand side part.\n", + "\n", + "U3U4=sqrt(pow(1,2)+pow(UL1,2))\n", + "theta1=asin(1/U3U4)\n", + "\n", + "L3U4=sqrt(pow(UL1,2)+pow(UL2,2))\n", + "theta2=asin(6/L3U4)\n", + "\n", + "#moment at U4\n", + "\n", + "FL3L4=(R2*(L5+L6)-PL4*L4)/UL4\n", + "\n", + "print \"FL3L4=\", round(FL3L4,1),\"KN\",\"(Tension)\"\n", + "\n", + "#moment at L3\n", + "FU4U3=(-PL4*L4-PL5*(L4+L5)+R2*(L4+L5+L6))/(cos(theta1)*UL3)\n", + "print \"FU4U3=\", round(FU4U3,1),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of horizontal forces \n", + "FL4L3=FL3L4\n", + "FU4L3=(-FL4L3+FU4U3*cos(theta1))/sin(theta2)\n", + "print \"FU4L3=\", round(FU4L3,1),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.10 page number84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 60.0 °\n", + "F2= 51.9615 KN (Tension)\n", + "F1= 110.0 KN (Comp.)\n", + "F3= 69.282 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan,tan,sin,cos,pi\n", + "\n", + "#Each load is 20 kN.\n", + "\n", + "#variable declaration\n", + "\n", + "P=20.0\n", + "AB=18.0\n", + "A=3.0\n", + "\n", + "RA=P*7/2\n", + "RB=RA\n", + "\n", + "theta1=30.0*pi/180\n", + "a=(3*A)/(4*cos(theta1))\n", + "#Take Section (A)–(A) and consider the equilibrium of left hand side part of the French Truss\n", + "#Drop perpendicular CE on AB. \n", + "\n", + "CE=3*A*tan(theta1)\n", + "DE=A\n", + "\n", + "theta=atan(CE/DE)*180/pi\n", + "print \"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at point A\n", + "\n", + "F2=(P*a*cos(theta1)*6)/(A*2*sin(theta*pi/180))\n", + "print \"F2=\",round(F2,4),\"KN\",\"(Tension)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "F1=(F2*sin(theta*pi/180)+RA-P*3)/(sin(theta1))\n", + "print \"F1=\",round(F1,4),\"KN\",\"(Comp.)\"\n", + "\n", + "F3=F1*cos(theta1)-F2*cos(theta*pi/180)\n", + "print \"F3=\",round(F3,4),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.11 page number 85" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAE= 30.0 KN (Tension)\n", + "FBC= 71.4 KN (Comp.)\n", + "FFC= 40.98 KN (Tension)\n", + "FAB= 92.62 KN (Comp.)\n", + "FAF= 40.98 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=15.0 #vertical loading at point A,KN\n", + "PB=30.0 #vertical loading at point B,KN\n", + "PC=30.0 #vertical loading at point C,KN\n", + "PD=30.0 #vertical loading at point D,KN\n", + "PE=15.0 #vertical loading at point E,KN\n", + "\n", + "#Due to symmetry, the reactions are equal\n", + "RA=(PA+PB+PC+PD+PE)/2\n", + "RB=RA\n", + "#Drop perpendicular CH on AF. \n", + "#in traingle ACH\n", + "\n", + "angleACH=45.0*pi/180 #angleACH,°\n", + "angleFCV=30.0*pi/180 # FC is inclined at 30° to vertical i.e., 60° to horizontal and CH = 5 m \n", + "CH=5.0\n", + "angleFCH=60.0*pi/180\n", + "\n", + "#It is not possible to find a joint where there are only two unknowns. Hence, consider section (1)–(1). \n", + "#For left hand side part of the frame\n", + "#moment at C\n", + "\n", + "FAE=(RA*CH-PA*CH-PB*CH/2)/(CH)\n", + "print \"FAE=\",round(FAE),\"KN\",\"(Tension)\"\n", + "\n", + "#Assuming the directions for FFC and FBC \n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "#FFC=FBC*sqrt(2)-RA\n", + "\n", + "FBC=(RA*sin(angleFCH)-PA)/(sqrt(2)*sin(angleFCH)-(1/sqrt(2)))\n", + "print \"FBC=\",round(FBC,2),\"KN\",\"(Comp.)\"\n", + "\n", + "FFC=FBC*sqrt(2)-RA\n", + "print \"FFC=\",round(FFC,2),\"KN\",\"(Tension)\"\n", + "\n", + "#Assumed directions of FBC and FFC are correct. Therefore, FBC is in compression and FFC is in tension. Now we can proceed with method of joints to find the forces in other members. Since it is a symmetric truss, analysis of half the truss is sufficient. Other values may be written down by making use of symmetrry.\n", + "\n", + "#Joint B: sum of forces normal to AC = 0, gives \n", + "\n", + "FBF=PC*cos(angleACH)\n", + "\n", + "#sum of forces parallel to AC = 0, gives \n", + "\n", + "FAB=FBC+PC*sin(angleACH)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "\n", + "#JOINT A\n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "FAF=(FAB*sin(angleACH)+PA-RA)/sin(angleFCV)\n", + "\n", + "print \"FAF=\",round(FAF,2),\"KN\",\"(Tension)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_dbMwF5t.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_dbMwF5t.ipynb new file mode 100644 index 00000000..09420950 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_dbMwF5t.ipynb @@ -0,0 +1,1030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3-TRUSSES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.1 Page number68" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 45.0 °\n", + "FCB= 56.57 KN\n", + "FCD= 40.0 KN\n", + "FDB= 40.0 KN\n", + "FDE= 40.0 KN\n", + "FBE= 113.14 KN\n", + "FBA= 120.0 KN\n", + "Member , Magnitude of Force in KN , Nature\n", + "AB , 120.0 , Tension\n", + "BC , 56.57 , Tension\n", + "CD , 40.0 , Compresion\n", + "DE , 40.0 , Compresion\n", + "BE , 113.14 , Compresion\n", + "BD , 40.0 , Tension\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "#Determine the inclinations of all inclined members\n", + "\n", + "theta=atan(1)*180/pi\n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "#Now at joints C, there are only two unknowns,forces in members CB and CD, say FCB and FCD.\n", + "#Now there are two equations of equilibrium for the forces meeting at the joint and two unknown forces. Hence, the unknown forces can be determined. At joint C sum V= 0 condition shows that the force FCB should act away from the joint C so that its vertical component balances the vertical downward load at C.\n", + " \n", + "P=40.0\n", + "FCB=P/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\"\n", + "\n", + "#Now sum H=0 indicates that FCD should act towards C.\n", + "\n", + "FCD=FCB*cos(theta*pi/180)\n", + "\n", + "print \"FCD=\",round(FCD,2),\"KN\"\n", + "\n", + "#In the present case, near the joint C, the arrows are marked on the members CB and CD to indicate forces FCB and FCD directions as found in the analysis of joint C. Then reversed directions are marked in the members CB and CD near joints B and D, respectively.\n", + "\n", + "FDB=40.0\n", + "FDE=40.0\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\"\n", + "\n", + "print \"FDE=\",round(FDE,2),\"KN\"\n", + "\n", + "#In the present case, after marking the forces in the members DB and DE, we find that analysis of joint B can be taken up.\n", + "\n", + "FBE=(FCB*sin(theta*pi/180)+P)/(sin(theta*pi/180))\n", + "\n", + "FBA=FCB*cos(theta*pi/180)+FBE*cos(theta*pi/180)\n", + "\n", + "print \"FBE=\", round(FBE,2),\"KN\"\n", + "print \"FBA=\", round(FBA,2),\"KN\"\n", + "#Determine the nature of forces in each member and tabulate the results. Note that if the arrow marks on a member are towards each other, then the member is in tension and if the arrow marks are away from each other, the member is in compression.\n", + "\n", + "print \"Member\",\",\",\"Magnitude of Force in KN\",\",\",\"Nature\"\n", + "print \"AB\",\",\", round(FBA,2) ,\",\",\"Tension\"\n", + "print \"BC\",\",\", round(FCB,2) ,\",\",\"Tension\"\n", + "print \"CD\",\",\", round(FCD,2) ,\",\",\"Compresion\"\n", + "print \"DE\",\",\", round(FDE,2) ,\",\",\"Compresion\"\n", + "print \"BE\",\",\", round(FBE,2) ,\",\",\"Compresion\"\n", + "print \"BD\",\",\", round(P,2) ,\",\",\"Tension\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.2 Page number70" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 83.7158 KN (Comp.)\n", + "FAE= 41.8579 KN (Tension)\n", + "FDC= 89.4893 KN (Comp.)\n", + "FDE= 44.7446 KN (Tension)\n", + "FBC= 60.6218 KN (Comp.)\n", + "FCE= 31.7543 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=40.0\n", + "PC=50.0\n", + "PE=60.0\n", + "\n", + "theta=60.0\n", + "\n", + "RD=(PC*3+PE*2+PB*1)/(4.0)\n", + "\n", + "RA=PB+PC+PE-RD\n", + "\n", + "FAB=RA/sin(theta*pi/180)\n", + "\n", + "print\"FAB=\",round(FAB,4),\"KN\" ,\"(Comp.)\"\n", + "\n", + "FAE=FAB*cos(theta*pi/180)\n", + "\n", + "print\"FAE=\",round(FAE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FDC=RD/sin(theta*pi/180)\n", + "\n", + "print\"FDC=\",round(FDC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FDE=FDC*cos(theta*pi/180)\n", + "\n", + "print\"FDE=\",round(FDE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBE=(FAB*sin(theta*pi/180)-PB)/sin(theta*pi/180)\n", + "\n", + "FBC=(FAB+FBE)*(0.5)\n", + "print\"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "FCE=(FDC*sin(theta*pi/180)-PC)/(sin(theta*pi/180))\n", + "print\"FCE=\",round(FCE,4),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.3 Page number72" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 23.09 KN [Comp.]\n", + "FAC= 11.55 KN [Tensile]\n", + "FDB= 20.0 KN [Comp.]\n", + "FDC= 17.32 KN [Tensile]\n", + "FCB= 11.55 KN FCB= 11.55 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #Load at point B,KN\n", + "PC=10.0 #Load at point C,KN \n", + "thetaA=60.0 #angleBAC\n", + "thetaD=30.0 #angleBDC\n", + "\n", + "AC=3.0 #length,m\n", + "CD=3.0 #length,m\n", + "\n", + "AB=(AC+CD)*cos(thetaA*pi/180)\n", + "BD=(AC+CD)*cos(thetaD*pi/180)\n", + "#mistake in book\n", + "#angleBCA=angleABC=theta\n", + "\n", + "theta=(180.0-thetaA)/(2.0) \n", + "\n", + "#Taking moment about A, we get\n", + "\n", + "RD=(PC*AC+PB*AC*cos(thetaA*pi/180))/(AC+CD)\n", + "\n", + "RA=PC+PB-RD\n", + "#Joint A\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FAB=RA/sin(thetaA*pi/180)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"[Comp.]\"\n", + "FAC=FAB*cos(thetaA*pi/180)\n", + "print \"FAC=\",round(FAC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint D\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FDB=RD/sin(thetaD*pi/180)\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\",\"[Comp.]\"\n", + "FDC=FDB*cos(thetaD*pi/180)\n", + "print \"FDC=\",round(FDC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint C\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FCB=PC/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\",\n", + "\n", + "#CHECK\n", + "\n", + "FCB=(FDC-FAC)/cos(theta*pi/180)\n", + "print \"FCB=\",round(FCB,2),\"KN\",\"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.4 Page number74\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FBF= 42.4264 KN (Tension)\n", + "FBC= 30.0 KN (Comp.)\n", + "FCF= 50.0 KN (Comp.)\n", + "FCD= 30.0 KN (Comp.)\n", + "FDF= 70.7107 KN (Tensile)\n", + "FDF= 70.7107 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #vertical load at point B,KN\n", + "PC=50.0 #vertical load at point C,KN \n", + "PDv=40.0 #vertical load at point D,KN\n", + "PDh=20.0 #Horizontal load at point D,KN\n", + "PF=30.0 #vertical load at point F,KN\n", + "HA=PDh\n", + "\n", + "RE=(PC*4+PDv*8+PDh*4+PF*4)/(8.0)\n", + "\n", + "VA=PB+PC+PDv+PF-RE\n", + "\n", + "#joint A\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FAB=VA\n", + "FAF=HA\n", + "\n", + "#joint E\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FED=RE\n", + "FEF=0\n", + "\n", + "#Joint B: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FBF=(VA-PB)/sin(theta*pi/180)\n", + "\n", + "print\"FBF=\",round(FBF,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBC=FBF*cos(theta*pi/180)\n", + "\n", + "print\"FBC=\",round(FBC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint C: \n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "\n", + "FCF=PC\n", + "\n", + "print\"FCF=\",round(FCF,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FCD=FBC\n", + "\n", + "print\"FCD=\",round(FCD,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint D: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FDF=(RE-PDv)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"(Tensile)\"\n", + "\n", + "#check\n", + "\n", + "FDF=(FCD+PDh)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.5 Page number75" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FED= 25.0 KN (Tension)\n", + "FEF= 15.0 KN (Comp.)\n", + "FAB= 20.0 KN (Comp.)\n", + "FAF= 15.0 KN (Comp.)\n", + "FCB= 25.0 KN (Comp.)\n", + "FCD= 20.0 KN (Tension)\n", + "FBF= 0.0\n", + "FBD= 15.0 KN (Tension)\n", + "FFD= 0.0\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,sin,cos\n", + "\n", + "#All inclined members have the same inclination to horizontal. Now, length of an inclined member is BF\n", + "\n", + "#variable declaration\n", + "\n", + "PE=20.0\n", + "AF=3.0\n", + "FE=3.0\n", + "AB=4.0\n", + "FD=4.0\n", + "BD=3.0\n", + "CD=4.0\n", + "\n", + "BF=sqrt(pow(AF,2)+pow(AB,2))\n", + "DE=BF\n", + "BC=DE\n", + "\n", + "#sin(theta)=AB/BF\n", + "#cos(theta)=AF/BF\n", + "\n", + "theta=asin(AB/BF)\n", + "#As soon as a joint is analysed the forces on the joint are marked on members \n", + "\n", + "#Joint E\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "FED=PE/sin(theta)\n", + "print\"FED=\",round(FED),\"KN\",\"(Tension)\"\n", + "\n", + "FEF=FED*cos(theta)\n", + "print\"FEF=\",round(FEF),\"KN\",\"(Comp.)\"\n", + "\n", + "#At this stage as no other joint is having only two unknowns, no further progress is possible. Let us find the reactions at the supports considering the whole structure. Let the reaction be RC HORIZONTAL at point C,VA,HA at point A Vertically & Horizontally respectively.\n", + "#Taking moment at point A,\n", + "\n", + "RC=PE*6/8 \n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "VA=PE\n", + "HA=RC\n", + "\n", + "#Joint A\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FAB=VA\n", + "print\"FAB=\",round(FAB),\"KN\",\"(Comp.)\"\n", + "\n", + "FAF=HA\n", + "print\"FAF=\",round(FAF),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint C\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FCB=RC/cos(theta)\n", + "print\"FCB=\",round(FCB),\"KN\",\"(Comp.)\"\n", + "\n", + "FCD=FCB*sin(theta)\n", + "print\"FCD=\",round(FCD),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint B\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FBF=(FCB*sin(theta)-FAB)/sin(theta)\n", + "\n", + "print\"FBF=\",round(FBF)\n", + "\n", + "FBD=FCB*cos(theta)\n", + "print\"FBD=\",round(FBD),\"KN\",\"(Tension)\"\n", + "\n", + "#joint F\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FFD=FBF\n", + "print\"FFD=\",round(FFD)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 3.6 page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FHG= 25.0 KN (Comp.)\n", + "FHF= 15.0 KN (Tension)\n", + "FAC= 18.0278 KN (Comp.)\n", + "FAB= 15.0 KN (Tension)\n", + "FBC= 0.0\n", + "FBD=FBA 15.0 KN (Tension)\n", + "FCE=FCA 18.0278 KN (Comp.)\n", + "FDE= 0.0\n", + "FDF=FDB 15.0 KN (Tension)\n", + "FEF= 0\n", + "FEG=FCE= 18.0278 KN (Comp.)\n", + "FFG= 12.0 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan, cos , sin, pi\n", + "\n", + "#variable declaration\n", + "\n", + "AB=2.0 #length of beam AB,m\n", + "BD=2.0 #length of beam BD,m\n", + "DF=2.0 #length of beam DF,m\n", + "FH=3.0 #length of beam FH,m\n", + "FG=4.0 #length of beam FG,m\n", + "PF=12.0 #Vertical Load at point F,KN\n", + "PH=20.0 #Vertical Load at point H,KN\n", + "\n", + "#mistake in book FG=4.0 , given FG=2.0 \n", + "\n", + "theta1=atan(FG/(AB+BD+DF))\n", + "theta3=atan(FG/FH)\n", + "theta2=theta3\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "#joint H\n", + "\n", + "FHG=PH/sin(theta3)\n", + "print \"FHG=\",round(FHG),\"KN\",\"(Comp.)\" \n", + "\n", + "FHF=FHG*cos(theta2)\n", + "print \"FHF=\",round(FHF),\"KN\",\"(Tension)\"\n", + "\n", + "#taking moment at G\n", + "\n", + "RA=PH*FH/(AB+BD+DF)\n", + "\n", + "RG=RA+PF+PH\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAC=RA/sin(theta1)\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Comp.)\" \n", + "\n", + "FAB=FAC*cos(theta1)\n", + "print \"FAB=\",round(FAB),\"KN\",\"(Tension)\"\n", + " \n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=0\n", + "print \"FBC=\",round(FBC) \n", + "FBA=FAB\n", + "FBD=FBA\n", + "print \"FBD=FBA\",round(FBD),\"KN\",\"(Tension)\"\n", + " \n", + "#Joint C: Sum of Forces normal to AC = 0, gives FCD =0 since FBC = 0 ,sum of Forces parallel to CE =0 \n", + "\n", + "FCA=FAC\n", + "FCE=FCA\n", + "print \"FCE=FCA\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=0\n", + "print \"FDE=\",round(FDE) \n", + "\n", + "FDB=FBD\n", + "FDF=FDB\n", + "\n", + "print \"FDF=FDB\",round(FDF),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint E: sum of Forces normal to CG = 0, gives FEF = 0 and sum of Forces in the direction of CG = 0, gives \n", + "\n", + "FEF=0\n", + "\n", + "print \"FEF=\",FEF\n", + "\n", + "FEG=FCE\n", + "\n", + "print \"FEG=FCE=\", round(FEG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint F:\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=PF\n", + "\n", + "print \"FFG=\",round(FFG),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.7 page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FGF= 23.094 KN (Tension)\n", + "FGE= 11.547 KN (Comp.)\n", + "FFG= 23.094 KN (Comp.)\n", + "FFD= 13.094 KN (Tension)\n", + "FAB= 36.7543 KN (Comp.)\n", + "FAC= 8.3771 KN (Tension)\n", + "FBC= 9.4338 KN (Comp.)\n", + "FBD= 13.6603 KN (Comp.)\n", + "FCD= 9.4338 KN (Tension)\n", + "FCE= 1.0566 KN (Comp.)\n", + "FDE= 44.0748 KN (Comp.)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Since all members are 3 m long, all triangles are equilateral and hence all inclined members are at 60° to horizontal. Joint-by-joint analysis is carried out . Then nature of the force is determined. \n", + "\n", + "#variable declaration\n", + "\n", + "AB=3.0\n", + "BC=AB\n", + "AC=AB\n", + "BD=BC\n", + "CD=BD\n", + "CE=CD\n", + "DE=CE\n", + "EF=DE\n", + "DF=DE\n", + "EG=DE\n", + "FG=DF\n", + "\n", + "theta=60.0*pi/180 #angles BAC,BCA,DCE,DEC,FEG,FGE,°\n", + "\n", + "PB=40.0 #Vertical Loading at point B,KN\n", + "PD=30.0 #Vertical Loading at point D,KN\n", + "HF=10.0 #Horizontal Loading at point F,KN\n", + "PG=20.0 #Vertical Loading at point G,KN\n", + "\n", + "#joint G\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGF=PG/sin(theta)\n", + "\n", + "print \"FGF=\",round(FGF,4),\"KN\",\"(Tension)\"\n", + "\n", + "FGE=FGF*cos(theta)\n", + "\n", + "print \"FGE=\",round(FGE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint F\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=FGF\n", + "\n", + "print \"FFG=\",round(FFG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FFE=FGF\n", + "FFD=FGF*cos(theta)+FFE*cos(theta)-HF\n", + "print \"FFD=\",round(FFD,4),\"KN\",\"(Tension)\"\n", + "\n", + "#Now, without finding reaction we cannot proceed. Hence, consider equilibrium of the entire truss\n", + "#moment about point A\n", + "\n", + "RE=((PB*AC/2)-(HF*EF*sin(theta))+(PD*(AC+CE/2))+(PG*(AC+CE+EG)))/(AC+CE)\n", + "\n", + "VA=PB+PD+PG-RE\n", + "\n", + "HA=HF\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAB=VA/sin(theta)\n", + "\n", + "print \"FAB=\",round(FAB,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FAC=FAB*cos(theta)-HF\n", + "\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Tension)\"\n", + "\n", + "\n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=(PB-FAB*sin(theta))/sin(theta)\n", + "\n", + "print \"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FBA=FAB\n", + "FBD=-FBC*cos(theta)+FBA*cos(theta)\n", + "\n", + "print \"FBD=\",round(FBD,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint C\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FCD=FBC*sin(theta)/sin(theta)\n", + "\n", + "print \"FCD=\",round(FCD,4),\"KN\",\"(Tension)\"\n", + "\n", + "FCE=FCD*cos(theta)+FBC*cos(theta)-FAC\n", + "\n", + "print \"FCE=\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=(PD+FCD*sin(theta))/sin(theta)\n", + "\n", + "print \"FDE=\",round(FDE,4),\"KN\",\"(Comp.)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.8 page number82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FFH= 69.282 KN (Comp.)\n", + "FGH= 5.7735 KN (Comp.)\n", + "FGI= 72.1688 KN (Tensile)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Each load is 10 kN and all triangles are equilateral with sides 4 m.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=10.0\n", + "PD=PB\n", + "PF=PD\n", + "AB=4.0\n", + "BC=AB\n", + "AC=BC\n", + "BD=BC\n", + "CD=BC\n", + "DE=CD\n", + "CE=CD\n", + "DF=DE\n", + "EF=DE\n", + "EG=DE\n", + "FG=EF\n", + "#Take section (A)–(A), which cuts the members FH, GH and GI and separates the truss into two parts. \n", + "AG=AC+CE+EG\n", + "BG=CE+EG+AC/2\n", + "DG=EG+CE/2\n", + "FG1=EG/2\n", + "RA=PB*7/2\n", + "RO=RA\n", + "theta=60.0*pi/180\n", + "#moment at point G\n", + "FFH=(RA*AG-PB*BG-PD*DG-PF*FG1)/(FG*sin(theta))\n", + "print \"FFH=\",round(FFH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGH=(RA-PB-PD-PF)/(sin(theta))\n", + "print \"FGH=\",round(FGH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FGI=FFH+FGH*cos(theta)\n", + "print \"FGI=\",round(FGI,4),\"KN\",\"(Tensile)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.9 page number 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL3L4= 412.5 KN (Tension)\n", + "FU4U3= 456.2 KN (Comp.)\n", + "FU4L3= 62.5 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import asin,acos,sin,cos,sqrt\n", + "\n", + "#To determine reactions, consider equilibrium equations\n", + "\n", + "#variable declaration\n", + " #all Vertical loading are in KN\n", + "PL1=200.0 \n", + "PL2=200.0\n", + "PL3=150.0\n", + "PL4=100.0\n", + "PL5=100.0\n", + "\n", + "#length in m\n", + "UL1=6.0\n", + "UL2=8.0\n", + "UL3=9.0\n", + "UL4=UL2\n", + "UL5=UL1\n", + "\n", + "L1=6.0\n", + "L2=6.0\n", + "L3=6.0\n", + "L4=6.0\n", + "L5=6.0\n", + "L6=6.0\n", + "\n", + "#moment at point LO\n", + "\n", + "R2=(PL1*L1+PL2*(L1+L2)+PL3*(L1+L2+L3)+PL4*(L1+L2+L3+L4)+PL5*(L1+L2+L3+L4+L5))/(L1+L2+L3+L4+L5+L6)\n", + "\n", + "R1=PL1+PL2+PL3+PL4+PL5-R2\n", + "\n", + "#Take the section (1)–(1) and consider the right hand side part.\n", + "\n", + "U3U4=sqrt(pow(1,2)+pow(UL1,2))\n", + "theta1=asin(1/U3U4)\n", + "\n", + "L3U4=sqrt(pow(UL1,2)+pow(UL2,2))\n", + "theta2=asin(6/L3U4)\n", + "\n", + "#moment at U4\n", + "\n", + "FL3L4=(R2*(L5+L6)-PL4*L4)/UL4\n", + "\n", + "print \"FL3L4=\", round(FL3L4,1),\"KN\",\"(Tension)\"\n", + "\n", + "#moment at L3\n", + "FU4U3=(-PL4*L4-PL5*(L4+L5)+R2*(L4+L5+L6))/(cos(theta1)*UL3)\n", + "print \"FU4U3=\", round(FU4U3,1),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of horizontal forces \n", + "FL4L3=FL3L4\n", + "FU4L3=(-FL4L3+FU4U3*cos(theta1))/sin(theta2)\n", + "print \"FU4L3=\", round(FU4L3,1),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.10 page number84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 60.0 °\n", + "F2= 51.9615 KN (Tension)\n", + "F1= 110.0 KN (Comp.)\n", + "F3= 69.282 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan,tan,sin,cos,pi\n", + "\n", + "#Each load is 20 kN.\n", + "\n", + "#variable declaration\n", + "\n", + "P=20.0\n", + "AB=18.0\n", + "A=3.0\n", + "\n", + "RA=P*7/2\n", + "RB=RA\n", + "\n", + "theta1=30.0*pi/180\n", + "a=(3*A)/(4*cos(theta1))\n", + "#Take Section (A)–(A) and consider the equilibrium of left hand side part of the French Truss\n", + "#Drop perpendicular CE on AB. \n", + "\n", + "CE=3*A*tan(theta1)\n", + "DE=A\n", + "\n", + "theta=atan(CE/DE)*180/pi\n", + "print \"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at point A\n", + "\n", + "F2=(P*a*cos(theta1)*6)/(A*2*sin(theta*pi/180))\n", + "print \"F2=\",round(F2,4),\"KN\",\"(Tension)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "F1=(F2*sin(theta*pi/180)+RA-P*3)/(sin(theta1))\n", + "print \"F1=\",round(F1,4),\"KN\",\"(Comp.)\"\n", + "\n", + "F3=F1*cos(theta1)-F2*cos(theta*pi/180)\n", + "print \"F3=\",round(F3,4),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.11 page number 85" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAE= 30.0 KN (Tension)\n", + "FBC= 71.4 KN (Comp.)\n", + "FFC= 40.98 KN (Tension)\n", + "FAB= 92.62 KN (Comp.)\n", + "FAF= 40.98 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=15.0 #vertical loading at point A,KN\n", + "PB=30.0 #vertical loading at point B,KN\n", + "PC=30.0 #vertical loading at point C,KN\n", + "PD=30.0 #vertical loading at point D,KN\n", + "PE=15.0 #vertical loading at point E,KN\n", + "\n", + "#Due to symmetry, the reactions are equal\n", + "RA=(PA+PB+PC+PD+PE)/2\n", + "RB=RA\n", + "#Drop perpendicular CH on AF. \n", + "#in traingle ACH\n", + "\n", + "angleACH=45.0*pi/180 #angleACH,°\n", + "angleFCV=30.0*pi/180 # FC is inclined at 30° to vertical i.e., 60° to horizontal and CH = 5 m \n", + "CH=5.0\n", + "angleFCH=60.0*pi/180\n", + "\n", + "#It is not possible to find a joint where there are only two unknowns. Hence, consider section (1)–(1). \n", + "#For left hand side part of the frame\n", + "#moment at C\n", + "\n", + "FAE=(RA*CH-PA*CH-PB*CH/2)/(CH)\n", + "print \"FAE=\",round(FAE),\"KN\",\"(Tension)\"\n", + "\n", + "#Assuming the directions for FFC and FBC \n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "#FFC=FBC*sqrt(2)-RA\n", + "\n", + "FBC=(RA*sin(angleFCH)-PA)/(sqrt(2)*sin(angleFCH)-(1/sqrt(2)))\n", + "print \"FBC=\",round(FBC,2),\"KN\",\"(Comp.)\"\n", + "\n", + "FFC=FBC*sqrt(2)-RA\n", + "print \"FFC=\",round(FFC,2),\"KN\",\"(Tension)\"\n", + "\n", + "#Assumed directions of FBC and FFC are correct. Therefore, FBC is in compression and FFC is in tension. Now we can proceed with method of joints to find the forces in other members. Since it is a symmetric truss, analysis of half the truss is sufficient. Other values may be written down by making use of symmetrry.\n", + "\n", + "#Joint B: sum of forces normal to AC = 0, gives \n", + "\n", + "FBF=PC*cos(angleACH)\n", + "\n", + "#sum of forces parallel to AC = 0, gives \n", + "\n", + "FAB=FBC+PC*sin(angleACH)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "\n", + "#JOINT A\n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "FAF=(FAB*sin(angleACH)+PA-RA)/sin(angleFCV)\n", + "\n", + "print \"FAF=\",round(FAF,2),\"KN\",\"(Tension)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_lB9BZeV.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_lB9BZeV.ipynb new file mode 100644 index 00000000..09420950 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_lB9BZeV.ipynb @@ -0,0 +1,1030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3-TRUSSES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.1 Page number68" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 45.0 °\n", + "FCB= 56.57 KN\n", + "FCD= 40.0 KN\n", + "FDB= 40.0 KN\n", + "FDE= 40.0 KN\n", + "FBE= 113.14 KN\n", + "FBA= 120.0 KN\n", + "Member , Magnitude of Force in KN , Nature\n", + "AB , 120.0 , Tension\n", + "BC , 56.57 , Tension\n", + "CD , 40.0 , Compresion\n", + "DE , 40.0 , Compresion\n", + "BE , 113.14 , Compresion\n", + "BD , 40.0 , Tension\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "#Determine the inclinations of all inclined members\n", + "\n", + "theta=atan(1)*180/pi\n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "#Now at joints C, there are only two unknowns,forces in members CB and CD, say FCB and FCD.\n", + "#Now there are two equations of equilibrium for the forces meeting at the joint and two unknown forces. Hence, the unknown forces can be determined. At joint C sum V= 0 condition shows that the force FCB should act away from the joint C so that its vertical component balances the vertical downward load at C.\n", + " \n", + "P=40.0\n", + "FCB=P/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\"\n", + "\n", + "#Now sum H=0 indicates that FCD should act towards C.\n", + "\n", + "FCD=FCB*cos(theta*pi/180)\n", + "\n", + "print \"FCD=\",round(FCD,2),\"KN\"\n", + "\n", + "#In the present case, near the joint C, the arrows are marked on the members CB and CD to indicate forces FCB and FCD directions as found in the analysis of joint C. Then reversed directions are marked in the members CB and CD near joints B and D, respectively.\n", + "\n", + "FDB=40.0\n", + "FDE=40.0\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\"\n", + "\n", + "print \"FDE=\",round(FDE,2),\"KN\"\n", + "\n", + "#In the present case, after marking the forces in the members DB and DE, we find that analysis of joint B can be taken up.\n", + "\n", + "FBE=(FCB*sin(theta*pi/180)+P)/(sin(theta*pi/180))\n", + "\n", + "FBA=FCB*cos(theta*pi/180)+FBE*cos(theta*pi/180)\n", + "\n", + "print \"FBE=\", round(FBE,2),\"KN\"\n", + "print \"FBA=\", round(FBA,2),\"KN\"\n", + "#Determine the nature of forces in each member and tabulate the results. Note that if the arrow marks on a member are towards each other, then the member is in tension and if the arrow marks are away from each other, the member is in compression.\n", + "\n", + "print \"Member\",\",\",\"Magnitude of Force in KN\",\",\",\"Nature\"\n", + "print \"AB\",\",\", round(FBA,2) ,\",\",\"Tension\"\n", + "print \"BC\",\",\", round(FCB,2) ,\",\",\"Tension\"\n", + "print \"CD\",\",\", round(FCD,2) ,\",\",\"Compresion\"\n", + "print \"DE\",\",\", round(FDE,2) ,\",\",\"Compresion\"\n", + "print \"BE\",\",\", round(FBE,2) ,\",\",\"Compresion\"\n", + "print \"BD\",\",\", round(P,2) ,\",\",\"Tension\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.2 Page number70" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 83.7158 KN (Comp.)\n", + "FAE= 41.8579 KN (Tension)\n", + "FDC= 89.4893 KN (Comp.)\n", + "FDE= 44.7446 KN (Tension)\n", + "FBC= 60.6218 KN (Comp.)\n", + "FCE= 31.7543 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=40.0\n", + "PC=50.0\n", + "PE=60.0\n", + "\n", + "theta=60.0\n", + "\n", + "RD=(PC*3+PE*2+PB*1)/(4.0)\n", + "\n", + "RA=PB+PC+PE-RD\n", + "\n", + "FAB=RA/sin(theta*pi/180)\n", + "\n", + "print\"FAB=\",round(FAB,4),\"KN\" ,\"(Comp.)\"\n", + "\n", + "FAE=FAB*cos(theta*pi/180)\n", + "\n", + "print\"FAE=\",round(FAE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FDC=RD/sin(theta*pi/180)\n", + "\n", + "print\"FDC=\",round(FDC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FDE=FDC*cos(theta*pi/180)\n", + "\n", + "print\"FDE=\",round(FDE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBE=(FAB*sin(theta*pi/180)-PB)/sin(theta*pi/180)\n", + "\n", + "FBC=(FAB+FBE)*(0.5)\n", + "print\"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "FCE=(FDC*sin(theta*pi/180)-PC)/(sin(theta*pi/180))\n", + "print\"FCE=\",round(FCE,4),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.3 Page number72" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 23.09 KN [Comp.]\n", + "FAC= 11.55 KN [Tensile]\n", + "FDB= 20.0 KN [Comp.]\n", + "FDC= 17.32 KN [Tensile]\n", + "FCB= 11.55 KN FCB= 11.55 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #Load at point B,KN\n", + "PC=10.0 #Load at point C,KN \n", + "thetaA=60.0 #angleBAC\n", + "thetaD=30.0 #angleBDC\n", + "\n", + "AC=3.0 #length,m\n", + "CD=3.0 #length,m\n", + "\n", + "AB=(AC+CD)*cos(thetaA*pi/180)\n", + "BD=(AC+CD)*cos(thetaD*pi/180)\n", + "#mistake in book\n", + "#angleBCA=angleABC=theta\n", + "\n", + "theta=(180.0-thetaA)/(2.0) \n", + "\n", + "#Taking moment about A, we get\n", + "\n", + "RD=(PC*AC+PB*AC*cos(thetaA*pi/180))/(AC+CD)\n", + "\n", + "RA=PC+PB-RD\n", + "#Joint A\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FAB=RA/sin(thetaA*pi/180)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"[Comp.]\"\n", + "FAC=FAB*cos(thetaA*pi/180)\n", + "print \"FAC=\",round(FAC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint D\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FDB=RD/sin(thetaD*pi/180)\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\",\"[Comp.]\"\n", + "FDC=FDB*cos(thetaD*pi/180)\n", + "print \"FDC=\",round(FDC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint C\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FCB=PC/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\",\n", + "\n", + "#CHECK\n", + "\n", + "FCB=(FDC-FAC)/cos(theta*pi/180)\n", + "print \"FCB=\",round(FCB,2),\"KN\",\"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.4 Page number74\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FBF= 42.4264 KN (Tension)\n", + "FBC= 30.0 KN (Comp.)\n", + "FCF= 50.0 KN (Comp.)\n", + "FCD= 30.0 KN (Comp.)\n", + "FDF= 70.7107 KN (Tensile)\n", + "FDF= 70.7107 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #vertical load at point B,KN\n", + "PC=50.0 #vertical load at point C,KN \n", + "PDv=40.0 #vertical load at point D,KN\n", + "PDh=20.0 #Horizontal load at point D,KN\n", + "PF=30.0 #vertical load at point F,KN\n", + "HA=PDh\n", + "\n", + "RE=(PC*4+PDv*8+PDh*4+PF*4)/(8.0)\n", + "\n", + "VA=PB+PC+PDv+PF-RE\n", + "\n", + "#joint A\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FAB=VA\n", + "FAF=HA\n", + "\n", + "#joint E\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FED=RE\n", + "FEF=0\n", + "\n", + "#Joint B: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FBF=(VA-PB)/sin(theta*pi/180)\n", + "\n", + "print\"FBF=\",round(FBF,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBC=FBF*cos(theta*pi/180)\n", + "\n", + "print\"FBC=\",round(FBC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint C: \n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "\n", + "FCF=PC\n", + "\n", + "print\"FCF=\",round(FCF,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FCD=FBC\n", + "\n", + "print\"FCD=\",round(FCD,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint D: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FDF=(RE-PDv)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"(Tensile)\"\n", + "\n", + "#check\n", + "\n", + "FDF=(FCD+PDh)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.5 Page number75" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FED= 25.0 KN (Tension)\n", + "FEF= 15.0 KN (Comp.)\n", + "FAB= 20.0 KN (Comp.)\n", + "FAF= 15.0 KN (Comp.)\n", + "FCB= 25.0 KN (Comp.)\n", + "FCD= 20.0 KN (Tension)\n", + "FBF= 0.0\n", + "FBD= 15.0 KN (Tension)\n", + "FFD= 0.0\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,sin,cos\n", + "\n", + "#All inclined members have the same inclination to horizontal. Now, length of an inclined member is BF\n", + "\n", + "#variable declaration\n", + "\n", + "PE=20.0\n", + "AF=3.0\n", + "FE=3.0\n", + "AB=4.0\n", + "FD=4.0\n", + "BD=3.0\n", + "CD=4.0\n", + "\n", + "BF=sqrt(pow(AF,2)+pow(AB,2))\n", + "DE=BF\n", + "BC=DE\n", + "\n", + "#sin(theta)=AB/BF\n", + "#cos(theta)=AF/BF\n", + "\n", + "theta=asin(AB/BF)\n", + "#As soon as a joint is analysed the forces on the joint are marked on members \n", + "\n", + "#Joint E\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "FED=PE/sin(theta)\n", + "print\"FED=\",round(FED),\"KN\",\"(Tension)\"\n", + "\n", + "FEF=FED*cos(theta)\n", + "print\"FEF=\",round(FEF),\"KN\",\"(Comp.)\"\n", + "\n", + "#At this stage as no other joint is having only two unknowns, no further progress is possible. Let us find the reactions at the supports considering the whole structure. Let the reaction be RC HORIZONTAL at point C,VA,HA at point A Vertically & Horizontally respectively.\n", + "#Taking moment at point A,\n", + "\n", + "RC=PE*6/8 \n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "VA=PE\n", + "HA=RC\n", + "\n", + "#Joint A\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FAB=VA\n", + "print\"FAB=\",round(FAB),\"KN\",\"(Comp.)\"\n", + "\n", + "FAF=HA\n", + "print\"FAF=\",round(FAF),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint C\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FCB=RC/cos(theta)\n", + "print\"FCB=\",round(FCB),\"KN\",\"(Comp.)\"\n", + "\n", + "FCD=FCB*sin(theta)\n", + "print\"FCD=\",round(FCD),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint B\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FBF=(FCB*sin(theta)-FAB)/sin(theta)\n", + "\n", + "print\"FBF=\",round(FBF)\n", + "\n", + "FBD=FCB*cos(theta)\n", + "print\"FBD=\",round(FBD),\"KN\",\"(Tension)\"\n", + "\n", + "#joint F\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FFD=FBF\n", + "print\"FFD=\",round(FFD)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 3.6 page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FHG= 25.0 KN (Comp.)\n", + "FHF= 15.0 KN (Tension)\n", + "FAC= 18.0278 KN (Comp.)\n", + "FAB= 15.0 KN (Tension)\n", + "FBC= 0.0\n", + "FBD=FBA 15.0 KN (Tension)\n", + "FCE=FCA 18.0278 KN (Comp.)\n", + "FDE= 0.0\n", + "FDF=FDB 15.0 KN (Tension)\n", + "FEF= 0\n", + "FEG=FCE= 18.0278 KN (Comp.)\n", + "FFG= 12.0 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan, cos , sin, pi\n", + "\n", + "#variable declaration\n", + "\n", + "AB=2.0 #length of beam AB,m\n", + "BD=2.0 #length of beam BD,m\n", + "DF=2.0 #length of beam DF,m\n", + "FH=3.0 #length of beam FH,m\n", + "FG=4.0 #length of beam FG,m\n", + "PF=12.0 #Vertical Load at point F,KN\n", + "PH=20.0 #Vertical Load at point H,KN\n", + "\n", + "#mistake in book FG=4.0 , given FG=2.0 \n", + "\n", + "theta1=atan(FG/(AB+BD+DF))\n", + "theta3=atan(FG/FH)\n", + "theta2=theta3\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "#joint H\n", + "\n", + "FHG=PH/sin(theta3)\n", + "print \"FHG=\",round(FHG),\"KN\",\"(Comp.)\" \n", + "\n", + "FHF=FHG*cos(theta2)\n", + "print \"FHF=\",round(FHF),\"KN\",\"(Tension)\"\n", + "\n", + "#taking moment at G\n", + "\n", + "RA=PH*FH/(AB+BD+DF)\n", + "\n", + "RG=RA+PF+PH\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAC=RA/sin(theta1)\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Comp.)\" \n", + "\n", + "FAB=FAC*cos(theta1)\n", + "print \"FAB=\",round(FAB),\"KN\",\"(Tension)\"\n", + " \n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=0\n", + "print \"FBC=\",round(FBC) \n", + "FBA=FAB\n", + "FBD=FBA\n", + "print \"FBD=FBA\",round(FBD),\"KN\",\"(Tension)\"\n", + " \n", + "#Joint C: Sum of Forces normal to AC = 0, gives FCD =0 since FBC = 0 ,sum of Forces parallel to CE =0 \n", + "\n", + "FCA=FAC\n", + "FCE=FCA\n", + "print \"FCE=FCA\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=0\n", + "print \"FDE=\",round(FDE) \n", + "\n", + "FDB=FBD\n", + "FDF=FDB\n", + "\n", + "print \"FDF=FDB\",round(FDF),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint E: sum of Forces normal to CG = 0, gives FEF = 0 and sum of Forces in the direction of CG = 0, gives \n", + "\n", + "FEF=0\n", + "\n", + "print \"FEF=\",FEF\n", + "\n", + "FEG=FCE\n", + "\n", + "print \"FEG=FCE=\", round(FEG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint F:\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=PF\n", + "\n", + "print \"FFG=\",round(FFG),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.7 page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FGF= 23.094 KN (Tension)\n", + "FGE= 11.547 KN (Comp.)\n", + "FFG= 23.094 KN (Comp.)\n", + "FFD= 13.094 KN (Tension)\n", + "FAB= 36.7543 KN (Comp.)\n", + "FAC= 8.3771 KN (Tension)\n", + "FBC= 9.4338 KN (Comp.)\n", + "FBD= 13.6603 KN (Comp.)\n", + "FCD= 9.4338 KN (Tension)\n", + "FCE= 1.0566 KN (Comp.)\n", + "FDE= 44.0748 KN (Comp.)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Since all members are 3 m long, all triangles are equilateral and hence all inclined members are at 60° to horizontal. Joint-by-joint analysis is carried out . Then nature of the force is determined. \n", + "\n", + "#variable declaration\n", + "\n", + "AB=3.0\n", + "BC=AB\n", + "AC=AB\n", + "BD=BC\n", + "CD=BD\n", + "CE=CD\n", + "DE=CE\n", + "EF=DE\n", + "DF=DE\n", + "EG=DE\n", + "FG=DF\n", + "\n", + "theta=60.0*pi/180 #angles BAC,BCA,DCE,DEC,FEG,FGE,°\n", + "\n", + "PB=40.0 #Vertical Loading at point B,KN\n", + "PD=30.0 #Vertical Loading at point D,KN\n", + "HF=10.0 #Horizontal Loading at point F,KN\n", + "PG=20.0 #Vertical Loading at point G,KN\n", + "\n", + "#joint G\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGF=PG/sin(theta)\n", + "\n", + "print \"FGF=\",round(FGF,4),\"KN\",\"(Tension)\"\n", + "\n", + "FGE=FGF*cos(theta)\n", + "\n", + "print \"FGE=\",round(FGE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint F\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=FGF\n", + "\n", + "print \"FFG=\",round(FFG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FFE=FGF\n", + "FFD=FGF*cos(theta)+FFE*cos(theta)-HF\n", + "print \"FFD=\",round(FFD,4),\"KN\",\"(Tension)\"\n", + "\n", + "#Now, without finding reaction we cannot proceed. Hence, consider equilibrium of the entire truss\n", + "#moment about point A\n", + "\n", + "RE=((PB*AC/2)-(HF*EF*sin(theta))+(PD*(AC+CE/2))+(PG*(AC+CE+EG)))/(AC+CE)\n", + "\n", + "VA=PB+PD+PG-RE\n", + "\n", + "HA=HF\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAB=VA/sin(theta)\n", + "\n", + "print \"FAB=\",round(FAB,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FAC=FAB*cos(theta)-HF\n", + "\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Tension)\"\n", + "\n", + "\n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=(PB-FAB*sin(theta))/sin(theta)\n", + "\n", + "print \"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FBA=FAB\n", + "FBD=-FBC*cos(theta)+FBA*cos(theta)\n", + "\n", + "print \"FBD=\",round(FBD,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint C\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FCD=FBC*sin(theta)/sin(theta)\n", + "\n", + "print \"FCD=\",round(FCD,4),\"KN\",\"(Tension)\"\n", + "\n", + "FCE=FCD*cos(theta)+FBC*cos(theta)-FAC\n", + "\n", + "print \"FCE=\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=(PD+FCD*sin(theta))/sin(theta)\n", + "\n", + "print \"FDE=\",round(FDE,4),\"KN\",\"(Comp.)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.8 page number82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FFH= 69.282 KN (Comp.)\n", + "FGH= 5.7735 KN (Comp.)\n", + "FGI= 72.1688 KN (Tensile)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Each load is 10 kN and all triangles are equilateral with sides 4 m.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=10.0\n", + "PD=PB\n", + "PF=PD\n", + "AB=4.0\n", + "BC=AB\n", + "AC=BC\n", + "BD=BC\n", + "CD=BC\n", + "DE=CD\n", + "CE=CD\n", + "DF=DE\n", + "EF=DE\n", + "EG=DE\n", + "FG=EF\n", + "#Take section (A)–(A), which cuts the members FH, GH and GI and separates the truss into two parts. \n", + "AG=AC+CE+EG\n", + "BG=CE+EG+AC/2\n", + "DG=EG+CE/2\n", + "FG1=EG/2\n", + "RA=PB*7/2\n", + "RO=RA\n", + "theta=60.0*pi/180\n", + "#moment at point G\n", + "FFH=(RA*AG-PB*BG-PD*DG-PF*FG1)/(FG*sin(theta))\n", + "print \"FFH=\",round(FFH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGH=(RA-PB-PD-PF)/(sin(theta))\n", + "print \"FGH=\",round(FGH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FGI=FFH+FGH*cos(theta)\n", + "print \"FGI=\",round(FGI,4),\"KN\",\"(Tensile)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.9 page number 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL3L4= 412.5 KN (Tension)\n", + "FU4U3= 456.2 KN (Comp.)\n", + "FU4L3= 62.5 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import asin,acos,sin,cos,sqrt\n", + "\n", + "#To determine reactions, consider equilibrium equations\n", + "\n", + "#variable declaration\n", + " #all Vertical loading are in KN\n", + "PL1=200.0 \n", + "PL2=200.0\n", + "PL3=150.0\n", + "PL4=100.0\n", + "PL5=100.0\n", + "\n", + "#length in m\n", + "UL1=6.0\n", + "UL2=8.0\n", + "UL3=9.0\n", + "UL4=UL2\n", + "UL5=UL1\n", + "\n", + "L1=6.0\n", + "L2=6.0\n", + "L3=6.0\n", + "L4=6.0\n", + "L5=6.0\n", + "L6=6.0\n", + "\n", + "#moment at point LO\n", + "\n", + "R2=(PL1*L1+PL2*(L1+L2)+PL3*(L1+L2+L3)+PL4*(L1+L2+L3+L4)+PL5*(L1+L2+L3+L4+L5))/(L1+L2+L3+L4+L5+L6)\n", + "\n", + "R1=PL1+PL2+PL3+PL4+PL5-R2\n", + "\n", + "#Take the section (1)–(1) and consider the right hand side part.\n", + "\n", + "U3U4=sqrt(pow(1,2)+pow(UL1,2))\n", + "theta1=asin(1/U3U4)\n", + "\n", + "L3U4=sqrt(pow(UL1,2)+pow(UL2,2))\n", + "theta2=asin(6/L3U4)\n", + "\n", + "#moment at U4\n", + "\n", + "FL3L4=(R2*(L5+L6)-PL4*L4)/UL4\n", + "\n", + "print \"FL3L4=\", round(FL3L4,1),\"KN\",\"(Tension)\"\n", + "\n", + "#moment at L3\n", + "FU4U3=(-PL4*L4-PL5*(L4+L5)+R2*(L4+L5+L6))/(cos(theta1)*UL3)\n", + "print \"FU4U3=\", round(FU4U3,1),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of horizontal forces \n", + "FL4L3=FL3L4\n", + "FU4L3=(-FL4L3+FU4U3*cos(theta1))/sin(theta2)\n", + "print \"FU4L3=\", round(FU4L3,1),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.10 page number84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 60.0 °\n", + "F2= 51.9615 KN (Tension)\n", + "F1= 110.0 KN (Comp.)\n", + "F3= 69.282 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan,tan,sin,cos,pi\n", + "\n", + "#Each load is 20 kN.\n", + "\n", + "#variable declaration\n", + "\n", + "P=20.0\n", + "AB=18.0\n", + "A=3.0\n", + "\n", + "RA=P*7/2\n", + "RB=RA\n", + "\n", + "theta1=30.0*pi/180\n", + "a=(3*A)/(4*cos(theta1))\n", + "#Take Section (A)–(A) and consider the equilibrium of left hand side part of the French Truss\n", + "#Drop perpendicular CE on AB. \n", + "\n", + "CE=3*A*tan(theta1)\n", + "DE=A\n", + "\n", + "theta=atan(CE/DE)*180/pi\n", + "print \"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at point A\n", + "\n", + "F2=(P*a*cos(theta1)*6)/(A*2*sin(theta*pi/180))\n", + "print \"F2=\",round(F2,4),\"KN\",\"(Tension)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "F1=(F2*sin(theta*pi/180)+RA-P*3)/(sin(theta1))\n", + "print \"F1=\",round(F1,4),\"KN\",\"(Comp.)\"\n", + "\n", + "F3=F1*cos(theta1)-F2*cos(theta*pi/180)\n", + "print \"F3=\",round(F3,4),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.11 page number 85" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAE= 30.0 KN (Tension)\n", + "FBC= 71.4 KN (Comp.)\n", + "FFC= 40.98 KN (Tension)\n", + "FAB= 92.62 KN (Comp.)\n", + "FAF= 40.98 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=15.0 #vertical loading at point A,KN\n", + "PB=30.0 #vertical loading at point B,KN\n", + "PC=30.0 #vertical loading at point C,KN\n", + "PD=30.0 #vertical loading at point D,KN\n", + "PE=15.0 #vertical loading at point E,KN\n", + "\n", + "#Due to symmetry, the reactions are equal\n", + "RA=(PA+PB+PC+PD+PE)/2\n", + "RB=RA\n", + "#Drop perpendicular CH on AF. \n", + "#in traingle ACH\n", + "\n", + "angleACH=45.0*pi/180 #angleACH,°\n", + "angleFCV=30.0*pi/180 # FC is inclined at 30° to vertical i.e., 60° to horizontal and CH = 5 m \n", + "CH=5.0\n", + "angleFCH=60.0*pi/180\n", + "\n", + "#It is not possible to find a joint where there are only two unknowns. Hence, consider section (1)–(1). \n", + "#For left hand side part of the frame\n", + "#moment at C\n", + "\n", + "FAE=(RA*CH-PA*CH-PB*CH/2)/(CH)\n", + "print \"FAE=\",round(FAE),\"KN\",\"(Tension)\"\n", + "\n", + "#Assuming the directions for FFC and FBC \n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "#FFC=FBC*sqrt(2)-RA\n", + "\n", + "FBC=(RA*sin(angleFCH)-PA)/(sqrt(2)*sin(angleFCH)-(1/sqrt(2)))\n", + "print \"FBC=\",round(FBC,2),\"KN\",\"(Comp.)\"\n", + "\n", + "FFC=FBC*sqrt(2)-RA\n", + "print \"FFC=\",round(FFC,2),\"KN\",\"(Tension)\"\n", + "\n", + "#Assumed directions of FBC and FFC are correct. Therefore, FBC is in compression and FFC is in tension. Now we can proceed with method of joints to find the forces in other members. Since it is a symmetric truss, analysis of half the truss is sufficient. Other values may be written down by making use of symmetrry.\n", + "\n", + "#Joint B: sum of forces normal to AC = 0, gives \n", + "\n", + "FBF=PC*cos(angleACH)\n", + "\n", + "#sum of forces parallel to AC = 0, gives \n", + "\n", + "FAB=FBC+PC*sin(angleACH)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "\n", + "#JOINT A\n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "FAF=(FAB*sin(angleACH)+PA-RA)/sin(angleFCV)\n", + "\n", + "print \"FAF=\",round(FAF,2),\"KN\",\"(Tension)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_phPgJb2.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_phPgJb2.ipynb new file mode 100644 index 00000000..09420950 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_phPgJb2.ipynb @@ -0,0 +1,1030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3-TRUSSES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.1 Page number68" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 45.0 °\n", + "FCB= 56.57 KN\n", + "FCD= 40.0 KN\n", + "FDB= 40.0 KN\n", + "FDE= 40.0 KN\n", + "FBE= 113.14 KN\n", + "FBA= 120.0 KN\n", + "Member , Magnitude of Force in KN , Nature\n", + "AB , 120.0 , Tension\n", + "BC , 56.57 , Tension\n", + "CD , 40.0 , Compresion\n", + "DE , 40.0 , Compresion\n", + "BE , 113.14 , Compresion\n", + "BD , 40.0 , Tension\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "#Determine the inclinations of all inclined members\n", + "\n", + "theta=atan(1)*180/pi\n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "#Now at joints C, there are only two unknowns,forces in members CB and CD, say FCB and FCD.\n", + "#Now there are two equations of equilibrium for the forces meeting at the joint and two unknown forces. Hence, the unknown forces can be determined. At joint C sum V= 0 condition shows that the force FCB should act away from the joint C so that its vertical component balances the vertical downward load at C.\n", + " \n", + "P=40.0\n", + "FCB=P/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\"\n", + "\n", + "#Now sum H=0 indicates that FCD should act towards C.\n", + "\n", + "FCD=FCB*cos(theta*pi/180)\n", + "\n", + "print \"FCD=\",round(FCD,2),\"KN\"\n", + "\n", + "#In the present case, near the joint C, the arrows are marked on the members CB and CD to indicate forces FCB and FCD directions as found in the analysis of joint C. Then reversed directions are marked in the members CB and CD near joints B and D, respectively.\n", + "\n", + "FDB=40.0\n", + "FDE=40.0\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\"\n", + "\n", + "print \"FDE=\",round(FDE,2),\"KN\"\n", + "\n", + "#In the present case, after marking the forces in the members DB and DE, we find that analysis of joint B can be taken up.\n", + "\n", + "FBE=(FCB*sin(theta*pi/180)+P)/(sin(theta*pi/180))\n", + "\n", + "FBA=FCB*cos(theta*pi/180)+FBE*cos(theta*pi/180)\n", + "\n", + "print \"FBE=\", round(FBE,2),\"KN\"\n", + "print \"FBA=\", round(FBA,2),\"KN\"\n", + "#Determine the nature of forces in each member and tabulate the results. Note that if the arrow marks on a member are towards each other, then the member is in tension and if the arrow marks are away from each other, the member is in compression.\n", + "\n", + "print \"Member\",\",\",\"Magnitude of Force in KN\",\",\",\"Nature\"\n", + "print \"AB\",\",\", round(FBA,2) ,\",\",\"Tension\"\n", + "print \"BC\",\",\", round(FCB,2) ,\",\",\"Tension\"\n", + "print \"CD\",\",\", round(FCD,2) ,\",\",\"Compresion\"\n", + "print \"DE\",\",\", round(FDE,2) ,\",\",\"Compresion\"\n", + "print \"BE\",\",\", round(FBE,2) ,\",\",\"Compresion\"\n", + "print \"BD\",\",\", round(P,2) ,\",\",\"Tension\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.2 Page number70" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 83.7158 KN (Comp.)\n", + "FAE= 41.8579 KN (Tension)\n", + "FDC= 89.4893 KN (Comp.)\n", + "FDE= 44.7446 KN (Tension)\n", + "FBC= 60.6218 KN (Comp.)\n", + "FCE= 31.7543 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=40.0\n", + "PC=50.0\n", + "PE=60.0\n", + "\n", + "theta=60.0\n", + "\n", + "RD=(PC*3+PE*2+PB*1)/(4.0)\n", + "\n", + "RA=PB+PC+PE-RD\n", + "\n", + "FAB=RA/sin(theta*pi/180)\n", + "\n", + "print\"FAB=\",round(FAB,4),\"KN\" ,\"(Comp.)\"\n", + "\n", + "FAE=FAB*cos(theta*pi/180)\n", + "\n", + "print\"FAE=\",round(FAE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FDC=RD/sin(theta*pi/180)\n", + "\n", + "print\"FDC=\",round(FDC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FDE=FDC*cos(theta*pi/180)\n", + "\n", + "print\"FDE=\",round(FDE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBE=(FAB*sin(theta*pi/180)-PB)/sin(theta*pi/180)\n", + "\n", + "FBC=(FAB+FBE)*(0.5)\n", + "print\"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "FCE=(FDC*sin(theta*pi/180)-PC)/(sin(theta*pi/180))\n", + "print\"FCE=\",round(FCE,4),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.3 Page number72" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 23.09 KN [Comp.]\n", + "FAC= 11.55 KN [Tensile]\n", + "FDB= 20.0 KN [Comp.]\n", + "FDC= 17.32 KN [Tensile]\n", + "FCB= 11.55 KN FCB= 11.55 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #Load at point B,KN\n", + "PC=10.0 #Load at point C,KN \n", + "thetaA=60.0 #angleBAC\n", + "thetaD=30.0 #angleBDC\n", + "\n", + "AC=3.0 #length,m\n", + "CD=3.0 #length,m\n", + "\n", + "AB=(AC+CD)*cos(thetaA*pi/180)\n", + "BD=(AC+CD)*cos(thetaD*pi/180)\n", + "#mistake in book\n", + "#angleBCA=angleABC=theta\n", + "\n", + "theta=(180.0-thetaA)/(2.0) \n", + "\n", + "#Taking moment about A, we get\n", + "\n", + "RD=(PC*AC+PB*AC*cos(thetaA*pi/180))/(AC+CD)\n", + "\n", + "RA=PC+PB-RD\n", + "#Joint A\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FAB=RA/sin(thetaA*pi/180)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"[Comp.]\"\n", + "FAC=FAB*cos(thetaA*pi/180)\n", + "print \"FAC=\",round(FAC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint D\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FDB=RD/sin(thetaD*pi/180)\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\",\"[Comp.]\"\n", + "FDC=FDB*cos(thetaD*pi/180)\n", + "print \"FDC=\",round(FDC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint C\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FCB=PC/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\",\n", + "\n", + "#CHECK\n", + "\n", + "FCB=(FDC-FAC)/cos(theta*pi/180)\n", + "print \"FCB=\",round(FCB,2),\"KN\",\"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.4 Page number74\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FBF= 42.4264 KN (Tension)\n", + "FBC= 30.0 KN (Comp.)\n", + "FCF= 50.0 KN (Comp.)\n", + "FCD= 30.0 KN (Comp.)\n", + "FDF= 70.7107 KN (Tensile)\n", + "FDF= 70.7107 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #vertical load at point B,KN\n", + "PC=50.0 #vertical load at point C,KN \n", + "PDv=40.0 #vertical load at point D,KN\n", + "PDh=20.0 #Horizontal load at point D,KN\n", + "PF=30.0 #vertical load at point F,KN\n", + "HA=PDh\n", + "\n", + "RE=(PC*4+PDv*8+PDh*4+PF*4)/(8.0)\n", + "\n", + "VA=PB+PC+PDv+PF-RE\n", + "\n", + "#joint A\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FAB=VA\n", + "FAF=HA\n", + "\n", + "#joint E\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FED=RE\n", + "FEF=0\n", + "\n", + "#Joint B: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FBF=(VA-PB)/sin(theta*pi/180)\n", + "\n", + "print\"FBF=\",round(FBF,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBC=FBF*cos(theta*pi/180)\n", + "\n", + "print\"FBC=\",round(FBC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint C: \n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "\n", + "FCF=PC\n", + "\n", + "print\"FCF=\",round(FCF,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FCD=FBC\n", + "\n", + "print\"FCD=\",round(FCD,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint D: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FDF=(RE-PDv)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"(Tensile)\"\n", + "\n", + "#check\n", + "\n", + "FDF=(FCD+PDh)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.5 Page number75" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FED= 25.0 KN (Tension)\n", + "FEF= 15.0 KN (Comp.)\n", + "FAB= 20.0 KN (Comp.)\n", + "FAF= 15.0 KN (Comp.)\n", + "FCB= 25.0 KN (Comp.)\n", + "FCD= 20.0 KN (Tension)\n", + "FBF= 0.0\n", + "FBD= 15.0 KN (Tension)\n", + "FFD= 0.0\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,sin,cos\n", + "\n", + "#All inclined members have the same inclination to horizontal. Now, length of an inclined member is BF\n", + "\n", + "#variable declaration\n", + "\n", + "PE=20.0\n", + "AF=3.0\n", + "FE=3.0\n", + "AB=4.0\n", + "FD=4.0\n", + "BD=3.0\n", + "CD=4.0\n", + "\n", + "BF=sqrt(pow(AF,2)+pow(AB,2))\n", + "DE=BF\n", + "BC=DE\n", + "\n", + "#sin(theta)=AB/BF\n", + "#cos(theta)=AF/BF\n", + "\n", + "theta=asin(AB/BF)\n", + "#As soon as a joint is analysed the forces on the joint are marked on members \n", + "\n", + "#Joint E\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "FED=PE/sin(theta)\n", + "print\"FED=\",round(FED),\"KN\",\"(Tension)\"\n", + "\n", + "FEF=FED*cos(theta)\n", + "print\"FEF=\",round(FEF),\"KN\",\"(Comp.)\"\n", + "\n", + "#At this stage as no other joint is having only two unknowns, no further progress is possible. Let us find the reactions at the supports considering the whole structure. Let the reaction be RC HORIZONTAL at point C,VA,HA at point A Vertically & Horizontally respectively.\n", + "#Taking moment at point A,\n", + "\n", + "RC=PE*6/8 \n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "VA=PE\n", + "HA=RC\n", + "\n", + "#Joint A\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FAB=VA\n", + "print\"FAB=\",round(FAB),\"KN\",\"(Comp.)\"\n", + "\n", + "FAF=HA\n", + "print\"FAF=\",round(FAF),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint C\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FCB=RC/cos(theta)\n", + "print\"FCB=\",round(FCB),\"KN\",\"(Comp.)\"\n", + "\n", + "FCD=FCB*sin(theta)\n", + "print\"FCD=\",round(FCD),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint B\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FBF=(FCB*sin(theta)-FAB)/sin(theta)\n", + "\n", + "print\"FBF=\",round(FBF)\n", + "\n", + "FBD=FCB*cos(theta)\n", + "print\"FBD=\",round(FBD),\"KN\",\"(Tension)\"\n", + "\n", + "#joint F\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FFD=FBF\n", + "print\"FFD=\",round(FFD)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 3.6 page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FHG= 25.0 KN (Comp.)\n", + "FHF= 15.0 KN (Tension)\n", + "FAC= 18.0278 KN (Comp.)\n", + "FAB= 15.0 KN (Tension)\n", + "FBC= 0.0\n", + "FBD=FBA 15.0 KN (Tension)\n", + "FCE=FCA 18.0278 KN (Comp.)\n", + "FDE= 0.0\n", + "FDF=FDB 15.0 KN (Tension)\n", + "FEF= 0\n", + "FEG=FCE= 18.0278 KN (Comp.)\n", + "FFG= 12.0 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan, cos , sin, pi\n", + "\n", + "#variable declaration\n", + "\n", + "AB=2.0 #length of beam AB,m\n", + "BD=2.0 #length of beam BD,m\n", + "DF=2.0 #length of beam DF,m\n", + "FH=3.0 #length of beam FH,m\n", + "FG=4.0 #length of beam FG,m\n", + "PF=12.0 #Vertical Load at point F,KN\n", + "PH=20.0 #Vertical Load at point H,KN\n", + "\n", + "#mistake in book FG=4.0 , given FG=2.0 \n", + "\n", + "theta1=atan(FG/(AB+BD+DF))\n", + "theta3=atan(FG/FH)\n", + "theta2=theta3\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "#joint H\n", + "\n", + "FHG=PH/sin(theta3)\n", + "print \"FHG=\",round(FHG),\"KN\",\"(Comp.)\" \n", + "\n", + "FHF=FHG*cos(theta2)\n", + "print \"FHF=\",round(FHF),\"KN\",\"(Tension)\"\n", + "\n", + "#taking moment at G\n", + "\n", + "RA=PH*FH/(AB+BD+DF)\n", + "\n", + "RG=RA+PF+PH\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAC=RA/sin(theta1)\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Comp.)\" \n", + "\n", + "FAB=FAC*cos(theta1)\n", + "print \"FAB=\",round(FAB),\"KN\",\"(Tension)\"\n", + " \n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=0\n", + "print \"FBC=\",round(FBC) \n", + "FBA=FAB\n", + "FBD=FBA\n", + "print \"FBD=FBA\",round(FBD),\"KN\",\"(Tension)\"\n", + " \n", + "#Joint C: Sum of Forces normal to AC = 0, gives FCD =0 since FBC = 0 ,sum of Forces parallel to CE =0 \n", + "\n", + "FCA=FAC\n", + "FCE=FCA\n", + "print \"FCE=FCA\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=0\n", + "print \"FDE=\",round(FDE) \n", + "\n", + "FDB=FBD\n", + "FDF=FDB\n", + "\n", + "print \"FDF=FDB\",round(FDF),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint E: sum of Forces normal to CG = 0, gives FEF = 0 and sum of Forces in the direction of CG = 0, gives \n", + "\n", + "FEF=0\n", + "\n", + "print \"FEF=\",FEF\n", + "\n", + "FEG=FCE\n", + "\n", + "print \"FEG=FCE=\", round(FEG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint F:\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=PF\n", + "\n", + "print \"FFG=\",round(FFG),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.7 page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FGF= 23.094 KN (Tension)\n", + "FGE= 11.547 KN (Comp.)\n", + "FFG= 23.094 KN (Comp.)\n", + "FFD= 13.094 KN (Tension)\n", + "FAB= 36.7543 KN (Comp.)\n", + "FAC= 8.3771 KN (Tension)\n", + "FBC= 9.4338 KN (Comp.)\n", + "FBD= 13.6603 KN (Comp.)\n", + "FCD= 9.4338 KN (Tension)\n", + "FCE= 1.0566 KN (Comp.)\n", + "FDE= 44.0748 KN (Comp.)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Since all members are 3 m long, all triangles are equilateral and hence all inclined members are at 60° to horizontal. Joint-by-joint analysis is carried out . Then nature of the force is determined. \n", + "\n", + "#variable declaration\n", + "\n", + "AB=3.0\n", + "BC=AB\n", + "AC=AB\n", + "BD=BC\n", + "CD=BD\n", + "CE=CD\n", + "DE=CE\n", + "EF=DE\n", + "DF=DE\n", + "EG=DE\n", + "FG=DF\n", + "\n", + "theta=60.0*pi/180 #angles BAC,BCA,DCE,DEC,FEG,FGE,°\n", + "\n", + "PB=40.0 #Vertical Loading at point B,KN\n", + "PD=30.0 #Vertical Loading at point D,KN\n", + "HF=10.0 #Horizontal Loading at point F,KN\n", + "PG=20.0 #Vertical Loading at point G,KN\n", + "\n", + "#joint G\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGF=PG/sin(theta)\n", + "\n", + "print \"FGF=\",round(FGF,4),\"KN\",\"(Tension)\"\n", + "\n", + "FGE=FGF*cos(theta)\n", + "\n", + "print \"FGE=\",round(FGE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint F\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=FGF\n", + "\n", + "print \"FFG=\",round(FFG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FFE=FGF\n", + "FFD=FGF*cos(theta)+FFE*cos(theta)-HF\n", + "print \"FFD=\",round(FFD,4),\"KN\",\"(Tension)\"\n", + "\n", + "#Now, without finding reaction we cannot proceed. Hence, consider equilibrium of the entire truss\n", + "#moment about point A\n", + "\n", + "RE=((PB*AC/2)-(HF*EF*sin(theta))+(PD*(AC+CE/2))+(PG*(AC+CE+EG)))/(AC+CE)\n", + "\n", + "VA=PB+PD+PG-RE\n", + "\n", + "HA=HF\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAB=VA/sin(theta)\n", + "\n", + "print \"FAB=\",round(FAB,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FAC=FAB*cos(theta)-HF\n", + "\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Tension)\"\n", + "\n", + "\n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=(PB-FAB*sin(theta))/sin(theta)\n", + "\n", + "print \"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FBA=FAB\n", + "FBD=-FBC*cos(theta)+FBA*cos(theta)\n", + "\n", + "print \"FBD=\",round(FBD,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint C\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FCD=FBC*sin(theta)/sin(theta)\n", + "\n", + "print \"FCD=\",round(FCD,4),\"KN\",\"(Tension)\"\n", + "\n", + "FCE=FCD*cos(theta)+FBC*cos(theta)-FAC\n", + "\n", + "print \"FCE=\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=(PD+FCD*sin(theta))/sin(theta)\n", + "\n", + "print \"FDE=\",round(FDE,4),\"KN\",\"(Comp.)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.8 page number82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FFH= 69.282 KN (Comp.)\n", + "FGH= 5.7735 KN (Comp.)\n", + "FGI= 72.1688 KN (Tensile)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Each load is 10 kN and all triangles are equilateral with sides 4 m.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=10.0\n", + "PD=PB\n", + "PF=PD\n", + "AB=4.0\n", + "BC=AB\n", + "AC=BC\n", + "BD=BC\n", + "CD=BC\n", + "DE=CD\n", + "CE=CD\n", + "DF=DE\n", + "EF=DE\n", + "EG=DE\n", + "FG=EF\n", + "#Take section (A)–(A), which cuts the members FH, GH and GI and separates the truss into two parts. \n", + "AG=AC+CE+EG\n", + "BG=CE+EG+AC/2\n", + "DG=EG+CE/2\n", + "FG1=EG/2\n", + "RA=PB*7/2\n", + "RO=RA\n", + "theta=60.0*pi/180\n", + "#moment at point G\n", + "FFH=(RA*AG-PB*BG-PD*DG-PF*FG1)/(FG*sin(theta))\n", + "print \"FFH=\",round(FFH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGH=(RA-PB-PD-PF)/(sin(theta))\n", + "print \"FGH=\",round(FGH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FGI=FFH+FGH*cos(theta)\n", + "print \"FGI=\",round(FGI,4),\"KN\",\"(Tensile)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.9 page number 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL3L4= 412.5 KN (Tension)\n", + "FU4U3= 456.2 KN (Comp.)\n", + "FU4L3= 62.5 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import asin,acos,sin,cos,sqrt\n", + "\n", + "#To determine reactions, consider equilibrium equations\n", + "\n", + "#variable declaration\n", + " #all Vertical loading are in KN\n", + "PL1=200.0 \n", + "PL2=200.0\n", + "PL3=150.0\n", + "PL4=100.0\n", + "PL5=100.0\n", + "\n", + "#length in m\n", + "UL1=6.0\n", + "UL2=8.0\n", + "UL3=9.0\n", + "UL4=UL2\n", + "UL5=UL1\n", + "\n", + "L1=6.0\n", + "L2=6.0\n", + "L3=6.0\n", + "L4=6.0\n", + "L5=6.0\n", + "L6=6.0\n", + "\n", + "#moment at point LO\n", + "\n", + "R2=(PL1*L1+PL2*(L1+L2)+PL3*(L1+L2+L3)+PL4*(L1+L2+L3+L4)+PL5*(L1+L2+L3+L4+L5))/(L1+L2+L3+L4+L5+L6)\n", + "\n", + "R1=PL1+PL2+PL3+PL4+PL5-R2\n", + "\n", + "#Take the section (1)–(1) and consider the right hand side part.\n", + "\n", + "U3U4=sqrt(pow(1,2)+pow(UL1,2))\n", + "theta1=asin(1/U3U4)\n", + "\n", + "L3U4=sqrt(pow(UL1,2)+pow(UL2,2))\n", + "theta2=asin(6/L3U4)\n", + "\n", + "#moment at U4\n", + "\n", + "FL3L4=(R2*(L5+L6)-PL4*L4)/UL4\n", + "\n", + "print \"FL3L4=\", round(FL3L4,1),\"KN\",\"(Tension)\"\n", + "\n", + "#moment at L3\n", + "FU4U3=(-PL4*L4-PL5*(L4+L5)+R2*(L4+L5+L6))/(cos(theta1)*UL3)\n", + "print \"FU4U3=\", round(FU4U3,1),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of horizontal forces \n", + "FL4L3=FL3L4\n", + "FU4L3=(-FL4L3+FU4U3*cos(theta1))/sin(theta2)\n", + "print \"FU4L3=\", round(FU4L3,1),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.10 page number84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 60.0 °\n", + "F2= 51.9615 KN (Tension)\n", + "F1= 110.0 KN (Comp.)\n", + "F3= 69.282 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan,tan,sin,cos,pi\n", + "\n", + "#Each load is 20 kN.\n", + "\n", + "#variable declaration\n", + "\n", + "P=20.0\n", + "AB=18.0\n", + "A=3.0\n", + "\n", + "RA=P*7/2\n", + "RB=RA\n", + "\n", + "theta1=30.0*pi/180\n", + "a=(3*A)/(4*cos(theta1))\n", + "#Take Section (A)–(A) and consider the equilibrium of left hand side part of the French Truss\n", + "#Drop perpendicular CE on AB. \n", + "\n", + "CE=3*A*tan(theta1)\n", + "DE=A\n", + "\n", + "theta=atan(CE/DE)*180/pi\n", + "print \"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at point A\n", + "\n", + "F2=(P*a*cos(theta1)*6)/(A*2*sin(theta*pi/180))\n", + "print \"F2=\",round(F2,4),\"KN\",\"(Tension)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "F1=(F2*sin(theta*pi/180)+RA-P*3)/(sin(theta1))\n", + "print \"F1=\",round(F1,4),\"KN\",\"(Comp.)\"\n", + "\n", + "F3=F1*cos(theta1)-F2*cos(theta*pi/180)\n", + "print \"F3=\",round(F3,4),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.11 page number 85" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAE= 30.0 KN (Tension)\n", + "FBC= 71.4 KN (Comp.)\n", + "FFC= 40.98 KN (Tension)\n", + "FAB= 92.62 KN (Comp.)\n", + "FAF= 40.98 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=15.0 #vertical loading at point A,KN\n", + "PB=30.0 #vertical loading at point B,KN\n", + "PC=30.0 #vertical loading at point C,KN\n", + "PD=30.0 #vertical loading at point D,KN\n", + "PE=15.0 #vertical loading at point E,KN\n", + "\n", + "#Due to symmetry, the reactions are equal\n", + "RA=(PA+PB+PC+PD+PE)/2\n", + "RB=RA\n", + "#Drop perpendicular CH on AF. \n", + "#in traingle ACH\n", + "\n", + "angleACH=45.0*pi/180 #angleACH,°\n", + "angleFCV=30.0*pi/180 # FC is inclined at 30° to vertical i.e., 60° to horizontal and CH = 5 m \n", + "CH=5.0\n", + "angleFCH=60.0*pi/180\n", + "\n", + "#It is not possible to find a joint where there are only two unknowns. Hence, consider section (1)–(1). \n", + "#For left hand side part of the frame\n", + "#moment at C\n", + "\n", + "FAE=(RA*CH-PA*CH-PB*CH/2)/(CH)\n", + "print \"FAE=\",round(FAE),\"KN\",\"(Tension)\"\n", + "\n", + "#Assuming the directions for FFC and FBC \n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "#FFC=FBC*sqrt(2)-RA\n", + "\n", + "FBC=(RA*sin(angleFCH)-PA)/(sqrt(2)*sin(angleFCH)-(1/sqrt(2)))\n", + "print \"FBC=\",round(FBC,2),\"KN\",\"(Comp.)\"\n", + "\n", + "FFC=FBC*sqrt(2)-RA\n", + "print \"FFC=\",round(FFC,2),\"KN\",\"(Tension)\"\n", + "\n", + "#Assumed directions of FBC and FFC are correct. Therefore, FBC is in compression and FFC is in tension. Now we can proceed with method of joints to find the forces in other members. Since it is a symmetric truss, analysis of half the truss is sufficient. Other values may be written down by making use of symmetrry.\n", + "\n", + "#Joint B: sum of forces normal to AC = 0, gives \n", + "\n", + "FBF=PC*cos(angleACH)\n", + "\n", + "#sum of forces parallel to AC = 0, gives \n", + "\n", + "FAB=FBC+PC*sin(angleACH)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "\n", + "#JOINT A\n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "FAF=(FAB*sin(angleACH)+PA-RA)/sin(angleFCV)\n", + "\n", + "print \"FAF=\",round(FAF,2),\"KN\",\"(Tension)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_vhNgss4.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_vhNgss4.ipynb new file mode 100644 index 00000000..09420950 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_vhNgss4.ipynb @@ -0,0 +1,1030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3-TRUSSES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.1 Page number68" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 45.0 °\n", + "FCB= 56.57 KN\n", + "FCD= 40.0 KN\n", + "FDB= 40.0 KN\n", + "FDE= 40.0 KN\n", + "FBE= 113.14 KN\n", + "FBA= 120.0 KN\n", + "Member , Magnitude of Force in KN , Nature\n", + "AB , 120.0 , Tension\n", + "BC , 56.57 , Tension\n", + "CD , 40.0 , Compresion\n", + "DE , 40.0 , Compresion\n", + "BE , 113.14 , Compresion\n", + "BD , 40.0 , Tension\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "#Determine the inclinations of all inclined members\n", + "\n", + "theta=atan(1)*180/pi\n", + "\n", + "print \"theta=\",round(theta,2),\"°\"\n", + "\n", + "#Now at joints C, there are only two unknowns,forces in members CB and CD, say FCB and FCD.\n", + "#Now there are two equations of equilibrium for the forces meeting at the joint and two unknown forces. Hence, the unknown forces can be determined. At joint C sum V= 0 condition shows that the force FCB should act away from the joint C so that its vertical component balances the vertical downward load at C.\n", + " \n", + "P=40.0\n", + "FCB=P/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\"\n", + "\n", + "#Now sum H=0 indicates that FCD should act towards C.\n", + "\n", + "FCD=FCB*cos(theta*pi/180)\n", + "\n", + "print \"FCD=\",round(FCD,2),\"KN\"\n", + "\n", + "#In the present case, near the joint C, the arrows are marked on the members CB and CD to indicate forces FCB and FCD directions as found in the analysis of joint C. Then reversed directions are marked in the members CB and CD near joints B and D, respectively.\n", + "\n", + "FDB=40.0\n", + "FDE=40.0\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\"\n", + "\n", + "print \"FDE=\",round(FDE,2),\"KN\"\n", + "\n", + "#In the present case, after marking the forces in the members DB and DE, we find that analysis of joint B can be taken up.\n", + "\n", + "FBE=(FCB*sin(theta*pi/180)+P)/(sin(theta*pi/180))\n", + "\n", + "FBA=FCB*cos(theta*pi/180)+FBE*cos(theta*pi/180)\n", + "\n", + "print \"FBE=\", round(FBE,2),\"KN\"\n", + "print \"FBA=\", round(FBA,2),\"KN\"\n", + "#Determine the nature of forces in each member and tabulate the results. Note that if the arrow marks on a member are towards each other, then the member is in tension and if the arrow marks are away from each other, the member is in compression.\n", + "\n", + "print \"Member\",\",\",\"Magnitude of Force in KN\",\",\",\"Nature\"\n", + "print \"AB\",\",\", round(FBA,2) ,\",\",\"Tension\"\n", + "print \"BC\",\",\", round(FCB,2) ,\",\",\"Tension\"\n", + "print \"CD\",\",\", round(FCD,2) ,\",\",\"Compresion\"\n", + "print \"DE\",\",\", round(FDE,2) ,\",\",\"Compresion\"\n", + "print \"BE\",\",\", round(FBE,2) ,\",\",\"Compresion\"\n", + "print \"BD\",\",\", round(P,2) ,\",\",\"Tension\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.2 Page number70" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 83.7158 KN (Comp.)\n", + "FAE= 41.8579 KN (Tension)\n", + "FDC= 89.4893 KN (Comp.)\n", + "FDE= 44.7446 KN (Tension)\n", + "FBC= 60.6218 KN (Comp.)\n", + "FCE= 31.7543 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=40.0\n", + "PC=50.0\n", + "PE=60.0\n", + "\n", + "theta=60.0\n", + "\n", + "RD=(PC*3+PE*2+PB*1)/(4.0)\n", + "\n", + "RA=PB+PC+PE-RD\n", + "\n", + "FAB=RA/sin(theta*pi/180)\n", + "\n", + "print\"FAB=\",round(FAB,4),\"KN\" ,\"(Comp.)\"\n", + "\n", + "FAE=FAB*cos(theta*pi/180)\n", + "\n", + "print\"FAE=\",round(FAE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FDC=RD/sin(theta*pi/180)\n", + "\n", + "print\"FDC=\",round(FDC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FDE=FDC*cos(theta*pi/180)\n", + "\n", + "print\"FDE=\",round(FDE,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBE=(FAB*sin(theta*pi/180)-PB)/sin(theta*pi/180)\n", + "\n", + "FBC=(FAB+FBE)*(0.5)\n", + "print\"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "FCE=(FDC*sin(theta*pi/180)-PC)/(sin(theta*pi/180))\n", + "print\"FCE=\",round(FCE,4),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.3 Page number72" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB= 23.09 KN [Comp.]\n", + "FAC= 11.55 KN [Tensile]\n", + "FDB= 20.0 KN [Comp.]\n", + "FDC= 17.32 KN [Tensile]\n", + "FCB= 11.55 KN FCB= 11.55 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#variable declaration\n", + "\n", + "PB=20.0 #Load at point B,KN\n", + "PC=10.0 #Load at point C,KN \n", + "thetaA=60.0 #angleBAC\n", + "thetaD=30.0 #angleBDC\n", + "\n", + "AC=3.0 #length,m\n", + "CD=3.0 #length,m\n", + "\n", + "AB=(AC+CD)*cos(thetaA*pi/180)\n", + "BD=(AC+CD)*cos(thetaD*pi/180)\n", + "#mistake in book\n", + "#angleBCA=angleABC=theta\n", + "\n", + "theta=(180.0-thetaA)/(2.0) \n", + "\n", + "#Taking moment about A, we get\n", + "\n", + "RD=(PC*AC+PB*AC*cos(thetaA*pi/180))/(AC+CD)\n", + "\n", + "RA=PC+PB-RD\n", + "#Joint A\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FAB=RA/sin(thetaA*pi/180)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"[Comp.]\"\n", + "FAC=FAB*cos(thetaA*pi/180)\n", + "print \"FAC=\",round(FAC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint D\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FDB=RD/sin(thetaD*pi/180)\n", + "\n", + "print \"FDB=\",round(FDB,2),\"KN\",\"[Comp.]\"\n", + "FDC=FDB*cos(thetaD*pi/180)\n", + "print \"FDC=\",round(FDC,2),\"KN\",\"[Tensile]\"\n", + "\n", + "#Joint C\n", + "#vertical & horizontal forces sum to zero\n", + "\n", + "FCB=PC/sin(theta*pi/180)\n", + "\n", + "print \"FCB=\",round(FCB,2),\"KN\",\n", + "\n", + "#CHECK\n", + "\n", + "FCB=(FDC-FAC)/cos(theta*pi/180)\n", + "print \"FCB=\",round(FCB,2),\"KN\",\"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.4 Page number74\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FBF= 42.4264 KN (Tension)\n", + "FBC= 30.0 KN (Comp.)\n", + "FCF= 50.0 KN (Comp.)\n", + "FCD= 30.0 KN (Comp.)\n", + "FDF= 70.7107 KN (Tensile)\n", + "FDF= 70.7107 KN Checked\n" + ] + } + ], + "source": [ + "from math import sqrt,atan,pi,sin,cos\n", + "\n", + "#Now, we cannot find a joint with only two unknown forces without finding reactions.\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=30.0 #vertical load at point B,KN\n", + "PC=50.0 #vertical load at point C,KN \n", + "PDv=40.0 #vertical load at point D,KN\n", + "PDh=20.0 #Horizontal load at point D,KN\n", + "PF=30.0 #vertical load at point F,KN\n", + "HA=PDh\n", + "\n", + "RE=(PC*4+PDv*8+PDh*4+PF*4)/(8.0)\n", + "\n", + "VA=PB+PC+PDv+PF-RE\n", + "\n", + "#joint A\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FAB=VA\n", + "FAF=HA\n", + "\n", + "#joint E\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "FED=RE\n", + "FEF=0\n", + "\n", + "#Joint B: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FBF=(VA-PB)/sin(theta*pi/180)\n", + "\n", + "print\"FBF=\",round(FBF,4),\"KN\" , \"(Tension)\"\n", + "\n", + "FBC=FBF*cos(theta*pi/180)\n", + "\n", + "print\"FBC=\",round(FBC,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint C: \n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "\n", + "FCF=PC\n", + "\n", + "print\"FCF=\",round(FCF,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "FCD=FBC\n", + "\n", + "print\"FCD=\",round(FCD,4),\"KN\" , \"(Comp.)\"\n", + "\n", + "#Joint D: Noting that inclined member is at 45°\n", + "#sum of vertical & sum of horizontal forces is zero.\n", + "\n", + "theta=45.0\n", + "FDF=(RE-PDv)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"(Tensile)\"\n", + "\n", + "#check\n", + "\n", + "FDF=(FCD+PDh)/cos(theta*pi/180)\n", + "\n", + "print\"FDF=\",round(FDF,4),\"KN\" , \"Checked\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example3.5 Page number75" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FED= 25.0 KN (Tension)\n", + "FEF= 15.0 KN (Comp.)\n", + "FAB= 20.0 KN (Comp.)\n", + "FAF= 15.0 KN (Comp.)\n", + "FCB= 25.0 KN (Comp.)\n", + "FCD= 20.0 KN (Tension)\n", + "FBF= 0.0\n", + "FBD= 15.0 KN (Tension)\n", + "FFD= 0.0\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,sin,cos\n", + "\n", + "#All inclined members have the same inclination to horizontal. Now, length of an inclined member is BF\n", + "\n", + "#variable declaration\n", + "\n", + "PE=20.0\n", + "AF=3.0\n", + "FE=3.0\n", + "AB=4.0\n", + "FD=4.0\n", + "BD=3.0\n", + "CD=4.0\n", + "\n", + "BF=sqrt(pow(AF,2)+pow(AB,2))\n", + "DE=BF\n", + "BC=DE\n", + "\n", + "#sin(theta)=AB/BF\n", + "#cos(theta)=AF/BF\n", + "\n", + "theta=asin(AB/BF)\n", + "#As soon as a joint is analysed the forces on the joint are marked on members \n", + "\n", + "#Joint E\n", + "#Consider the equilibrium of the entire frame,Sum of moments about A is zero,Horizontal forces & Vertical forces is zero.\n", + "\n", + "FED=PE/sin(theta)\n", + "print\"FED=\",round(FED),\"KN\",\"(Tension)\"\n", + "\n", + "FEF=FED*cos(theta)\n", + "print\"FEF=\",round(FEF),\"KN\",\"(Comp.)\"\n", + "\n", + "#At this stage as no other joint is having only two unknowns, no further progress is possible. Let us find the reactions at the supports considering the whole structure. Let the reaction be RC HORIZONTAL at point C,VA,HA at point A Vertically & Horizontally respectively.\n", + "#Taking moment at point A,\n", + "\n", + "RC=PE*6/8 \n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "VA=PE\n", + "HA=RC\n", + "\n", + "#Joint A\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FAB=VA\n", + "print\"FAB=\",round(FAB),\"KN\",\"(Comp.)\"\n", + "\n", + "FAF=HA\n", + "print\"FAF=\",round(FAF),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint C\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "FCB=RC/cos(theta)\n", + "print\"FCB=\",round(FCB),\"KN\",\"(Comp.)\"\n", + "\n", + "FCD=FCB*sin(theta)\n", + "print\"FCD=\",round(FCD),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint B\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FBF=(FCB*sin(theta)-FAB)/sin(theta)\n", + "\n", + "print\"FBF=\",round(FBF)\n", + "\n", + "FBD=FCB*cos(theta)\n", + "print\"FBD=\",round(FBD),\"KN\",\"(Tension)\"\n", + "\n", + "#joint F\n", + "#sum of vertical & sun of horizontal forces is zero.\n", + "\n", + "FFD=FBF\n", + "print\"FFD=\",round(FFD)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 3.6 page number 78" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FHG= 25.0 KN (Comp.)\n", + "FHF= 15.0 KN (Tension)\n", + "FAC= 18.0278 KN (Comp.)\n", + "FAB= 15.0 KN (Tension)\n", + "FBC= 0.0\n", + "FBD=FBA 15.0 KN (Tension)\n", + "FCE=FCA 18.0278 KN (Comp.)\n", + "FDE= 0.0\n", + "FDF=FDB 15.0 KN (Tension)\n", + "FEF= 0\n", + "FEG=FCE= 18.0278 KN (Comp.)\n", + "FFG= 12.0 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan, cos , sin, pi\n", + "\n", + "#variable declaration\n", + "\n", + "AB=2.0 #length of beam AB,m\n", + "BD=2.0 #length of beam BD,m\n", + "DF=2.0 #length of beam DF,m\n", + "FH=3.0 #length of beam FH,m\n", + "FG=4.0 #length of beam FG,m\n", + "PF=12.0 #Vertical Load at point F,KN\n", + "PH=20.0 #Vertical Load at point H,KN\n", + "\n", + "#mistake in book FG=4.0 , given FG=2.0 \n", + "\n", + "theta1=atan(FG/(AB+BD+DF))\n", + "theta3=atan(FG/FH)\n", + "theta2=theta3\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "#joint H\n", + "\n", + "FHG=PH/sin(theta3)\n", + "print \"FHG=\",round(FHG),\"KN\",\"(Comp.)\" \n", + "\n", + "FHF=FHG*cos(theta2)\n", + "print \"FHF=\",round(FHF),\"KN\",\"(Tension)\"\n", + "\n", + "#taking moment at G\n", + "\n", + "RA=PH*FH/(AB+BD+DF)\n", + "\n", + "RG=RA+PF+PH\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAC=RA/sin(theta1)\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Comp.)\" \n", + "\n", + "FAB=FAC*cos(theta1)\n", + "print \"FAB=\",round(FAB),\"KN\",\"(Tension)\"\n", + " \n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=0\n", + "print \"FBC=\",round(FBC) \n", + "FBA=FAB\n", + "FBD=FBA\n", + "print \"FBD=FBA\",round(FBD),\"KN\",\"(Tension)\"\n", + " \n", + "#Joint C: Sum of Forces normal to AC = 0, gives FCD =0 since FBC = 0 ,sum of Forces parallel to CE =0 \n", + "\n", + "FCA=FAC\n", + "FCE=FCA\n", + "print \"FCE=FCA\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=0\n", + "print \"FDE=\",round(FDE) \n", + "\n", + "FDB=FBD\n", + "FDF=FDB\n", + "\n", + "print \"FDF=FDB\",round(FDF),\"KN\",\"(Tension)\"\n", + "\n", + "#Joint E: sum of Forces normal to CG = 0, gives FEF = 0 and sum of Forces in the direction of CG = 0, gives \n", + "\n", + "FEF=0\n", + "\n", + "print \"FEF=\",FEF\n", + "\n", + "FEG=FCE\n", + "\n", + "print \"FEG=FCE=\", round(FEG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#Joint F:\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=PF\n", + "\n", + "print \"FFG=\",round(FFG),\"KN\",\"(Tension)\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.7 page number 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FGF= 23.094 KN (Tension)\n", + "FGE= 11.547 KN (Comp.)\n", + "FFG= 23.094 KN (Comp.)\n", + "FFD= 13.094 KN (Tension)\n", + "FAB= 36.7543 KN (Comp.)\n", + "FAC= 8.3771 KN (Tension)\n", + "FBC= 9.4338 KN (Comp.)\n", + "FBD= 13.6603 KN (Comp.)\n", + "FCD= 9.4338 KN (Tension)\n", + "FCE= 1.0566 KN (Comp.)\n", + "FDE= 44.0748 KN (Comp.)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "# Since all members are 3 m long, all triangles are equilateral and hence all inclined members are at 60° to horizontal. Joint-by-joint analysis is carried out . Then nature of the force is determined. \n", + "\n", + "#variable declaration\n", + "\n", + "AB=3.0\n", + "BC=AB\n", + "AC=AB\n", + "BD=BC\n", + "CD=BD\n", + "CE=CD\n", + "DE=CE\n", + "EF=DE\n", + "DF=DE\n", + "EG=DE\n", + "FG=DF\n", + "\n", + "theta=60.0*pi/180 #angles BAC,BCA,DCE,DEC,FEG,FGE,°\n", + "\n", + "PB=40.0 #Vertical Loading at point B,KN\n", + "PD=30.0 #Vertical Loading at point D,KN\n", + "HF=10.0 #Horizontal Loading at point F,KN\n", + "PG=20.0 #Vertical Loading at point G,KN\n", + "\n", + "#joint G\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGF=PG/sin(theta)\n", + "\n", + "print \"FGF=\",round(FGF,4),\"KN\",\"(Tension)\"\n", + "\n", + "FGE=FGF*cos(theta)\n", + "\n", + "print \"FGE=\",round(FGE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint F\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FFG=FGF\n", + "\n", + "print \"FFG=\",round(FFG,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FFE=FGF\n", + "FFD=FGF*cos(theta)+FFE*cos(theta)-HF\n", + "print \"FFD=\",round(FFD,4),\"KN\",\"(Tension)\"\n", + "\n", + "#Now, without finding reaction we cannot proceed. Hence, consider equilibrium of the entire truss\n", + "#moment about point A\n", + "\n", + "RE=((PB*AC/2)-(HF*EF*sin(theta))+(PD*(AC+CE/2))+(PG*(AC+CE+EG)))/(AC+CE)\n", + "\n", + "VA=PB+PD+PG-RE\n", + "\n", + "HA=HF\n", + "\n", + "#joint A\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FAB=VA/sin(theta)\n", + "\n", + "print \"FAB=\",round(FAB,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FAC=FAB*cos(theta)-HF\n", + "\n", + "print \"FAC=\",round(FAC,4),\"KN\",\"(Tension)\"\n", + "\n", + "\n", + "#joint B\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FBC=(PB-FAB*sin(theta))/sin(theta)\n", + "\n", + "print \"FBC=\",round(FBC,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FBA=FAB\n", + "FBD=-FBC*cos(theta)+FBA*cos(theta)\n", + "\n", + "print \"FBD=\",round(FBD,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint C\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FCD=FBC*sin(theta)/sin(theta)\n", + "\n", + "print \"FCD=\",round(FCD,4),\"KN\",\"(Tension)\"\n", + "\n", + "FCE=FCD*cos(theta)+FBC*cos(theta)-FAC\n", + "\n", + "print \"FCE=\",round(FCE,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#joint D\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FDE=(PD+FCD*sin(theta))/sin(theta)\n", + "\n", + "print \"FDE=\",round(FDE,4),\"KN\",\"(Comp.)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.8 page number82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FFH= 69.282 KN (Comp.)\n", + "FGH= 5.7735 KN (Comp.)\n", + "FGI= 72.1688 KN (Tensile)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi\n", + "\n", + "#Each load is 10 kN and all triangles are equilateral with sides 4 m.\n", + "\n", + "#variable declaration\n", + "\n", + "PB=10.0\n", + "PD=PB\n", + "PF=PD\n", + "AB=4.0\n", + "BC=AB\n", + "AC=BC\n", + "BD=BC\n", + "CD=BC\n", + "DE=CD\n", + "CE=CD\n", + "DF=DE\n", + "EF=DE\n", + "EG=DE\n", + "FG=EF\n", + "#Take section (A)–(A), which cuts the members FH, GH and GI and separates the truss into two parts. \n", + "AG=AC+CE+EG\n", + "BG=CE+EG+AC/2\n", + "DG=EG+CE/2\n", + "FG1=EG/2\n", + "RA=PB*7/2\n", + "RO=RA\n", + "theta=60.0*pi/180\n", + "#moment at point G\n", + "FFH=(RA*AG-PB*BG-PD*DG-PF*FG1)/(FG*sin(theta))\n", + "print \"FFH=\",round(FFH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "\n", + "FGH=(RA-PB-PD-PF)/(sin(theta))\n", + "print \"FGH=\",round(FGH,4),\"KN\",\"(Comp.)\"\n", + "\n", + "FGI=FFH+FGH*cos(theta)\n", + "print \"FGI=\",round(FGI,4),\"KN\",\"(Tensile)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.9 page number 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL3L4= 412.5 KN (Tension)\n", + "FU4U3= 456.2 KN (Comp.)\n", + "FU4L3= 62.5 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import asin,acos,sin,cos,sqrt\n", + "\n", + "#To determine reactions, consider equilibrium equations\n", + "\n", + "#variable declaration\n", + " #all Vertical loading are in KN\n", + "PL1=200.0 \n", + "PL2=200.0\n", + "PL3=150.0\n", + "PL4=100.0\n", + "PL5=100.0\n", + "\n", + "#length in m\n", + "UL1=6.0\n", + "UL2=8.0\n", + "UL3=9.0\n", + "UL4=UL2\n", + "UL5=UL1\n", + "\n", + "L1=6.0\n", + "L2=6.0\n", + "L3=6.0\n", + "L4=6.0\n", + "L5=6.0\n", + "L6=6.0\n", + "\n", + "#moment at point LO\n", + "\n", + "R2=(PL1*L1+PL2*(L1+L2)+PL3*(L1+L2+L3)+PL4*(L1+L2+L3+L4)+PL5*(L1+L2+L3+L4+L5))/(L1+L2+L3+L4+L5+L6)\n", + "\n", + "R1=PL1+PL2+PL3+PL4+PL5-R2\n", + "\n", + "#Take the section (1)–(1) and consider the right hand side part.\n", + "\n", + "U3U4=sqrt(pow(1,2)+pow(UL1,2))\n", + "theta1=asin(1/U3U4)\n", + "\n", + "L3U4=sqrt(pow(UL1,2)+pow(UL2,2))\n", + "theta2=asin(6/L3U4)\n", + "\n", + "#moment at U4\n", + "\n", + "FL3L4=(R2*(L5+L6)-PL4*L4)/UL4\n", + "\n", + "print \"FL3L4=\", round(FL3L4,1),\"KN\",\"(Tension)\"\n", + "\n", + "#moment at L3\n", + "FU4U3=(-PL4*L4-PL5*(L4+L5)+R2*(L4+L5+L6))/(cos(theta1)*UL3)\n", + "print \"FU4U3=\", round(FU4U3,1),\"KN\",\"(Comp.)\"\n", + "\n", + "#sum of horizontal forces \n", + "FL4L3=FL3L4\n", + "FU4L3=(-FL4L3+FU4U3*cos(theta1))/sin(theta2)\n", + "print \"FU4L3=\", round(FU4L3,1),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.10 page number84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 60.0 °\n", + "F2= 51.9615 KN (Tension)\n", + "F1= 110.0 KN (Comp.)\n", + "F3= 69.282 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import atan,tan,sin,cos,pi\n", + "\n", + "#Each load is 20 kN.\n", + "\n", + "#variable declaration\n", + "\n", + "P=20.0\n", + "AB=18.0\n", + "A=3.0\n", + "\n", + "RA=P*7/2\n", + "RB=RA\n", + "\n", + "theta1=30.0*pi/180\n", + "a=(3*A)/(4*cos(theta1))\n", + "#Take Section (A)–(A) and consider the equilibrium of left hand side part of the French Truss\n", + "#Drop perpendicular CE on AB. \n", + "\n", + "CE=3*A*tan(theta1)\n", + "DE=A\n", + "\n", + "theta=atan(CE/DE)*180/pi\n", + "print \"theta=\",round(theta),\"°\"\n", + "\n", + "#moment at point A\n", + "\n", + "F2=(P*a*cos(theta1)*6)/(A*2*sin(theta*pi/180))\n", + "print \"F2=\",round(F2,4),\"KN\",\"(Tension)\"\n", + "\n", + "#sum of all vertical forces & sum of all horizotal forces is zero\n", + "F1=(F2*sin(theta*pi/180)+RA-P*3)/(sin(theta1))\n", + "print \"F1=\",round(F1,4),\"KN\",\"(Comp.)\"\n", + "\n", + "F3=F1*cos(theta1)-F2*cos(theta*pi/180)\n", + "print \"F3=\",round(F3,4),\"KN\",\"(Tension)\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 3.11 page number 85" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAE= 30.0 KN (Tension)\n", + "FBC= 71.4 KN (Comp.)\n", + "FFC= 40.98 KN (Tension)\n", + "FAB= 92.62 KN (Comp.)\n", + "FAF= 40.98 KN (Tension)\n" + ] + } + ], + "source": [ + "from math import sin,cos,pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "PA=15.0 #vertical loading at point A,KN\n", + "PB=30.0 #vertical loading at point B,KN\n", + "PC=30.0 #vertical loading at point C,KN\n", + "PD=30.0 #vertical loading at point D,KN\n", + "PE=15.0 #vertical loading at point E,KN\n", + "\n", + "#Due to symmetry, the reactions are equal\n", + "RA=(PA+PB+PC+PD+PE)/2\n", + "RB=RA\n", + "#Drop perpendicular CH on AF. \n", + "#in traingle ACH\n", + "\n", + "angleACH=45.0*pi/180 #angleACH,°\n", + "angleFCV=30.0*pi/180 # FC is inclined at 30° to vertical i.e., 60° to horizontal and CH = 5 m \n", + "CH=5.0\n", + "angleFCH=60.0*pi/180\n", + "\n", + "#It is not possible to find a joint where there are only two unknowns. Hence, consider section (1)–(1). \n", + "#For left hand side part of the frame\n", + "#moment at C\n", + "\n", + "FAE=(RA*CH-PA*CH-PB*CH/2)/(CH)\n", + "print \"FAE=\",round(FAE),\"KN\",\"(Tension)\"\n", + "\n", + "#Assuming the directions for FFC and FBC \n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "#FFC=FBC*sqrt(2)-RA\n", + "\n", + "FBC=(RA*sin(angleFCH)-PA)/(sqrt(2)*sin(angleFCH)-(1/sqrt(2)))\n", + "print \"FBC=\",round(FBC,2),\"KN\",\"(Comp.)\"\n", + "\n", + "FFC=FBC*sqrt(2)-RA\n", + "print \"FFC=\",round(FFC,2),\"KN\",\"(Tension)\"\n", + "\n", + "#Assumed directions of FBC and FFC are correct. Therefore, FBC is in compression and FFC is in tension. Now we can proceed with method of joints to find the forces in other members. Since it is a symmetric truss, analysis of half the truss is sufficient. Other values may be written down by making use of symmetrry.\n", + "\n", + "#Joint B: sum of forces normal to AC = 0, gives \n", + "\n", + "FBF=PC*cos(angleACH)\n", + "\n", + "#sum of forces parallel to AC = 0, gives \n", + "\n", + "FAB=FBC+PC*sin(angleACH)\n", + "\n", + "print \"FAB=\",round(FAB,2),\"KN\",\"(Comp.)\"\n", + "\n", + "\n", + "\n", + "#JOINT A\n", + "#sum of vertical & sum of horizontal forces is zero\n", + "\n", + "FAF=(FAB*sin(angleACH)+PA-RA)/sin(angleFCV)\n", + "\n", + "print \"FAF=\",round(FAF,2),\"KN\",\"(Tension)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_JAwYggT.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_JAwYggT.ipynb new file mode 100644 index 00000000..d78e1aa8 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_JAwYggT.ipynb @@ -0,0 +1,1403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4-DISTRIBUTED FORCES, CENTRE OF GRAVITY AND MOMENT OF INERTIA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.1 page number 102\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 407.44 mm\n", + "yc= 101.65 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#variable declaration\n", + "\n", + "L1=600.0 #length of wire AB,mm\n", + "L2=200.0 #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "\n", + "X1=300.0\n", + "X2=600.0\n", + "X3=600.0-150*cos(theta)\n", + "Y1=0\n", + "Y2=100\n", + "Y3=200+150*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.2 page number 103" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 451.2 mm\n", + "yc= 54.07 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids \n", + "\n", + "#variable declaration\n", + "\n", + "L1=400.0 #length of wire AB,mm\n", + "L2=150.0*pi #length of wire BC,mm\n", + "L3=250.0 #length of wire CD,mm\n", + "theta=30*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=200.0\n", + "X2=475.0\n", + "X3=400+300.0+250*cos(theta)/2\n", + "\n", + "Y1=0\n", + "Y2=2*150/pi\n", + "Y3=125*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.3 page number 105" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.19 mm\n", + "yc= 198.5 mm\n", + "zc= 56.17 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "# The length and the centroid of portions AB, BC and CD \n", + "# portion AB is in x-z plane, BC in y-z plane and CD in x-y plane. AB and BC are semi circular in shape\n", + "\n", + "#variable declaration\n", + "\n", + "L1=100.0*pi #length of wire AB,mm\n", + "L2=140.0*pi #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=100.0\n", + "X2=0\n", + "X3=300*sin(theta)\n", + "\n", + "Y1=0\n", + "Y2=140\n", + "Y3=280+300*cos(theta)\n", + "Z1=2*100/pi\n", + "Z2=2*140/pi\n", + "Z3=0\n", + "\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "zc=(L1*Z1+L2*Z2+L3*Z3)/L\n", + "\n", + "print \"zc=\",round(zc,2),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.4 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 0.0\n", + "yc= 40.0 mm\n", + "Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20.0 #Area of 1 ,mm^2\n", + "A2=20.0*100.0 #Area of 2,mm^2\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=10\n", + "Y2=70\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "print \"Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.5 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 36.62\n", + "yc= 61.62 mm\n", + "Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=150.0*12.0 #Area of 1 ,mm^2\n", + "A2=(200.0-12.0)*12.0 #Area of 2,mm^2\n", + "\n", + "X1=75\n", + "X2=6\n", + "\n", + "Y1=6\n", + "Y2=12+(200-12)/2\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.6 page number 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "yc= 59.71 mm\n", + "Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20 #Area of 1 ,mm^2\n", + "A2=100.0*20.0 #Area of 2,mm^2\n", + "A3=150.0*30.0 #Area of 3,mm^2\n", + "\n", + "#Selecting the coordinate system, due to symmetry centroid must lie on y axis,\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=30+100+20/2\n", + "Y2=30+100/2\n", + "Y3=30/2\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.7 page number 113" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 3.523 m\n", + "yc= 2.777 m\n" + ] + } + ], + "source": [ + "# Note that it is convenient to take axis in such a way that the centroids of all simple figures are having positive coordinates. If coordinate of any simple figure comes out to be negative, one should be careful in assigning the sign of moment of area \n", + "\n", + "#variable declaration\n", + "\n", + "A1=2.0*6.0*1.0/2.0 #Area of 1,m^2\n", + "A2=2.0*7.5 #Area of 2,m^2\n", + "A3=3.0*5.0*1.0/2 #Area of 3,m^2\n", + "A4=1.0*4.0 #Area of 4,m^2\n", + "\n", + "#The composite figure can be conveniently divided into two triangles and two rectangle\n", + "\n", + "X1=2.0*2.0/3.0\n", + "X2=2.0+1.0\n", + "X3=2.0+2.0+(1.0*3.0/3.0)\n", + "X4=4.0+4.0/2.0\n", + "\n", + "Y1=6.0/3.0\n", + "Y2=7.5/2.0\n", + "Y3=1.0+5.0/3.0\n", + "Y4=1/2.0\n", + "\n", + "A=A1+A2+A3+A4\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4)/A\n", + "\n", + "print \"xc=\",round(xc,3),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.8 page number 114\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 2.995 m\n", + "yc= 1.89 m\n" + ] + } + ], + "source": [ + "\n", + "# The composite section is divided into three simple figures, a triangle, a rectangle and a semicircle\n", + "\n", + "from math import pi\n", + "#variable declaration\n", + "\n", + "A1=1.0*3.0*4.0/2.0 #Area of 1,m^2\n", + "A2=6.0*4.0 #Area of 2,m^2\n", + "A3=1.0*pi*pow(2,2)/2 #Area of 3,m^2\n", + "\n", + "#The coordinates of centroids of these three simple figures are:\n", + "\n", + "X1=6.0+3.0/3.0\n", + "X2=3.0\n", + "X3=-(4*2)/(3.0*pi)\n", + "\n", + "Y1=4.0/3.0\n", + "Y2=2.0\n", + "Y3=2.0\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "print \"xc=\",round(xc,4),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.9 page number 115" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 145.42 m\n", + "yc= 90.39 m\n" + ] + } + ], + "source": [ + "#The composite area is equal to a rectangle of size 160 × 280 mm plus a triangle of size 280 mm base width and 40 mm height and minus areas of six holes. In this case also the can be used for locating centroid by treating area of holes as negative. The area of simple figures and their centroids are\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Ar=160.0*280.0 #Area of rectangle,mm^2\n", + "At=280.0*40.0/2.0 #Area of triangle,mm^2\n", + "d=21.5 #diameter of hole,mm \n", + "Ah=-pi*pow(d,2)/4 #Area of hole,mm^2\n", + "\n", + "A=Ar+At+Ah*6\n", + "\n", + "\n", + "Xr=140.0\n", + "Xt=560/3.0\n", + "Xh1=70.0\n", + "Xh2=140.0\n", + "Xh3=210.0\n", + "Xh4=70.0\n", + "Xh5=140.0\n", + "Xh6=210.0\n", + "\n", + "Yr=80.0\n", + "Yt=160.0+40.0/3.0\n", + "Yh1=50.0\n", + "Yh2=50.0\n", + "Yh3=50.0\n", + "Yh4=120.0\n", + "Yh5=130.0\n", + "Yh6=140.0\n", + "\n", + "xc=(Ar*Xr+At*Xt+Ah*(Xh1+Xh2+Xh3+Xh4+Xh5+Xh6))/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(Ar*Yr+At*Yt+Ah*(Yh1+Yh2+Yh3+Yh4+Yh5+Yh6))/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.10 page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.48 mm\n", + "yc= 67.86 mm\n" + ] + } + ], + "source": [ + "# If xc and yc are the coordinates of the centre of the circle, centroid also must have the coordinates xc and yc as per the condition laid down in the problem. The shaded area may be considered as a rectangle of size 200 mm × 150 mm minus a triangle of sides 100 mm × 75 mm and a circle of diameter 100 mm.\n", + "\n", + "\n", + "#variable declaration\n", + "\n", + "Ap=200.0*150.0 #Area of plate,mm^2\n", + "At=100.0*75.0/2.0 #Area of triangle,mm^2\n", + "Ah=pi*pow(100,2)/4.0 #Area of hole ,mm^2\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "\n", + "X1=100.0\n", + "X2=200.0-100.0/3.0\n", + "#X3=Xc\n", + "\n", + "Y1=75.0\n", + "Y2=150.0-25.0\n", + "#Y3=Yc\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "xc=(Ap*X1-At*X2)/(Ah+A)\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "yc=(Ap*Y1-At*Y2)/(Ah+A)\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.11 page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 326.4 m\n", + "yc= 219.12 m\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "X=40.0\n", + "A1=14.0*12.0*pow(X,2) #Area of rectangle,mm^2\n", + "A2=6.0*4.0*pow(X,2)/2.0 #Area of triangle,mm^2\n", + "A3=-4*4*pow(X,2) #Area of removed subtracted,mm^2\n", + "A4=-pi*pow(4*X,2)/2.0 #Area of semicircle to be subtracted,mm^2\n", + "A5=-pi*pow(4*X,2)/4.0 #Area of quarter of circle to be subtracted,mm^2\n", + "\n", + "X1=7.0*X\n", + "X2=14*X+2*X\n", + "X3=2*X\n", + "X4=6.0*X\n", + "X5=14.0*X-(16*X/(3*pi))\n", + "\n", + "Y1=6.0*X\n", + "Y2=4.0*X/3.0\n", + "Y3=8.0*X+2.0*X\n", + "Y4=(16.0*X)/(3*pi)\n", + "Y5=12*X-4*(4*X/(3*pi))\n", + "\n", + "A=A1+A2+A3+A4+A5\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.12 page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 6372441.9 mm^4\n", + "Iyy= 2824166.0 mm^4\n", + "kxx= 46.88 mm\n", + "kyy= 31.21 mm\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + "from math import pi,sqrt\n", + "#variable declaration\n", + "\n", + "\n", + "A1=150.0*10.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "#Due to symmetry, centroid lies on the symmetric axis y-y. The distance of the centroid from the top most fibre is given by:\n", + "\n", + "Y1=5.0\n", + "Y2=10.0+70.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#Referring to the centroidal axis x-x and y-y, the centroid of A1 is g1 (0.0, yc-5) and that of A2 is g2 (0.0, 80-yc)\n", + "\n", + "#Moment of inertia of the section about x-x axis Ixx = moment of inertia of A1 about x-x axis + moment of inertia of A2 about x-x axis.\n", + "\n", + "\n", + "Ixx=(150*pow(10,3)/12)+(A1*pow((yc-5),2))+(10*pow(140,3)/12)+(A2*pow((80-yc),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(10*pow(150,3)/12)+(140*pow(10,3)/12)\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Hence, the moment of inertia of the section about an axis passing through the centroid and parallel to the top most fibre is Ixxmm^4 and moment of inertia of the section about the axis of symmetry is Iyy mm^4. \n", + "#The radius of gyration is given by\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print\"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print\"kyy=\",round(kyy,2),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.13 page number 131" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 3411298.7 mm^4\n", + "Iyy= 1208657.7 mm^4\n", + "Izz= 4619956.4 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=125.0*10.0 #Area of 1,mm^2\n", + "A2=75.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "\n", + "#First, the centroid of the given section is to be located. Two reference axis (1)–(1) and (2)–(2) \n", + "\n", + "#The distance of centroid from the axis (1)–(1)\n", + "\n", + "X1=5.0\n", + "X2=10.0+75.0/2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "#Similarly, the distance of the centroid from the axis (2)–(2)\n", + "\n", + "Y1=125.0/2\n", + "Y2=5.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#With respect to the centroidal axis x-x and y-y, the centroid of A1 is g1 (xc-5, (85/2)-xc) and that of A2 is g2 ((135/2)-yc, yc-5). \n", + "Ixx=(10*pow(125,3)/12)+(A1*pow(21.56,2))+(75.0*pow(10.0,3.0)/12)+(A2*pow((39.94),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(125*pow(10,3)/12)+(A1*pow(15.94,2))+(10*pow(75,3)/12)+(A2*pow(26.56,2)) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# eample 4.14 page number 132" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 59269202.1 mm^4\n", + "Iyy= 12005814.8 mm^4\n", + "Izz= 71275016.9 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=200.0*9.0 #Area of 1,mm^2\n", + "A2=(250.0-9*2)*6.7 #Area of 2,mm^2\n", + "A3=200.0*9.0 #Area of 3,mm^2 \n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The section is symmetrical about both x-x and y-y axis. \n", + "X1=0\n", + "X2=0\n", + "X3=0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "\n", + "Y1=245.5\n", + "Y2=125.0\n", + "Y3=4.5\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#Therefore, its centroid will coincide with the centroid of rectangle A2. With respect to the centroidal axis x-x and y-y, the centroid of rectangle A1 is g1 (0.0, 120.5), that of A2 is g2 (0.0, 0.0) and that of A3 is g3 (0.0, 120.5).\n", + "\n", + "Ixx=(200.0*pow(9,3)/12)+(A1*pow(yc-4.5,2))+(6.7*pow(232,3.0)/12)+0+(200*pow(9,3)/12)+(A3*pow((yc-4.5),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(9*pow(200,3)/12)+(232*pow(6.7,3)/12)+(9*pow(200,3)/12) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "#misprint in book\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.15 page number 133" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 135903229.0 mm^4\n", + "Iyy= 5276363.1 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*13.5 #Area of 1,mm^2\n", + "A2=(400.0-27.0)*8.1 #Area of 2,mm^2\n", + "A3=100.0*13.5 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The given section is symmetric about horizontal axis passing through the centroid g2 of the rectangle A2.\n", + "\n", + "X1=50.0\n", + "X2=8.1/2.0\n", + "X3=50.0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "Y1=386.5+13.5/2.0\n", + "Y2=200.0\n", + "Y3=13.5/2\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y\n", + "\n", + "Ixx=(100.0*pow(13.5,3)/12.0)+(A1*pow((200-(13.5/2)),2))+(8.1*pow(373,3.0)/12.0)+0+(100*pow(13.5,3)/12.0)+(A3*pow((200-(13.5/2)),2))\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(13.5*pow(100.0,3)/12.0)+(A1*pow((50-xc),2))+(373.0*pow(8.1,3.0)/12.0)+A2*pow(21.68,2)+(13.5*pow(100,3)/12.0)+(A3*pow((50-xc),2))\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.16 page number 134\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polar moment of Inertia= 32109472.0 mm^4\n", + "kxx= 90.3 mm\n", + "kyy= 23.09 mm\n" + ] + } + ], + "source": [ + "# The section is divided into three rectangles A1, A2 and A3\n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=80.0*12.0 #Area of 1,mm^2\n", + "A2=(150.0-22.0)*12.0 #Area of 2,mm^2\n", + "A3=120.0*10.0 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on axis y-y. The bottom fibre (1)–(1) is chosen as reference axis to locate the centroid\n", + "\n", + "Y1=150-6\n", + "Y2=(128/2) +10\n", + "Y3=5\n", + "\n", + "yc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "X1=60.0\n", + "X2=60.0\n", + "X3=60.0\n", + "\n", + "xc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangles A1 is g1 (0.0, 150-6-yc), that of A2 is g2 (0.0, 75-yc) and that of A3 is g3 (0.0, yc-5 ).\n", + "\n", + "Iyy=(12*(pow(80,3))/12)+(128*(pow(12,3))/12)+(10*(pow(120,3))/12)\n", + "\n", + "Ixx=(80.0*pow(12.0,3)/12.0)+(A1*pow((150-6-yc),2))+(12*pow(128,3.0)/12.0)+(A2*pow((75-yc),2))+(120*pow(10,3)/12.0)+(A3*pow((150-10-6-yc),2))\n", + "\n", + "\n", + "\n", + "PolarmomentofInertia=Ixx+Iyy\n", + "\n", + "print \"Polar moment of Inertia=\",round(PolarmomentofInertia),\"mm^4\"\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print \"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print \"kyy=\",round(kyy,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.17 page number 135" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 31543827.2 mm^4\n", + "Iyy= 19745121.6 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#The given composite section may be divided into simple rectangles and triangle\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*30.0 #Area of 1,mm^2\n", + "A2=100.0*25.0 #Area of 2,mm^2\n", + "A3=200.0*20.0 #Area of 3,mm^2 \n", + "A4=87.5*20.0/2.0 #Area of 4,mm^2\n", + "A5=87.5*20.0/2.0 #Area of 5,mm^2\n", + "\n", + "A=A1+A2+A3+A4+A5 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on the axis y-y. A reference axis (1)–(1) is choosen as shown in the figure. The distance of the centroidal axis from (1)–(1)\n", + "\n", + "X1=100.0\n", + "X2=100.0\n", + "X3=100.0\n", + "X4=2.0*87.5/3.0\n", + "X5=200-X4\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "Y1=135.0\n", + "Y2=70.0\n", + "Y3=10.0\n", + "Y4=(20.0/3.0)+20.0\n", + "Y5=Y4\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangle A1 is g1 (0.0,135.0-yc), that of A2 is g2(0.0,70.00-yc), that of A3 is g3 (0.0, yc-10.0), the centroid of triangle A4 is g4 (41.66,yc-20.0-(20.0/3.0) ) and that of A5 is g5 (41.66,yc-20.0-(20.0/3.0)).\n", + "\n", + "\n", + "Ixx=(100.0*pow(30,3)/12.0)+(A1*pow((135.0-yc),2))+(25.0*pow(100,3.0)/12.0)+(A2*pow((70.0-yc),2))+(200*pow(20,3)/12.0)+(A3*pow((yc-10.0),2))+((87.5*pow(20,3)/36.0)+(A4*pow((yc-20.0-(20.0/3.0)),2)))*2\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(30.0*pow(100,3)/12.0)+(100.0*pow(25,3.0)/12.0)+(20*pow(200,3)/12.0)+((20.0*pow(87.5,3)/36.0)+(A4*pow((41.66),2)))*2\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.18 page number137" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 806093331.0 mm^4\n" + ] + } + ], + "source": [ + "#In this problem, it is required to find out the moment of inertia of the section about an axis AB. So there is no need to find out the position of the centroid. \n", + "#The given section is split up into simple rectangles\n", + "#Moment of inertia about AB = Sum of moments of inertia of the rectangle about AB\n", + "\n", + "#variable declaration\n", + "\n", + "A1=400*20.0\n", + "A2=100*10\n", + "A3=10*380.0\n", + "A4=100*10.0\n", + "\n", + "IAB=(400.0*pow(20,3)/12)+(A1*pow(10,2))+((100*pow(10,3)/12)+(A2*pow(25,2)))*2+((10*pow(380,3)/12)+(A3*pow(220,2)))*2+((100*pow(10,3)/12)+(A4*pow(415,2)))*2\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.19 page number 137" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 50399393.9 mm^4\n" + ] + } + ], + "source": [ + "# The built-up section is divided into six simple rectangles\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=250.0*10.0 #Area of 1,mm^2\n", + "A2=40.0*10.0 #Area of 2,mm^2\n", + "\n", + "A=A1*2+A2*4 #Total area,mm^2 \n", + "\n", + "\n", + "Y1=5.0\n", + "Y2=30.0\n", + "Y3=15.0\n", + "Y4=255.0\n", + "Y5=135.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A2*Y3+A2*Y4+A1*Y5)/A\n", + "\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(250.0*pow(10,3)/12.0)+(A1*pow((yc-5),2))+((10.0*pow(40,3.0)/12.0)+(A2*pow((yc-30.0),2)))*2+(40*pow(10,3)/12.0)+(A2*pow((yc-15.0),2))+(10.0*pow(250.0,3.0)/12.0)+(A1*pow((yc-135.0),2))+(40.0*pow(10.0,3)/12)+(A2*pow((yc-255),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.20 page number 138" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "145.394736842\n", + "Ixx= 752680131.6 mm^4\n" + ] + } + ], + "source": [ + "#Each angle is divided into two rectangles \n", + "\n", + "#variable declaration\n", + "\n", + "A1=600.0*15.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A3=150.0*10.0\n", + "A4=400.0*20.0\n", + "A=A1+A2*2+A3*2+A4 #Total area,mm^2 \n", + "\n", + "#The distance of the centroidal axis from the bottom fibres of section \n", + "\n", + "Y1=320.0\n", + "Y2=100.0\n", + "Y3=25.0\n", + "Y4=10.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A3*Y3*2+A4*Y4)/A\n", + "print yc\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(15.0*pow(600,3)/12.0)+(A1*pow((yc-320),2))+((10.0*pow(140,3.0)/12.0)+(A2*pow((yc-100.0),2)))*2+((150*pow(10,3)/12.0)+(A3*pow((yc-15.0),2)))*2+(400.0*pow(20.0,3.0)/12.0)+(A4*pow((yc-10.0),2))\n", + "\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.21 page number 139" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 36000000.0 mm^4\n" + ] + } + ], + "source": [ + "\n", + "from math import asin,sin,cos,pi\n", + "\n", + "#The rectangle is divided into four triangles\n", + "#The lines AE and FC are parallel to x-axis\n", + " \n", + "#variable declaration\n", + "\n", + "theta=asin(4.0/5.0)\n", + "\n", + "AB=100.0\n", + "BK=AB*sin((90*pi/180)-theta)\n", + "ND=BK\n", + "FD=60.0/sin(theta)\n", + "AF=150.0-FD\n", + "FL=ME=75.0*sin(theta)\n", + "AE=AB/cos((90*pi/180)-theta)\n", + "FC=AE\n", + "A=125.0*60.0/2.0\n", + "\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(125*pow(60,3)/36)+(A*pow((ND*4.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*2.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))\n", + "\n", + "print \"Ixx=\",round(Ixx),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.22, page number 140" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 4292979.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into a triangle PQR, a semicircle PSQ having base on axis AB and a circle having its centre on axis AB\n", + "\n", + "#variable declaration\n", + "#Now,Moment of inertia of the section about axis AB\n", + "IAB=(80*pow(80,3)/12)+(pi*pow(80,4)/128)-(pi*pow(40,4)/64)\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.23 page number141" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "106.435694487 28.4724404943\n", + "Ixx= 686943.0 mm^4\n", + "Iyy= 17146488.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into three simple figures viz., a triangle ABC, a rectangle ACDE and a semicircle. \n", + "\n", + "#variable declaration\n", + "\n", + "r=20.0 #radius of semicircle\n", + "A1=80.0*20.0/2 #Area of triangle ABC \n", + "A3=40.0*80.0 #Area of rectangle ACDE \n", + "A4=pi*pow(r,2)/2 #Area of semicircle\n", + "At1=30.0*20.0/2.0\n", + "At2=50.0*20.0/2.0\n", + "A=A1+A3-A4 #Total area\n", + "\n", + "X1=2.0*30.0/3.0\n", + "X2=50.0*30.0/3.0\n", + "X3=40.0\n", + "X4=40.0\n", + "\n", + "xc=(At1*X1+At2*X2+A3*X3-A4*X4)/A\n", + "#mistake in book\n", + "\n", + "Y1=(20.0/3.0)+40.0\n", + "Y3=20.0\n", + "Y4=(4.0*20.0)/(3.0*pi)\n", + "\n", + "yc=(A1*Y1+A3*Y3-A4*Y4)/A\n", + "print xc,yc\n", + "#\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(80.0*pow(20.0,3)/36) +A1*pow((60.0-(2*20.0/3.0)-yc),2)+(80*pow(40,3)/12)+(A3*pow((yc-20.0),2))-((0.0068598*pow(20,4))+(A4*pow((yc-Y4),2)))\n", + "\n", + "print\"Ixx=\",round(Ixx),\"mm^4\"\n", + "\n", + "\n", + "Iyy=(20.0*pow(30.0,3)/36) +At1*pow((xc-(2*30.0/3.0)),2)+(20*pow(50,3)/36)+(At2*pow((xc-(30.0+(50/3))),2))+((40*pow(80,3)/12)+(A3*pow((xc-40),2)))-((pi*pow(40,4))/(2*64))-(A4*pow((40-xc),2))\n", + "\n", + "print\"Iyy=\",round(Iyy),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.27 page number 150" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25000.0 5625.0 235.619449019 7889.38055098\n", + "xc= 0.411 m\n", + "yc= 0.329 m\n", + "zc= 0.221 m\n" + ] + } + ], + "source": [ + "#A concrete block of size 0.60 m × 0.75 m × 0.5 m is cast with a hole of diameter 0.2 m and depth 0.3 m\n", + "#The hole is completely filled with steel balls weighing 2500 N. Locate the centre of gravity of the body.\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "W=25000.0 # weight of concrete=25000, N/m^3\n", + "W1=0.6*0.75*0.5*W #Weight of solid concrete block\n", + "W2=pi*pow(0.2,2)*0.3*W/4 #Weight of concrete (W2) removed for making hole:\n", + "W3=2500\n", + "\n", + "#Taking origin as shown in the figure, the centre of gravity of solid block is (0.375, 0.3, 0.25) and that of hollow portion is (0.5, 0.4, 0.15)\n", + "\n", + "X1=0.375\n", + "X2=0.5\n", + "X3=0.5\n", + "\n", + "Y1=0.3\n", + "Y2=0.4\n", + "Y3=0.4\n", + "\n", + "Z1=0.25\n", + "Z2=0.15\n", + "Z3=0.15\n", + "\n", + "Wt=W3+W1-W2\n", + "print W,W1,W2,Wt\n", + "xc=(W1*X1-W2*X2+W3*X3)/Wt\n", + "\n", + "yc=(W1*Y1-W2*Y2+W3*Y3)/Wt\n", + "\n", + "zc=(W1*Z1-W2*Z2+W3*Z3)/Wt\n", + "\n", + "print\"xc=\",round(xc,3),\"m\"\n", + "print\"yc=\",round(yc,3),\"m\"\n", + "print\"zc=\",round(zc,3),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_N9DqFsm.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_N9DqFsm.ipynb new file mode 100644 index 00000000..d78e1aa8 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_N9DqFsm.ipynb @@ -0,0 +1,1403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4-DISTRIBUTED FORCES, CENTRE OF GRAVITY AND MOMENT OF INERTIA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.1 page number 102\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 407.44 mm\n", + "yc= 101.65 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#variable declaration\n", + "\n", + "L1=600.0 #length of wire AB,mm\n", + "L2=200.0 #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "\n", + "X1=300.0\n", + "X2=600.0\n", + "X3=600.0-150*cos(theta)\n", + "Y1=0\n", + "Y2=100\n", + "Y3=200+150*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.2 page number 103" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 451.2 mm\n", + "yc= 54.07 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids \n", + "\n", + "#variable declaration\n", + "\n", + "L1=400.0 #length of wire AB,mm\n", + "L2=150.0*pi #length of wire BC,mm\n", + "L3=250.0 #length of wire CD,mm\n", + "theta=30*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=200.0\n", + "X2=475.0\n", + "X3=400+300.0+250*cos(theta)/2\n", + "\n", + "Y1=0\n", + "Y2=2*150/pi\n", + "Y3=125*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.3 page number 105" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.19 mm\n", + "yc= 198.5 mm\n", + "zc= 56.17 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "# The length and the centroid of portions AB, BC and CD \n", + "# portion AB is in x-z plane, BC in y-z plane and CD in x-y plane. AB and BC are semi circular in shape\n", + "\n", + "#variable declaration\n", + "\n", + "L1=100.0*pi #length of wire AB,mm\n", + "L2=140.0*pi #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=100.0\n", + "X2=0\n", + "X3=300*sin(theta)\n", + "\n", + "Y1=0\n", + "Y2=140\n", + "Y3=280+300*cos(theta)\n", + "Z1=2*100/pi\n", + "Z2=2*140/pi\n", + "Z3=0\n", + "\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "zc=(L1*Z1+L2*Z2+L3*Z3)/L\n", + "\n", + "print \"zc=\",round(zc,2),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.4 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 0.0\n", + "yc= 40.0 mm\n", + "Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20.0 #Area of 1 ,mm^2\n", + "A2=20.0*100.0 #Area of 2,mm^2\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=10\n", + "Y2=70\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "print \"Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.5 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 36.62\n", + "yc= 61.62 mm\n", + "Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=150.0*12.0 #Area of 1 ,mm^2\n", + "A2=(200.0-12.0)*12.0 #Area of 2,mm^2\n", + "\n", + "X1=75\n", + "X2=6\n", + "\n", + "Y1=6\n", + "Y2=12+(200-12)/2\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.6 page number 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "yc= 59.71 mm\n", + "Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20 #Area of 1 ,mm^2\n", + "A2=100.0*20.0 #Area of 2,mm^2\n", + "A3=150.0*30.0 #Area of 3,mm^2\n", + "\n", + "#Selecting the coordinate system, due to symmetry centroid must lie on y axis,\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=30+100+20/2\n", + "Y2=30+100/2\n", + "Y3=30/2\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.7 page number 113" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 3.523 m\n", + "yc= 2.777 m\n" + ] + } + ], + "source": [ + "# Note that it is convenient to take axis in such a way that the centroids of all simple figures are having positive coordinates. If coordinate of any simple figure comes out to be negative, one should be careful in assigning the sign of moment of area \n", + "\n", + "#variable declaration\n", + "\n", + "A1=2.0*6.0*1.0/2.0 #Area of 1,m^2\n", + "A2=2.0*7.5 #Area of 2,m^2\n", + "A3=3.0*5.0*1.0/2 #Area of 3,m^2\n", + "A4=1.0*4.0 #Area of 4,m^2\n", + "\n", + "#The composite figure can be conveniently divided into two triangles and two rectangle\n", + "\n", + "X1=2.0*2.0/3.0\n", + "X2=2.0+1.0\n", + "X3=2.0+2.0+(1.0*3.0/3.0)\n", + "X4=4.0+4.0/2.0\n", + "\n", + "Y1=6.0/3.0\n", + "Y2=7.5/2.0\n", + "Y3=1.0+5.0/3.0\n", + "Y4=1/2.0\n", + "\n", + "A=A1+A2+A3+A4\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4)/A\n", + "\n", + "print \"xc=\",round(xc,3),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.8 page number 114\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 2.995 m\n", + "yc= 1.89 m\n" + ] + } + ], + "source": [ + "\n", + "# The composite section is divided into three simple figures, a triangle, a rectangle and a semicircle\n", + "\n", + "from math import pi\n", + "#variable declaration\n", + "\n", + "A1=1.0*3.0*4.0/2.0 #Area of 1,m^2\n", + "A2=6.0*4.0 #Area of 2,m^2\n", + "A3=1.0*pi*pow(2,2)/2 #Area of 3,m^2\n", + "\n", + "#The coordinates of centroids of these three simple figures are:\n", + "\n", + "X1=6.0+3.0/3.0\n", + "X2=3.0\n", + "X3=-(4*2)/(3.0*pi)\n", + "\n", + "Y1=4.0/3.0\n", + "Y2=2.0\n", + "Y3=2.0\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "print \"xc=\",round(xc,4),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.9 page number 115" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 145.42 m\n", + "yc= 90.39 m\n" + ] + } + ], + "source": [ + "#The composite area is equal to a rectangle of size 160 × 280 mm plus a triangle of size 280 mm base width and 40 mm height and minus areas of six holes. In this case also the can be used for locating centroid by treating area of holes as negative. The area of simple figures and their centroids are\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Ar=160.0*280.0 #Area of rectangle,mm^2\n", + "At=280.0*40.0/2.0 #Area of triangle,mm^2\n", + "d=21.5 #diameter of hole,mm \n", + "Ah=-pi*pow(d,2)/4 #Area of hole,mm^2\n", + "\n", + "A=Ar+At+Ah*6\n", + "\n", + "\n", + "Xr=140.0\n", + "Xt=560/3.0\n", + "Xh1=70.0\n", + "Xh2=140.0\n", + "Xh3=210.0\n", + "Xh4=70.0\n", + "Xh5=140.0\n", + "Xh6=210.0\n", + "\n", + "Yr=80.0\n", + "Yt=160.0+40.0/3.0\n", + "Yh1=50.0\n", + "Yh2=50.0\n", + "Yh3=50.0\n", + "Yh4=120.0\n", + "Yh5=130.0\n", + "Yh6=140.0\n", + "\n", + "xc=(Ar*Xr+At*Xt+Ah*(Xh1+Xh2+Xh3+Xh4+Xh5+Xh6))/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(Ar*Yr+At*Yt+Ah*(Yh1+Yh2+Yh3+Yh4+Yh5+Yh6))/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.10 page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.48 mm\n", + "yc= 67.86 mm\n" + ] + } + ], + "source": [ + "# If xc and yc are the coordinates of the centre of the circle, centroid also must have the coordinates xc and yc as per the condition laid down in the problem. The shaded area may be considered as a rectangle of size 200 mm × 150 mm minus a triangle of sides 100 mm × 75 mm and a circle of diameter 100 mm.\n", + "\n", + "\n", + "#variable declaration\n", + "\n", + "Ap=200.0*150.0 #Area of plate,mm^2\n", + "At=100.0*75.0/2.0 #Area of triangle,mm^2\n", + "Ah=pi*pow(100,2)/4.0 #Area of hole ,mm^2\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "\n", + "X1=100.0\n", + "X2=200.0-100.0/3.0\n", + "#X3=Xc\n", + "\n", + "Y1=75.0\n", + "Y2=150.0-25.0\n", + "#Y3=Yc\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "xc=(Ap*X1-At*X2)/(Ah+A)\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "yc=(Ap*Y1-At*Y2)/(Ah+A)\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.11 page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 326.4 m\n", + "yc= 219.12 m\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "X=40.0\n", + "A1=14.0*12.0*pow(X,2) #Area of rectangle,mm^2\n", + "A2=6.0*4.0*pow(X,2)/2.0 #Area of triangle,mm^2\n", + "A3=-4*4*pow(X,2) #Area of removed subtracted,mm^2\n", + "A4=-pi*pow(4*X,2)/2.0 #Area of semicircle to be subtracted,mm^2\n", + "A5=-pi*pow(4*X,2)/4.0 #Area of quarter of circle to be subtracted,mm^2\n", + "\n", + "X1=7.0*X\n", + "X2=14*X+2*X\n", + "X3=2*X\n", + "X4=6.0*X\n", + "X5=14.0*X-(16*X/(3*pi))\n", + "\n", + "Y1=6.0*X\n", + "Y2=4.0*X/3.0\n", + "Y3=8.0*X+2.0*X\n", + "Y4=(16.0*X)/(3*pi)\n", + "Y5=12*X-4*(4*X/(3*pi))\n", + "\n", + "A=A1+A2+A3+A4+A5\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.12 page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 6372441.9 mm^4\n", + "Iyy= 2824166.0 mm^4\n", + "kxx= 46.88 mm\n", + "kyy= 31.21 mm\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + "from math import pi,sqrt\n", + "#variable declaration\n", + "\n", + "\n", + "A1=150.0*10.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "#Due to symmetry, centroid lies on the symmetric axis y-y. The distance of the centroid from the top most fibre is given by:\n", + "\n", + "Y1=5.0\n", + "Y2=10.0+70.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#Referring to the centroidal axis x-x and y-y, the centroid of A1 is g1 (0.0, yc-5) and that of A2 is g2 (0.0, 80-yc)\n", + "\n", + "#Moment of inertia of the section about x-x axis Ixx = moment of inertia of A1 about x-x axis + moment of inertia of A2 about x-x axis.\n", + "\n", + "\n", + "Ixx=(150*pow(10,3)/12)+(A1*pow((yc-5),2))+(10*pow(140,3)/12)+(A2*pow((80-yc),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(10*pow(150,3)/12)+(140*pow(10,3)/12)\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Hence, the moment of inertia of the section about an axis passing through the centroid and parallel to the top most fibre is Ixxmm^4 and moment of inertia of the section about the axis of symmetry is Iyy mm^4. \n", + "#The radius of gyration is given by\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print\"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print\"kyy=\",round(kyy,2),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.13 page number 131" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 3411298.7 mm^4\n", + "Iyy= 1208657.7 mm^4\n", + "Izz= 4619956.4 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=125.0*10.0 #Area of 1,mm^2\n", + "A2=75.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "\n", + "#First, the centroid of the given section is to be located. Two reference axis (1)–(1) and (2)–(2) \n", + "\n", + "#The distance of centroid from the axis (1)–(1)\n", + "\n", + "X1=5.0\n", + "X2=10.0+75.0/2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "#Similarly, the distance of the centroid from the axis (2)–(2)\n", + "\n", + "Y1=125.0/2\n", + "Y2=5.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#With respect to the centroidal axis x-x and y-y, the centroid of A1 is g1 (xc-5, (85/2)-xc) and that of A2 is g2 ((135/2)-yc, yc-5). \n", + "Ixx=(10*pow(125,3)/12)+(A1*pow(21.56,2))+(75.0*pow(10.0,3.0)/12)+(A2*pow((39.94),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(125*pow(10,3)/12)+(A1*pow(15.94,2))+(10*pow(75,3)/12)+(A2*pow(26.56,2)) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# eample 4.14 page number 132" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 59269202.1 mm^4\n", + "Iyy= 12005814.8 mm^4\n", + "Izz= 71275016.9 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=200.0*9.0 #Area of 1,mm^2\n", + "A2=(250.0-9*2)*6.7 #Area of 2,mm^2\n", + "A3=200.0*9.0 #Area of 3,mm^2 \n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The section is symmetrical about both x-x and y-y axis. \n", + "X1=0\n", + "X2=0\n", + "X3=0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "\n", + "Y1=245.5\n", + "Y2=125.0\n", + "Y3=4.5\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#Therefore, its centroid will coincide with the centroid of rectangle A2. With respect to the centroidal axis x-x and y-y, the centroid of rectangle A1 is g1 (0.0, 120.5), that of A2 is g2 (0.0, 0.0) and that of A3 is g3 (0.0, 120.5).\n", + "\n", + "Ixx=(200.0*pow(9,3)/12)+(A1*pow(yc-4.5,2))+(6.7*pow(232,3.0)/12)+0+(200*pow(9,3)/12)+(A3*pow((yc-4.5),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(9*pow(200,3)/12)+(232*pow(6.7,3)/12)+(9*pow(200,3)/12) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "#misprint in book\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.15 page number 133" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 135903229.0 mm^4\n", + "Iyy= 5276363.1 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*13.5 #Area of 1,mm^2\n", + "A2=(400.0-27.0)*8.1 #Area of 2,mm^2\n", + "A3=100.0*13.5 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The given section is symmetric about horizontal axis passing through the centroid g2 of the rectangle A2.\n", + "\n", + "X1=50.0\n", + "X2=8.1/2.0\n", + "X3=50.0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "Y1=386.5+13.5/2.0\n", + "Y2=200.0\n", + "Y3=13.5/2\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y\n", + "\n", + "Ixx=(100.0*pow(13.5,3)/12.0)+(A1*pow((200-(13.5/2)),2))+(8.1*pow(373,3.0)/12.0)+0+(100*pow(13.5,3)/12.0)+(A3*pow((200-(13.5/2)),2))\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(13.5*pow(100.0,3)/12.0)+(A1*pow((50-xc),2))+(373.0*pow(8.1,3.0)/12.0)+A2*pow(21.68,2)+(13.5*pow(100,3)/12.0)+(A3*pow((50-xc),2))\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.16 page number 134\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polar moment of Inertia= 32109472.0 mm^4\n", + "kxx= 90.3 mm\n", + "kyy= 23.09 mm\n" + ] + } + ], + "source": [ + "# The section is divided into three rectangles A1, A2 and A3\n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=80.0*12.0 #Area of 1,mm^2\n", + "A2=(150.0-22.0)*12.0 #Area of 2,mm^2\n", + "A3=120.0*10.0 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on axis y-y. The bottom fibre (1)–(1) is chosen as reference axis to locate the centroid\n", + "\n", + "Y1=150-6\n", + "Y2=(128/2) +10\n", + "Y3=5\n", + "\n", + "yc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "X1=60.0\n", + "X2=60.0\n", + "X3=60.0\n", + "\n", + "xc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangles A1 is g1 (0.0, 150-6-yc), that of A2 is g2 (0.0, 75-yc) and that of A3 is g3 (0.0, yc-5 ).\n", + "\n", + "Iyy=(12*(pow(80,3))/12)+(128*(pow(12,3))/12)+(10*(pow(120,3))/12)\n", + "\n", + "Ixx=(80.0*pow(12.0,3)/12.0)+(A1*pow((150-6-yc),2))+(12*pow(128,3.0)/12.0)+(A2*pow((75-yc),2))+(120*pow(10,3)/12.0)+(A3*pow((150-10-6-yc),2))\n", + "\n", + "\n", + "\n", + "PolarmomentofInertia=Ixx+Iyy\n", + "\n", + "print \"Polar moment of Inertia=\",round(PolarmomentofInertia),\"mm^4\"\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print \"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print \"kyy=\",round(kyy,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.17 page number 135" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 31543827.2 mm^4\n", + "Iyy= 19745121.6 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#The given composite section may be divided into simple rectangles and triangle\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*30.0 #Area of 1,mm^2\n", + "A2=100.0*25.0 #Area of 2,mm^2\n", + "A3=200.0*20.0 #Area of 3,mm^2 \n", + "A4=87.5*20.0/2.0 #Area of 4,mm^2\n", + "A5=87.5*20.0/2.0 #Area of 5,mm^2\n", + "\n", + "A=A1+A2+A3+A4+A5 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on the axis y-y. A reference axis (1)–(1) is choosen as shown in the figure. The distance of the centroidal axis from (1)–(1)\n", + "\n", + "X1=100.0\n", + "X2=100.0\n", + "X3=100.0\n", + "X4=2.0*87.5/3.0\n", + "X5=200-X4\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "Y1=135.0\n", + "Y2=70.0\n", + "Y3=10.0\n", + "Y4=(20.0/3.0)+20.0\n", + "Y5=Y4\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangle A1 is g1 (0.0,135.0-yc), that of A2 is g2(0.0,70.00-yc), that of A3 is g3 (0.0, yc-10.0), the centroid of triangle A4 is g4 (41.66,yc-20.0-(20.0/3.0) ) and that of A5 is g5 (41.66,yc-20.0-(20.0/3.0)).\n", + "\n", + "\n", + "Ixx=(100.0*pow(30,3)/12.0)+(A1*pow((135.0-yc),2))+(25.0*pow(100,3.0)/12.0)+(A2*pow((70.0-yc),2))+(200*pow(20,3)/12.0)+(A3*pow((yc-10.0),2))+((87.5*pow(20,3)/36.0)+(A4*pow((yc-20.0-(20.0/3.0)),2)))*2\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(30.0*pow(100,3)/12.0)+(100.0*pow(25,3.0)/12.0)+(20*pow(200,3)/12.0)+((20.0*pow(87.5,3)/36.0)+(A4*pow((41.66),2)))*2\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.18 page number137" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 806093331.0 mm^4\n" + ] + } + ], + "source": [ + "#In this problem, it is required to find out the moment of inertia of the section about an axis AB. So there is no need to find out the position of the centroid. \n", + "#The given section is split up into simple rectangles\n", + "#Moment of inertia about AB = Sum of moments of inertia of the rectangle about AB\n", + "\n", + "#variable declaration\n", + "\n", + "A1=400*20.0\n", + "A2=100*10\n", + "A3=10*380.0\n", + "A4=100*10.0\n", + "\n", + "IAB=(400.0*pow(20,3)/12)+(A1*pow(10,2))+((100*pow(10,3)/12)+(A2*pow(25,2)))*2+((10*pow(380,3)/12)+(A3*pow(220,2)))*2+((100*pow(10,3)/12)+(A4*pow(415,2)))*2\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.19 page number 137" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 50399393.9 mm^4\n" + ] + } + ], + "source": [ + "# The built-up section is divided into six simple rectangles\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=250.0*10.0 #Area of 1,mm^2\n", + "A2=40.0*10.0 #Area of 2,mm^2\n", + "\n", + "A=A1*2+A2*4 #Total area,mm^2 \n", + "\n", + "\n", + "Y1=5.0\n", + "Y2=30.0\n", + "Y3=15.0\n", + "Y4=255.0\n", + "Y5=135.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A2*Y3+A2*Y4+A1*Y5)/A\n", + "\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(250.0*pow(10,3)/12.0)+(A1*pow((yc-5),2))+((10.0*pow(40,3.0)/12.0)+(A2*pow((yc-30.0),2)))*2+(40*pow(10,3)/12.0)+(A2*pow((yc-15.0),2))+(10.0*pow(250.0,3.0)/12.0)+(A1*pow((yc-135.0),2))+(40.0*pow(10.0,3)/12)+(A2*pow((yc-255),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.20 page number 138" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "145.394736842\n", + "Ixx= 752680131.6 mm^4\n" + ] + } + ], + "source": [ + "#Each angle is divided into two rectangles \n", + "\n", + "#variable declaration\n", + "\n", + "A1=600.0*15.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A3=150.0*10.0\n", + "A4=400.0*20.0\n", + "A=A1+A2*2+A3*2+A4 #Total area,mm^2 \n", + "\n", + "#The distance of the centroidal axis from the bottom fibres of section \n", + "\n", + "Y1=320.0\n", + "Y2=100.0\n", + "Y3=25.0\n", + "Y4=10.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A3*Y3*2+A4*Y4)/A\n", + "print yc\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(15.0*pow(600,3)/12.0)+(A1*pow((yc-320),2))+((10.0*pow(140,3.0)/12.0)+(A2*pow((yc-100.0),2)))*2+((150*pow(10,3)/12.0)+(A3*pow((yc-15.0),2)))*2+(400.0*pow(20.0,3.0)/12.0)+(A4*pow((yc-10.0),2))\n", + "\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.21 page number 139" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 36000000.0 mm^4\n" + ] + } + ], + "source": [ + "\n", + "from math import asin,sin,cos,pi\n", + "\n", + "#The rectangle is divided into four triangles\n", + "#The lines AE and FC are parallel to x-axis\n", + " \n", + "#variable declaration\n", + "\n", + "theta=asin(4.0/5.0)\n", + "\n", + "AB=100.0\n", + "BK=AB*sin((90*pi/180)-theta)\n", + "ND=BK\n", + "FD=60.0/sin(theta)\n", + "AF=150.0-FD\n", + "FL=ME=75.0*sin(theta)\n", + "AE=AB/cos((90*pi/180)-theta)\n", + "FC=AE\n", + "A=125.0*60.0/2.0\n", + "\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(125*pow(60,3)/36)+(A*pow((ND*4.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*2.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))\n", + "\n", + "print \"Ixx=\",round(Ixx),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.22, page number 140" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 4292979.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into a triangle PQR, a semicircle PSQ having base on axis AB and a circle having its centre on axis AB\n", + "\n", + "#variable declaration\n", + "#Now,Moment of inertia of the section about axis AB\n", + "IAB=(80*pow(80,3)/12)+(pi*pow(80,4)/128)-(pi*pow(40,4)/64)\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.23 page number141" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "106.435694487 28.4724404943\n", + "Ixx= 686943.0 mm^4\n", + "Iyy= 17146488.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into three simple figures viz., a triangle ABC, a rectangle ACDE and a semicircle. \n", + "\n", + "#variable declaration\n", + "\n", + "r=20.0 #radius of semicircle\n", + "A1=80.0*20.0/2 #Area of triangle ABC \n", + "A3=40.0*80.0 #Area of rectangle ACDE \n", + "A4=pi*pow(r,2)/2 #Area of semicircle\n", + "At1=30.0*20.0/2.0\n", + "At2=50.0*20.0/2.0\n", + "A=A1+A3-A4 #Total area\n", + "\n", + "X1=2.0*30.0/3.0\n", + "X2=50.0*30.0/3.0\n", + "X3=40.0\n", + "X4=40.0\n", + "\n", + "xc=(At1*X1+At2*X2+A3*X3-A4*X4)/A\n", + "#mistake in book\n", + "\n", + "Y1=(20.0/3.0)+40.0\n", + "Y3=20.0\n", + "Y4=(4.0*20.0)/(3.0*pi)\n", + "\n", + "yc=(A1*Y1+A3*Y3-A4*Y4)/A\n", + "print xc,yc\n", + "#\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(80.0*pow(20.0,3)/36) +A1*pow((60.0-(2*20.0/3.0)-yc),2)+(80*pow(40,3)/12)+(A3*pow((yc-20.0),2))-((0.0068598*pow(20,4))+(A4*pow((yc-Y4),2)))\n", + "\n", + "print\"Ixx=\",round(Ixx),\"mm^4\"\n", + "\n", + "\n", + "Iyy=(20.0*pow(30.0,3)/36) +At1*pow((xc-(2*30.0/3.0)),2)+(20*pow(50,3)/36)+(At2*pow((xc-(30.0+(50/3))),2))+((40*pow(80,3)/12)+(A3*pow((xc-40),2)))-((pi*pow(40,4))/(2*64))-(A4*pow((40-xc),2))\n", + "\n", + "print\"Iyy=\",round(Iyy),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.27 page number 150" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25000.0 5625.0 235.619449019 7889.38055098\n", + "xc= 0.411 m\n", + "yc= 0.329 m\n", + "zc= 0.221 m\n" + ] + } + ], + "source": [ + "#A concrete block of size 0.60 m × 0.75 m × 0.5 m is cast with a hole of diameter 0.2 m and depth 0.3 m\n", + "#The hole is completely filled with steel balls weighing 2500 N. Locate the centre of gravity of the body.\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "W=25000.0 # weight of concrete=25000, N/m^3\n", + "W1=0.6*0.75*0.5*W #Weight of solid concrete block\n", + "W2=pi*pow(0.2,2)*0.3*W/4 #Weight of concrete (W2) removed for making hole:\n", + "W3=2500\n", + "\n", + "#Taking origin as shown in the figure, the centre of gravity of solid block is (0.375, 0.3, 0.25) and that of hollow portion is (0.5, 0.4, 0.15)\n", + "\n", + "X1=0.375\n", + "X2=0.5\n", + "X3=0.5\n", + "\n", + "Y1=0.3\n", + "Y2=0.4\n", + "Y3=0.4\n", + "\n", + "Z1=0.25\n", + "Z2=0.15\n", + "Z3=0.15\n", + "\n", + "Wt=W3+W1-W2\n", + "print W,W1,W2,Wt\n", + "xc=(W1*X1-W2*X2+W3*X3)/Wt\n", + "\n", + "yc=(W1*Y1-W2*Y2+W3*Y3)/Wt\n", + "\n", + "zc=(W1*Z1-W2*Z2+W3*Z3)/Wt\n", + "\n", + "print\"xc=\",round(xc,3),\"m\"\n", + "print\"yc=\",round(yc,3),\"m\"\n", + "print\"zc=\",round(zc,3),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_P9rwEqr.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_P9rwEqr.ipynb new file mode 100644 index 00000000..d78e1aa8 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_P9rwEqr.ipynb @@ -0,0 +1,1403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4-DISTRIBUTED FORCES, CENTRE OF GRAVITY AND MOMENT OF INERTIA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.1 page number 102\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 407.44 mm\n", + "yc= 101.65 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#variable declaration\n", + "\n", + "L1=600.0 #length of wire AB,mm\n", + "L2=200.0 #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "\n", + "X1=300.0\n", + "X2=600.0\n", + "X3=600.0-150*cos(theta)\n", + "Y1=0\n", + "Y2=100\n", + "Y3=200+150*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.2 page number 103" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 451.2 mm\n", + "yc= 54.07 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids \n", + "\n", + "#variable declaration\n", + "\n", + "L1=400.0 #length of wire AB,mm\n", + "L2=150.0*pi #length of wire BC,mm\n", + "L3=250.0 #length of wire CD,mm\n", + "theta=30*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=200.0\n", + "X2=475.0\n", + "X3=400+300.0+250*cos(theta)/2\n", + "\n", + "Y1=0\n", + "Y2=2*150/pi\n", + "Y3=125*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.3 page number 105" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.19 mm\n", + "yc= 198.5 mm\n", + "zc= 56.17 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "# The length and the centroid of portions AB, BC and CD \n", + "# portion AB is in x-z plane, BC in y-z plane and CD in x-y plane. AB and BC are semi circular in shape\n", + "\n", + "#variable declaration\n", + "\n", + "L1=100.0*pi #length of wire AB,mm\n", + "L2=140.0*pi #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=100.0\n", + "X2=0\n", + "X3=300*sin(theta)\n", + "\n", + "Y1=0\n", + "Y2=140\n", + "Y3=280+300*cos(theta)\n", + "Z1=2*100/pi\n", + "Z2=2*140/pi\n", + "Z3=0\n", + "\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "zc=(L1*Z1+L2*Z2+L3*Z3)/L\n", + "\n", + "print \"zc=\",round(zc,2),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.4 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 0.0\n", + "yc= 40.0 mm\n", + "Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20.0 #Area of 1 ,mm^2\n", + "A2=20.0*100.0 #Area of 2,mm^2\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=10\n", + "Y2=70\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "print \"Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.5 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 36.62\n", + "yc= 61.62 mm\n", + "Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=150.0*12.0 #Area of 1 ,mm^2\n", + "A2=(200.0-12.0)*12.0 #Area of 2,mm^2\n", + "\n", + "X1=75\n", + "X2=6\n", + "\n", + "Y1=6\n", + "Y2=12+(200-12)/2\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.6 page number 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "yc= 59.71 mm\n", + "Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20 #Area of 1 ,mm^2\n", + "A2=100.0*20.0 #Area of 2,mm^2\n", + "A3=150.0*30.0 #Area of 3,mm^2\n", + "\n", + "#Selecting the coordinate system, due to symmetry centroid must lie on y axis,\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=30+100+20/2\n", + "Y2=30+100/2\n", + "Y3=30/2\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.7 page number 113" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 3.523 m\n", + "yc= 2.777 m\n" + ] + } + ], + "source": [ + "# Note that it is convenient to take axis in such a way that the centroids of all simple figures are having positive coordinates. If coordinate of any simple figure comes out to be negative, one should be careful in assigning the sign of moment of area \n", + "\n", + "#variable declaration\n", + "\n", + "A1=2.0*6.0*1.0/2.0 #Area of 1,m^2\n", + "A2=2.0*7.5 #Area of 2,m^2\n", + "A3=3.0*5.0*1.0/2 #Area of 3,m^2\n", + "A4=1.0*4.0 #Area of 4,m^2\n", + "\n", + "#The composite figure can be conveniently divided into two triangles and two rectangle\n", + "\n", + "X1=2.0*2.0/3.0\n", + "X2=2.0+1.0\n", + "X3=2.0+2.0+(1.0*3.0/3.0)\n", + "X4=4.0+4.0/2.0\n", + "\n", + "Y1=6.0/3.0\n", + "Y2=7.5/2.0\n", + "Y3=1.0+5.0/3.0\n", + "Y4=1/2.0\n", + "\n", + "A=A1+A2+A3+A4\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4)/A\n", + "\n", + "print \"xc=\",round(xc,3),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.8 page number 114\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 2.995 m\n", + "yc= 1.89 m\n" + ] + } + ], + "source": [ + "\n", + "# The composite section is divided into three simple figures, a triangle, a rectangle and a semicircle\n", + "\n", + "from math import pi\n", + "#variable declaration\n", + "\n", + "A1=1.0*3.0*4.0/2.0 #Area of 1,m^2\n", + "A2=6.0*4.0 #Area of 2,m^2\n", + "A3=1.0*pi*pow(2,2)/2 #Area of 3,m^2\n", + "\n", + "#The coordinates of centroids of these three simple figures are:\n", + "\n", + "X1=6.0+3.0/3.0\n", + "X2=3.0\n", + "X3=-(4*2)/(3.0*pi)\n", + "\n", + "Y1=4.0/3.0\n", + "Y2=2.0\n", + "Y3=2.0\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "print \"xc=\",round(xc,4),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.9 page number 115" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 145.42 m\n", + "yc= 90.39 m\n" + ] + } + ], + "source": [ + "#The composite area is equal to a rectangle of size 160 × 280 mm plus a triangle of size 280 mm base width and 40 mm height and minus areas of six holes. In this case also the can be used for locating centroid by treating area of holes as negative. The area of simple figures and their centroids are\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Ar=160.0*280.0 #Area of rectangle,mm^2\n", + "At=280.0*40.0/2.0 #Area of triangle,mm^2\n", + "d=21.5 #diameter of hole,mm \n", + "Ah=-pi*pow(d,2)/4 #Area of hole,mm^2\n", + "\n", + "A=Ar+At+Ah*6\n", + "\n", + "\n", + "Xr=140.0\n", + "Xt=560/3.0\n", + "Xh1=70.0\n", + "Xh2=140.0\n", + "Xh3=210.0\n", + "Xh4=70.0\n", + "Xh5=140.0\n", + "Xh6=210.0\n", + "\n", + "Yr=80.0\n", + "Yt=160.0+40.0/3.0\n", + "Yh1=50.0\n", + "Yh2=50.0\n", + "Yh3=50.0\n", + "Yh4=120.0\n", + "Yh5=130.0\n", + "Yh6=140.0\n", + "\n", + "xc=(Ar*Xr+At*Xt+Ah*(Xh1+Xh2+Xh3+Xh4+Xh5+Xh6))/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(Ar*Yr+At*Yt+Ah*(Yh1+Yh2+Yh3+Yh4+Yh5+Yh6))/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.10 page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.48 mm\n", + "yc= 67.86 mm\n" + ] + } + ], + "source": [ + "# If xc and yc are the coordinates of the centre of the circle, centroid also must have the coordinates xc and yc as per the condition laid down in the problem. The shaded area may be considered as a rectangle of size 200 mm × 150 mm minus a triangle of sides 100 mm × 75 mm and a circle of diameter 100 mm.\n", + "\n", + "\n", + "#variable declaration\n", + "\n", + "Ap=200.0*150.0 #Area of plate,mm^2\n", + "At=100.0*75.0/2.0 #Area of triangle,mm^2\n", + "Ah=pi*pow(100,2)/4.0 #Area of hole ,mm^2\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "\n", + "X1=100.0\n", + "X2=200.0-100.0/3.0\n", + "#X3=Xc\n", + "\n", + "Y1=75.0\n", + "Y2=150.0-25.0\n", + "#Y3=Yc\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "xc=(Ap*X1-At*X2)/(Ah+A)\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "yc=(Ap*Y1-At*Y2)/(Ah+A)\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.11 page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 326.4 m\n", + "yc= 219.12 m\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "X=40.0\n", + "A1=14.0*12.0*pow(X,2) #Area of rectangle,mm^2\n", + "A2=6.0*4.0*pow(X,2)/2.0 #Area of triangle,mm^2\n", + "A3=-4*4*pow(X,2) #Area of removed subtracted,mm^2\n", + "A4=-pi*pow(4*X,2)/2.0 #Area of semicircle to be subtracted,mm^2\n", + "A5=-pi*pow(4*X,2)/4.0 #Area of quarter of circle to be subtracted,mm^2\n", + "\n", + "X1=7.0*X\n", + "X2=14*X+2*X\n", + "X3=2*X\n", + "X4=6.0*X\n", + "X5=14.0*X-(16*X/(3*pi))\n", + "\n", + "Y1=6.0*X\n", + "Y2=4.0*X/3.0\n", + "Y3=8.0*X+2.0*X\n", + "Y4=(16.0*X)/(3*pi)\n", + "Y5=12*X-4*(4*X/(3*pi))\n", + "\n", + "A=A1+A2+A3+A4+A5\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.12 page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 6372441.9 mm^4\n", + "Iyy= 2824166.0 mm^4\n", + "kxx= 46.88 mm\n", + "kyy= 31.21 mm\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + "from math import pi,sqrt\n", + "#variable declaration\n", + "\n", + "\n", + "A1=150.0*10.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "#Due to symmetry, centroid lies on the symmetric axis y-y. The distance of the centroid from the top most fibre is given by:\n", + "\n", + "Y1=5.0\n", + "Y2=10.0+70.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#Referring to the centroidal axis x-x and y-y, the centroid of A1 is g1 (0.0, yc-5) and that of A2 is g2 (0.0, 80-yc)\n", + "\n", + "#Moment of inertia of the section about x-x axis Ixx = moment of inertia of A1 about x-x axis + moment of inertia of A2 about x-x axis.\n", + "\n", + "\n", + "Ixx=(150*pow(10,3)/12)+(A1*pow((yc-5),2))+(10*pow(140,3)/12)+(A2*pow((80-yc),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(10*pow(150,3)/12)+(140*pow(10,3)/12)\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Hence, the moment of inertia of the section about an axis passing through the centroid and parallel to the top most fibre is Ixxmm^4 and moment of inertia of the section about the axis of symmetry is Iyy mm^4. \n", + "#The radius of gyration is given by\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print\"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print\"kyy=\",round(kyy,2),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.13 page number 131" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 3411298.7 mm^4\n", + "Iyy= 1208657.7 mm^4\n", + "Izz= 4619956.4 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=125.0*10.0 #Area of 1,mm^2\n", + "A2=75.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "\n", + "#First, the centroid of the given section is to be located. Two reference axis (1)–(1) and (2)–(2) \n", + "\n", + "#The distance of centroid from the axis (1)–(1)\n", + "\n", + "X1=5.0\n", + "X2=10.0+75.0/2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "#Similarly, the distance of the centroid from the axis (2)–(2)\n", + "\n", + "Y1=125.0/2\n", + "Y2=5.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#With respect to the centroidal axis x-x and y-y, the centroid of A1 is g1 (xc-5, (85/2)-xc) and that of A2 is g2 ((135/2)-yc, yc-5). \n", + "Ixx=(10*pow(125,3)/12)+(A1*pow(21.56,2))+(75.0*pow(10.0,3.0)/12)+(A2*pow((39.94),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(125*pow(10,3)/12)+(A1*pow(15.94,2))+(10*pow(75,3)/12)+(A2*pow(26.56,2)) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# eample 4.14 page number 132" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 59269202.1 mm^4\n", + "Iyy= 12005814.8 mm^4\n", + "Izz= 71275016.9 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=200.0*9.0 #Area of 1,mm^2\n", + "A2=(250.0-9*2)*6.7 #Area of 2,mm^2\n", + "A3=200.0*9.0 #Area of 3,mm^2 \n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The section is symmetrical about both x-x and y-y axis. \n", + "X1=0\n", + "X2=0\n", + "X3=0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "\n", + "Y1=245.5\n", + "Y2=125.0\n", + "Y3=4.5\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#Therefore, its centroid will coincide with the centroid of rectangle A2. With respect to the centroidal axis x-x and y-y, the centroid of rectangle A1 is g1 (0.0, 120.5), that of A2 is g2 (0.0, 0.0) and that of A3 is g3 (0.0, 120.5).\n", + "\n", + "Ixx=(200.0*pow(9,3)/12)+(A1*pow(yc-4.5,2))+(6.7*pow(232,3.0)/12)+0+(200*pow(9,3)/12)+(A3*pow((yc-4.5),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(9*pow(200,3)/12)+(232*pow(6.7,3)/12)+(9*pow(200,3)/12) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "#misprint in book\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.15 page number 133" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 135903229.0 mm^4\n", + "Iyy= 5276363.1 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*13.5 #Area of 1,mm^2\n", + "A2=(400.0-27.0)*8.1 #Area of 2,mm^2\n", + "A3=100.0*13.5 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The given section is symmetric about horizontal axis passing through the centroid g2 of the rectangle A2.\n", + "\n", + "X1=50.0\n", + "X2=8.1/2.0\n", + "X3=50.0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "Y1=386.5+13.5/2.0\n", + "Y2=200.0\n", + "Y3=13.5/2\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y\n", + "\n", + "Ixx=(100.0*pow(13.5,3)/12.0)+(A1*pow((200-(13.5/2)),2))+(8.1*pow(373,3.0)/12.0)+0+(100*pow(13.5,3)/12.0)+(A3*pow((200-(13.5/2)),2))\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(13.5*pow(100.0,3)/12.0)+(A1*pow((50-xc),2))+(373.0*pow(8.1,3.0)/12.0)+A2*pow(21.68,2)+(13.5*pow(100,3)/12.0)+(A3*pow((50-xc),2))\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.16 page number 134\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polar moment of Inertia= 32109472.0 mm^4\n", + "kxx= 90.3 mm\n", + "kyy= 23.09 mm\n" + ] + } + ], + "source": [ + "# The section is divided into three rectangles A1, A2 and A3\n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=80.0*12.0 #Area of 1,mm^2\n", + "A2=(150.0-22.0)*12.0 #Area of 2,mm^2\n", + "A3=120.0*10.0 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on axis y-y. The bottom fibre (1)–(1) is chosen as reference axis to locate the centroid\n", + "\n", + "Y1=150-6\n", + "Y2=(128/2) +10\n", + "Y3=5\n", + "\n", + "yc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "X1=60.0\n", + "X2=60.0\n", + "X3=60.0\n", + "\n", + "xc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangles A1 is g1 (0.0, 150-6-yc), that of A2 is g2 (0.0, 75-yc) and that of A3 is g3 (0.0, yc-5 ).\n", + "\n", + "Iyy=(12*(pow(80,3))/12)+(128*(pow(12,3))/12)+(10*(pow(120,3))/12)\n", + "\n", + "Ixx=(80.0*pow(12.0,3)/12.0)+(A1*pow((150-6-yc),2))+(12*pow(128,3.0)/12.0)+(A2*pow((75-yc),2))+(120*pow(10,3)/12.0)+(A3*pow((150-10-6-yc),2))\n", + "\n", + "\n", + "\n", + "PolarmomentofInertia=Ixx+Iyy\n", + "\n", + "print \"Polar moment of Inertia=\",round(PolarmomentofInertia),\"mm^4\"\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print \"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print \"kyy=\",round(kyy,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.17 page number 135" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 31543827.2 mm^4\n", + "Iyy= 19745121.6 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#The given composite section may be divided into simple rectangles and triangle\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*30.0 #Area of 1,mm^2\n", + "A2=100.0*25.0 #Area of 2,mm^2\n", + "A3=200.0*20.0 #Area of 3,mm^2 \n", + "A4=87.5*20.0/2.0 #Area of 4,mm^2\n", + "A5=87.5*20.0/2.0 #Area of 5,mm^2\n", + "\n", + "A=A1+A2+A3+A4+A5 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on the axis y-y. A reference axis (1)–(1) is choosen as shown in the figure. The distance of the centroidal axis from (1)–(1)\n", + "\n", + "X1=100.0\n", + "X2=100.0\n", + "X3=100.0\n", + "X4=2.0*87.5/3.0\n", + "X5=200-X4\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "Y1=135.0\n", + "Y2=70.0\n", + "Y3=10.0\n", + "Y4=(20.0/3.0)+20.0\n", + "Y5=Y4\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangle A1 is g1 (0.0,135.0-yc), that of A2 is g2(0.0,70.00-yc), that of A3 is g3 (0.0, yc-10.0), the centroid of triangle A4 is g4 (41.66,yc-20.0-(20.0/3.0) ) and that of A5 is g5 (41.66,yc-20.0-(20.0/3.0)).\n", + "\n", + "\n", + "Ixx=(100.0*pow(30,3)/12.0)+(A1*pow((135.0-yc),2))+(25.0*pow(100,3.0)/12.0)+(A2*pow((70.0-yc),2))+(200*pow(20,3)/12.0)+(A3*pow((yc-10.0),2))+((87.5*pow(20,3)/36.0)+(A4*pow((yc-20.0-(20.0/3.0)),2)))*2\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(30.0*pow(100,3)/12.0)+(100.0*pow(25,3.0)/12.0)+(20*pow(200,3)/12.0)+((20.0*pow(87.5,3)/36.0)+(A4*pow((41.66),2)))*2\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.18 page number137" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 806093331.0 mm^4\n" + ] + } + ], + "source": [ + "#In this problem, it is required to find out the moment of inertia of the section about an axis AB. So there is no need to find out the position of the centroid. \n", + "#The given section is split up into simple rectangles\n", + "#Moment of inertia about AB = Sum of moments of inertia of the rectangle about AB\n", + "\n", + "#variable declaration\n", + "\n", + "A1=400*20.0\n", + "A2=100*10\n", + "A3=10*380.0\n", + "A4=100*10.0\n", + "\n", + "IAB=(400.0*pow(20,3)/12)+(A1*pow(10,2))+((100*pow(10,3)/12)+(A2*pow(25,2)))*2+((10*pow(380,3)/12)+(A3*pow(220,2)))*2+((100*pow(10,3)/12)+(A4*pow(415,2)))*2\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.19 page number 137" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 50399393.9 mm^4\n" + ] + } + ], + "source": [ + "# The built-up section is divided into six simple rectangles\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=250.0*10.0 #Area of 1,mm^2\n", + "A2=40.0*10.0 #Area of 2,mm^2\n", + "\n", + "A=A1*2+A2*4 #Total area,mm^2 \n", + "\n", + "\n", + "Y1=5.0\n", + "Y2=30.0\n", + "Y3=15.0\n", + "Y4=255.0\n", + "Y5=135.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A2*Y3+A2*Y4+A1*Y5)/A\n", + "\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(250.0*pow(10,3)/12.0)+(A1*pow((yc-5),2))+((10.0*pow(40,3.0)/12.0)+(A2*pow((yc-30.0),2)))*2+(40*pow(10,3)/12.0)+(A2*pow((yc-15.0),2))+(10.0*pow(250.0,3.0)/12.0)+(A1*pow((yc-135.0),2))+(40.0*pow(10.0,3)/12)+(A2*pow((yc-255),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.20 page number 138" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "145.394736842\n", + "Ixx= 752680131.6 mm^4\n" + ] + } + ], + "source": [ + "#Each angle is divided into two rectangles \n", + "\n", + "#variable declaration\n", + "\n", + "A1=600.0*15.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A3=150.0*10.0\n", + "A4=400.0*20.0\n", + "A=A1+A2*2+A3*2+A4 #Total area,mm^2 \n", + "\n", + "#The distance of the centroidal axis from the bottom fibres of section \n", + "\n", + "Y1=320.0\n", + "Y2=100.0\n", + "Y3=25.0\n", + "Y4=10.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A3*Y3*2+A4*Y4)/A\n", + "print yc\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(15.0*pow(600,3)/12.0)+(A1*pow((yc-320),2))+((10.0*pow(140,3.0)/12.0)+(A2*pow((yc-100.0),2)))*2+((150*pow(10,3)/12.0)+(A3*pow((yc-15.0),2)))*2+(400.0*pow(20.0,3.0)/12.0)+(A4*pow((yc-10.0),2))\n", + "\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.21 page number 139" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 36000000.0 mm^4\n" + ] + } + ], + "source": [ + "\n", + "from math import asin,sin,cos,pi\n", + "\n", + "#The rectangle is divided into four triangles\n", + "#The lines AE and FC are parallel to x-axis\n", + " \n", + "#variable declaration\n", + "\n", + "theta=asin(4.0/5.0)\n", + "\n", + "AB=100.0\n", + "BK=AB*sin((90*pi/180)-theta)\n", + "ND=BK\n", + "FD=60.0/sin(theta)\n", + "AF=150.0-FD\n", + "FL=ME=75.0*sin(theta)\n", + "AE=AB/cos((90*pi/180)-theta)\n", + "FC=AE\n", + "A=125.0*60.0/2.0\n", + "\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(125*pow(60,3)/36)+(A*pow((ND*4.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*2.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))\n", + "\n", + "print \"Ixx=\",round(Ixx),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.22, page number 140" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 4292979.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into a triangle PQR, a semicircle PSQ having base on axis AB and a circle having its centre on axis AB\n", + "\n", + "#variable declaration\n", + "#Now,Moment of inertia of the section about axis AB\n", + "IAB=(80*pow(80,3)/12)+(pi*pow(80,4)/128)-(pi*pow(40,4)/64)\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.23 page number141" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "106.435694487 28.4724404943\n", + "Ixx= 686943.0 mm^4\n", + "Iyy= 17146488.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into three simple figures viz., a triangle ABC, a rectangle ACDE and a semicircle. \n", + "\n", + "#variable declaration\n", + "\n", + "r=20.0 #radius of semicircle\n", + "A1=80.0*20.0/2 #Area of triangle ABC \n", + "A3=40.0*80.0 #Area of rectangle ACDE \n", + "A4=pi*pow(r,2)/2 #Area of semicircle\n", + "At1=30.0*20.0/2.0\n", + "At2=50.0*20.0/2.0\n", + "A=A1+A3-A4 #Total area\n", + "\n", + "X1=2.0*30.0/3.0\n", + "X2=50.0*30.0/3.0\n", + "X3=40.0\n", + "X4=40.0\n", + "\n", + "xc=(At1*X1+At2*X2+A3*X3-A4*X4)/A\n", + "#mistake in book\n", + "\n", + "Y1=(20.0/3.0)+40.0\n", + "Y3=20.0\n", + "Y4=(4.0*20.0)/(3.0*pi)\n", + "\n", + "yc=(A1*Y1+A3*Y3-A4*Y4)/A\n", + "print xc,yc\n", + "#\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(80.0*pow(20.0,3)/36) +A1*pow((60.0-(2*20.0/3.0)-yc),2)+(80*pow(40,3)/12)+(A3*pow((yc-20.0),2))-((0.0068598*pow(20,4))+(A4*pow((yc-Y4),2)))\n", + "\n", + "print\"Ixx=\",round(Ixx),\"mm^4\"\n", + "\n", + "\n", + "Iyy=(20.0*pow(30.0,3)/36) +At1*pow((xc-(2*30.0/3.0)),2)+(20*pow(50,3)/36)+(At2*pow((xc-(30.0+(50/3))),2))+((40*pow(80,3)/12)+(A3*pow((xc-40),2)))-((pi*pow(40,4))/(2*64))-(A4*pow((40-xc),2))\n", + "\n", + "print\"Iyy=\",round(Iyy),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.27 page number 150" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25000.0 5625.0 235.619449019 7889.38055098\n", + "xc= 0.411 m\n", + "yc= 0.329 m\n", + "zc= 0.221 m\n" + ] + } + ], + "source": [ + "#A concrete block of size 0.60 m × 0.75 m × 0.5 m is cast with a hole of diameter 0.2 m and depth 0.3 m\n", + "#The hole is completely filled with steel balls weighing 2500 N. Locate the centre of gravity of the body.\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "W=25000.0 # weight of concrete=25000, N/m^3\n", + "W1=0.6*0.75*0.5*W #Weight of solid concrete block\n", + "W2=pi*pow(0.2,2)*0.3*W/4 #Weight of concrete (W2) removed for making hole:\n", + "W3=2500\n", + "\n", + "#Taking origin as shown in the figure, the centre of gravity of solid block is (0.375, 0.3, 0.25) and that of hollow portion is (0.5, 0.4, 0.15)\n", + "\n", + "X1=0.375\n", + "X2=0.5\n", + "X3=0.5\n", + "\n", + "Y1=0.3\n", + "Y2=0.4\n", + "Y3=0.4\n", + "\n", + "Z1=0.25\n", + "Z2=0.15\n", + "Z3=0.15\n", + "\n", + "Wt=W3+W1-W2\n", + "print W,W1,W2,Wt\n", + "xc=(W1*X1-W2*X2+W3*X3)/Wt\n", + "\n", + "yc=(W1*Y1-W2*Y2+W3*Y3)/Wt\n", + "\n", + "zc=(W1*Z1-W2*Z2+W3*Z3)/Wt\n", + "\n", + "print\"xc=\",round(xc,3),\"m\"\n", + "print\"yc=\",round(yc,3),\"m\"\n", + "print\"zc=\",round(zc,3),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_R0XPX4L.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_R0XPX4L.ipynb new file mode 100644 index 00000000..d78e1aa8 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_R0XPX4L.ipynb @@ -0,0 +1,1403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4-DISTRIBUTED FORCES, CENTRE OF GRAVITY AND MOMENT OF INERTIA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.1 page number 102\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 407.44 mm\n", + "yc= 101.65 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#variable declaration\n", + "\n", + "L1=600.0 #length of wire AB,mm\n", + "L2=200.0 #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "\n", + "X1=300.0\n", + "X2=600.0\n", + "X3=600.0-150*cos(theta)\n", + "Y1=0\n", + "Y2=100\n", + "Y3=200+150*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.2 page number 103" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 451.2 mm\n", + "yc= 54.07 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids \n", + "\n", + "#variable declaration\n", + "\n", + "L1=400.0 #length of wire AB,mm\n", + "L2=150.0*pi #length of wire BC,mm\n", + "L3=250.0 #length of wire CD,mm\n", + "theta=30*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=200.0\n", + "X2=475.0\n", + "X3=400+300.0+250*cos(theta)/2\n", + "\n", + "Y1=0\n", + "Y2=2*150/pi\n", + "Y3=125*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.3 page number 105" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.19 mm\n", + "yc= 198.5 mm\n", + "zc= 56.17 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "# The length and the centroid of portions AB, BC and CD \n", + "# portion AB is in x-z plane, BC in y-z plane and CD in x-y plane. AB and BC are semi circular in shape\n", + "\n", + "#variable declaration\n", + "\n", + "L1=100.0*pi #length of wire AB,mm\n", + "L2=140.0*pi #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=100.0\n", + "X2=0\n", + "X3=300*sin(theta)\n", + "\n", + "Y1=0\n", + "Y2=140\n", + "Y3=280+300*cos(theta)\n", + "Z1=2*100/pi\n", + "Z2=2*140/pi\n", + "Z3=0\n", + "\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "zc=(L1*Z1+L2*Z2+L3*Z3)/L\n", + "\n", + "print \"zc=\",round(zc,2),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.4 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 0.0\n", + "yc= 40.0 mm\n", + "Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20.0 #Area of 1 ,mm^2\n", + "A2=20.0*100.0 #Area of 2,mm^2\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=10\n", + "Y2=70\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "print \"Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.5 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 36.62\n", + "yc= 61.62 mm\n", + "Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=150.0*12.0 #Area of 1 ,mm^2\n", + "A2=(200.0-12.0)*12.0 #Area of 2,mm^2\n", + "\n", + "X1=75\n", + "X2=6\n", + "\n", + "Y1=6\n", + "Y2=12+(200-12)/2\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.6 page number 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "yc= 59.71 mm\n", + "Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20 #Area of 1 ,mm^2\n", + "A2=100.0*20.0 #Area of 2,mm^2\n", + "A3=150.0*30.0 #Area of 3,mm^2\n", + "\n", + "#Selecting the coordinate system, due to symmetry centroid must lie on y axis,\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=30+100+20/2\n", + "Y2=30+100/2\n", + "Y3=30/2\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.7 page number 113" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 3.523 m\n", + "yc= 2.777 m\n" + ] + } + ], + "source": [ + "# Note that it is convenient to take axis in such a way that the centroids of all simple figures are having positive coordinates. If coordinate of any simple figure comes out to be negative, one should be careful in assigning the sign of moment of area \n", + "\n", + "#variable declaration\n", + "\n", + "A1=2.0*6.0*1.0/2.0 #Area of 1,m^2\n", + "A2=2.0*7.5 #Area of 2,m^2\n", + "A3=3.0*5.0*1.0/2 #Area of 3,m^2\n", + "A4=1.0*4.0 #Area of 4,m^2\n", + "\n", + "#The composite figure can be conveniently divided into two triangles and two rectangle\n", + "\n", + "X1=2.0*2.0/3.0\n", + "X2=2.0+1.0\n", + "X3=2.0+2.0+(1.0*3.0/3.0)\n", + "X4=4.0+4.0/2.0\n", + "\n", + "Y1=6.0/3.0\n", + "Y2=7.5/2.0\n", + "Y3=1.0+5.0/3.0\n", + "Y4=1/2.0\n", + "\n", + "A=A1+A2+A3+A4\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4)/A\n", + "\n", + "print \"xc=\",round(xc,3),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.8 page number 114\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 2.995 m\n", + "yc= 1.89 m\n" + ] + } + ], + "source": [ + "\n", + "# The composite section is divided into three simple figures, a triangle, a rectangle and a semicircle\n", + "\n", + "from math import pi\n", + "#variable declaration\n", + "\n", + "A1=1.0*3.0*4.0/2.0 #Area of 1,m^2\n", + "A2=6.0*4.0 #Area of 2,m^2\n", + "A3=1.0*pi*pow(2,2)/2 #Area of 3,m^2\n", + "\n", + "#The coordinates of centroids of these three simple figures are:\n", + "\n", + "X1=6.0+3.0/3.0\n", + "X2=3.0\n", + "X3=-(4*2)/(3.0*pi)\n", + "\n", + "Y1=4.0/3.0\n", + "Y2=2.0\n", + "Y3=2.0\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "print \"xc=\",round(xc,4),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.9 page number 115" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 145.42 m\n", + "yc= 90.39 m\n" + ] + } + ], + "source": [ + "#The composite area is equal to a rectangle of size 160 × 280 mm plus a triangle of size 280 mm base width and 40 mm height and minus areas of six holes. In this case also the can be used for locating centroid by treating area of holes as negative. The area of simple figures and their centroids are\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Ar=160.0*280.0 #Area of rectangle,mm^2\n", + "At=280.0*40.0/2.0 #Area of triangle,mm^2\n", + "d=21.5 #diameter of hole,mm \n", + "Ah=-pi*pow(d,2)/4 #Area of hole,mm^2\n", + "\n", + "A=Ar+At+Ah*6\n", + "\n", + "\n", + "Xr=140.0\n", + "Xt=560/3.0\n", + "Xh1=70.0\n", + "Xh2=140.0\n", + "Xh3=210.0\n", + "Xh4=70.0\n", + "Xh5=140.0\n", + "Xh6=210.0\n", + "\n", + "Yr=80.0\n", + "Yt=160.0+40.0/3.0\n", + "Yh1=50.0\n", + "Yh2=50.0\n", + "Yh3=50.0\n", + "Yh4=120.0\n", + "Yh5=130.0\n", + "Yh6=140.0\n", + "\n", + "xc=(Ar*Xr+At*Xt+Ah*(Xh1+Xh2+Xh3+Xh4+Xh5+Xh6))/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(Ar*Yr+At*Yt+Ah*(Yh1+Yh2+Yh3+Yh4+Yh5+Yh6))/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.10 page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.48 mm\n", + "yc= 67.86 mm\n" + ] + } + ], + "source": [ + "# If xc and yc are the coordinates of the centre of the circle, centroid also must have the coordinates xc and yc as per the condition laid down in the problem. The shaded area may be considered as a rectangle of size 200 mm × 150 mm minus a triangle of sides 100 mm × 75 mm and a circle of diameter 100 mm.\n", + "\n", + "\n", + "#variable declaration\n", + "\n", + "Ap=200.0*150.0 #Area of plate,mm^2\n", + "At=100.0*75.0/2.0 #Area of triangle,mm^2\n", + "Ah=pi*pow(100,2)/4.0 #Area of hole ,mm^2\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "\n", + "X1=100.0\n", + "X2=200.0-100.0/3.0\n", + "#X3=Xc\n", + "\n", + "Y1=75.0\n", + "Y2=150.0-25.0\n", + "#Y3=Yc\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "xc=(Ap*X1-At*X2)/(Ah+A)\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "yc=(Ap*Y1-At*Y2)/(Ah+A)\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.11 page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 326.4 m\n", + "yc= 219.12 m\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "X=40.0\n", + "A1=14.0*12.0*pow(X,2) #Area of rectangle,mm^2\n", + "A2=6.0*4.0*pow(X,2)/2.0 #Area of triangle,mm^2\n", + "A3=-4*4*pow(X,2) #Area of removed subtracted,mm^2\n", + "A4=-pi*pow(4*X,2)/2.0 #Area of semicircle to be subtracted,mm^2\n", + "A5=-pi*pow(4*X,2)/4.0 #Area of quarter of circle to be subtracted,mm^2\n", + "\n", + "X1=7.0*X\n", + "X2=14*X+2*X\n", + "X3=2*X\n", + "X4=6.0*X\n", + "X5=14.0*X-(16*X/(3*pi))\n", + "\n", + "Y1=6.0*X\n", + "Y2=4.0*X/3.0\n", + "Y3=8.0*X+2.0*X\n", + "Y4=(16.0*X)/(3*pi)\n", + "Y5=12*X-4*(4*X/(3*pi))\n", + "\n", + "A=A1+A2+A3+A4+A5\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.12 page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 6372441.9 mm^4\n", + "Iyy= 2824166.0 mm^4\n", + "kxx= 46.88 mm\n", + "kyy= 31.21 mm\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + "from math import pi,sqrt\n", + "#variable declaration\n", + "\n", + "\n", + "A1=150.0*10.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "#Due to symmetry, centroid lies on the symmetric axis y-y. The distance of the centroid from the top most fibre is given by:\n", + "\n", + "Y1=5.0\n", + "Y2=10.0+70.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#Referring to the centroidal axis x-x and y-y, the centroid of A1 is g1 (0.0, yc-5) and that of A2 is g2 (0.0, 80-yc)\n", + "\n", + "#Moment of inertia of the section about x-x axis Ixx = moment of inertia of A1 about x-x axis + moment of inertia of A2 about x-x axis.\n", + "\n", + "\n", + "Ixx=(150*pow(10,3)/12)+(A1*pow((yc-5),2))+(10*pow(140,3)/12)+(A2*pow((80-yc),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(10*pow(150,3)/12)+(140*pow(10,3)/12)\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Hence, the moment of inertia of the section about an axis passing through the centroid and parallel to the top most fibre is Ixxmm^4 and moment of inertia of the section about the axis of symmetry is Iyy mm^4. \n", + "#The radius of gyration is given by\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print\"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print\"kyy=\",round(kyy,2),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.13 page number 131" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 3411298.7 mm^4\n", + "Iyy= 1208657.7 mm^4\n", + "Izz= 4619956.4 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=125.0*10.0 #Area of 1,mm^2\n", + "A2=75.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "\n", + "#First, the centroid of the given section is to be located. Two reference axis (1)–(1) and (2)–(2) \n", + "\n", + "#The distance of centroid from the axis (1)–(1)\n", + "\n", + "X1=5.0\n", + "X2=10.0+75.0/2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "#Similarly, the distance of the centroid from the axis (2)–(2)\n", + "\n", + "Y1=125.0/2\n", + "Y2=5.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#With respect to the centroidal axis x-x and y-y, the centroid of A1 is g1 (xc-5, (85/2)-xc) and that of A2 is g2 ((135/2)-yc, yc-5). \n", + "Ixx=(10*pow(125,3)/12)+(A1*pow(21.56,2))+(75.0*pow(10.0,3.0)/12)+(A2*pow((39.94),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(125*pow(10,3)/12)+(A1*pow(15.94,2))+(10*pow(75,3)/12)+(A2*pow(26.56,2)) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# eample 4.14 page number 132" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 59269202.1 mm^4\n", + "Iyy= 12005814.8 mm^4\n", + "Izz= 71275016.9 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=200.0*9.0 #Area of 1,mm^2\n", + "A2=(250.0-9*2)*6.7 #Area of 2,mm^2\n", + "A3=200.0*9.0 #Area of 3,mm^2 \n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The section is symmetrical about both x-x and y-y axis. \n", + "X1=0\n", + "X2=0\n", + "X3=0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "\n", + "Y1=245.5\n", + "Y2=125.0\n", + "Y3=4.5\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#Therefore, its centroid will coincide with the centroid of rectangle A2. With respect to the centroidal axis x-x and y-y, the centroid of rectangle A1 is g1 (0.0, 120.5), that of A2 is g2 (0.0, 0.0) and that of A3 is g3 (0.0, 120.5).\n", + "\n", + "Ixx=(200.0*pow(9,3)/12)+(A1*pow(yc-4.5,2))+(6.7*pow(232,3.0)/12)+0+(200*pow(9,3)/12)+(A3*pow((yc-4.5),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(9*pow(200,3)/12)+(232*pow(6.7,3)/12)+(9*pow(200,3)/12) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "#misprint in book\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.15 page number 133" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 135903229.0 mm^4\n", + "Iyy= 5276363.1 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*13.5 #Area of 1,mm^2\n", + "A2=(400.0-27.0)*8.1 #Area of 2,mm^2\n", + "A3=100.0*13.5 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The given section is symmetric about horizontal axis passing through the centroid g2 of the rectangle A2.\n", + "\n", + "X1=50.0\n", + "X2=8.1/2.0\n", + "X3=50.0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "Y1=386.5+13.5/2.0\n", + "Y2=200.0\n", + "Y3=13.5/2\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y\n", + "\n", + "Ixx=(100.0*pow(13.5,3)/12.0)+(A1*pow((200-(13.5/2)),2))+(8.1*pow(373,3.0)/12.0)+0+(100*pow(13.5,3)/12.0)+(A3*pow((200-(13.5/2)),2))\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(13.5*pow(100.0,3)/12.0)+(A1*pow((50-xc),2))+(373.0*pow(8.1,3.0)/12.0)+A2*pow(21.68,2)+(13.5*pow(100,3)/12.0)+(A3*pow((50-xc),2))\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.16 page number 134\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polar moment of Inertia= 32109472.0 mm^4\n", + "kxx= 90.3 mm\n", + "kyy= 23.09 mm\n" + ] + } + ], + "source": [ + "# The section is divided into three rectangles A1, A2 and A3\n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=80.0*12.0 #Area of 1,mm^2\n", + "A2=(150.0-22.0)*12.0 #Area of 2,mm^2\n", + "A3=120.0*10.0 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on axis y-y. The bottom fibre (1)–(1) is chosen as reference axis to locate the centroid\n", + "\n", + "Y1=150-6\n", + "Y2=(128/2) +10\n", + "Y3=5\n", + "\n", + "yc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "X1=60.0\n", + "X2=60.0\n", + "X3=60.0\n", + "\n", + "xc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangles A1 is g1 (0.0, 150-6-yc), that of A2 is g2 (0.0, 75-yc) and that of A3 is g3 (0.0, yc-5 ).\n", + "\n", + "Iyy=(12*(pow(80,3))/12)+(128*(pow(12,3))/12)+(10*(pow(120,3))/12)\n", + "\n", + "Ixx=(80.0*pow(12.0,3)/12.0)+(A1*pow((150-6-yc),2))+(12*pow(128,3.0)/12.0)+(A2*pow((75-yc),2))+(120*pow(10,3)/12.0)+(A3*pow((150-10-6-yc),2))\n", + "\n", + "\n", + "\n", + "PolarmomentofInertia=Ixx+Iyy\n", + "\n", + "print \"Polar moment of Inertia=\",round(PolarmomentofInertia),\"mm^4\"\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print \"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print \"kyy=\",round(kyy,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.17 page number 135" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 31543827.2 mm^4\n", + "Iyy= 19745121.6 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#The given composite section may be divided into simple rectangles and triangle\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*30.0 #Area of 1,mm^2\n", + "A2=100.0*25.0 #Area of 2,mm^2\n", + "A3=200.0*20.0 #Area of 3,mm^2 \n", + "A4=87.5*20.0/2.0 #Area of 4,mm^2\n", + "A5=87.5*20.0/2.0 #Area of 5,mm^2\n", + "\n", + "A=A1+A2+A3+A4+A5 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on the axis y-y. A reference axis (1)–(1) is choosen as shown in the figure. The distance of the centroidal axis from (1)–(1)\n", + "\n", + "X1=100.0\n", + "X2=100.0\n", + "X3=100.0\n", + "X4=2.0*87.5/3.0\n", + "X5=200-X4\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "Y1=135.0\n", + "Y2=70.0\n", + "Y3=10.0\n", + "Y4=(20.0/3.0)+20.0\n", + "Y5=Y4\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangle A1 is g1 (0.0,135.0-yc), that of A2 is g2(0.0,70.00-yc), that of A3 is g3 (0.0, yc-10.0), the centroid of triangle A4 is g4 (41.66,yc-20.0-(20.0/3.0) ) and that of A5 is g5 (41.66,yc-20.0-(20.0/3.0)).\n", + "\n", + "\n", + "Ixx=(100.0*pow(30,3)/12.0)+(A1*pow((135.0-yc),2))+(25.0*pow(100,3.0)/12.0)+(A2*pow((70.0-yc),2))+(200*pow(20,3)/12.0)+(A3*pow((yc-10.0),2))+((87.5*pow(20,3)/36.0)+(A4*pow((yc-20.0-(20.0/3.0)),2)))*2\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(30.0*pow(100,3)/12.0)+(100.0*pow(25,3.0)/12.0)+(20*pow(200,3)/12.0)+((20.0*pow(87.5,3)/36.0)+(A4*pow((41.66),2)))*2\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.18 page number137" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 806093331.0 mm^4\n" + ] + } + ], + "source": [ + "#In this problem, it is required to find out the moment of inertia of the section about an axis AB. So there is no need to find out the position of the centroid. \n", + "#The given section is split up into simple rectangles\n", + "#Moment of inertia about AB = Sum of moments of inertia of the rectangle about AB\n", + "\n", + "#variable declaration\n", + "\n", + "A1=400*20.0\n", + "A2=100*10\n", + "A3=10*380.0\n", + "A4=100*10.0\n", + "\n", + "IAB=(400.0*pow(20,3)/12)+(A1*pow(10,2))+((100*pow(10,3)/12)+(A2*pow(25,2)))*2+((10*pow(380,3)/12)+(A3*pow(220,2)))*2+((100*pow(10,3)/12)+(A4*pow(415,2)))*2\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.19 page number 137" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 50399393.9 mm^4\n" + ] + } + ], + "source": [ + "# The built-up section is divided into six simple rectangles\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=250.0*10.0 #Area of 1,mm^2\n", + "A2=40.0*10.0 #Area of 2,mm^2\n", + "\n", + "A=A1*2+A2*4 #Total area,mm^2 \n", + "\n", + "\n", + "Y1=5.0\n", + "Y2=30.0\n", + "Y3=15.0\n", + "Y4=255.0\n", + "Y5=135.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A2*Y3+A2*Y4+A1*Y5)/A\n", + "\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(250.0*pow(10,3)/12.0)+(A1*pow((yc-5),2))+((10.0*pow(40,3.0)/12.0)+(A2*pow((yc-30.0),2)))*2+(40*pow(10,3)/12.0)+(A2*pow((yc-15.0),2))+(10.0*pow(250.0,3.0)/12.0)+(A1*pow((yc-135.0),2))+(40.0*pow(10.0,3)/12)+(A2*pow((yc-255),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.20 page number 138" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "145.394736842\n", + "Ixx= 752680131.6 mm^4\n" + ] + } + ], + "source": [ + "#Each angle is divided into two rectangles \n", + "\n", + "#variable declaration\n", + "\n", + "A1=600.0*15.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A3=150.0*10.0\n", + "A4=400.0*20.0\n", + "A=A1+A2*2+A3*2+A4 #Total area,mm^2 \n", + "\n", + "#The distance of the centroidal axis from the bottom fibres of section \n", + "\n", + "Y1=320.0\n", + "Y2=100.0\n", + "Y3=25.0\n", + "Y4=10.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A3*Y3*2+A4*Y4)/A\n", + "print yc\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(15.0*pow(600,3)/12.0)+(A1*pow((yc-320),2))+((10.0*pow(140,3.0)/12.0)+(A2*pow((yc-100.0),2)))*2+((150*pow(10,3)/12.0)+(A3*pow((yc-15.0),2)))*2+(400.0*pow(20.0,3.0)/12.0)+(A4*pow((yc-10.0),2))\n", + "\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.21 page number 139" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 36000000.0 mm^4\n" + ] + } + ], + "source": [ + "\n", + "from math import asin,sin,cos,pi\n", + "\n", + "#The rectangle is divided into four triangles\n", + "#The lines AE and FC are parallel to x-axis\n", + " \n", + "#variable declaration\n", + "\n", + "theta=asin(4.0/5.0)\n", + "\n", + "AB=100.0\n", + "BK=AB*sin((90*pi/180)-theta)\n", + "ND=BK\n", + "FD=60.0/sin(theta)\n", + "AF=150.0-FD\n", + "FL=ME=75.0*sin(theta)\n", + "AE=AB/cos((90*pi/180)-theta)\n", + "FC=AE\n", + "A=125.0*60.0/2.0\n", + "\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(125*pow(60,3)/36)+(A*pow((ND*4.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*2.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))\n", + "\n", + "print \"Ixx=\",round(Ixx),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.22, page number 140" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 4292979.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into a triangle PQR, a semicircle PSQ having base on axis AB and a circle having its centre on axis AB\n", + "\n", + "#variable declaration\n", + "#Now,Moment of inertia of the section about axis AB\n", + "IAB=(80*pow(80,3)/12)+(pi*pow(80,4)/128)-(pi*pow(40,4)/64)\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.23 page number141" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "106.435694487 28.4724404943\n", + "Ixx= 686943.0 mm^4\n", + "Iyy= 17146488.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into three simple figures viz., a triangle ABC, a rectangle ACDE and a semicircle. \n", + "\n", + "#variable declaration\n", + "\n", + "r=20.0 #radius of semicircle\n", + "A1=80.0*20.0/2 #Area of triangle ABC \n", + "A3=40.0*80.0 #Area of rectangle ACDE \n", + "A4=pi*pow(r,2)/2 #Area of semicircle\n", + "At1=30.0*20.0/2.0\n", + "At2=50.0*20.0/2.0\n", + "A=A1+A3-A4 #Total area\n", + "\n", + "X1=2.0*30.0/3.0\n", + "X2=50.0*30.0/3.0\n", + "X3=40.0\n", + "X4=40.0\n", + "\n", + "xc=(At1*X1+At2*X2+A3*X3-A4*X4)/A\n", + "#mistake in book\n", + "\n", + "Y1=(20.0/3.0)+40.0\n", + "Y3=20.0\n", + "Y4=(4.0*20.0)/(3.0*pi)\n", + "\n", + "yc=(A1*Y1+A3*Y3-A4*Y4)/A\n", + "print xc,yc\n", + "#\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(80.0*pow(20.0,3)/36) +A1*pow((60.0-(2*20.0/3.0)-yc),2)+(80*pow(40,3)/12)+(A3*pow((yc-20.0),2))-((0.0068598*pow(20,4))+(A4*pow((yc-Y4),2)))\n", + "\n", + "print\"Ixx=\",round(Ixx),\"mm^4\"\n", + "\n", + "\n", + "Iyy=(20.0*pow(30.0,3)/36) +At1*pow((xc-(2*30.0/3.0)),2)+(20*pow(50,3)/36)+(At2*pow((xc-(30.0+(50/3))),2))+((40*pow(80,3)/12)+(A3*pow((xc-40),2)))-((pi*pow(40,4))/(2*64))-(A4*pow((40-xc),2))\n", + "\n", + "print\"Iyy=\",round(Iyy),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.27 page number 150" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25000.0 5625.0 235.619449019 7889.38055098\n", + "xc= 0.411 m\n", + "yc= 0.329 m\n", + "zc= 0.221 m\n" + ] + } + ], + "source": [ + "#A concrete block of size 0.60 m × 0.75 m × 0.5 m is cast with a hole of diameter 0.2 m and depth 0.3 m\n", + "#The hole is completely filled with steel balls weighing 2500 N. Locate the centre of gravity of the body.\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "W=25000.0 # weight of concrete=25000, N/m^3\n", + "W1=0.6*0.75*0.5*W #Weight of solid concrete block\n", + "W2=pi*pow(0.2,2)*0.3*W/4 #Weight of concrete (W2) removed for making hole:\n", + "W3=2500\n", + "\n", + "#Taking origin as shown in the figure, the centre of gravity of solid block is (0.375, 0.3, 0.25) and that of hollow portion is (0.5, 0.4, 0.15)\n", + "\n", + "X1=0.375\n", + "X2=0.5\n", + "X3=0.5\n", + "\n", + "Y1=0.3\n", + "Y2=0.4\n", + "Y3=0.4\n", + "\n", + "Z1=0.25\n", + "Z2=0.15\n", + "Z3=0.15\n", + "\n", + "Wt=W3+W1-W2\n", + "print W,W1,W2,Wt\n", + "xc=(W1*X1-W2*X2+W3*X3)/Wt\n", + "\n", + "yc=(W1*Y1-W2*Y2+W3*Y3)/Wt\n", + "\n", + "zc=(W1*Z1-W2*Z2+W3*Z3)/Wt\n", + "\n", + "print\"xc=\",round(xc,3),\"m\"\n", + "print\"yc=\",round(yc,3),\"m\"\n", + "print\"zc=\",round(zc,3),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_S0t8OJu.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_S0t8OJu.ipynb new file mode 100644 index 00000000..d78e1aa8 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_S0t8OJu.ipynb @@ -0,0 +1,1403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4-DISTRIBUTED FORCES, CENTRE OF GRAVITY AND MOMENT OF INERTIA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.1 page number 102\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 407.44 mm\n", + "yc= 101.65 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#variable declaration\n", + "\n", + "L1=600.0 #length of wire AB,mm\n", + "L2=200.0 #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "\n", + "X1=300.0\n", + "X2=600.0\n", + "X3=600.0-150*cos(theta)\n", + "Y1=0\n", + "Y2=100\n", + "Y3=200+150*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.2 page number 103" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 451.2 mm\n", + "yc= 54.07 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids \n", + "\n", + "#variable declaration\n", + "\n", + "L1=400.0 #length of wire AB,mm\n", + "L2=150.0*pi #length of wire BC,mm\n", + "L3=250.0 #length of wire CD,mm\n", + "theta=30*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=200.0\n", + "X2=475.0\n", + "X3=400+300.0+250*cos(theta)/2\n", + "\n", + "Y1=0\n", + "Y2=2*150/pi\n", + "Y3=125*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.3 page number 105" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.19 mm\n", + "yc= 198.5 mm\n", + "zc= 56.17 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "# The length and the centroid of portions AB, BC and CD \n", + "# portion AB is in x-z plane, BC in y-z plane and CD in x-y plane. AB and BC are semi circular in shape\n", + "\n", + "#variable declaration\n", + "\n", + "L1=100.0*pi #length of wire AB,mm\n", + "L2=140.0*pi #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=100.0\n", + "X2=0\n", + "X3=300*sin(theta)\n", + "\n", + "Y1=0\n", + "Y2=140\n", + "Y3=280+300*cos(theta)\n", + "Z1=2*100/pi\n", + "Z2=2*140/pi\n", + "Z3=0\n", + "\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "zc=(L1*Z1+L2*Z2+L3*Z3)/L\n", + "\n", + "print \"zc=\",round(zc,2),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.4 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 0.0\n", + "yc= 40.0 mm\n", + "Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20.0 #Area of 1 ,mm^2\n", + "A2=20.0*100.0 #Area of 2,mm^2\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=10\n", + "Y2=70\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "print \"Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.5 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 36.62\n", + "yc= 61.62 mm\n", + "Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=150.0*12.0 #Area of 1 ,mm^2\n", + "A2=(200.0-12.0)*12.0 #Area of 2,mm^2\n", + "\n", + "X1=75\n", + "X2=6\n", + "\n", + "Y1=6\n", + "Y2=12+(200-12)/2\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.6 page number 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "yc= 59.71 mm\n", + "Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20 #Area of 1 ,mm^2\n", + "A2=100.0*20.0 #Area of 2,mm^2\n", + "A3=150.0*30.0 #Area of 3,mm^2\n", + "\n", + "#Selecting the coordinate system, due to symmetry centroid must lie on y axis,\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=30+100+20/2\n", + "Y2=30+100/2\n", + "Y3=30/2\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.7 page number 113" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 3.523 m\n", + "yc= 2.777 m\n" + ] + } + ], + "source": [ + "# Note that it is convenient to take axis in such a way that the centroids of all simple figures are having positive coordinates. If coordinate of any simple figure comes out to be negative, one should be careful in assigning the sign of moment of area \n", + "\n", + "#variable declaration\n", + "\n", + "A1=2.0*6.0*1.0/2.0 #Area of 1,m^2\n", + "A2=2.0*7.5 #Area of 2,m^2\n", + "A3=3.0*5.0*1.0/2 #Area of 3,m^2\n", + "A4=1.0*4.0 #Area of 4,m^2\n", + "\n", + "#The composite figure can be conveniently divided into two triangles and two rectangle\n", + "\n", + "X1=2.0*2.0/3.0\n", + "X2=2.0+1.0\n", + "X3=2.0+2.0+(1.0*3.0/3.0)\n", + "X4=4.0+4.0/2.0\n", + "\n", + "Y1=6.0/3.0\n", + "Y2=7.5/2.0\n", + "Y3=1.0+5.0/3.0\n", + "Y4=1/2.0\n", + "\n", + "A=A1+A2+A3+A4\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4)/A\n", + "\n", + "print \"xc=\",round(xc,3),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.8 page number 114\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 2.995 m\n", + "yc= 1.89 m\n" + ] + } + ], + "source": [ + "\n", + "# The composite section is divided into three simple figures, a triangle, a rectangle and a semicircle\n", + "\n", + "from math import pi\n", + "#variable declaration\n", + "\n", + "A1=1.0*3.0*4.0/2.0 #Area of 1,m^2\n", + "A2=6.0*4.0 #Area of 2,m^2\n", + "A3=1.0*pi*pow(2,2)/2 #Area of 3,m^2\n", + "\n", + "#The coordinates of centroids of these three simple figures are:\n", + "\n", + "X1=6.0+3.0/3.0\n", + "X2=3.0\n", + "X3=-(4*2)/(3.0*pi)\n", + "\n", + "Y1=4.0/3.0\n", + "Y2=2.0\n", + "Y3=2.0\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "print \"xc=\",round(xc,4),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.9 page number 115" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 145.42 m\n", + "yc= 90.39 m\n" + ] + } + ], + "source": [ + "#The composite area is equal to a rectangle of size 160 × 280 mm plus a triangle of size 280 mm base width and 40 mm height and minus areas of six holes. In this case also the can be used for locating centroid by treating area of holes as negative. The area of simple figures and their centroids are\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Ar=160.0*280.0 #Area of rectangle,mm^2\n", + "At=280.0*40.0/2.0 #Area of triangle,mm^2\n", + "d=21.5 #diameter of hole,mm \n", + "Ah=-pi*pow(d,2)/4 #Area of hole,mm^2\n", + "\n", + "A=Ar+At+Ah*6\n", + "\n", + "\n", + "Xr=140.0\n", + "Xt=560/3.0\n", + "Xh1=70.0\n", + "Xh2=140.0\n", + "Xh3=210.0\n", + "Xh4=70.0\n", + "Xh5=140.0\n", + "Xh6=210.0\n", + "\n", + "Yr=80.0\n", + "Yt=160.0+40.0/3.0\n", + "Yh1=50.0\n", + "Yh2=50.0\n", + "Yh3=50.0\n", + "Yh4=120.0\n", + "Yh5=130.0\n", + "Yh6=140.0\n", + "\n", + "xc=(Ar*Xr+At*Xt+Ah*(Xh1+Xh2+Xh3+Xh4+Xh5+Xh6))/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(Ar*Yr+At*Yt+Ah*(Yh1+Yh2+Yh3+Yh4+Yh5+Yh6))/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.10 page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.48 mm\n", + "yc= 67.86 mm\n" + ] + } + ], + "source": [ + "# If xc and yc are the coordinates of the centre of the circle, centroid also must have the coordinates xc and yc as per the condition laid down in the problem. The shaded area may be considered as a rectangle of size 200 mm × 150 mm minus a triangle of sides 100 mm × 75 mm and a circle of diameter 100 mm.\n", + "\n", + "\n", + "#variable declaration\n", + "\n", + "Ap=200.0*150.0 #Area of plate,mm^2\n", + "At=100.0*75.0/2.0 #Area of triangle,mm^2\n", + "Ah=pi*pow(100,2)/4.0 #Area of hole ,mm^2\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "\n", + "X1=100.0\n", + "X2=200.0-100.0/3.0\n", + "#X3=Xc\n", + "\n", + "Y1=75.0\n", + "Y2=150.0-25.0\n", + "#Y3=Yc\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "xc=(Ap*X1-At*X2)/(Ah+A)\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "yc=(Ap*Y1-At*Y2)/(Ah+A)\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.11 page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 326.4 m\n", + "yc= 219.12 m\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "X=40.0\n", + "A1=14.0*12.0*pow(X,2) #Area of rectangle,mm^2\n", + "A2=6.0*4.0*pow(X,2)/2.0 #Area of triangle,mm^2\n", + "A3=-4*4*pow(X,2) #Area of removed subtracted,mm^2\n", + "A4=-pi*pow(4*X,2)/2.0 #Area of semicircle to be subtracted,mm^2\n", + "A5=-pi*pow(4*X,2)/4.0 #Area of quarter of circle to be subtracted,mm^2\n", + "\n", + "X1=7.0*X\n", + "X2=14*X+2*X\n", + "X3=2*X\n", + "X4=6.0*X\n", + "X5=14.0*X-(16*X/(3*pi))\n", + "\n", + "Y1=6.0*X\n", + "Y2=4.0*X/3.0\n", + "Y3=8.0*X+2.0*X\n", + "Y4=(16.0*X)/(3*pi)\n", + "Y5=12*X-4*(4*X/(3*pi))\n", + "\n", + "A=A1+A2+A3+A4+A5\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.12 page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 6372441.9 mm^4\n", + "Iyy= 2824166.0 mm^4\n", + "kxx= 46.88 mm\n", + "kyy= 31.21 mm\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + "from math import pi,sqrt\n", + "#variable declaration\n", + "\n", + "\n", + "A1=150.0*10.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "#Due to symmetry, centroid lies on the symmetric axis y-y. The distance of the centroid from the top most fibre is given by:\n", + "\n", + "Y1=5.0\n", + "Y2=10.0+70.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#Referring to the centroidal axis x-x and y-y, the centroid of A1 is g1 (0.0, yc-5) and that of A2 is g2 (0.0, 80-yc)\n", + "\n", + "#Moment of inertia of the section about x-x axis Ixx = moment of inertia of A1 about x-x axis + moment of inertia of A2 about x-x axis.\n", + "\n", + "\n", + "Ixx=(150*pow(10,3)/12)+(A1*pow((yc-5),2))+(10*pow(140,3)/12)+(A2*pow((80-yc),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(10*pow(150,3)/12)+(140*pow(10,3)/12)\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Hence, the moment of inertia of the section about an axis passing through the centroid and parallel to the top most fibre is Ixxmm^4 and moment of inertia of the section about the axis of symmetry is Iyy mm^4. \n", + "#The radius of gyration is given by\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print\"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print\"kyy=\",round(kyy,2),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.13 page number 131" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 3411298.7 mm^4\n", + "Iyy= 1208657.7 mm^4\n", + "Izz= 4619956.4 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=125.0*10.0 #Area of 1,mm^2\n", + "A2=75.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "\n", + "#First, the centroid of the given section is to be located. Two reference axis (1)–(1) and (2)–(2) \n", + "\n", + "#The distance of centroid from the axis (1)–(1)\n", + "\n", + "X1=5.0\n", + "X2=10.0+75.0/2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "#Similarly, the distance of the centroid from the axis (2)–(2)\n", + "\n", + "Y1=125.0/2\n", + "Y2=5.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#With respect to the centroidal axis x-x and y-y, the centroid of A1 is g1 (xc-5, (85/2)-xc) and that of A2 is g2 ((135/2)-yc, yc-5). \n", + "Ixx=(10*pow(125,3)/12)+(A1*pow(21.56,2))+(75.0*pow(10.0,3.0)/12)+(A2*pow((39.94),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(125*pow(10,3)/12)+(A1*pow(15.94,2))+(10*pow(75,3)/12)+(A2*pow(26.56,2)) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# eample 4.14 page number 132" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 59269202.1 mm^4\n", + "Iyy= 12005814.8 mm^4\n", + "Izz= 71275016.9 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=200.0*9.0 #Area of 1,mm^2\n", + "A2=(250.0-9*2)*6.7 #Area of 2,mm^2\n", + "A3=200.0*9.0 #Area of 3,mm^2 \n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The section is symmetrical about both x-x and y-y axis. \n", + "X1=0\n", + "X2=0\n", + "X3=0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "\n", + "Y1=245.5\n", + "Y2=125.0\n", + "Y3=4.5\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#Therefore, its centroid will coincide with the centroid of rectangle A2. With respect to the centroidal axis x-x and y-y, the centroid of rectangle A1 is g1 (0.0, 120.5), that of A2 is g2 (0.0, 0.0) and that of A3 is g3 (0.0, 120.5).\n", + "\n", + "Ixx=(200.0*pow(9,3)/12)+(A1*pow(yc-4.5,2))+(6.7*pow(232,3.0)/12)+0+(200*pow(9,3)/12)+(A3*pow((yc-4.5),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(9*pow(200,3)/12)+(232*pow(6.7,3)/12)+(9*pow(200,3)/12) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "#misprint in book\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.15 page number 133" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 135903229.0 mm^4\n", + "Iyy= 5276363.1 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*13.5 #Area of 1,mm^2\n", + "A2=(400.0-27.0)*8.1 #Area of 2,mm^2\n", + "A3=100.0*13.5 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The given section is symmetric about horizontal axis passing through the centroid g2 of the rectangle A2.\n", + "\n", + "X1=50.0\n", + "X2=8.1/2.0\n", + "X3=50.0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "Y1=386.5+13.5/2.0\n", + "Y2=200.0\n", + "Y3=13.5/2\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y\n", + "\n", + "Ixx=(100.0*pow(13.5,3)/12.0)+(A1*pow((200-(13.5/2)),2))+(8.1*pow(373,3.0)/12.0)+0+(100*pow(13.5,3)/12.0)+(A3*pow((200-(13.5/2)),2))\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(13.5*pow(100.0,3)/12.0)+(A1*pow((50-xc),2))+(373.0*pow(8.1,3.0)/12.0)+A2*pow(21.68,2)+(13.5*pow(100,3)/12.0)+(A3*pow((50-xc),2))\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.16 page number 134\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polar moment of Inertia= 32109472.0 mm^4\n", + "kxx= 90.3 mm\n", + "kyy= 23.09 mm\n" + ] + } + ], + "source": [ + "# The section is divided into three rectangles A1, A2 and A3\n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=80.0*12.0 #Area of 1,mm^2\n", + "A2=(150.0-22.0)*12.0 #Area of 2,mm^2\n", + "A3=120.0*10.0 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on axis y-y. The bottom fibre (1)–(1) is chosen as reference axis to locate the centroid\n", + "\n", + "Y1=150-6\n", + "Y2=(128/2) +10\n", + "Y3=5\n", + "\n", + "yc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "X1=60.0\n", + "X2=60.0\n", + "X3=60.0\n", + "\n", + "xc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangles A1 is g1 (0.0, 150-6-yc), that of A2 is g2 (0.0, 75-yc) and that of A3 is g3 (0.0, yc-5 ).\n", + "\n", + "Iyy=(12*(pow(80,3))/12)+(128*(pow(12,3))/12)+(10*(pow(120,3))/12)\n", + "\n", + "Ixx=(80.0*pow(12.0,3)/12.0)+(A1*pow((150-6-yc),2))+(12*pow(128,3.0)/12.0)+(A2*pow((75-yc),2))+(120*pow(10,3)/12.0)+(A3*pow((150-10-6-yc),2))\n", + "\n", + "\n", + "\n", + "PolarmomentofInertia=Ixx+Iyy\n", + "\n", + "print \"Polar moment of Inertia=\",round(PolarmomentofInertia),\"mm^4\"\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print \"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print \"kyy=\",round(kyy,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.17 page number 135" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 31543827.2 mm^4\n", + "Iyy= 19745121.6 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#The given composite section may be divided into simple rectangles and triangle\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*30.0 #Area of 1,mm^2\n", + "A2=100.0*25.0 #Area of 2,mm^2\n", + "A3=200.0*20.0 #Area of 3,mm^2 \n", + "A4=87.5*20.0/2.0 #Area of 4,mm^2\n", + "A5=87.5*20.0/2.0 #Area of 5,mm^2\n", + "\n", + "A=A1+A2+A3+A4+A5 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on the axis y-y. A reference axis (1)–(1) is choosen as shown in the figure. The distance of the centroidal axis from (1)–(1)\n", + "\n", + "X1=100.0\n", + "X2=100.0\n", + "X3=100.0\n", + "X4=2.0*87.5/3.0\n", + "X5=200-X4\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "Y1=135.0\n", + "Y2=70.0\n", + "Y3=10.0\n", + "Y4=(20.0/3.0)+20.0\n", + "Y5=Y4\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangle A1 is g1 (0.0,135.0-yc), that of A2 is g2(0.0,70.00-yc), that of A3 is g3 (0.0, yc-10.0), the centroid of triangle A4 is g4 (41.66,yc-20.0-(20.0/3.0) ) and that of A5 is g5 (41.66,yc-20.0-(20.0/3.0)).\n", + "\n", + "\n", + "Ixx=(100.0*pow(30,3)/12.0)+(A1*pow((135.0-yc),2))+(25.0*pow(100,3.0)/12.0)+(A2*pow((70.0-yc),2))+(200*pow(20,3)/12.0)+(A3*pow((yc-10.0),2))+((87.5*pow(20,3)/36.0)+(A4*pow((yc-20.0-(20.0/3.0)),2)))*2\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(30.0*pow(100,3)/12.0)+(100.0*pow(25,3.0)/12.0)+(20*pow(200,3)/12.0)+((20.0*pow(87.5,3)/36.0)+(A4*pow((41.66),2)))*2\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.18 page number137" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 806093331.0 mm^4\n" + ] + } + ], + "source": [ + "#In this problem, it is required to find out the moment of inertia of the section about an axis AB. So there is no need to find out the position of the centroid. \n", + "#The given section is split up into simple rectangles\n", + "#Moment of inertia about AB = Sum of moments of inertia of the rectangle about AB\n", + "\n", + "#variable declaration\n", + "\n", + "A1=400*20.0\n", + "A2=100*10\n", + "A3=10*380.0\n", + "A4=100*10.0\n", + "\n", + "IAB=(400.0*pow(20,3)/12)+(A1*pow(10,2))+((100*pow(10,3)/12)+(A2*pow(25,2)))*2+((10*pow(380,3)/12)+(A3*pow(220,2)))*2+((100*pow(10,3)/12)+(A4*pow(415,2)))*2\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.19 page number 137" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 50399393.9 mm^4\n" + ] + } + ], + "source": [ + "# The built-up section is divided into six simple rectangles\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=250.0*10.0 #Area of 1,mm^2\n", + "A2=40.0*10.0 #Area of 2,mm^2\n", + "\n", + "A=A1*2+A2*4 #Total area,mm^2 \n", + "\n", + "\n", + "Y1=5.0\n", + "Y2=30.0\n", + "Y3=15.0\n", + "Y4=255.0\n", + "Y5=135.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A2*Y3+A2*Y4+A1*Y5)/A\n", + "\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(250.0*pow(10,3)/12.0)+(A1*pow((yc-5),2))+((10.0*pow(40,3.0)/12.0)+(A2*pow((yc-30.0),2)))*2+(40*pow(10,3)/12.0)+(A2*pow((yc-15.0),2))+(10.0*pow(250.0,3.0)/12.0)+(A1*pow((yc-135.0),2))+(40.0*pow(10.0,3)/12)+(A2*pow((yc-255),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.20 page number 138" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "145.394736842\n", + "Ixx= 752680131.6 mm^4\n" + ] + } + ], + "source": [ + "#Each angle is divided into two rectangles \n", + "\n", + "#variable declaration\n", + "\n", + "A1=600.0*15.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A3=150.0*10.0\n", + "A4=400.0*20.0\n", + "A=A1+A2*2+A3*2+A4 #Total area,mm^2 \n", + "\n", + "#The distance of the centroidal axis from the bottom fibres of section \n", + "\n", + "Y1=320.0\n", + "Y2=100.0\n", + "Y3=25.0\n", + "Y4=10.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A3*Y3*2+A4*Y4)/A\n", + "print yc\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(15.0*pow(600,3)/12.0)+(A1*pow((yc-320),2))+((10.0*pow(140,3.0)/12.0)+(A2*pow((yc-100.0),2)))*2+((150*pow(10,3)/12.0)+(A3*pow((yc-15.0),2)))*2+(400.0*pow(20.0,3.0)/12.0)+(A4*pow((yc-10.0),2))\n", + "\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.21 page number 139" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 36000000.0 mm^4\n" + ] + } + ], + "source": [ + "\n", + "from math import asin,sin,cos,pi\n", + "\n", + "#The rectangle is divided into four triangles\n", + "#The lines AE and FC are parallel to x-axis\n", + " \n", + "#variable declaration\n", + "\n", + "theta=asin(4.0/5.0)\n", + "\n", + "AB=100.0\n", + "BK=AB*sin((90*pi/180)-theta)\n", + "ND=BK\n", + "FD=60.0/sin(theta)\n", + "AF=150.0-FD\n", + "FL=ME=75.0*sin(theta)\n", + "AE=AB/cos((90*pi/180)-theta)\n", + "FC=AE\n", + "A=125.0*60.0/2.0\n", + "\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(125*pow(60,3)/36)+(A*pow((ND*4.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*2.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))\n", + "\n", + "print \"Ixx=\",round(Ixx),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.22, page number 140" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 4292979.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into a triangle PQR, a semicircle PSQ having base on axis AB and a circle having its centre on axis AB\n", + "\n", + "#variable declaration\n", + "#Now,Moment of inertia of the section about axis AB\n", + "IAB=(80*pow(80,3)/12)+(pi*pow(80,4)/128)-(pi*pow(40,4)/64)\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.23 page number141" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "106.435694487 28.4724404943\n", + "Ixx= 686943.0 mm^4\n", + "Iyy= 17146488.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into three simple figures viz., a triangle ABC, a rectangle ACDE and a semicircle. \n", + "\n", + "#variable declaration\n", + "\n", + "r=20.0 #radius of semicircle\n", + "A1=80.0*20.0/2 #Area of triangle ABC \n", + "A3=40.0*80.0 #Area of rectangle ACDE \n", + "A4=pi*pow(r,2)/2 #Area of semicircle\n", + "At1=30.0*20.0/2.0\n", + "At2=50.0*20.0/2.0\n", + "A=A1+A3-A4 #Total area\n", + "\n", + "X1=2.0*30.0/3.0\n", + "X2=50.0*30.0/3.0\n", + "X3=40.0\n", + "X4=40.0\n", + "\n", + "xc=(At1*X1+At2*X2+A3*X3-A4*X4)/A\n", + "#mistake in book\n", + "\n", + "Y1=(20.0/3.0)+40.0\n", + "Y3=20.0\n", + "Y4=(4.0*20.0)/(3.0*pi)\n", + "\n", + "yc=(A1*Y1+A3*Y3-A4*Y4)/A\n", + "print xc,yc\n", + "#\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(80.0*pow(20.0,3)/36) +A1*pow((60.0-(2*20.0/3.0)-yc),2)+(80*pow(40,3)/12)+(A3*pow((yc-20.0),2))-((0.0068598*pow(20,4))+(A4*pow((yc-Y4),2)))\n", + "\n", + "print\"Ixx=\",round(Ixx),\"mm^4\"\n", + "\n", + "\n", + "Iyy=(20.0*pow(30.0,3)/36) +At1*pow((xc-(2*30.0/3.0)),2)+(20*pow(50,3)/36)+(At2*pow((xc-(30.0+(50/3))),2))+((40*pow(80,3)/12)+(A3*pow((xc-40),2)))-((pi*pow(40,4))/(2*64))-(A4*pow((40-xc),2))\n", + "\n", + "print\"Iyy=\",round(Iyy),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.27 page number 150" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25000.0 5625.0 235.619449019 7889.38055098\n", + "xc= 0.411 m\n", + "yc= 0.329 m\n", + "zc= 0.221 m\n" + ] + } + ], + "source": [ + "#A concrete block of size 0.60 m × 0.75 m × 0.5 m is cast with a hole of diameter 0.2 m and depth 0.3 m\n", + "#The hole is completely filled with steel balls weighing 2500 N. Locate the centre of gravity of the body.\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "W=25000.0 # weight of concrete=25000, N/m^3\n", + "W1=0.6*0.75*0.5*W #Weight of solid concrete block\n", + "W2=pi*pow(0.2,2)*0.3*W/4 #Weight of concrete (W2) removed for making hole:\n", + "W3=2500\n", + "\n", + "#Taking origin as shown in the figure, the centre of gravity of solid block is (0.375, 0.3, 0.25) and that of hollow portion is (0.5, 0.4, 0.15)\n", + "\n", + "X1=0.375\n", + "X2=0.5\n", + "X3=0.5\n", + "\n", + "Y1=0.3\n", + "Y2=0.4\n", + "Y3=0.4\n", + "\n", + "Z1=0.25\n", + "Z2=0.15\n", + "Z3=0.15\n", + "\n", + "Wt=W3+W1-W2\n", + "print W,W1,W2,Wt\n", + "xc=(W1*X1-W2*X2+W3*X3)/Wt\n", + "\n", + "yc=(W1*Y1-W2*Y2+W3*Y3)/Wt\n", + "\n", + "zc=(W1*Z1-W2*Z2+W3*Z3)/Wt\n", + "\n", + "print\"xc=\",round(xc,3),\"m\"\n", + "print\"yc=\",round(yc,3),\"m\"\n", + "print\"zc=\",round(zc,3),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_uFVYXqM.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_uFVYXqM.ipynb new file mode 100644 index 00000000..d78e1aa8 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_uFVYXqM.ipynb @@ -0,0 +1,1403 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4-DISTRIBUTED FORCES, CENTRE OF GRAVITY AND MOMENT OF INERTIA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.1 page number 102\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 407.44 mm\n", + "yc= 101.65 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#variable declaration\n", + "\n", + "L1=600.0 #length of wire AB,mm\n", + "L2=200.0 #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "\n", + "X1=300.0\n", + "X2=600.0\n", + "X3=600.0-150*cos(theta)\n", + "Y1=0\n", + "Y2=100\n", + "Y3=200+150*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.2 page number 103" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 451.2 mm\n", + "yc= 54.07 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "\n", + "#The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids \n", + "\n", + "#variable declaration\n", + "\n", + "L1=400.0 #length of wire AB,mm\n", + "L2=150.0*pi #length of wire BC,mm\n", + "L3=250.0 #length of wire CD,mm\n", + "theta=30*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=200.0\n", + "X2=475.0\n", + "X3=400+300.0+250*cos(theta)/2\n", + "\n", + "Y1=0\n", + "Y2=2*150/pi\n", + "Y3=125*sin(theta)\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.3 page number 105" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.19 mm\n", + "yc= 198.5 mm\n", + "zc= 56.17 mm\n" + ] + } + ], + "source": [ + "from math import cos,sin,pi\n", + "# The length and the centroid of portions AB, BC and CD \n", + "# portion AB is in x-z plane, BC in y-z plane and CD in x-y plane. AB and BC are semi circular in shape\n", + "\n", + "#variable declaration\n", + "\n", + "L1=100.0*pi #length of wire AB,mm\n", + "L2=140.0*pi #length of wire BC,mm\n", + "L3=300.0 #length of wire CD,mm\n", + "theta=45*pi/180\n", + "\n", + "#The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)\n", + "X1=100.0\n", + "X2=0\n", + "X3=300*sin(theta)\n", + "\n", + "Y1=0\n", + "Y2=140\n", + "Y3=280+300*cos(theta)\n", + "Z1=2*100/pi\n", + "Z2=2*140/pi\n", + "Z3=0\n", + "\n", + "L=L1+L2+L3 #Total length,mm\n", + "\n", + "xc=(L1*X1+L2*X2+L3*X3)/L\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "\n", + "yc=(L1*Y1+L2*Y2+L3*Y3)/L\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "zc=(L1*Z1+L2*Z2+L3*Z3)/L\n", + "\n", + "print \"zc=\",round(zc,2),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.4 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 0.0\n", + "yc= 40.0 mm\n", + "Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20.0 #Area of 1 ,mm^2\n", + "A2=20.0*100.0 #Area of 2,mm^2\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=10\n", + "Y2=70\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "print \"Hence, centroid of T-section is on the symmetric axis at a distance 40 mm from the top\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.5 page number 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 36.62\n", + "yc= 61.62 mm\n", + "Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=150.0*12.0 #Area of 1 ,mm^2\n", + "A2=(200.0-12.0)*12.0 #Area of 2,mm^2\n", + "\n", + "X1=75\n", + "X2=6\n", + "\n", + "Y1=6\n", + "Y2=12+(200-12)/2\n", + "\n", + "A=A1+A2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "print \"xc=\",round(xc,2)\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is at x = 36.62 mm and y = 61.62 mm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.6 page number 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "yc= 59.71 mm\n", + "Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "A1=100.0*20 #Area of 1 ,mm^2\n", + "A2=100.0*20.0 #Area of 2,mm^2\n", + "A3=150.0*30.0 #Area of 3,mm^2\n", + "\n", + "#Selecting the coordinate system, due to symmetry centroid must lie on y axis,\n", + "\n", + "X1=0\n", + "X2=0\n", + "\n", + "Y1=30+100+20/2\n", + "Y2=30+100/2\n", + "Y3=30/2\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n", + "\n", + "print \"Thus, the centroid is on the symmetric axis at a distance 59.71 mm from the bottom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.7 page number 113" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 3.523 m\n", + "yc= 2.777 m\n" + ] + } + ], + "source": [ + "# Note that it is convenient to take axis in such a way that the centroids of all simple figures are having positive coordinates. If coordinate of any simple figure comes out to be negative, one should be careful in assigning the sign of moment of area \n", + "\n", + "#variable declaration\n", + "\n", + "A1=2.0*6.0*1.0/2.0 #Area of 1,m^2\n", + "A2=2.0*7.5 #Area of 2,m^2\n", + "A3=3.0*5.0*1.0/2 #Area of 3,m^2\n", + "A4=1.0*4.0 #Area of 4,m^2\n", + "\n", + "#The composite figure can be conveniently divided into two triangles and two rectangle\n", + "\n", + "X1=2.0*2.0/3.0\n", + "X2=2.0+1.0\n", + "X3=2.0+2.0+(1.0*3.0/3.0)\n", + "X4=4.0+4.0/2.0\n", + "\n", + "Y1=6.0/3.0\n", + "Y2=7.5/2.0\n", + "Y3=1.0+5.0/3.0\n", + "Y4=1/2.0\n", + "\n", + "A=A1+A2+A3+A4\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4)/A\n", + "\n", + "print \"xc=\",round(xc,3),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.8 page number 114\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 2.995 m\n", + "yc= 1.89 m\n" + ] + } + ], + "source": [ + "\n", + "# The composite section is divided into three simple figures, a triangle, a rectangle and a semicircle\n", + "\n", + "from math import pi\n", + "#variable declaration\n", + "\n", + "A1=1.0*3.0*4.0/2.0 #Area of 1,m^2\n", + "A2=6.0*4.0 #Area of 2,m^2\n", + "A3=1.0*pi*pow(2,2)/2 #Area of 3,m^2\n", + "\n", + "#The coordinates of centroids of these three simple figures are:\n", + "\n", + "X1=6.0+3.0/3.0\n", + "X2=3.0\n", + "X3=-(4*2)/(3.0*pi)\n", + "\n", + "Y1=4.0/3.0\n", + "Y2=2.0\n", + "Y3=2.0\n", + "\n", + "A=A1+A2+A3\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "print \"xc=\",round(xc,4),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "print \"yc=\",round(yc,3),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.9 page number 115" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 145.42 m\n", + "yc= 90.39 m\n" + ] + } + ], + "source": [ + "#The composite area is equal to a rectangle of size 160 × 280 mm plus a triangle of size 280 mm base width and 40 mm height and minus areas of six holes. In this case also the can be used for locating centroid by treating area of holes as negative. The area of simple figures and their centroids are\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Ar=160.0*280.0 #Area of rectangle,mm^2\n", + "At=280.0*40.0/2.0 #Area of triangle,mm^2\n", + "d=21.5 #diameter of hole,mm \n", + "Ah=-pi*pow(d,2)/4 #Area of hole,mm^2\n", + "\n", + "A=Ar+At+Ah*6\n", + "\n", + "\n", + "Xr=140.0\n", + "Xt=560/3.0\n", + "Xh1=70.0\n", + "Xh2=140.0\n", + "Xh3=210.0\n", + "Xh4=70.0\n", + "Xh5=140.0\n", + "Xh6=210.0\n", + "\n", + "Yr=80.0\n", + "Yt=160.0+40.0/3.0\n", + "Yh1=50.0\n", + "Yh2=50.0\n", + "Yh3=50.0\n", + "Yh4=120.0\n", + "Yh5=130.0\n", + "Yh6=140.0\n", + "\n", + "xc=(Ar*Xr+At*Xt+Ah*(Xh1+Xh2+Xh3+Xh4+Xh5+Xh6))/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(Ar*Yr+At*Yt+Ah*(Yh1+Yh2+Yh3+Yh4+Yh5+Yh6))/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.10 page number 116" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 90.48 mm\n", + "yc= 67.86 mm\n" + ] + } + ], + "source": [ + "# If xc and yc are the coordinates of the centre of the circle, centroid also must have the coordinates xc and yc as per the condition laid down in the problem. The shaded area may be considered as a rectangle of size 200 mm × 150 mm minus a triangle of sides 100 mm × 75 mm and a circle of diameter 100 mm.\n", + "\n", + "\n", + "#variable declaration\n", + "\n", + "Ap=200.0*150.0 #Area of plate,mm^2\n", + "At=100.0*75.0/2.0 #Area of triangle,mm^2\n", + "Ah=pi*pow(100,2)/4.0 #Area of hole ,mm^2\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "\n", + "X1=100.0\n", + "X2=200.0-100.0/3.0\n", + "#X3=Xc\n", + "\n", + "Y1=75.0\n", + "Y2=150.0-25.0\n", + "#Y3=Yc\n", + "\n", + "A=Ap-At-Ah\n", + "\n", + "xc=(Ap*X1-At*X2)/(Ah+A)\n", + "\n", + "print \"xc=\",round(xc,2),\"mm\"\n", + "\n", + "yc=(Ap*Y1-At*Y2)/(Ah+A)\n", + "\n", + "print \"yc=\",round(yc,2),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.11 page number 118" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "xc= 326.4 m\n", + "yc= 219.12 m\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "X=40.0\n", + "A1=14.0*12.0*pow(X,2) #Area of rectangle,mm^2\n", + "A2=6.0*4.0*pow(X,2)/2.0 #Area of triangle,mm^2\n", + "A3=-4*4*pow(X,2) #Area of removed subtracted,mm^2\n", + "A4=-pi*pow(4*X,2)/2.0 #Area of semicircle to be subtracted,mm^2\n", + "A5=-pi*pow(4*X,2)/4.0 #Area of quarter of circle to be subtracted,mm^2\n", + "\n", + "X1=7.0*X\n", + "X2=14*X+2*X\n", + "X3=2*X\n", + "X4=6.0*X\n", + "X5=14.0*X-(16*X/(3*pi))\n", + "\n", + "Y1=6.0*X\n", + "Y2=4.0*X/3.0\n", + "Y3=8.0*X+2.0*X\n", + "Y4=(16.0*X)/(3*pi)\n", + "Y5=12*X-4*(4*X/(3*pi))\n", + "\n", + "A=A1+A2+A3+A4+A5\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "print \"xc=\",round(xc,2),\"m\"\n", + "\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "print \"yc=\",round(yc,2),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.12 page number 130" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 6372441.9 mm^4\n", + "Iyy= 2824166.0 mm^4\n", + "kxx= 46.88 mm\n", + "kyy= 31.21 mm\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + "from math import pi,sqrt\n", + "#variable declaration\n", + "\n", + "\n", + "A1=150.0*10.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "#Due to symmetry, centroid lies on the symmetric axis y-y. The distance of the centroid from the top most fibre is given by:\n", + "\n", + "Y1=5.0\n", + "Y2=10.0+70.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#Referring to the centroidal axis x-x and y-y, the centroid of A1 is g1 (0.0, yc-5) and that of A2 is g2 (0.0, 80-yc)\n", + "\n", + "#Moment of inertia of the section about x-x axis Ixx = moment of inertia of A1 about x-x axis + moment of inertia of A2 about x-x axis.\n", + "\n", + "\n", + "Ixx=(150*pow(10,3)/12)+(A1*pow((yc-5),2))+(10*pow(140,3)/12)+(A2*pow((80-yc),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(10*pow(150,3)/12)+(140*pow(10,3)/12)\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Hence, the moment of inertia of the section about an axis passing through the centroid and parallel to the top most fibre is Ixxmm^4 and moment of inertia of the section about the axis of symmetry is Iyy mm^4. \n", + "#The radius of gyration is given by\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print\"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print\"kyy=\",round(kyy,2),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.13 page number 131" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 3411298.7 mm^4\n", + "Iyy= 1208657.7 mm^4\n", + "Izz= 4619956.4 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=125.0*10.0 #Area of 1,mm^2\n", + "A2=75.0*10.0 #Area of 2,mm^2\n", + "A=A1+A2 #Total area,mm^2 \n", + "\n", + "#First, the centroid of the given section is to be located. Two reference axis (1)–(1) and (2)–(2) \n", + "\n", + "#The distance of centroid from the axis (1)–(1)\n", + "\n", + "X1=5.0\n", + "X2=10.0+75.0/2\n", + "\n", + "xc=(A1*X1+A2*X2)/A\n", + "\n", + "#Similarly, the distance of the centroid from the axis (2)–(2)\n", + "\n", + "Y1=125.0/2\n", + "Y2=5.0\n", + "\n", + "yc=(A1*Y1+A2*Y2)/A\n", + "\n", + "#With respect to the centroidal axis x-x and y-y, the centroid of A1 is g1 (xc-5, (85/2)-xc) and that of A2 is g2 ((135/2)-yc, yc-5). \n", + "Ixx=(10*pow(125,3)/12)+(A1*pow(21.56,2))+(75.0*pow(10.0,3.0)/12)+(A2*pow((39.94),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(125*pow(10,3)/12)+(A1*pow(15.94,2))+(10*pow(75,3)/12)+(A2*pow(26.56,2)) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# eample 4.14 page number 132" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 59269202.1 mm^4\n", + "Iyy= 12005814.8 mm^4\n", + "Izz= 71275016.9 mm^4\n" + ] + } + ], + "source": [ + "#The given composite section can be divided into two rectangles \n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=200.0*9.0 #Area of 1,mm^2\n", + "A2=(250.0-9*2)*6.7 #Area of 2,mm^2\n", + "A3=200.0*9.0 #Area of 3,mm^2 \n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The section is symmetrical about both x-x and y-y axis. \n", + "X1=0\n", + "X2=0\n", + "X3=0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "\n", + "Y1=245.5\n", + "Y2=125.0\n", + "Y3=4.5\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#Therefore, its centroid will coincide with the centroid of rectangle A2. With respect to the centroidal axis x-x and y-y, the centroid of rectangle A1 is g1 (0.0, 120.5), that of A2 is g2 (0.0, 0.0) and that of A3 is g3 (0.0, 120.5).\n", + "\n", + "Ixx=(200.0*pow(9,3)/12)+(A1*pow(yc-4.5,2))+(6.7*pow(232,3.0)/12)+0+(200*pow(9,3)/12)+(A3*pow((yc-4.5),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(9*pow(200,3)/12)+(232*pow(6.7,3)/12)+(9*pow(200,3)/12) \n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n", + "\n", + "#Izz=Polar moment of inertia\n", + "\n", + "Izz=Ixx+Iyy\n", + "\n", + "#misprint in book\n", + "\n", + "print \"Izz=\",round(Izz,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.15 page number 133" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 135903229.0 mm^4\n", + "Iyy= 5276363.1 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*13.5 #Area of 1,mm^2\n", + "A2=(400.0-27.0)*8.1 #Area of 2,mm^2\n", + "A3=100.0*13.5 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#The given section is symmetric about horizontal axis passing through the centroid g2 of the rectangle A2.\n", + "\n", + "X1=50.0\n", + "X2=8.1/2.0\n", + "X3=50.0\n", + "\n", + "xc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "Y1=386.5+13.5/2.0\n", + "Y2=200.0\n", + "Y3=13.5/2\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y\n", + "\n", + "Ixx=(100.0*pow(13.5,3)/12.0)+(A1*pow((200-(13.5/2)),2))+(8.1*pow(373,3.0)/12.0)+0+(100*pow(13.5,3)/12.0)+(A3*pow((200-(13.5/2)),2))\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(13.5*pow(100.0,3)/12.0)+(A1*pow((50-xc),2))+(373.0*pow(8.1,3.0)/12.0)+A2*pow(21.68,2)+(13.5*pow(100,3)/12.0)+(A3*pow((50-xc),2))\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.16 page number 134\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polar moment of Inertia= 32109472.0 mm^4\n", + "kxx= 90.3 mm\n", + "kyy= 23.09 mm\n" + ] + } + ], + "source": [ + "# The section is divided into three rectangles A1, A2 and A3\n", + "\n", + " \n", + "#variable declaration\n", + "\n", + "\n", + "A1=80.0*12.0 #Area of 1,mm^2\n", + "A2=(150.0-22.0)*12.0 #Area of 2,mm^2\n", + "A3=120.0*10.0 #Area of 3,mm^2 \n", + "\n", + "A=A1+A2+A3 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on axis y-y. The bottom fibre (1)–(1) is chosen as reference axis to locate the centroid\n", + "\n", + "Y1=150-6\n", + "Y2=(128/2) +10\n", + "Y3=5\n", + "\n", + "yc=(A1*X1+A2*X2+A3*X3)/A\n", + "\n", + "X1=60.0\n", + "X2=60.0\n", + "X3=60.0\n", + "\n", + "xc=(A1*Y1+A2*Y2+A3*Y3)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangles A1 is g1 (0.0, 150-6-yc), that of A2 is g2 (0.0, 75-yc) and that of A3 is g3 (0.0, yc-5 ).\n", + "\n", + "Iyy=(12*(pow(80,3))/12)+(128*(pow(12,3))/12)+(10*(pow(120,3))/12)\n", + "\n", + "Ixx=(80.0*pow(12.0,3)/12.0)+(A1*pow((150-6-yc),2))+(12*pow(128,3.0)/12.0)+(A2*pow((75-yc),2))+(120*pow(10,3)/12.0)+(A3*pow((150-10-6-yc),2))\n", + "\n", + "\n", + "\n", + "PolarmomentofInertia=Ixx+Iyy\n", + "\n", + "print \"Polar moment of Inertia=\",round(PolarmomentofInertia),\"mm^4\"\n", + "\n", + "kxx=sqrt(Ixx/A)\n", + "print \"kxx=\",round(kxx,2),\"mm\"\n", + "\n", + "\n", + "kyy=sqrt(Iyy/A)\n", + "print \"kyy=\",round(kyy,2),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.17 page number 135" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 31543827.2 mm^4\n", + "Iyy= 19745121.6 mm^4\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "\n", + "#The given composite section may be divided into simple rectangles and triangle\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=100.0*30.0 #Area of 1,mm^2\n", + "A2=100.0*25.0 #Area of 2,mm^2\n", + "A3=200.0*20.0 #Area of 3,mm^2 \n", + "A4=87.5*20.0/2.0 #Area of 4,mm^2\n", + "A5=87.5*20.0/2.0 #Area of 5,mm^2\n", + "\n", + "A=A1+A2+A3+A4+A5 #Total area,mm^2 \n", + "\n", + "#Due to symmetry, centroid lies on the axis y-y. A reference axis (1)–(1) is choosen as shown in the figure. The distance of the centroidal axis from (1)–(1)\n", + "\n", + "X1=100.0\n", + "X2=100.0\n", + "X3=100.0\n", + "X4=2.0*87.5/3.0\n", + "X5=200-X4\n", + "xc=(A1*X1+A2*X2+A3*X3+A4*X4+A5*X5)/A\n", + "\n", + "Y1=135.0\n", + "Y2=70.0\n", + "Y3=10.0\n", + "Y4=(20.0/3.0)+20.0\n", + "Y5=Y4\n", + "\n", + "yc=(A1*Y1+A2*Y2+A3*Y3+A4*Y4+A5*Y5)/A\n", + "\n", + "#With reference to the centroidal axis x-x and y-y, the centroid of the rectangle A1 is g1 (0.0,135.0-yc), that of A2 is g2(0.0,70.00-yc), that of A3 is g3 (0.0, yc-10.0), the centroid of triangle A4 is g4 (41.66,yc-20.0-(20.0/3.0) ) and that of A5 is g5 (41.66,yc-20.0-(20.0/3.0)).\n", + "\n", + "\n", + "Ixx=(100.0*pow(30,3)/12.0)+(A1*pow((135.0-yc),2))+(25.0*pow(100,3.0)/12.0)+(A2*pow((70.0-yc),2))+(200*pow(20,3)/12.0)+(A3*pow((yc-10.0),2))+((87.5*pow(20,3)/36.0)+(A4*pow((yc-20.0-(20.0/3.0)),2)))*2\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n", + "Iyy=(30.0*pow(100,3)/12.0)+(100.0*pow(25,3.0)/12.0)+(20*pow(200,3)/12.0)+((20.0*pow(87.5,3)/36.0)+(A4*pow((41.66),2)))*2\n", + "\n", + "print \"Iyy=\",round(Iyy,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.18 page number137" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 806093331.0 mm^4\n" + ] + } + ], + "source": [ + "#In this problem, it is required to find out the moment of inertia of the section about an axis AB. So there is no need to find out the position of the centroid. \n", + "#The given section is split up into simple rectangles\n", + "#Moment of inertia about AB = Sum of moments of inertia of the rectangle about AB\n", + "\n", + "#variable declaration\n", + "\n", + "A1=400*20.0\n", + "A2=100*10\n", + "A3=10*380.0\n", + "A4=100*10.0\n", + "\n", + "IAB=(400.0*pow(20,3)/12)+(A1*pow(10,2))+((100*pow(10,3)/12)+(A2*pow(25,2)))*2+((10*pow(380,3)/12)+(A3*pow(220,2)))*2+((100*pow(10,3)/12)+(A4*pow(415,2)))*2\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.19 page number 137" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 50399393.9 mm^4\n" + ] + } + ], + "source": [ + "# The built-up section is divided into six simple rectangles\n", + "\n", + "#variable declaration\n", + "\n", + "\n", + "A1=250.0*10.0 #Area of 1,mm^2\n", + "A2=40.0*10.0 #Area of 2,mm^2\n", + "\n", + "A=A1*2+A2*4 #Total area,mm^2 \n", + "\n", + "\n", + "Y1=5.0\n", + "Y2=30.0\n", + "Y3=15.0\n", + "Y4=255.0\n", + "Y5=135.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A2*Y3+A2*Y4+A1*Y5)/A\n", + "\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(250.0*pow(10,3)/12.0)+(A1*pow((yc-5),2))+((10.0*pow(40,3.0)/12.0)+(A2*pow((yc-30.0),2)))*2+(40*pow(10,3)/12.0)+(A2*pow((yc-15.0),2))+(10.0*pow(250.0,3.0)/12.0)+(A1*pow((yc-135.0),2))+(40.0*pow(10.0,3)/12)+(A2*pow((yc-255),2))\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.20 page number 138" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "145.394736842\n", + "Ixx= 752680131.6 mm^4\n" + ] + } + ], + "source": [ + "#Each angle is divided into two rectangles \n", + "\n", + "#variable declaration\n", + "\n", + "A1=600.0*15.0 #Area of 1,mm^2\n", + "A2=140.0*10.0 #Area of 2,mm^2\n", + "A3=150.0*10.0\n", + "A4=400.0*20.0\n", + "A=A1+A2*2+A3*2+A4 #Total area,mm^2 \n", + "\n", + "#The distance of the centroidal axis from the bottom fibres of section \n", + "\n", + "Y1=320.0\n", + "Y2=100.0\n", + "Y3=25.0\n", + "Y4=10.0\n", + "\n", + "yc=(A1*Y1+2*A2*Y2+A3*Y3*2+A4*Y4)/A\n", + "print yc\n", + "#Now, Moment of inertia about the centroidalaxis=Sum of the moment of inertia of the individual rectangles\n", + "\n", + "Ixx=(15.0*pow(600,3)/12.0)+(A1*pow((yc-320),2))+((10.0*pow(140,3.0)/12.0)+(A2*pow((yc-100.0),2)))*2+((150*pow(10,3)/12.0)+(A3*pow((yc-15.0),2)))*2+(400.0*pow(20.0,3.0)/12.0)+(A4*pow((yc-10.0),2))\n", + "\n", + "\n", + "print \"Ixx=\",round(Ixx,1),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.21 page number 139" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ixx= 36000000.0 mm^4\n" + ] + } + ], + "source": [ + "\n", + "from math import asin,sin,cos,pi\n", + "\n", + "#The rectangle is divided into four triangles\n", + "#The lines AE and FC are parallel to x-axis\n", + " \n", + "#variable declaration\n", + "\n", + "theta=asin(4.0/5.0)\n", + "\n", + "AB=100.0\n", + "BK=AB*sin((90*pi/180)-theta)\n", + "ND=BK\n", + "FD=60.0/sin(theta)\n", + "AF=150.0-FD\n", + "FL=ME=75.0*sin(theta)\n", + "AE=AB/cos((90*pi/180)-theta)\n", + "FC=AE\n", + "A=125.0*60.0/2.0\n", + "\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(125*pow(60,3)/36)+(A*pow((ND*4.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*2.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))+(125*pow(60,3)/36)+(A*pow((ND*1.0/3.0),2))\n", + "\n", + "print \"Ixx=\",round(Ixx),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.22, page number 140" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IAB= 4292979.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into a triangle PQR, a semicircle PSQ having base on axis AB and a circle having its centre on axis AB\n", + "\n", + "#variable declaration\n", + "#Now,Moment of inertia of the section about axis AB\n", + "IAB=(80*pow(80,3)/12)+(pi*pow(80,4)/128)-(pi*pow(40,4)/64)\n", + "\n", + "print \"IAB=\",round(IAB),\"mm^4\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example4.23 page number141" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "106.435694487 28.4724404943\n", + "Ixx= 686943.0 mm^4\n", + "Iyy= 17146488.0 mm^4\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#The section is divided into three simple figures viz., a triangle ABC, a rectangle ACDE and a semicircle. \n", + "\n", + "#variable declaration\n", + "\n", + "r=20.0 #radius of semicircle\n", + "A1=80.0*20.0/2 #Area of triangle ABC \n", + "A3=40.0*80.0 #Area of rectangle ACDE \n", + "A4=pi*pow(r,2)/2 #Area of semicircle\n", + "At1=30.0*20.0/2.0\n", + "At2=50.0*20.0/2.0\n", + "A=A1+A3-A4 #Total area\n", + "\n", + "X1=2.0*30.0/3.0\n", + "X2=50.0*30.0/3.0\n", + "X3=40.0\n", + "X4=40.0\n", + "\n", + "xc=(At1*X1+At2*X2+A3*X3-A4*X4)/A\n", + "#mistake in book\n", + "\n", + "Y1=(20.0/3.0)+40.0\n", + "Y3=20.0\n", + "Y4=(4.0*20.0)/(3.0*pi)\n", + "\n", + "yc=(A1*Y1+A3*Y3-A4*Y4)/A\n", + "print xc,yc\n", + "#\n", + "#Moment of inertia of the section about axis x-x=Sum of the momentsof inertia of individual triangular areasabout axis\n", + "\n", + "Ixx=(80.0*pow(20.0,3)/36) +A1*pow((60.0-(2*20.0/3.0)-yc),2)+(80*pow(40,3)/12)+(A3*pow((yc-20.0),2))-((0.0068598*pow(20,4))+(A4*pow((yc-Y4),2)))\n", + "\n", + "print\"Ixx=\",round(Ixx),\"mm^4\"\n", + "\n", + "\n", + "Iyy=(20.0*pow(30.0,3)/36) +At1*pow((xc-(2*30.0/3.0)),2)+(20*pow(50,3)/36)+(At2*pow((xc-(30.0+(50/3))),2))+((40*pow(80,3)/12)+(A3*pow((xc-40),2)))-((pi*pow(40,4))/(2*64))-(A4*pow((40-xc),2))\n", + "\n", + "print\"Iyy=\",round(Iyy),\"mm^4\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 4.27 page number 150" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25000.0 5625.0 235.619449019 7889.38055098\n", + "xc= 0.411 m\n", + "yc= 0.329 m\n", + "zc= 0.221 m\n" + ] + } + ], + "source": [ + "#A concrete block of size 0.60 m × 0.75 m × 0.5 m is cast with a hole of diameter 0.2 m and depth 0.3 m\n", + "#The hole is completely filled with steel balls weighing 2500 N. Locate the centre of gravity of the body.\n", + "\n", + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "W=25000.0 # weight of concrete=25000, N/m^3\n", + "W1=0.6*0.75*0.5*W #Weight of solid concrete block\n", + "W2=pi*pow(0.2,2)*0.3*W/4 #Weight of concrete (W2) removed for making hole:\n", + "W3=2500\n", + "\n", + "#Taking origin as shown in the figure, the centre of gravity of solid block is (0.375, 0.3, 0.25) and that of hollow portion is (0.5, 0.4, 0.15)\n", + "\n", + "X1=0.375\n", + "X2=0.5\n", + "X3=0.5\n", + "\n", + "Y1=0.3\n", + "Y2=0.4\n", + "Y3=0.4\n", + "\n", + "Z1=0.25\n", + "Z2=0.15\n", + "Z3=0.15\n", + "\n", + "Wt=W3+W1-W2\n", + "print W,W1,W2,Wt\n", + "xc=(W1*X1-W2*X2+W3*X3)/Wt\n", + "\n", + "yc=(W1*Y1-W2*Y2+W3*Y3)/Wt\n", + "\n", + "zc=(W1*Z1-W2*Z2+W3*Z3)/Wt\n", + "\n", + "print\"xc=\",round(xc,3),\"m\"\n", + "print\"yc=\",round(yc,3),\"m\"\n", + "print\"zc=\",round(zc,3),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_24XsJCT.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_24XsJCT.ipynb new file mode 100644 index 00000000..87ac24ec --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_24XsJCT.ipynb @@ -0,0 +1,774 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5-FRICTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1250.0 N\n", + "P= 1210.36288071 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=1000.0 #weight of block a\n", + "Wb=2000.0 #weight of block b\n", + "uab=1.0/4.0 #coefficient of friction between A and B\n", + "ubg=1.0/3.0 #coefficient of friction between ground and B\n", + "#When P is horizontal\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "N2=N1+ Wb #Normal Reaction on block B from Ground\n", + "F2=ubg*N2 #limiting Friction between A and ground\n", + "P=F1+F2\n", + "print \"P=\",P,\"N\"\n", + "#When P is inclined at angle o\n", + "o=30.0*3.14/180.0\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "#from\n", + "#N2+Psin30=N1+Wb\n", + "#Pcos30=F1+F2\n", + "#F1=ubg*N2\n", + "N2=(N1+Wb-F1*math.tan(o))/(1+ubg*math.tan(o))\n", + "P=(N1+Wb-N2)/math.sin(o)\n", + "print \"P=\",P,\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29.0693410161 °\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=300.0 #weight of upper block \n", + "Wb=900.0 #weight of lower block \n", + "u1=1.0/3.0 #coefficient of friction between upper block and lower block\n", + "u2=1.0/3.0 #coefficient of friction between ground and lower block\n", + "#using \n", + "#N1=Wacoso Normal Reaction\n", + "#F1=u1*N1 Friction\n", + "#N2=Wbcoso+N1\n", + "#F2=u2*N2\n", + "o=math.atan((u1*Wa+u2*Wb+u2*Wa)/Wb)*180/3.14\n", + "print o,\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 30.0152164356\n", + "coefficient of friction is 0.1\n" + ] + } + ], + "source": [ + "import math\n", + "W=500.0 #weight of block\n", + "F1=200.0 #force up the inclined plane when block is moving down\n", + "F2=300.0 #force up the inclined plane when block is at rest\n", + "#When block starts moving down the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Fr+F1=Wsino\n", + "#sino-ucoso=F1/w 1\n", + "#When block starts moving up the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Wsino+Wucoso=F2\n", + "#using these equations\n", + "o=math.asin((F1*0.5/W)+(F2*0.5/W)) #angle of inclination\n", + "print \"Angle of inclination is \",(o*180/3.14)\n", + "#using 1\n", + "u=math.sin(o)-F1/W\n", + "print \"coefficient of friction is\",round(u,3)\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of Inclination 21.8124674778\n" + ] + } + ], + "source": [ + "import math\n", + "uag=0.5 #coefficient of friction between block A and the plane\n", + "ubg=0.2 #coefficient of friction between block B and the plane\n", + "Wb=500.0 #weight of block B\n", + "Wa=1000.0 #weight of block A\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N1=Wacoso ,Fr=uagN1\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=uagWacoso-Wasino\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N2=Wbcoso ,Fr=uagN2\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=Wbsino-ubgwbsino\n", + "o=math.atan((uag*Wa+ubg*Wb)/(Wa+Wb))*180.0/3.14\n", + "print \"Angle of Inclination\",o;\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "853.305553493 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wl=750.0 #weight of lower block\n", + "Wu=500.0 #weight of upper block\n", + "o1=60.0*3.14/180.0 #angle of inclined plane\n", + "o2=30.0 *3.14/180.0 # anlge at which pull is applied\n", + "u=0.2 #coefficient of friction\n", + "#for 750 N block\n", + "#Σ Forces normal to the plane = 0 \n", + "N1=Wl*math.cos(o1)\n", + "F1=u*N1\n", + "#Σ Forces parallel to the plane = 0\n", + "T=F1+Wl*math.sin(o1)\n", + "#Σ Forces horizontal to the plane = 0\n", + "P=(T+u*Wu)/(math.cos(o2)+u*math.sin(o2))\n", + "print P,\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least Weight is 266.34090474 N\n", + "Greatest Weight is 969.473014916 N\n" + ] + } + ], + "source": [ + "import math\n", + "o1=60.0*3.14/180.0 #angle of inclination of plane AC\n", + "o2=30.0*3.14/180.0 #angle of inclination of plane BC\n", + "Wbc=1000.0 #weight of block on plane BC\n", + "ubc=0.28 #coefficient of friction between the load and the plane BC \n", + "uac=0.20 #coefficient of friction between the load and the plane AC\n", + "#for least weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)-F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(uac*math.cos(o1)+math.sin(o1))\n", + "print \"Least Weight is\",W,\"N\"\n", + "#for greatest weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)+F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(-1*uac*math.cos(o1)+math.sin(o1))\n", + "print \"Greatest Weight is\",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight 10498.172578 N\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.4 #The coefficient of friction on the horizontal plane\n", + "oi=30 #angle of inclined plane\n", + "o=20.0 #The limiting angle of friction for block B on the inclined plane\n", + "wb=5000.0 #weight of block b\n", + "ub=math.tan(o*3.14/180.0) #coefficcient of friction on plane\n", + "#for block B\n", + "#N1 N2 N3 are normal reaction\n", + "#F1 F2 are frictional forces\n", + "#F1=ub*N1 \n", + "#N1 sinoi + F1 cos oi=wb\n", + "N1=wb/(math.sin(oi*3.14/180.0)+ub*math.cos(oi*3.14/180.0))\n", + "F1=ub*N1\n", + "C=N1*math.cos(oi*3.14/180.0)-F1*math.sin(oi*3.14/180.0)\n", + "\n", + "#force balance on A in horizontal balance\n", + "F2=C\n", + "N2=F2/u\n", + "#force balance on A in vertical balance\n", + "W=N2\n", + "print \"Weight \",W,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force = 23812.7516422 N\n" + ] + } + ], + "source": [ + "import math\n", + "w=20000.0 #weight of upper block\n", + "o=15.0 #The angle of friction for all surfaces of contact\n", + "u=math.tan(o) #coefficient of friction\n", + "#R1 R2 are forces\n", + "Or1=15.0 #angle force R1 makes with x axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "R2=w*math.sin((90-Or1)*3.14/180.0)/math.sin((90+Or1+Or2)*3.14/180.0)\n", + "#applyig lamis theorem on block B\n", + "Or1=15.0 #angle force R3 makes with Y axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "P=R2*math.sin((180-Or1-Or2)*3.14/180.0)/math.sin((90+Or1)*3.14/180.0)\n", + "print \"Force =\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 66.26 KN\n" + ] + } + ], + "source": [ + "import math \n", + "w=160.0 #weight of block,KN\n", + "u=0.25 #coefficient of friction\n", + "phi=math.atan(u)\n", + "\n", + "#The free body diagrams of wedges A, B and block C .The problem being symmetric, the reactions R1 and R2 on wedges A and B are equal. The system of forces on block C andon wedge A are shown in the form convenient for applying Lami’s theorem\n", + "R1=w*math.sin(math.pi-(16*math.pi/180)-phi)/math.sin(2*(phi+math.pi*16/180))\n", + "#consider the equillibrium of the wedge A ,Ny lamis's theorem,we get\n", + "P=R1*math.sin(math.pi-phi-phi-(16*math.pi/180))/math.sin((math.pi/2)+phi)\n", + "print\"P=\",round(P,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force required is 62.0836173323 N\n" + ] + } + ], + "source": [ + "import math\n", + "l=4.0 #length of ladder\n", + "u1=0.2 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.3 #coefficient of friction between floor and the ladder\n", + "wm=600.0 #weight of man\n", + "lm=3.0 #distance of man\n", + "o=3.14*60.0/180.0 #angle made by ladder with floor\n", + "#sum of all moment about A =0\n", + "Nb=(w*l/2*math.cos(o)+wm*lm*math.cos(o))/(l*(math.sin(o)+u1*math.cos(o))) # normal reaction from wall\n", + "Fb=u1*Nb #friction from wall\n", + "#force balance in vertical direction\n", + "Na=(w+wm-Fb) # normal reaction from ground\n", + "Fa=u2*Na #friction from ground\n", + "P=Nb-Fa\n", + "print \"Force required is \",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 71.6013500101 degrees\n" + ] + } + ], + "source": [ + "import math\n", + "l=6.0 #length of ladder\n", + "u1=0.4 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.25 #coefficient of friction between floor and the ladder\n", + "wl=900.0 #weight of load\n", + "ll=5.0 #distance of load\n", + "#force balancing\n", + "#Na Nb normal reaction at A and B\n", + "#Fa Fb friction at A and B\n", + "#Fa=u2*Na \n", + "#Fb=u1*Nb\n", + "#Na+Fb=w+wl\n", + "#Fa=Nb\n", + "Nb=(wl+w)*u2/(1+u2*u1)\n", + "Na=Nb/u2\n", + "Fa=u2*Na\n", + "Fb=u1*Nb\n", + "#sum of all moments about a is =0\n", + "temp=((w*l*0.5)+(wl*ll)-(Fb*l))/(Nb*l)\n", + "o=math.atan(temp)*180/3.14\n", + "print \"Angle of inclination is \",o,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.12" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length will 0.5 times\n" + ] + } + ], + "source": [ + "import math\n", + "o=45.0*3.14/180.0 #angle of inclination \n", + "u=0.5 #coefficient of friction\n", + "r=1.5 #ratio of mans weight to ladders weight\n", + "o1=45.0*math.pi/180.0 #angle of inclination\n", + "#from law of friction\n", + "#Fa = μNa\n", + "#Fb = μNb\n", + "#Fa – Nb = 0 \n", + "#Na + Fb = W + r W\n", + "#ΣMA = 0\n", + "o=(((u*u+u)*(1+r)/((1+u)))-1.0/2.0)/r\n", + "print \"length will\",o,\"times\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.13" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum weight is 6277.60420331\n", + "Minimum weight is 57.3467183245\n" + ] + } + ], + "source": [ + "import math\n", + "n=1.25 #number of turns\n", + "o=2*3.14*n #angle of contact\n", + "u=0.3 #coefficient of friction\n", + "t=600.0 #force at the other end of the rope\n", + "#if the impending motion of the weight be downward.\n", + "W=T2=t*2.71**(u*o)\n", + "print \"Maximum weight is \",W\n", + "#if the impending motion of weight be upwards\n", + "W=T1=t*2.71**(-1*u*o)\n", + "print \"Minimum weight is \",W" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.14" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight is 136.9599857 N\n" + ] + } + ], + "source": [ + "import math\n", + "ur=0.20 #The coefficient of friction between the rope and the fixed drum\n", + "uo=0.30 #The coefficient of friction between other surfaces\n", + "cosa=4.0/5.0 #cos of angle of inclination\n", + "sina=3.0/5.0 #sin of angle of inclination\n", + "Ww=1000.0 #weight\n", + "o=3.14 #angle of contact of rope with pulley\n", + "#for unknown weight\n", + "#force balance perpendicular to the plane\n", + "#N1 = W cos α\n", + "#fr=uoN1\n", + "#force balance along the plane\n", + "#T1 = F1 + W sin α\n", + "#for 1000 N body\n", + "#force balance perpendicular to the plane\n", + "#N2=N1+Wwcosa\n", + "#fr2=uoN2\n", + "#force balance along the plane\n", + "#T2= Wwsina -F1 -F2\n", + "#T2=T1*e^(ur*o)\n", + "W=(Ww*sina-uo*Ww*cosa)/(((uo*cosa+sina)*(2.71**(uo*o)))+(uo*cosa+uo*cosa))\n", + "print \"Weight is \",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.15" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force P applied at the end of the brake lever 274.480678202\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.3 #coefficient of friction\n", + "r=250 #radius of brake drum\n", + "l=300 #length of lever arm\n", + "M=300000.0 #torque\n", + "o=r*3.14/180.0\n", + "l2=50.0\n", + "#using \n", + "#T2 = T1e^(μθ) T1 and T2 are tension\n", + "#(T2-T1)r=M\n", + "T1=M/(r*(2.71**(u*o)-1))\n", + "T2=(2.71**(u*o))*T1\n", + "#Consider the lever arm. Taking moment about the hinge\n", + "p=T2*l2/l #force P applied at the end of the brake lever\n", + "print \"force P applied at the end of the brake lever\",p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.16" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6972.02507534 mm\n", + "Power Transmitted 3252832.96438 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=O2=3.14+2*math.asin((d1+d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2+d2/2)*O1+2*D*math.cos(math.asin((d1+d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O1))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 5.17" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6955.3382782 mm\n", + "Power Transmitted 3035637.41075 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=3.14+2*math.asin((d1-d2)/(2*D))\n", + "O2=3.14-2*math.asin((d1-d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2*O1+d2/2*O2)+2*D*math.cos(math.asin((d1-d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O2))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n", + "\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_8mD0UuG.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_8mD0UuG.ipynb new file mode 100644 index 00000000..87ac24ec --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_8mD0UuG.ipynb @@ -0,0 +1,774 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5-FRICTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1250.0 N\n", + "P= 1210.36288071 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=1000.0 #weight of block a\n", + "Wb=2000.0 #weight of block b\n", + "uab=1.0/4.0 #coefficient of friction between A and B\n", + "ubg=1.0/3.0 #coefficient of friction between ground and B\n", + "#When P is horizontal\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "N2=N1+ Wb #Normal Reaction on block B from Ground\n", + "F2=ubg*N2 #limiting Friction between A and ground\n", + "P=F1+F2\n", + "print \"P=\",P,\"N\"\n", + "#When P is inclined at angle o\n", + "o=30.0*3.14/180.0\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "#from\n", + "#N2+Psin30=N1+Wb\n", + "#Pcos30=F1+F2\n", + "#F1=ubg*N2\n", + "N2=(N1+Wb-F1*math.tan(o))/(1+ubg*math.tan(o))\n", + "P=(N1+Wb-N2)/math.sin(o)\n", + "print \"P=\",P,\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29.0693410161 °\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=300.0 #weight of upper block \n", + "Wb=900.0 #weight of lower block \n", + "u1=1.0/3.0 #coefficient of friction between upper block and lower block\n", + "u2=1.0/3.0 #coefficient of friction between ground and lower block\n", + "#using \n", + "#N1=Wacoso Normal Reaction\n", + "#F1=u1*N1 Friction\n", + "#N2=Wbcoso+N1\n", + "#F2=u2*N2\n", + "o=math.atan((u1*Wa+u2*Wb+u2*Wa)/Wb)*180/3.14\n", + "print o,\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 30.0152164356\n", + "coefficient of friction is 0.1\n" + ] + } + ], + "source": [ + "import math\n", + "W=500.0 #weight of block\n", + "F1=200.0 #force up the inclined plane when block is moving down\n", + "F2=300.0 #force up the inclined plane when block is at rest\n", + "#When block starts moving down the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Fr+F1=Wsino\n", + "#sino-ucoso=F1/w 1\n", + "#When block starts moving up the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Wsino+Wucoso=F2\n", + "#using these equations\n", + "o=math.asin((F1*0.5/W)+(F2*0.5/W)) #angle of inclination\n", + "print \"Angle of inclination is \",(o*180/3.14)\n", + "#using 1\n", + "u=math.sin(o)-F1/W\n", + "print \"coefficient of friction is\",round(u,3)\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of Inclination 21.8124674778\n" + ] + } + ], + "source": [ + "import math\n", + "uag=0.5 #coefficient of friction between block A and the plane\n", + "ubg=0.2 #coefficient of friction between block B and the plane\n", + "Wb=500.0 #weight of block B\n", + "Wa=1000.0 #weight of block A\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N1=Wacoso ,Fr=uagN1\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=uagWacoso-Wasino\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N2=Wbcoso ,Fr=uagN2\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=Wbsino-ubgwbsino\n", + "o=math.atan((uag*Wa+ubg*Wb)/(Wa+Wb))*180.0/3.14\n", + "print \"Angle of Inclination\",o;\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "853.305553493 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wl=750.0 #weight of lower block\n", + "Wu=500.0 #weight of upper block\n", + "o1=60.0*3.14/180.0 #angle of inclined plane\n", + "o2=30.0 *3.14/180.0 # anlge at which pull is applied\n", + "u=0.2 #coefficient of friction\n", + "#for 750 N block\n", + "#Σ Forces normal to the plane = 0 \n", + "N1=Wl*math.cos(o1)\n", + "F1=u*N1\n", + "#Σ Forces parallel to the plane = 0\n", + "T=F1+Wl*math.sin(o1)\n", + "#Σ Forces horizontal to the plane = 0\n", + "P=(T+u*Wu)/(math.cos(o2)+u*math.sin(o2))\n", + "print P,\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least Weight is 266.34090474 N\n", + "Greatest Weight is 969.473014916 N\n" + ] + } + ], + "source": [ + "import math\n", + "o1=60.0*3.14/180.0 #angle of inclination of plane AC\n", + "o2=30.0*3.14/180.0 #angle of inclination of plane BC\n", + "Wbc=1000.0 #weight of block on plane BC\n", + "ubc=0.28 #coefficient of friction between the load and the plane BC \n", + "uac=0.20 #coefficient of friction between the load and the plane AC\n", + "#for least weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)-F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(uac*math.cos(o1)+math.sin(o1))\n", + "print \"Least Weight is\",W,\"N\"\n", + "#for greatest weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)+F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(-1*uac*math.cos(o1)+math.sin(o1))\n", + "print \"Greatest Weight is\",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight 10498.172578 N\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.4 #The coefficient of friction on the horizontal plane\n", + "oi=30 #angle of inclined plane\n", + "o=20.0 #The limiting angle of friction for block B on the inclined plane\n", + "wb=5000.0 #weight of block b\n", + "ub=math.tan(o*3.14/180.0) #coefficcient of friction on plane\n", + "#for block B\n", + "#N1 N2 N3 are normal reaction\n", + "#F1 F2 are frictional forces\n", + "#F1=ub*N1 \n", + "#N1 sinoi + F1 cos oi=wb\n", + "N1=wb/(math.sin(oi*3.14/180.0)+ub*math.cos(oi*3.14/180.0))\n", + "F1=ub*N1\n", + "C=N1*math.cos(oi*3.14/180.0)-F1*math.sin(oi*3.14/180.0)\n", + "\n", + "#force balance on A in horizontal balance\n", + "F2=C\n", + "N2=F2/u\n", + "#force balance on A in vertical balance\n", + "W=N2\n", + "print \"Weight \",W,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force = 23812.7516422 N\n" + ] + } + ], + "source": [ + "import math\n", + "w=20000.0 #weight of upper block\n", + "o=15.0 #The angle of friction for all surfaces of contact\n", + "u=math.tan(o) #coefficient of friction\n", + "#R1 R2 are forces\n", + "Or1=15.0 #angle force R1 makes with x axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "R2=w*math.sin((90-Or1)*3.14/180.0)/math.sin((90+Or1+Or2)*3.14/180.0)\n", + "#applyig lamis theorem on block B\n", + "Or1=15.0 #angle force R3 makes with Y axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "P=R2*math.sin((180-Or1-Or2)*3.14/180.0)/math.sin((90+Or1)*3.14/180.0)\n", + "print \"Force =\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 66.26 KN\n" + ] + } + ], + "source": [ + "import math \n", + "w=160.0 #weight of block,KN\n", + "u=0.25 #coefficient of friction\n", + "phi=math.atan(u)\n", + "\n", + "#The free body diagrams of wedges A, B and block C .The problem being symmetric, the reactions R1 and R2 on wedges A and B are equal. The system of forces on block C andon wedge A are shown in the form convenient for applying Lami’s theorem\n", + "R1=w*math.sin(math.pi-(16*math.pi/180)-phi)/math.sin(2*(phi+math.pi*16/180))\n", + "#consider the equillibrium of the wedge A ,Ny lamis's theorem,we get\n", + "P=R1*math.sin(math.pi-phi-phi-(16*math.pi/180))/math.sin((math.pi/2)+phi)\n", + "print\"P=\",round(P,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force required is 62.0836173323 N\n" + ] + } + ], + "source": [ + "import math\n", + "l=4.0 #length of ladder\n", + "u1=0.2 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.3 #coefficient of friction between floor and the ladder\n", + "wm=600.0 #weight of man\n", + "lm=3.0 #distance of man\n", + "o=3.14*60.0/180.0 #angle made by ladder with floor\n", + "#sum of all moment about A =0\n", + "Nb=(w*l/2*math.cos(o)+wm*lm*math.cos(o))/(l*(math.sin(o)+u1*math.cos(o))) # normal reaction from wall\n", + "Fb=u1*Nb #friction from wall\n", + "#force balance in vertical direction\n", + "Na=(w+wm-Fb) # normal reaction from ground\n", + "Fa=u2*Na #friction from ground\n", + "P=Nb-Fa\n", + "print \"Force required is \",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 71.6013500101 degrees\n" + ] + } + ], + "source": [ + "import math\n", + "l=6.0 #length of ladder\n", + "u1=0.4 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.25 #coefficient of friction between floor and the ladder\n", + "wl=900.0 #weight of load\n", + "ll=5.0 #distance of load\n", + "#force balancing\n", + "#Na Nb normal reaction at A and B\n", + "#Fa Fb friction at A and B\n", + "#Fa=u2*Na \n", + "#Fb=u1*Nb\n", + "#Na+Fb=w+wl\n", + "#Fa=Nb\n", + "Nb=(wl+w)*u2/(1+u2*u1)\n", + "Na=Nb/u2\n", + "Fa=u2*Na\n", + "Fb=u1*Nb\n", + "#sum of all moments about a is =0\n", + "temp=((w*l*0.5)+(wl*ll)-(Fb*l))/(Nb*l)\n", + "o=math.atan(temp)*180/3.14\n", + "print \"Angle of inclination is \",o,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.12" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length will 0.5 times\n" + ] + } + ], + "source": [ + "import math\n", + "o=45.0*3.14/180.0 #angle of inclination \n", + "u=0.5 #coefficient of friction\n", + "r=1.5 #ratio of mans weight to ladders weight\n", + "o1=45.0*math.pi/180.0 #angle of inclination\n", + "#from law of friction\n", + "#Fa = μNa\n", + "#Fb = μNb\n", + "#Fa – Nb = 0 \n", + "#Na + Fb = W + r W\n", + "#ΣMA = 0\n", + "o=(((u*u+u)*(1+r)/((1+u)))-1.0/2.0)/r\n", + "print \"length will\",o,\"times\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.13" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum weight is 6277.60420331\n", + "Minimum weight is 57.3467183245\n" + ] + } + ], + "source": [ + "import math\n", + "n=1.25 #number of turns\n", + "o=2*3.14*n #angle of contact\n", + "u=0.3 #coefficient of friction\n", + "t=600.0 #force at the other end of the rope\n", + "#if the impending motion of the weight be downward.\n", + "W=T2=t*2.71**(u*o)\n", + "print \"Maximum weight is \",W\n", + "#if the impending motion of weight be upwards\n", + "W=T1=t*2.71**(-1*u*o)\n", + "print \"Minimum weight is \",W" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.14" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight is 136.9599857 N\n" + ] + } + ], + "source": [ + "import math\n", + "ur=0.20 #The coefficient of friction between the rope and the fixed drum\n", + "uo=0.30 #The coefficient of friction between other surfaces\n", + "cosa=4.0/5.0 #cos of angle of inclination\n", + "sina=3.0/5.0 #sin of angle of inclination\n", + "Ww=1000.0 #weight\n", + "o=3.14 #angle of contact of rope with pulley\n", + "#for unknown weight\n", + "#force balance perpendicular to the plane\n", + "#N1 = W cos α\n", + "#fr=uoN1\n", + "#force balance along the plane\n", + "#T1 = F1 + W sin α\n", + "#for 1000 N body\n", + "#force balance perpendicular to the plane\n", + "#N2=N1+Wwcosa\n", + "#fr2=uoN2\n", + "#force balance along the plane\n", + "#T2= Wwsina -F1 -F2\n", + "#T2=T1*e^(ur*o)\n", + "W=(Ww*sina-uo*Ww*cosa)/(((uo*cosa+sina)*(2.71**(uo*o)))+(uo*cosa+uo*cosa))\n", + "print \"Weight is \",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.15" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force P applied at the end of the brake lever 274.480678202\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.3 #coefficient of friction\n", + "r=250 #radius of brake drum\n", + "l=300 #length of lever arm\n", + "M=300000.0 #torque\n", + "o=r*3.14/180.0\n", + "l2=50.0\n", + "#using \n", + "#T2 = T1e^(μθ) T1 and T2 are tension\n", + "#(T2-T1)r=M\n", + "T1=M/(r*(2.71**(u*o)-1))\n", + "T2=(2.71**(u*o))*T1\n", + "#Consider the lever arm. Taking moment about the hinge\n", + "p=T2*l2/l #force P applied at the end of the brake lever\n", + "print \"force P applied at the end of the brake lever\",p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.16" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6972.02507534 mm\n", + "Power Transmitted 3252832.96438 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=O2=3.14+2*math.asin((d1+d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2+d2/2)*O1+2*D*math.cos(math.asin((d1+d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O1))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 5.17" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6955.3382782 mm\n", + "Power Transmitted 3035637.41075 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=3.14+2*math.asin((d1-d2)/(2*D))\n", + "O2=3.14-2*math.asin((d1-d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2*O1+d2/2*O2)+2*D*math.cos(math.asin((d1-d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O2))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n", + "\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_LKhM1Au.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_LKhM1Au.ipynb new file mode 100644 index 00000000..87ac24ec --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_LKhM1Au.ipynb @@ -0,0 +1,774 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5-FRICTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1250.0 N\n", + "P= 1210.36288071 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=1000.0 #weight of block a\n", + "Wb=2000.0 #weight of block b\n", + "uab=1.0/4.0 #coefficient of friction between A and B\n", + "ubg=1.0/3.0 #coefficient of friction between ground and B\n", + "#When P is horizontal\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "N2=N1+ Wb #Normal Reaction on block B from Ground\n", + "F2=ubg*N2 #limiting Friction between A and ground\n", + "P=F1+F2\n", + "print \"P=\",P,\"N\"\n", + "#When P is inclined at angle o\n", + "o=30.0*3.14/180.0\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "#from\n", + "#N2+Psin30=N1+Wb\n", + "#Pcos30=F1+F2\n", + "#F1=ubg*N2\n", + "N2=(N1+Wb-F1*math.tan(o))/(1+ubg*math.tan(o))\n", + "P=(N1+Wb-N2)/math.sin(o)\n", + "print \"P=\",P,\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29.0693410161 °\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=300.0 #weight of upper block \n", + "Wb=900.0 #weight of lower block \n", + "u1=1.0/3.0 #coefficient of friction between upper block and lower block\n", + "u2=1.0/3.0 #coefficient of friction between ground and lower block\n", + "#using \n", + "#N1=Wacoso Normal Reaction\n", + "#F1=u1*N1 Friction\n", + "#N2=Wbcoso+N1\n", + "#F2=u2*N2\n", + "o=math.atan((u1*Wa+u2*Wb+u2*Wa)/Wb)*180/3.14\n", + "print o,\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 30.0152164356\n", + "coefficient of friction is 0.1\n" + ] + } + ], + "source": [ + "import math\n", + "W=500.0 #weight of block\n", + "F1=200.0 #force up the inclined plane when block is moving down\n", + "F2=300.0 #force up the inclined plane when block is at rest\n", + "#When block starts moving down the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Fr+F1=Wsino\n", + "#sino-ucoso=F1/w 1\n", + "#When block starts moving up the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Wsino+Wucoso=F2\n", + "#using these equations\n", + "o=math.asin((F1*0.5/W)+(F2*0.5/W)) #angle of inclination\n", + "print \"Angle of inclination is \",(o*180/3.14)\n", + "#using 1\n", + "u=math.sin(o)-F1/W\n", + "print \"coefficient of friction is\",round(u,3)\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of Inclination 21.8124674778\n" + ] + } + ], + "source": [ + "import math\n", + "uag=0.5 #coefficient of friction between block A and the plane\n", + "ubg=0.2 #coefficient of friction between block B and the plane\n", + "Wb=500.0 #weight of block B\n", + "Wa=1000.0 #weight of block A\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N1=Wacoso ,Fr=uagN1\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=uagWacoso-Wasino\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N2=Wbcoso ,Fr=uagN2\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=Wbsino-ubgwbsino\n", + "o=math.atan((uag*Wa+ubg*Wb)/(Wa+Wb))*180.0/3.14\n", + "print \"Angle of Inclination\",o;\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "853.305553493 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wl=750.0 #weight of lower block\n", + "Wu=500.0 #weight of upper block\n", + "o1=60.0*3.14/180.0 #angle of inclined plane\n", + "o2=30.0 *3.14/180.0 # anlge at which pull is applied\n", + "u=0.2 #coefficient of friction\n", + "#for 750 N block\n", + "#Σ Forces normal to the plane = 0 \n", + "N1=Wl*math.cos(o1)\n", + "F1=u*N1\n", + "#Σ Forces parallel to the plane = 0\n", + "T=F1+Wl*math.sin(o1)\n", + "#Σ Forces horizontal to the plane = 0\n", + "P=(T+u*Wu)/(math.cos(o2)+u*math.sin(o2))\n", + "print P,\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least Weight is 266.34090474 N\n", + "Greatest Weight is 969.473014916 N\n" + ] + } + ], + "source": [ + "import math\n", + "o1=60.0*3.14/180.0 #angle of inclination of plane AC\n", + "o2=30.0*3.14/180.0 #angle of inclination of plane BC\n", + "Wbc=1000.0 #weight of block on plane BC\n", + "ubc=0.28 #coefficient of friction between the load and the plane BC \n", + "uac=0.20 #coefficient of friction between the load and the plane AC\n", + "#for least weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)-F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(uac*math.cos(o1)+math.sin(o1))\n", + "print \"Least Weight is\",W,\"N\"\n", + "#for greatest weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)+F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(-1*uac*math.cos(o1)+math.sin(o1))\n", + "print \"Greatest Weight is\",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight 10498.172578 N\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.4 #The coefficient of friction on the horizontal plane\n", + "oi=30 #angle of inclined plane\n", + "o=20.0 #The limiting angle of friction for block B on the inclined plane\n", + "wb=5000.0 #weight of block b\n", + "ub=math.tan(o*3.14/180.0) #coefficcient of friction on plane\n", + "#for block B\n", + "#N1 N2 N3 are normal reaction\n", + "#F1 F2 are frictional forces\n", + "#F1=ub*N1 \n", + "#N1 sinoi + F1 cos oi=wb\n", + "N1=wb/(math.sin(oi*3.14/180.0)+ub*math.cos(oi*3.14/180.0))\n", + "F1=ub*N1\n", + "C=N1*math.cos(oi*3.14/180.0)-F1*math.sin(oi*3.14/180.0)\n", + "\n", + "#force balance on A in horizontal balance\n", + "F2=C\n", + "N2=F2/u\n", + "#force balance on A in vertical balance\n", + "W=N2\n", + "print \"Weight \",W,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force = 23812.7516422 N\n" + ] + } + ], + "source": [ + "import math\n", + "w=20000.0 #weight of upper block\n", + "o=15.0 #The angle of friction for all surfaces of contact\n", + "u=math.tan(o) #coefficient of friction\n", + "#R1 R2 are forces\n", + "Or1=15.0 #angle force R1 makes with x axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "R2=w*math.sin((90-Or1)*3.14/180.0)/math.sin((90+Or1+Or2)*3.14/180.0)\n", + "#applyig lamis theorem on block B\n", + "Or1=15.0 #angle force R3 makes with Y axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "P=R2*math.sin((180-Or1-Or2)*3.14/180.0)/math.sin((90+Or1)*3.14/180.0)\n", + "print \"Force =\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 66.26 KN\n" + ] + } + ], + "source": [ + "import math \n", + "w=160.0 #weight of block,KN\n", + "u=0.25 #coefficient of friction\n", + "phi=math.atan(u)\n", + "\n", + "#The free body diagrams of wedges A, B and block C .The problem being symmetric, the reactions R1 and R2 on wedges A and B are equal. The system of forces on block C andon wedge A are shown in the form convenient for applying Lami’s theorem\n", + "R1=w*math.sin(math.pi-(16*math.pi/180)-phi)/math.sin(2*(phi+math.pi*16/180))\n", + "#consider the equillibrium of the wedge A ,Ny lamis's theorem,we get\n", + "P=R1*math.sin(math.pi-phi-phi-(16*math.pi/180))/math.sin((math.pi/2)+phi)\n", + "print\"P=\",round(P,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force required is 62.0836173323 N\n" + ] + } + ], + "source": [ + "import math\n", + "l=4.0 #length of ladder\n", + "u1=0.2 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.3 #coefficient of friction between floor and the ladder\n", + "wm=600.0 #weight of man\n", + "lm=3.0 #distance of man\n", + "o=3.14*60.0/180.0 #angle made by ladder with floor\n", + "#sum of all moment about A =0\n", + "Nb=(w*l/2*math.cos(o)+wm*lm*math.cos(o))/(l*(math.sin(o)+u1*math.cos(o))) # normal reaction from wall\n", + "Fb=u1*Nb #friction from wall\n", + "#force balance in vertical direction\n", + "Na=(w+wm-Fb) # normal reaction from ground\n", + "Fa=u2*Na #friction from ground\n", + "P=Nb-Fa\n", + "print \"Force required is \",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 71.6013500101 degrees\n" + ] + } + ], + "source": [ + "import math\n", + "l=6.0 #length of ladder\n", + "u1=0.4 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.25 #coefficient of friction between floor and the ladder\n", + "wl=900.0 #weight of load\n", + "ll=5.0 #distance of load\n", + "#force balancing\n", + "#Na Nb normal reaction at A and B\n", + "#Fa Fb friction at A and B\n", + "#Fa=u2*Na \n", + "#Fb=u1*Nb\n", + "#Na+Fb=w+wl\n", + "#Fa=Nb\n", + "Nb=(wl+w)*u2/(1+u2*u1)\n", + "Na=Nb/u2\n", + "Fa=u2*Na\n", + "Fb=u1*Nb\n", + "#sum of all moments about a is =0\n", + "temp=((w*l*0.5)+(wl*ll)-(Fb*l))/(Nb*l)\n", + "o=math.atan(temp)*180/3.14\n", + "print \"Angle of inclination is \",o,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.12" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length will 0.5 times\n" + ] + } + ], + "source": [ + "import math\n", + "o=45.0*3.14/180.0 #angle of inclination \n", + "u=0.5 #coefficient of friction\n", + "r=1.5 #ratio of mans weight to ladders weight\n", + "o1=45.0*math.pi/180.0 #angle of inclination\n", + "#from law of friction\n", + "#Fa = μNa\n", + "#Fb = μNb\n", + "#Fa – Nb = 0 \n", + "#Na + Fb = W + r W\n", + "#ΣMA = 0\n", + "o=(((u*u+u)*(1+r)/((1+u)))-1.0/2.0)/r\n", + "print \"length will\",o,\"times\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.13" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum weight is 6277.60420331\n", + "Minimum weight is 57.3467183245\n" + ] + } + ], + "source": [ + "import math\n", + "n=1.25 #number of turns\n", + "o=2*3.14*n #angle of contact\n", + "u=0.3 #coefficient of friction\n", + "t=600.0 #force at the other end of the rope\n", + "#if the impending motion of the weight be downward.\n", + "W=T2=t*2.71**(u*o)\n", + "print \"Maximum weight is \",W\n", + "#if the impending motion of weight be upwards\n", + "W=T1=t*2.71**(-1*u*o)\n", + "print \"Minimum weight is \",W" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.14" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight is 136.9599857 N\n" + ] + } + ], + "source": [ + "import math\n", + "ur=0.20 #The coefficient of friction between the rope and the fixed drum\n", + "uo=0.30 #The coefficient of friction between other surfaces\n", + "cosa=4.0/5.0 #cos of angle of inclination\n", + "sina=3.0/5.0 #sin of angle of inclination\n", + "Ww=1000.0 #weight\n", + "o=3.14 #angle of contact of rope with pulley\n", + "#for unknown weight\n", + "#force balance perpendicular to the plane\n", + "#N1 = W cos α\n", + "#fr=uoN1\n", + "#force balance along the plane\n", + "#T1 = F1 + W sin α\n", + "#for 1000 N body\n", + "#force balance perpendicular to the plane\n", + "#N2=N1+Wwcosa\n", + "#fr2=uoN2\n", + "#force balance along the plane\n", + "#T2= Wwsina -F1 -F2\n", + "#T2=T1*e^(ur*o)\n", + "W=(Ww*sina-uo*Ww*cosa)/(((uo*cosa+sina)*(2.71**(uo*o)))+(uo*cosa+uo*cosa))\n", + "print \"Weight is \",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.15" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force P applied at the end of the brake lever 274.480678202\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.3 #coefficient of friction\n", + "r=250 #radius of brake drum\n", + "l=300 #length of lever arm\n", + "M=300000.0 #torque\n", + "o=r*3.14/180.0\n", + "l2=50.0\n", + "#using \n", + "#T2 = T1e^(μθ) T1 and T2 are tension\n", + "#(T2-T1)r=M\n", + "T1=M/(r*(2.71**(u*o)-1))\n", + "T2=(2.71**(u*o))*T1\n", + "#Consider the lever arm. Taking moment about the hinge\n", + "p=T2*l2/l #force P applied at the end of the brake lever\n", + "print \"force P applied at the end of the brake lever\",p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.16" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6972.02507534 mm\n", + "Power Transmitted 3252832.96438 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=O2=3.14+2*math.asin((d1+d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2+d2/2)*O1+2*D*math.cos(math.asin((d1+d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O1))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 5.17" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6955.3382782 mm\n", + "Power Transmitted 3035637.41075 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=3.14+2*math.asin((d1-d2)/(2*D))\n", + "O2=3.14-2*math.asin((d1-d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2*O1+d2/2*O2)+2*D*math.cos(math.asin((d1-d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O2))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n", + "\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_ZKnRxp7.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_ZKnRxp7.ipynb new file mode 100644 index 00000000..87ac24ec --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_ZKnRxp7.ipynb @@ -0,0 +1,774 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5-FRICTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1250.0 N\n", + "P= 1210.36288071 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=1000.0 #weight of block a\n", + "Wb=2000.0 #weight of block b\n", + "uab=1.0/4.0 #coefficient of friction between A and B\n", + "ubg=1.0/3.0 #coefficient of friction between ground and B\n", + "#When P is horizontal\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "N2=N1+ Wb #Normal Reaction on block B from Ground\n", + "F2=ubg*N2 #limiting Friction between A and ground\n", + "P=F1+F2\n", + "print \"P=\",P,\"N\"\n", + "#When P is inclined at angle o\n", + "o=30.0*3.14/180.0\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "#from\n", + "#N2+Psin30=N1+Wb\n", + "#Pcos30=F1+F2\n", + "#F1=ubg*N2\n", + "N2=(N1+Wb-F1*math.tan(o))/(1+ubg*math.tan(o))\n", + "P=(N1+Wb-N2)/math.sin(o)\n", + "print \"P=\",P,\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29.0693410161 °\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=300.0 #weight of upper block \n", + "Wb=900.0 #weight of lower block \n", + "u1=1.0/3.0 #coefficient of friction between upper block and lower block\n", + "u2=1.0/3.0 #coefficient of friction between ground and lower block\n", + "#using \n", + "#N1=Wacoso Normal Reaction\n", + "#F1=u1*N1 Friction\n", + "#N2=Wbcoso+N1\n", + "#F2=u2*N2\n", + "o=math.atan((u1*Wa+u2*Wb+u2*Wa)/Wb)*180/3.14\n", + "print o,\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 30.0152164356\n", + "coefficient of friction is 0.1\n" + ] + } + ], + "source": [ + "import math\n", + "W=500.0 #weight of block\n", + "F1=200.0 #force up the inclined plane when block is moving down\n", + "F2=300.0 #force up the inclined plane when block is at rest\n", + "#When block starts moving down the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Fr+F1=Wsino\n", + "#sino-ucoso=F1/w 1\n", + "#When block starts moving up the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Wsino+Wucoso=F2\n", + "#using these equations\n", + "o=math.asin((F1*0.5/W)+(F2*0.5/W)) #angle of inclination\n", + "print \"Angle of inclination is \",(o*180/3.14)\n", + "#using 1\n", + "u=math.sin(o)-F1/W\n", + "print \"coefficient of friction is\",round(u,3)\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of Inclination 21.8124674778\n" + ] + } + ], + "source": [ + "import math\n", + "uag=0.5 #coefficient of friction between block A and the plane\n", + "ubg=0.2 #coefficient of friction between block B and the plane\n", + "Wb=500.0 #weight of block B\n", + "Wa=1000.0 #weight of block A\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N1=Wacoso ,Fr=uagN1\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=uagWacoso-Wasino\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N2=Wbcoso ,Fr=uagN2\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=Wbsino-ubgwbsino\n", + "o=math.atan((uag*Wa+ubg*Wb)/(Wa+Wb))*180.0/3.14\n", + "print \"Angle of Inclination\",o;\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "853.305553493 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wl=750.0 #weight of lower block\n", + "Wu=500.0 #weight of upper block\n", + "o1=60.0*3.14/180.0 #angle of inclined plane\n", + "o2=30.0 *3.14/180.0 # anlge at which pull is applied\n", + "u=0.2 #coefficient of friction\n", + "#for 750 N block\n", + "#Σ Forces normal to the plane = 0 \n", + "N1=Wl*math.cos(o1)\n", + "F1=u*N1\n", + "#Σ Forces parallel to the plane = 0\n", + "T=F1+Wl*math.sin(o1)\n", + "#Σ Forces horizontal to the plane = 0\n", + "P=(T+u*Wu)/(math.cos(o2)+u*math.sin(o2))\n", + "print P,\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least Weight is 266.34090474 N\n", + "Greatest Weight is 969.473014916 N\n" + ] + } + ], + "source": [ + "import math\n", + "o1=60.0*3.14/180.0 #angle of inclination of plane AC\n", + "o2=30.0*3.14/180.0 #angle of inclination of plane BC\n", + "Wbc=1000.0 #weight of block on plane BC\n", + "ubc=0.28 #coefficient of friction between the load and the plane BC \n", + "uac=0.20 #coefficient of friction between the load and the plane AC\n", + "#for least weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)-F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(uac*math.cos(o1)+math.sin(o1))\n", + "print \"Least Weight is\",W,\"N\"\n", + "#for greatest weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)+F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(-1*uac*math.cos(o1)+math.sin(o1))\n", + "print \"Greatest Weight is\",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight 10498.172578 N\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.4 #The coefficient of friction on the horizontal plane\n", + "oi=30 #angle of inclined plane\n", + "o=20.0 #The limiting angle of friction for block B on the inclined plane\n", + "wb=5000.0 #weight of block b\n", + "ub=math.tan(o*3.14/180.0) #coefficcient of friction on plane\n", + "#for block B\n", + "#N1 N2 N3 are normal reaction\n", + "#F1 F2 are frictional forces\n", + "#F1=ub*N1 \n", + "#N1 sinoi + F1 cos oi=wb\n", + "N1=wb/(math.sin(oi*3.14/180.0)+ub*math.cos(oi*3.14/180.0))\n", + "F1=ub*N1\n", + "C=N1*math.cos(oi*3.14/180.0)-F1*math.sin(oi*3.14/180.0)\n", + "\n", + "#force balance on A in horizontal balance\n", + "F2=C\n", + "N2=F2/u\n", + "#force balance on A in vertical balance\n", + "W=N2\n", + "print \"Weight \",W,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force = 23812.7516422 N\n" + ] + } + ], + "source": [ + "import math\n", + "w=20000.0 #weight of upper block\n", + "o=15.0 #The angle of friction for all surfaces of contact\n", + "u=math.tan(o) #coefficient of friction\n", + "#R1 R2 are forces\n", + "Or1=15.0 #angle force R1 makes with x axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "R2=w*math.sin((90-Or1)*3.14/180.0)/math.sin((90+Or1+Or2)*3.14/180.0)\n", + "#applyig lamis theorem on block B\n", + "Or1=15.0 #angle force R3 makes with Y axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "P=R2*math.sin((180-Or1-Or2)*3.14/180.0)/math.sin((90+Or1)*3.14/180.0)\n", + "print \"Force =\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 66.26 KN\n" + ] + } + ], + "source": [ + "import math \n", + "w=160.0 #weight of block,KN\n", + "u=0.25 #coefficient of friction\n", + "phi=math.atan(u)\n", + "\n", + "#The free body diagrams of wedges A, B and block C .The problem being symmetric, the reactions R1 and R2 on wedges A and B are equal. The system of forces on block C andon wedge A are shown in the form convenient for applying Lami’s theorem\n", + "R1=w*math.sin(math.pi-(16*math.pi/180)-phi)/math.sin(2*(phi+math.pi*16/180))\n", + "#consider the equillibrium of the wedge A ,Ny lamis's theorem,we get\n", + "P=R1*math.sin(math.pi-phi-phi-(16*math.pi/180))/math.sin((math.pi/2)+phi)\n", + "print\"P=\",round(P,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force required is 62.0836173323 N\n" + ] + } + ], + "source": [ + "import math\n", + "l=4.0 #length of ladder\n", + "u1=0.2 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.3 #coefficient of friction between floor and the ladder\n", + "wm=600.0 #weight of man\n", + "lm=3.0 #distance of man\n", + "o=3.14*60.0/180.0 #angle made by ladder with floor\n", + "#sum of all moment about A =0\n", + "Nb=(w*l/2*math.cos(o)+wm*lm*math.cos(o))/(l*(math.sin(o)+u1*math.cos(o))) # normal reaction from wall\n", + "Fb=u1*Nb #friction from wall\n", + "#force balance in vertical direction\n", + "Na=(w+wm-Fb) # normal reaction from ground\n", + "Fa=u2*Na #friction from ground\n", + "P=Nb-Fa\n", + "print \"Force required is \",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 71.6013500101 degrees\n" + ] + } + ], + "source": [ + "import math\n", + "l=6.0 #length of ladder\n", + "u1=0.4 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.25 #coefficient of friction between floor and the ladder\n", + "wl=900.0 #weight of load\n", + "ll=5.0 #distance of load\n", + "#force balancing\n", + "#Na Nb normal reaction at A and B\n", + "#Fa Fb friction at A and B\n", + "#Fa=u2*Na \n", + "#Fb=u1*Nb\n", + "#Na+Fb=w+wl\n", + "#Fa=Nb\n", + "Nb=(wl+w)*u2/(1+u2*u1)\n", + "Na=Nb/u2\n", + "Fa=u2*Na\n", + "Fb=u1*Nb\n", + "#sum of all moments about a is =0\n", + "temp=((w*l*0.5)+(wl*ll)-(Fb*l))/(Nb*l)\n", + "o=math.atan(temp)*180/3.14\n", + "print \"Angle of inclination is \",o,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.12" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length will 0.5 times\n" + ] + } + ], + "source": [ + "import math\n", + "o=45.0*3.14/180.0 #angle of inclination \n", + "u=0.5 #coefficient of friction\n", + "r=1.5 #ratio of mans weight to ladders weight\n", + "o1=45.0*math.pi/180.0 #angle of inclination\n", + "#from law of friction\n", + "#Fa = μNa\n", + "#Fb = μNb\n", + "#Fa – Nb = 0 \n", + "#Na + Fb = W + r W\n", + "#ΣMA = 0\n", + "o=(((u*u+u)*(1+r)/((1+u)))-1.0/2.0)/r\n", + "print \"length will\",o,\"times\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.13" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum weight is 6277.60420331\n", + "Minimum weight is 57.3467183245\n" + ] + } + ], + "source": [ + "import math\n", + "n=1.25 #number of turns\n", + "o=2*3.14*n #angle of contact\n", + "u=0.3 #coefficient of friction\n", + "t=600.0 #force at the other end of the rope\n", + "#if the impending motion of the weight be downward.\n", + "W=T2=t*2.71**(u*o)\n", + "print \"Maximum weight is \",W\n", + "#if the impending motion of weight be upwards\n", + "W=T1=t*2.71**(-1*u*o)\n", + "print \"Minimum weight is \",W" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.14" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight is 136.9599857 N\n" + ] + } + ], + "source": [ + "import math\n", + "ur=0.20 #The coefficient of friction between the rope and the fixed drum\n", + "uo=0.30 #The coefficient of friction between other surfaces\n", + "cosa=4.0/5.0 #cos of angle of inclination\n", + "sina=3.0/5.0 #sin of angle of inclination\n", + "Ww=1000.0 #weight\n", + "o=3.14 #angle of contact of rope with pulley\n", + "#for unknown weight\n", + "#force balance perpendicular to the plane\n", + "#N1 = W cos α\n", + "#fr=uoN1\n", + "#force balance along the plane\n", + "#T1 = F1 + W sin α\n", + "#for 1000 N body\n", + "#force balance perpendicular to the plane\n", + "#N2=N1+Wwcosa\n", + "#fr2=uoN2\n", + "#force balance along the plane\n", + "#T2= Wwsina -F1 -F2\n", + "#T2=T1*e^(ur*o)\n", + "W=(Ww*sina-uo*Ww*cosa)/(((uo*cosa+sina)*(2.71**(uo*o)))+(uo*cosa+uo*cosa))\n", + "print \"Weight is \",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.15" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force P applied at the end of the brake lever 274.480678202\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.3 #coefficient of friction\n", + "r=250 #radius of brake drum\n", + "l=300 #length of lever arm\n", + "M=300000.0 #torque\n", + "o=r*3.14/180.0\n", + "l2=50.0\n", + "#using \n", + "#T2 = T1e^(μθ) T1 and T2 are tension\n", + "#(T2-T1)r=M\n", + "T1=M/(r*(2.71**(u*o)-1))\n", + "T2=(2.71**(u*o))*T1\n", + "#Consider the lever arm. Taking moment about the hinge\n", + "p=T2*l2/l #force P applied at the end of the brake lever\n", + "print \"force P applied at the end of the brake lever\",p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.16" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6972.02507534 mm\n", + "Power Transmitted 3252832.96438 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=O2=3.14+2*math.asin((d1+d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2+d2/2)*O1+2*D*math.cos(math.asin((d1+d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O1))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 5.17" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6955.3382782 mm\n", + "Power Transmitted 3035637.41075 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=3.14+2*math.asin((d1-d2)/(2*D))\n", + "O2=3.14-2*math.asin((d1-d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2*O1+d2/2*O2)+2*D*math.cos(math.asin((d1-d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O2))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n", + "\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_nV0EOp8.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_nV0EOp8.ipynb new file mode 100644 index 00000000..87ac24ec --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_nV0EOp8.ipynb @@ -0,0 +1,774 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5-FRICTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1250.0 N\n", + "P= 1210.36288071 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=1000.0 #weight of block a\n", + "Wb=2000.0 #weight of block b\n", + "uab=1.0/4.0 #coefficient of friction between A and B\n", + "ubg=1.0/3.0 #coefficient of friction between ground and B\n", + "#When P is horizontal\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "N2=N1+ Wb #Normal Reaction on block B from Ground\n", + "F2=ubg*N2 #limiting Friction between A and ground\n", + "P=F1+F2\n", + "print \"P=\",P,\"N\"\n", + "#When P is inclined at angle o\n", + "o=30.0*3.14/180.0\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "#from\n", + "#N2+Psin30=N1+Wb\n", + "#Pcos30=F1+F2\n", + "#F1=ubg*N2\n", + "N2=(N1+Wb-F1*math.tan(o))/(1+ubg*math.tan(o))\n", + "P=(N1+Wb-N2)/math.sin(o)\n", + "print \"P=\",P,\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29.0693410161 °\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=300.0 #weight of upper block \n", + "Wb=900.0 #weight of lower block \n", + "u1=1.0/3.0 #coefficient of friction between upper block and lower block\n", + "u2=1.0/3.0 #coefficient of friction between ground and lower block\n", + "#using \n", + "#N1=Wacoso Normal Reaction\n", + "#F1=u1*N1 Friction\n", + "#N2=Wbcoso+N1\n", + "#F2=u2*N2\n", + "o=math.atan((u1*Wa+u2*Wb+u2*Wa)/Wb)*180/3.14\n", + "print o,\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 30.0152164356\n", + "coefficient of friction is 0.1\n" + ] + } + ], + "source": [ + "import math\n", + "W=500.0 #weight of block\n", + "F1=200.0 #force up the inclined plane when block is moving down\n", + "F2=300.0 #force up the inclined plane when block is at rest\n", + "#When block starts moving down the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Fr+F1=Wsino\n", + "#sino-ucoso=F1/w 1\n", + "#When block starts moving up the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Wsino+Wucoso=F2\n", + "#using these equations\n", + "o=math.asin((F1*0.5/W)+(F2*0.5/W)) #angle of inclination\n", + "print \"Angle of inclination is \",(o*180/3.14)\n", + "#using 1\n", + "u=math.sin(o)-F1/W\n", + "print \"coefficient of friction is\",round(u,3)\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of Inclination 21.8124674778\n" + ] + } + ], + "source": [ + "import math\n", + "uag=0.5 #coefficient of friction between block A and the plane\n", + "ubg=0.2 #coefficient of friction between block B and the plane\n", + "Wb=500.0 #weight of block B\n", + "Wa=1000.0 #weight of block A\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N1=Wacoso ,Fr=uagN1\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=uagWacoso-Wasino\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N2=Wbcoso ,Fr=uagN2\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=Wbsino-ubgwbsino\n", + "o=math.atan((uag*Wa+ubg*Wb)/(Wa+Wb))*180.0/3.14\n", + "print \"Angle of Inclination\",o;\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "853.305553493 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wl=750.0 #weight of lower block\n", + "Wu=500.0 #weight of upper block\n", + "o1=60.0*3.14/180.0 #angle of inclined plane\n", + "o2=30.0 *3.14/180.0 # anlge at which pull is applied\n", + "u=0.2 #coefficient of friction\n", + "#for 750 N block\n", + "#Σ Forces normal to the plane = 0 \n", + "N1=Wl*math.cos(o1)\n", + "F1=u*N1\n", + "#Σ Forces parallel to the plane = 0\n", + "T=F1+Wl*math.sin(o1)\n", + "#Σ Forces horizontal to the plane = 0\n", + "P=(T+u*Wu)/(math.cos(o2)+u*math.sin(o2))\n", + "print P,\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least Weight is 266.34090474 N\n", + "Greatest Weight is 969.473014916 N\n" + ] + } + ], + "source": [ + "import math\n", + "o1=60.0*3.14/180.0 #angle of inclination of plane AC\n", + "o2=30.0*3.14/180.0 #angle of inclination of plane BC\n", + "Wbc=1000.0 #weight of block on plane BC\n", + "ubc=0.28 #coefficient of friction between the load and the plane BC \n", + "uac=0.20 #coefficient of friction between the load and the plane AC\n", + "#for least weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)-F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(uac*math.cos(o1)+math.sin(o1))\n", + "print \"Least Weight is\",W,\"N\"\n", + "#for greatest weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)+F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(-1*uac*math.cos(o1)+math.sin(o1))\n", + "print \"Greatest Weight is\",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight 10498.172578 N\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.4 #The coefficient of friction on the horizontal plane\n", + "oi=30 #angle of inclined plane\n", + "o=20.0 #The limiting angle of friction for block B on the inclined plane\n", + "wb=5000.0 #weight of block b\n", + "ub=math.tan(o*3.14/180.0) #coefficcient of friction on plane\n", + "#for block B\n", + "#N1 N2 N3 are normal reaction\n", + "#F1 F2 are frictional forces\n", + "#F1=ub*N1 \n", + "#N1 sinoi + F1 cos oi=wb\n", + "N1=wb/(math.sin(oi*3.14/180.0)+ub*math.cos(oi*3.14/180.0))\n", + "F1=ub*N1\n", + "C=N1*math.cos(oi*3.14/180.0)-F1*math.sin(oi*3.14/180.0)\n", + "\n", + "#force balance on A in horizontal balance\n", + "F2=C\n", + "N2=F2/u\n", + "#force balance on A in vertical balance\n", + "W=N2\n", + "print \"Weight \",W,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force = 23812.7516422 N\n" + ] + } + ], + "source": [ + "import math\n", + "w=20000.0 #weight of upper block\n", + "o=15.0 #The angle of friction for all surfaces of contact\n", + "u=math.tan(o) #coefficient of friction\n", + "#R1 R2 are forces\n", + "Or1=15.0 #angle force R1 makes with x axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "R2=w*math.sin((90-Or1)*3.14/180.0)/math.sin((90+Or1+Or2)*3.14/180.0)\n", + "#applyig lamis theorem on block B\n", + "Or1=15.0 #angle force R3 makes with Y axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "P=R2*math.sin((180-Or1-Or2)*3.14/180.0)/math.sin((90+Or1)*3.14/180.0)\n", + "print \"Force =\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 66.26 KN\n" + ] + } + ], + "source": [ + "import math \n", + "w=160.0 #weight of block,KN\n", + "u=0.25 #coefficient of friction\n", + "phi=math.atan(u)\n", + "\n", + "#The free body diagrams of wedges A, B and block C .The problem being symmetric, the reactions R1 and R2 on wedges A and B are equal. The system of forces on block C andon wedge A are shown in the form convenient for applying Lami’s theorem\n", + "R1=w*math.sin(math.pi-(16*math.pi/180)-phi)/math.sin(2*(phi+math.pi*16/180))\n", + "#consider the equillibrium of the wedge A ,Ny lamis's theorem,we get\n", + "P=R1*math.sin(math.pi-phi-phi-(16*math.pi/180))/math.sin((math.pi/2)+phi)\n", + "print\"P=\",round(P,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force required is 62.0836173323 N\n" + ] + } + ], + "source": [ + "import math\n", + "l=4.0 #length of ladder\n", + "u1=0.2 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.3 #coefficient of friction between floor and the ladder\n", + "wm=600.0 #weight of man\n", + "lm=3.0 #distance of man\n", + "o=3.14*60.0/180.0 #angle made by ladder with floor\n", + "#sum of all moment about A =0\n", + "Nb=(w*l/2*math.cos(o)+wm*lm*math.cos(o))/(l*(math.sin(o)+u1*math.cos(o))) # normal reaction from wall\n", + "Fb=u1*Nb #friction from wall\n", + "#force balance in vertical direction\n", + "Na=(w+wm-Fb) # normal reaction from ground\n", + "Fa=u2*Na #friction from ground\n", + "P=Nb-Fa\n", + "print \"Force required is \",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 71.6013500101 degrees\n" + ] + } + ], + "source": [ + "import math\n", + "l=6.0 #length of ladder\n", + "u1=0.4 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.25 #coefficient of friction between floor and the ladder\n", + "wl=900.0 #weight of load\n", + "ll=5.0 #distance of load\n", + "#force balancing\n", + "#Na Nb normal reaction at A and B\n", + "#Fa Fb friction at A and B\n", + "#Fa=u2*Na \n", + "#Fb=u1*Nb\n", + "#Na+Fb=w+wl\n", + "#Fa=Nb\n", + "Nb=(wl+w)*u2/(1+u2*u1)\n", + "Na=Nb/u2\n", + "Fa=u2*Na\n", + "Fb=u1*Nb\n", + "#sum of all moments about a is =0\n", + "temp=((w*l*0.5)+(wl*ll)-(Fb*l))/(Nb*l)\n", + "o=math.atan(temp)*180/3.14\n", + "print \"Angle of inclination is \",o,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.12" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length will 0.5 times\n" + ] + } + ], + "source": [ + "import math\n", + "o=45.0*3.14/180.0 #angle of inclination \n", + "u=0.5 #coefficient of friction\n", + "r=1.5 #ratio of mans weight to ladders weight\n", + "o1=45.0*math.pi/180.0 #angle of inclination\n", + "#from law of friction\n", + "#Fa = μNa\n", + "#Fb = μNb\n", + "#Fa – Nb = 0 \n", + "#Na + Fb = W + r W\n", + "#ΣMA = 0\n", + "o=(((u*u+u)*(1+r)/((1+u)))-1.0/2.0)/r\n", + "print \"length will\",o,\"times\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.13" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum weight is 6277.60420331\n", + "Minimum weight is 57.3467183245\n" + ] + } + ], + "source": [ + "import math\n", + "n=1.25 #number of turns\n", + "o=2*3.14*n #angle of contact\n", + "u=0.3 #coefficient of friction\n", + "t=600.0 #force at the other end of the rope\n", + "#if the impending motion of the weight be downward.\n", + "W=T2=t*2.71**(u*o)\n", + "print \"Maximum weight is \",W\n", + "#if the impending motion of weight be upwards\n", + "W=T1=t*2.71**(-1*u*o)\n", + "print \"Minimum weight is \",W" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.14" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight is 136.9599857 N\n" + ] + } + ], + "source": [ + "import math\n", + "ur=0.20 #The coefficient of friction between the rope and the fixed drum\n", + "uo=0.30 #The coefficient of friction between other surfaces\n", + "cosa=4.0/5.0 #cos of angle of inclination\n", + "sina=3.0/5.0 #sin of angle of inclination\n", + "Ww=1000.0 #weight\n", + "o=3.14 #angle of contact of rope with pulley\n", + "#for unknown weight\n", + "#force balance perpendicular to the plane\n", + "#N1 = W cos α\n", + "#fr=uoN1\n", + "#force balance along the plane\n", + "#T1 = F1 + W sin α\n", + "#for 1000 N body\n", + "#force balance perpendicular to the plane\n", + "#N2=N1+Wwcosa\n", + "#fr2=uoN2\n", + "#force balance along the plane\n", + "#T2= Wwsina -F1 -F2\n", + "#T2=T1*e^(ur*o)\n", + "W=(Ww*sina-uo*Ww*cosa)/(((uo*cosa+sina)*(2.71**(uo*o)))+(uo*cosa+uo*cosa))\n", + "print \"Weight is \",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.15" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force P applied at the end of the brake lever 274.480678202\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.3 #coefficient of friction\n", + "r=250 #radius of brake drum\n", + "l=300 #length of lever arm\n", + "M=300000.0 #torque\n", + "o=r*3.14/180.0\n", + "l2=50.0\n", + "#using \n", + "#T2 = T1e^(μθ) T1 and T2 are tension\n", + "#(T2-T1)r=M\n", + "T1=M/(r*(2.71**(u*o)-1))\n", + "T2=(2.71**(u*o))*T1\n", + "#Consider the lever arm. Taking moment about the hinge\n", + "p=T2*l2/l #force P applied at the end of the brake lever\n", + "print \"force P applied at the end of the brake lever\",p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.16" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6972.02507534 mm\n", + "Power Transmitted 3252832.96438 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=O2=3.14+2*math.asin((d1+d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2+d2/2)*O1+2*D*math.cos(math.asin((d1+d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O1))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 5.17" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6955.3382782 mm\n", + "Power Transmitted 3035637.41075 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=3.14+2*math.asin((d1-d2)/(2*D))\n", + "O2=3.14-2*math.asin((d1-d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2*O1+d2/2*O2)+2*D*math.cos(math.asin((d1-d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O2))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n", + "\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_woQKdAT.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_woQKdAT.ipynb new file mode 100644 index 00000000..87ac24ec --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_woQKdAT.ipynb @@ -0,0 +1,774 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5-FRICTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 1250.0 N\n", + "P= 1210.36288071 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=1000.0 #weight of block a\n", + "Wb=2000.0 #weight of block b\n", + "uab=1.0/4.0 #coefficient of friction between A and B\n", + "ubg=1.0/3.0 #coefficient of friction between ground and B\n", + "#When P is horizontal\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "N2=N1+ Wb #Normal Reaction on block B from Ground\n", + "F2=ubg*N2 #limiting Friction between A and ground\n", + "P=F1+F2\n", + "print \"P=\",P,\"N\"\n", + "#When P is inclined at angle o\n", + "o=30.0*3.14/180.0\n", + "#considering equilibrium of block A\n", + "N1=Wa #Normal Reaction on block A from block B\n", + "F1=uab*N1 #limiting Friction between A and B\n", + "T=F1 #tension\n", + "#considering equilibrium of block B\n", + "#from\n", + "#N2+Psin30=N1+Wb\n", + "#Pcos30=F1+F2\n", + "#F1=ubg*N2\n", + "N2=(N1+Wb-F1*math.tan(o))/(1+ubg*math.tan(o))\n", + "P=(N1+Wb-N2)/math.sin(o)\n", + "print \"P=\",P,\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29.0693410161 °\n" + ] + } + ], + "source": [ + "import math\n", + "Wa=300.0 #weight of upper block \n", + "Wb=900.0 #weight of lower block \n", + "u1=1.0/3.0 #coefficient of friction between upper block and lower block\n", + "u2=1.0/3.0 #coefficient of friction between ground and lower block\n", + "#using \n", + "#N1=Wacoso Normal Reaction\n", + "#F1=u1*N1 Friction\n", + "#N2=Wbcoso+N1\n", + "#F2=u2*N2\n", + "o=math.atan((u1*Wa+u2*Wb+u2*Wa)/Wb)*180/3.14\n", + "print o,\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 30.0152164356\n", + "coefficient of friction is 0.1\n" + ] + } + ], + "source": [ + "import math\n", + "W=500.0 #weight of block\n", + "F1=200.0 #force up the inclined plane when block is moving down\n", + "F2=300.0 #force up the inclined plane when block is at rest\n", + "#When block starts moving down the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Fr+F1=Wsino\n", + "#sino-ucoso=F1/w 1\n", + "#When block starts moving up the plane\n", + "#sum of all forces perpendicular to the plane = 0\n", + "#N =Wcoso\n", + "#sum of all forces parallel to the plane = 0\n", + "#Wsino+Wucoso=F2\n", + "#using these equations\n", + "o=math.asin((F1*0.5/W)+(F2*0.5/W)) #angle of inclination\n", + "print \"Angle of inclination is \",(o*180/3.14)\n", + "#using 1\n", + "u=math.sin(o)-F1/W\n", + "print \"coefficient of friction is\",round(u,3)\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of Inclination 21.8124674778\n" + ] + } + ], + "source": [ + "import math\n", + "uag=0.5 #coefficient of friction between block A and the plane\n", + "ubg=0.2 #coefficient of friction between block B and the plane\n", + "Wb=500.0 #weight of block B\n", + "Wa=1000.0 #weight of block A\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N1=Wacoso ,Fr=uagN1\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=uagWacoso-Wasino\n", + "#Considering equilibrium of block A,\n", + "#sum of all forces along the plane is 0\n", + "#N2=Wbcoso ,Fr=uagN2\n", + "#sum of all forces perpendicaular to the plane is 0\n", + "#T=Wbsino-ubgwbsino\n", + "o=math.atan((uag*Wa+ubg*Wb)/(Wa+Wb))*180.0/3.14\n", + "print \"Angle of Inclination\",o;\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "853.305553493 N\n" + ] + } + ], + "source": [ + "import math\n", + "Wl=750.0 #weight of lower block\n", + "Wu=500.0 #weight of upper block\n", + "o1=60.0*3.14/180.0 #angle of inclined plane\n", + "o2=30.0 *3.14/180.0 # anlge at which pull is applied\n", + "u=0.2 #coefficient of friction\n", + "#for 750 N block\n", + "#Σ Forces normal to the plane = 0 \n", + "N1=Wl*math.cos(o1)\n", + "F1=u*N1\n", + "#Σ Forces parallel to the plane = 0\n", + "T=F1+Wl*math.sin(o1)\n", + "#Σ Forces horizontal to the plane = 0\n", + "P=(T+u*Wu)/(math.cos(o2)+u*math.sin(o2))\n", + "print P,\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least Weight is 266.34090474 N\n", + "Greatest Weight is 969.473014916 N\n" + ] + } + ], + "source": [ + "import math\n", + "o1=60.0*3.14/180.0 #angle of inclination of plane AC\n", + "o2=30.0*3.14/180.0 #angle of inclination of plane BC\n", + "Wbc=1000.0 #weight of block on plane BC\n", + "ubc=0.28 #coefficient of friction between the load and the plane BC \n", + "uac=0.20 #coefficient of friction between the load and the plane AC\n", + "#for least weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)-F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(uac*math.cos(o1)+math.sin(o1))\n", + "print \"Least Weight is\",W,\"N\"\n", + "#for greatest weight \n", + "N1=Wbc*math.cos(o2) #Normal Reaction\n", + "F1=ubc*N1 #frictional Force\n", + "T=Wbc*math.sin(o2)+F1 #Tension\n", + "#for block on plane AC\n", + "#N2=Wcoso1\n", + "#F2=uac*N2\n", + "#T=F2+W sino2\n", + "W=T/(-1*uac*math.cos(o1)+math.sin(o1))\n", + "print \"Greatest Weight is\",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight 10498.172578 N\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.4 #The coefficient of friction on the horizontal plane\n", + "oi=30 #angle of inclined plane\n", + "o=20.0 #The limiting angle of friction for block B on the inclined plane\n", + "wb=5000.0 #weight of block b\n", + "ub=math.tan(o*3.14/180.0) #coefficcient of friction on plane\n", + "#for block B\n", + "#N1 N2 N3 are normal reaction\n", + "#F1 F2 are frictional forces\n", + "#F1=ub*N1 \n", + "#N1 sinoi + F1 cos oi=wb\n", + "N1=wb/(math.sin(oi*3.14/180.0)+ub*math.cos(oi*3.14/180.0))\n", + "F1=ub*N1\n", + "C=N1*math.cos(oi*3.14/180.0)-F1*math.sin(oi*3.14/180.0)\n", + "\n", + "#force balance on A in horizontal balance\n", + "F2=C\n", + "N2=F2/u\n", + "#force balance on A in vertical balance\n", + "W=N2\n", + "print \"Weight \",W,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force = 23812.7516422 N\n" + ] + } + ], + "source": [ + "import math\n", + "w=20000.0 #weight of upper block\n", + "o=15.0 #The angle of friction for all surfaces of contact\n", + "u=math.tan(o) #coefficient of friction\n", + "#R1 R2 are forces\n", + "Or1=15.0 #angle force R1 makes with x axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "R2=w*math.sin((90-Or1)*3.14/180.0)/math.sin((90+Or1+Or2)*3.14/180.0)\n", + "#applyig lamis theorem on block B\n", + "Or1=15.0 #angle force R3 makes with Y axis\n", + "Or2=35.0 #angle force R2 makes with Y axis\n", + "P=R2*math.sin((180-Or1-Or2)*3.14/180.0)/math.sin((90+Or1)*3.14/180.0)\n", + "print \"Force =\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 66.26 KN\n" + ] + } + ], + "source": [ + "import math \n", + "w=160.0 #weight of block,KN\n", + "u=0.25 #coefficient of friction\n", + "phi=math.atan(u)\n", + "\n", + "#The free body diagrams of wedges A, B and block C .The problem being symmetric, the reactions R1 and R2 on wedges A and B are equal. The system of forces on block C andon wedge A are shown in the form convenient for applying Lami’s theorem\n", + "R1=w*math.sin(math.pi-(16*math.pi/180)-phi)/math.sin(2*(phi+math.pi*16/180))\n", + "#consider the equillibrium of the wedge A ,Ny lamis's theorem,we get\n", + "P=R1*math.sin(math.pi-phi-phi-(16*math.pi/180))/math.sin((math.pi/2)+phi)\n", + "print\"P=\",round(P,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force required is 62.0836173323 N\n" + ] + } + ], + "source": [ + "import math\n", + "l=4.0 #length of ladder\n", + "u1=0.2 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.3 #coefficient of friction between floor and the ladder\n", + "wm=600.0 #weight of man\n", + "lm=3.0 #distance of man\n", + "o=3.14*60.0/180.0 #angle made by ladder with floor\n", + "#sum of all moment about A =0\n", + "Nb=(w*l/2*math.cos(o)+wm*lm*math.cos(o))/(l*(math.sin(o)+u1*math.cos(o))) # normal reaction from wall\n", + "Fb=u1*Nb #friction from wall\n", + "#force balance in vertical direction\n", + "Na=(w+wm-Fb) # normal reaction from ground\n", + "Fa=u2*Na #friction from ground\n", + "P=Nb-Fa\n", + "print \"Force required is \",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle of inclination is 71.6013500101 degrees\n" + ] + } + ], + "source": [ + "import math\n", + "l=6.0 #length of ladder\n", + "u1=0.4 #coefficient of friction between the wall and the ladder\n", + "w=200.0 #weight of ladder\n", + "u2=0.25 #coefficient of friction between floor and the ladder\n", + "wl=900.0 #weight of load\n", + "ll=5.0 #distance of load\n", + "#force balancing\n", + "#Na Nb normal reaction at A and B\n", + "#Fa Fb friction at A and B\n", + "#Fa=u2*Na \n", + "#Fb=u1*Nb\n", + "#Na+Fb=w+wl\n", + "#Fa=Nb\n", + "Nb=(wl+w)*u2/(1+u2*u1)\n", + "Na=Nb/u2\n", + "Fa=u2*Na\n", + "Fb=u1*Nb\n", + "#sum of all moments about a is =0\n", + "temp=((w*l*0.5)+(wl*ll)-(Fb*l))/(Nb*l)\n", + "o=math.atan(temp)*180/3.14\n", + "print \"Angle of inclination is \",o,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.12" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length will 0.5 times\n" + ] + } + ], + "source": [ + "import math\n", + "o=45.0*3.14/180.0 #angle of inclination \n", + "u=0.5 #coefficient of friction\n", + "r=1.5 #ratio of mans weight to ladders weight\n", + "o1=45.0*math.pi/180.0 #angle of inclination\n", + "#from law of friction\n", + "#Fa = μNa\n", + "#Fb = μNb\n", + "#Fa – Nb = 0 \n", + "#Na + Fb = W + r W\n", + "#ΣMA = 0\n", + "o=(((u*u+u)*(1+r)/((1+u)))-1.0/2.0)/r\n", + "print \"length will\",o,\"times\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.13" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum weight is 6277.60420331\n", + "Minimum weight is 57.3467183245\n" + ] + } + ], + "source": [ + "import math\n", + "n=1.25 #number of turns\n", + "o=2*3.14*n #angle of contact\n", + "u=0.3 #coefficient of friction\n", + "t=600.0 #force at the other end of the rope\n", + "#if the impending motion of the weight be downward.\n", + "W=T2=t*2.71**(u*o)\n", + "print \"Maximum weight is \",W\n", + "#if the impending motion of weight be upwards\n", + "W=T1=t*2.71**(-1*u*o)\n", + "print \"Minimum weight is \",W" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.14" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight is 136.9599857 N\n" + ] + } + ], + "source": [ + "import math\n", + "ur=0.20 #The coefficient of friction between the rope and the fixed drum\n", + "uo=0.30 #The coefficient of friction between other surfaces\n", + "cosa=4.0/5.0 #cos of angle of inclination\n", + "sina=3.0/5.0 #sin of angle of inclination\n", + "Ww=1000.0 #weight\n", + "o=3.14 #angle of contact of rope with pulley\n", + "#for unknown weight\n", + "#force balance perpendicular to the plane\n", + "#N1 = W cos α\n", + "#fr=uoN1\n", + "#force balance along the plane\n", + "#T1 = F1 + W sin α\n", + "#for 1000 N body\n", + "#force balance perpendicular to the plane\n", + "#N2=N1+Wwcosa\n", + "#fr2=uoN2\n", + "#force balance along the plane\n", + "#T2= Wwsina -F1 -F2\n", + "#T2=T1*e^(ur*o)\n", + "W=(Ww*sina-uo*Ww*cosa)/(((uo*cosa+sina)*(2.71**(uo*o)))+(uo*cosa+uo*cosa))\n", + "print \"Weight is \",W,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.15" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "force P applied at the end of the brake lever 274.480678202\n" + ] + } + ], + "source": [ + "import math\n", + "u=0.3 #coefficient of friction\n", + "r=250 #radius of brake drum\n", + "l=300 #length of lever arm\n", + "M=300000.0 #torque\n", + "o=r*3.14/180.0\n", + "l2=50.0\n", + "#using \n", + "#T2 = T1e^(μθ) T1 and T2 are tension\n", + "#(T2-T1)r=M\n", + "T1=M/(r*(2.71**(u*o)-1))\n", + "T2=(2.71**(u*o))*T1\n", + "#Consider the lever arm. Taking moment about the hinge\n", + "p=T2*l2/l #force P applied at the end of the brake lever\n", + "print \"force P applied at the end of the brake lever\",p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 5.16" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6972.02507534 mm\n", + "Power Transmitted 3252832.96438 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=O2=3.14+2*math.asin((d1+d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2+d2/2)*O1+2*D*math.cos(math.asin((d1+d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O1))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 5.17" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length of belt is 6955.3382782 mm\n", + "Power Transmitted 3035637.41075 Watt\n" + ] + } + ], + "source": [ + "import math\n", + "d1=500.0 #diameter of a shaft\n", + "d2=100.0 #diameter of a shaft\n", + "D=3000.0 #distance between shafts in mm\n", + "T=1000.0 #Maximum permissible tension in the belt\n", + "U=0.25 #coefficient of friction between the belt and the pulley\n", + "R=220.0 #revlution per minute of larger shaft\n", + "O1=3.14+2*math.asin((d1-d2)/(2*D))\n", + "O2=3.14-2*math.asin((d1-d2)/(2*D))\n", + "#Length of belt = Arc length DC + Arc length FE + 2BG\n", + "L=(d1/2*O1+d2/2*O2)+2*D*math.cos(math.asin((d1-d2)/(2*D)))\n", + "print \"Length of belt is \",L,\"mm\"\n", + "T1=T/(2.71**(U*O2))\n", + "Velocity_of_the_belt =d1/2*(R*2*3.14/60.0)\n", + "Power_transmitted=(T-T1)*Velocity_of_the_belt\n", + "print \"Power Transmitted\",Power_transmitted,\"Watt\"\n", + "\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_0a0tZuT.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_0a0tZuT.ipynb new file mode 100644 index 00000000..55339520 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_0a0tZuT.ipynb @@ -0,0 +1,1593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6-SIMPLE MACHINES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 20.0\n", + "Velocity Ratio 25.0\n", + "Efficiency 0.8\n", + "Ideal Load 12500.0\n", + "Ideal Effort 400.0\n", + "Effort lost in friction 100.0\n", + "frictional resistance 2500.0\n" + ] + } + ], + "source": [ + "import math\n", + "W = 10000.0 #Load\n", + "P = 500.0 #Effort\n", + "D = 20.0 #Distance moved by the effort \n", + "d = 0.8 #Distance moved by the load \n", + "MA=W/P #Mechanical advantage\n", + "VR=D/d #Velocity Ratio\n", + "Efficiency=MA/VR\n", + "Pi =W/VR #Ideal effort\n", + "Wi = P*VR #ideal load\n", + "efl=P-Pi #Effort lost in friction\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print \"Ideal Load\",Wi\n", + "print \"Ideal Effort\",Pi\n", + "print \"Effort lost in friction\",efl\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.05 W + 30.0\n", + "Load is 3400.0 N\n", + "Mechanical advantage-- 17.0\n", + "Ideal effort is 113.333333333 N\n", + "Effort lost in friction 86.6666666667\n", + "Efficiency 56.6666666667\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 2400.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "\n", + "W2 = 3000.0 #Load 2\n", + "P2= 180.0 #Effort2\n", + "P3= 200.0 #Effort3\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "W3=(P3-C)/m #Load 2\n", + "print \"Load is \",W3,\"N\"\n", + "MA=W3/P3 #Mechanical advantage\n", + "print \"Mechanical advantage--\",MA\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100\n", + "Pi =W3/VR #Ideal effort\n", + "print \"Ideal effort is\",Pi,\"N\"\n", + "\n", + "efl=P3-Pi #Effort lost in friction\n", + "\n", + "print \"Effort lost in friction\",efl\n", + "print \"Efficiency\",Efficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 51.3333333333\n", + "Velocity Ratio 85.5555555556\n", + "Efficiency 61.7142857143\n", + "Maximum Mechanical advantage-- 55.0\n", + "Maximum Efficiency 64.2857142857\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 7700.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=0.6\n", + "VR=MA/Efficiency #Velocity Ratio\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "W2 = 13200.0 #Load 2\n", + "P2= 250.0 #Effort2\n", + "MA=W2/P2\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "\n", + "\n", + "MMA=1/m #Maximum Mechanical advantage\n", + "print \"Maximum Mechanical advantage--\",MMA\n", + "\n", + "MaxEfficiency=MMA/VR*100\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.06 W + 10.5\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('<div/>');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " this.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", + " 'ui-helper-clearfix\"/>');\n", + " var titletext = $(\n", + " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", + " 'text-align: center; padding: 3px;\"/>');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('<div/>');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('<canvas/>');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var rubberband = $('<canvas/>');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width);\n", + " canvas.attr('height', height);\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('<button/>');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('<span/>');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('<span/>');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('<span/>');\n", + "\n", + " var fmt_picker = $('<select/>');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('<span class=\"mpl-message\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "}\n", + "\n", + "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", + " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", + " // which will in turn request a refresh of the image.\n", + " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", + "}\n", + "\n", + "mpl.figure.prototype.send_message = function(type, properties) {\n", + " properties['type'] = type;\n", + " properties['figure_id'] = this.id;\n", + " this.ws.send(JSON.stringify(properties));\n", + "}\n", + "\n", + "mpl.figure.prototype.send_draw_message = function() {\n", + " if (!this.waiting) {\n", + " this.waiting = true;\n", + " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", + " }\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " var format_dropdown = fig.format_dropdown;\n", + " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", + " fig.ondownload(fig, format);\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", + " var size = msg['size'];\n", + " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", + " fig._resize_canvas(size[0], size[1]);\n", + " fig.send_message(\"refresh\", {});\n", + " };\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", + " var x0 = msg['x0'];\n", + " var y0 = fig.canvas.height - msg['y0'];\n", + " var x1 = msg['x1'];\n", + " var y1 = fig.canvas.height - msg['y1'];\n", + " x0 = Math.floor(x0) + 0.5;\n", + " y0 = Math.floor(y0) + 0.5;\n", + " x1 = Math.floor(x1) + 0.5;\n", + " y1 = Math.floor(y1) + 0.5;\n", + " var min_x = Math.min(x0, x1);\n", + " var min_y = Math.min(y0, y1);\n", + " var width = Math.abs(x1 - x0);\n", + " var height = Math.abs(y1 - y0);\n", + "\n", + " fig.rubberband_context.clearRect(\n", + " 0, 0, fig.canvas.width, fig.canvas.height);\n", + "\n", + " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", + " // Updates the figure title.\n", + " fig.header.textContent = msg['label'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", + " var cursor = msg['cursor'];\n", + " switch(cursor)\n", + " {\n", + " case 0:\n", + " cursor = 'pointer';\n", + " break;\n", + " case 1:\n", + " cursor = 'default';\n", + " break;\n", + " case 2:\n", + " cursor = 'crosshair';\n", + " break;\n", + " case 3:\n", + " cursor = 'move';\n", + " break;\n", + " }\n", + " fig.rubberband_canvas.style.cursor = cursor;\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_message = function(fig, msg) {\n", + " fig.message.textContent = msg['message'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", + " // Request the server to send over a new figure.\n", + " fig.send_draw_message();\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", + " fig.image_mode = msg['mode'];\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Called whenever the canvas gets updated.\n", + " this.send_message(\"ack\", {});\n", + "}\n", + "\n", + "// A function to construct a web socket function for onmessage handling.\n", + "// Called in the figure constructor.\n", + "mpl.figure.prototype._make_on_message_function = function(fig) {\n", + " return function socket_on_message(evt) {\n", + " if (evt.data instanceof Blob) {\n", + " /* FIXME: We get \"Resource interpreted as Image but\n", + " * transferred with MIME type text/plain:\" errors on\n", + " * Chrome. But how to set the MIME type? It doesn't seem\n", + " * to be part of the websocket stream */\n", + " evt.data.type = \"image/png\";\n", + "\n", + " /* Free the memory for the previous frames */\n", + " if (fig.imageObj.src) {\n", + " (window.URL || window.webkitURL).revokeObjectURL(\n", + " fig.imageObj.src);\n", + " }\n", + "\n", + " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", + " evt.data);\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", + " fig.imageObj.src = evt.data;\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + "\n", + " var msg = JSON.parse(evt.data);\n", + " var msg_type = msg['type'];\n", + "\n", + " // Call the \"handle_{type}\" callback, which takes\n", + " // the figure and JSON message as its only arguments.\n", + " try {\n", + " var callback = fig[\"handle_\" + msg_type];\n", + " } catch (e) {\n", + " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", + " return;\n", + " }\n", + "\n", + " if (callback) {\n", + " try {\n", + " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", + " callback(fig, msg);\n", + " } catch (e) {\n", + " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", + " }\n", + " }\n", + " };\n", + "}\n", + "\n", + "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", + "mpl.findpos = function(e) {\n", + " //this section is from http://www.quirksmode.org/js/events_properties.html\n", + " var targ;\n", + " if (!e)\n", + " e = window.event;\n", + " if (e.target)\n", + " targ = e.target;\n", + " else if (e.srcElement)\n", + " targ = e.srcElement;\n", + " if (targ.nodeType == 3) // defeat Safari bug\n", + " targ = targ.parentNode;\n", + "\n", + " // jQuery normalizes the pageX and pageY\n", + " // pageX,Y are the mouse positions relative to the document\n", + " // offset() returns the position of the element relative to the document\n", + " var x = e.pageX - $(targ).offset().left;\n", + " var y = e.pageY - $(targ).offset().top;\n", + "\n", + " return {\"x\": x, \"y\": y};\n", + "};\n", + "\n", + "/*\n", + " * return a copy of an object with only non-object keys\n", + " * we need this to avoid circular references\n", + " * http://stackoverflow.com/a/24161582/3208463\n", + " */\n", + "function simpleKeys (original) {\n", + " return Object.keys(original).reduce(function (obj, key) {\n", + " if (typeof original[key] !== 'object')\n", + " obj[key] = original[key]\n", + " return obj;\n", + " }, {});\n", + "}\n", + "\n", + "mpl.figure.prototype.mouse_event = function(event, name) {\n", + " var canvas_pos = mpl.findpos(event)\n", + "\n", + " if (name === 'button_press')\n", + " {\n", + " this.canvas.focus();\n", + " this.canvas_div.focus();\n", + " }\n", + "\n", + " var x = canvas_pos.x;\n", + " var y = canvas_pos.y;\n", + "\n", + " this.send_message(name, {x: x, y: y, button: event.button,\n", + " step: event.step,\n", + " guiEvent: simpleKeys(event)});\n", + "\n", + " /* This prevents the web browser from automatically changing to\n", + " * the text insertion cursor when the button is pressed. We want\n", + " * to control all of the cursor setting manually through the\n", + " * 'cursor' event from matplotlib */\n", + " event.preventDefault();\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " // Handle any extra behaviour associated with a key event\n", + "}\n", + "\n", + "mpl.figure.prototype.key_event = function(event, name) {\n", + "\n", + " // Prevent repeat events\n", + " if (name == 'key_press')\n", + " {\n", + " if (event.which === this._key)\n", + " return;\n", + " else\n", + " this._key = event.which;\n", + " }\n", + " if (name == 'key_release')\n", + " this._key = null;\n", + "\n", + " var value = '';\n", + " if (event.ctrlKey && event.which != 17)\n", + " value += \"ctrl+\";\n", + " if (event.altKey && event.which != 18)\n", + " value += \"alt+\";\n", + " if (event.shiftKey && event.which != 16)\n", + " value += \"shift+\";\n", + "\n", + " value += 'k';\n", + " value += event.which.toString();\n", + "\n", + " this._key_event_extra(event, name);\n", + "\n", + " this.send_message(name, {key: value,\n", + " guiEvent: simpleKeys(event)});\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", + " if (name == 'download') {\n", + " this.handle_save(this, null);\n", + " } else {\n", + " this.send_message(\"toolbar_button\", {name: name});\n", + " }\n", + "};\n", + "\n", + "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", + " this.message.textContent = tooltip;\n", + "};\n", + "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", + "\n", + "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", + "\n", + "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", + " // Create a \"websocket\"-like object which calls the given IPython comm\n", + " // object with the appropriate methods. Currently this is a non binary\n", + " // socket, so there is still some room for performance tuning.\n", + " var ws = {};\n", + "\n", + " ws.close = function() {\n", + " comm.close()\n", + " };\n", + " ws.send = function(m) {\n", + " //console.log('sending', m);\n", + " comm.send(m);\n", + " };\n", + " // Register the callback with on_msg.\n", + " comm.on_msg(function(msg) {\n", + " //console.log('receiving', msg['content']['data'], msg);\n", + " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", + " ws.onmessage(msg['content']['data'])\n", + " });\n", + " return ws;\n", + "}\n", + "\n", + "mpl.mpl_figure_comm = function(comm, msg) {\n", + " // This is the function which gets called when the mpl process\n", + " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", + "\n", + " var id = msg.content.data.id;\n", + " // Get hold of the div created by the display call when the Comm\n", + " // socket was opened in Python.\n", + " var element = $(\"#\" + id);\n", + " var ws_proxy = comm_websocket_adapter(comm)\n", + "\n", + " function ondownload(figure, format) {\n", + " window.open(figure.imageObj.src);\n", + " }\n", + "\n", + " var fig = new mpl.figure(id, ws_proxy,\n", + " ondownload,\n", + " element.get(0));\n", + "\n", + " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", + " // web socket which is closed, not our websocket->open comm proxy.\n", + " ws_proxy.onopen();\n", + "\n", + " fig.parent_element = element.get(0);\n", + " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", + " if (!fig.cell_info) {\n", + " console.error(\"Failed to find cell for figure\", id, fig);\n", + " return;\n", + " }\n", + "\n", + " var output_index = fig.cell_info[2]\n", + " var cell = fig.cell_info[0];\n", + "\n", + "};\n", + "\n", + "mpl.figure.prototype.handle_close = function(fig, msg) {\n", + " fig.root.unbind('remove')\n", + "\n", + " // Update the output cell to use the data from the current canvas.\n", + " fig.push_to_output();\n", + " var dataURL = fig.canvas.toDataURL();\n", + " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", + " // the notebook keyboard shortcuts fail.\n", + " IPython.keyboard_manager.enable()\n", + " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", + " fig.close_ws(fig, msg);\n", + "}\n", + "\n", + "mpl.figure.prototype.close_ws = function(fig, msg){\n", + " fig.send_message('closing', msg);\n", + " // fig.ws.close()\n", + "}\n", + "\n", + "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", + " // Turn the data on the canvas into data in the output cell.\n", + " var dataURL = this.canvas.toDataURL();\n", + " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Tell IPython that the notebook contents must change.\n", + " IPython.notebook.set_dirty(true);\n", + " this.send_message(\"ack\", {});\n", + " var fig = this;\n", + " // Wait a second, then push the new image to the DOM so\n", + " // that it is saved nicely (might be nice to debounce this).\n", + " setTimeout(function () { fig.push_to_output() }, 1000);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items){\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) { continue; };\n", + "\n", + " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " // Add the status bar.\n", + " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "\n", + " // Add the close button to the window.\n", + " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", + " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", + " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", + " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", + " buttongrp.append(button);\n", + " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", + " titlebar.prepend(buttongrp);\n", + "}\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(el){\n", + " var fig = this\n", + " el.on(\"remove\", function(){\n", + "\tfig.close_ws(fig, {});\n", + " });\n", + "}\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(el){\n", + " // this is important to make the div 'focusable\n", + " el.attr('tabindex', 0)\n", + " // reach out to IPython and tell the keyboard manager to turn it's self\n", + " // off when our div gets focus\n", + "\n", + " // location in version 3\n", + " if (IPython.notebook.keyboard_manager) {\n", + " IPython.notebook.keyboard_manager.register_events(el);\n", + " }\n", + " else {\n", + " // location in version 2\n", + " IPython.keyboard_manager.register_events(el);\n", + " }\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " var manager = IPython.notebook.keyboard_manager;\n", + " if (!manager)\n", + " manager = IPython.keyboard_manager;\n", + "\n", + " // Check for shift+enter\n", + " if (event.shiftKey && event.which == 13) {\n", + " this.canvas_div.blur();\n", + " event.shiftKey = false;\n", + " // Send a \"J\" for go to next cell\n", + " event.which = 74;\n", + " event.keyCode = 74;\n", + " manager.command_mode();\n", + " manager.handle_keydown(event);\n", + " }\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " fig.ondownload(fig, null);\n", + "}\n", + "\n", + "\n", + "mpl.find_output_cell = function(html_output) {\n", + " // Return the cell and output element which can be found *uniquely* in the notebook.\n", + " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", + " // IPython event is triggered only after the cells have been serialised, which for\n", + " // our purposes (turning an active figure into a static one), is too late.\n", + " var cells = IPython.notebook.get_cells();\n", + " var ncells = cells.length;\n", + " for (var i=0; i<ncells; i++) {\n", + " var cell = cells[i];\n", + " if (cell.cell_type === 'code'){\n", + " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", + " var data = cell.output_area.outputs[j];\n", + " if (data.data) {\n", + " // IPython >= 3 moved mimebundle to data attribute of output\n", + " data = data.data;\n", + " }\n", + " if (data['text/html'] == html_output) {\n", + " return [cell, data, j];\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "\n", + "// Register the function which deals with the matplotlib target/channel.\n", + "// The kernel may be null if the page has been refreshed.\n", + "if (IPython.notebook.kernel != null) {\n", + " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", + "}\n" + ], + "text/plain": [ + "<IPython.core.display.Javascript object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<img src=\"data:image/png;base64,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\">" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum Efficiency 66.6666666667\n" + ] + } + ], + "source": [ + "%matplotlib notebook\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt2\n", + "W=[100.0,200.0,300.0,400.0,500.0,600.0] #loads \n", + "P=[16.0,22.5,28.0,34.0,40.5,46.5] #Efforts\n", + "VR=25.0 #velocity ratio\n", + "E=[0,0,0,0,0,0] #Efficiency\n", + "#calculating average slope\n", + "m=(P[4]-P[1])/(W[4]-W[1])\n", + "C=P[4]-m*W[4]\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "for i in range(0,6):\n", + " \n", + " E[i]=W[i]/(25*P[i])*100 #E=W/(P*VR)\n", + " \n", + "plt2.plot(W,E)\n", + "plt2.ylabel(\"Efficiency\")\n", + "plt2.xlabel(\"Load\")\n", + "plt2.show() \n", + "\n", + " \n", + "MaxEfficiency=1/VR*100*1/m\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency\n", + "\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 13.8888888889\n", + "Velocity Ratio 30.0\n", + "Efficiency 46.2962962963\n", + "self-locking machine\n", + "Ideal Load 10800.0\n", + "frictional resistance 5800.0\n" + ] + } + ], + "source": [ + "\n", + "W = 5000.0 #Load\n", + "P = 360.0 #Effort\n", + "\n", + "MA=W/P #Mechanical advantage\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100.0\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "\n", + "\n", + "\n", + "Wi = P*VR #ideal load\n", + "\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print var\n", + "print \"Ideal Load\",Wi\n", + "\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 937.5 N\n", + "number of pulley is 4\n" + ] + } + ], + "source": [ + "import math\n", + "W = 6000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.8\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n", + "#second case\n", + "P=520.0\n", + "n=0,\n", + "for i in range(3,20):\n", + " if((P*(0.8-(i-3)*0.05)*(2**i)))>6000:\n", + " n=i\n", + " break\n", + " \n", + " \n", + "print \"number of pulley is \",n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exmple 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 2352.94117647 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N=3.0 #number of movable pulleys\n", + "VR=2*N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.85\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1923.07692308 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1\n", + "N2=2.0 #number of movable puleys in system 2\n", + "VR=2*N1+2*N2 #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.78\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 79.3650793651\n", + "Effort lost in friction 37.1428571429\n" + ] + } + ], + "source": [ + "import math\n", + "W = 1000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N-1 #Velocity Ratio\n", + "P = 180.0 #Effort\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "Pi =W/VR #Ideal effort\n", + "\n", + "efl=P-Pi #Effort lost in friction\n", + "print \"Effort lost in friction\",efl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 595.238095238 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 2500.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1 in figure B\n", + "N2=2.0 #number of movable puleys in system 2 in figure C\n", + "VR=2**N1-1+2**N2-1 #Velocity Ratio\n", + "Efficiency=0.70\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.11" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 2.3\n", + "Effort is 745.341614907 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle\n", + "tcw=6.0 #thickness of the cord on the wheel\n", + "tca=20.0 #thickness of the cord on the axle\n", + "W=1200 #effort\n", + "ED=D+tcw #Effective diameter of the wheel\n", + "Ed=d+tca #Effectivediameter of axle\n", + "VR=ED/Ed #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.7\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 32.0\n", + "Effort is 1136.36363636 N\n" + ] + } + ], + "source": [ + "D=800.0 #diameter of the wheel\n", + "d1=250.0 #diameter of axle 1\n", + "d2=300.0 #diameter of axle 2\n", + "\n", + "W=20000.0 #effort\n", + "\n", + "VR=(2*D)/(d2-d1) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.55\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 3.33333333333\n", + "Effort is 2500.0 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle \n", + "\n", + "W=5000.0 #effort\n", + "\n", + "VR=(2*D)/(D-d) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.6\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.14" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1741.88034188 N\n" + ] + } + ], + "source": [ + "D=40.0 #Screw diameter\n", + "l=20.0 #Screw lwngth\n", + "p=l/3.0 #Lead of the screw\n", + "W=40000.0 #effort\n", + "R = 400 #Lever length\n", + "u = 0.12 #coefficient of friction between screw and nut\n", + "P = (d/(2*R))*W*((u+(p/(3.14*D)))/(1-u*(p/(3.14*D)))) #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.15" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 57.0287539936 N\n", + "Efficiency 55.8439936484 %\n", + "reversible machine\n", + "The torque required to keep the load from descending 2047.61904762 Nm\n" + ] + } + ], + "source": [ + "import math\n", + "d=50.0 #mean diameter of screw\n", + "p=10.0 #pitch of screw\n", + "u=0.05 #coefficient of friction at the screw thread\n", + "R=300.0 ##Lever length\n", + "W=6000.0 #Load\n", + "o1=math.atan(p/(3.14*d))\n", + "o2=math.atan(0.05)\n", + "P=d/(2*R)*(W*math.tan(o1+o2)) #effort\n", + "print \"Effort is\",P,\"N\"\n", + "VR=2*3.14*R/p #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "print \"Efficiency\",Efficiency,\"%\"\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "print var\n", + "T =d/2.0*W*math.tan(o1-o2) #The torque required to keep the load from descending\n", + "print \"The torque required to keep the load from descending\",T,\"Nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.16" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 12.9110001721 %\n" + ] + } + ], + "source": [ + "import math\n", + "p1=5.0 #Pitch of smaller screw\n", + "p2=10.0 #Pitch of larger screw\n", + "R=500.0 #Lever arm length from centre of screw\n", + "W=15000.0 #Load\n", + "P=185.0 #Effort\n", + "VR=2*3.14*R/(p2-p1) #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency\",Efficiency,\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.17" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 120.0\n", + "Law of machine is P= 0.01 W + 70.0\n", + "Efficiency for first case 25.0 %\n", + "Efficiency for second case 46.875 %\n" + ] + } + ], + "source": [ + "d=200.0 #Diameter of the load drum \n", + "R = 1200.0 # Length of lever arm \n", + "T1 = 10.0 #Number of teeth on pinion, \n", + "T2 = 100.0 #Number of teeth on spur wheel\n", + "VR=R*T2/(d*T1)*2.0 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "W1 = 3000.0 #Load 1\n", + "P1= 100.0 #Effort1\n", + "\n", + "W2 = 9000.0 #Load 2\n", + "P2= 160.0 #Effort2\n", + "\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for first case\",Efficiency,\"%\"\n", + "MA=W2/P2 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for second case\",Efficiency,\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.18" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 32.0\n", + "LOad 3200.0 N\n" + ] + } + ], + "source": [ + "d=150.0 #Diameter of the load drum \n", + "R = 400.0 # Length of lever arm \n", + "T1 = 15.0 #Number of teeth on pinion, \n", + "T3 = 20.0 #Number of teeth on pinion, \n", + "T2 = 45.0 #Number of teeth on spur wheel\n", + "T4 = 40.0 #Number of teeth on spur wheel\n", + "P= 250.0 #Effort\n", + "Efficiency=0.4\n", + "VR=R*T2/(d*T1)*2.0*T4/T3 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "\n", + "W=VR*Efficiency*P #Load \n", + "\n", + "print \"LOad\",W,\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_5vrvPsl.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_5vrvPsl.ipynb new file mode 100644 index 00000000..55339520 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_5vrvPsl.ipynb @@ -0,0 +1,1593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6-SIMPLE MACHINES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 20.0\n", + "Velocity Ratio 25.0\n", + "Efficiency 0.8\n", + "Ideal Load 12500.0\n", + "Ideal Effort 400.0\n", + "Effort lost in friction 100.0\n", + "frictional resistance 2500.0\n" + ] + } + ], + "source": [ + "import math\n", + "W = 10000.0 #Load\n", + "P = 500.0 #Effort\n", + "D = 20.0 #Distance moved by the effort \n", + "d = 0.8 #Distance moved by the load \n", + "MA=W/P #Mechanical advantage\n", + "VR=D/d #Velocity Ratio\n", + "Efficiency=MA/VR\n", + "Pi =W/VR #Ideal effort\n", + "Wi = P*VR #ideal load\n", + "efl=P-Pi #Effort lost in friction\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print \"Ideal Load\",Wi\n", + "print \"Ideal Effort\",Pi\n", + "print \"Effort lost in friction\",efl\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.05 W + 30.0\n", + "Load is 3400.0 N\n", + "Mechanical advantage-- 17.0\n", + "Ideal effort is 113.333333333 N\n", + "Effort lost in friction 86.6666666667\n", + "Efficiency 56.6666666667\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 2400.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "\n", + "W2 = 3000.0 #Load 2\n", + "P2= 180.0 #Effort2\n", + "P3= 200.0 #Effort3\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "W3=(P3-C)/m #Load 2\n", + "print \"Load is \",W3,\"N\"\n", + "MA=W3/P3 #Mechanical advantage\n", + "print \"Mechanical advantage--\",MA\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100\n", + "Pi =W3/VR #Ideal effort\n", + "print \"Ideal effort is\",Pi,\"N\"\n", + "\n", + "efl=P3-Pi #Effort lost in friction\n", + "\n", + "print \"Effort lost in friction\",efl\n", + "print \"Efficiency\",Efficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 51.3333333333\n", + "Velocity Ratio 85.5555555556\n", + "Efficiency 61.7142857143\n", + "Maximum Mechanical advantage-- 55.0\n", + "Maximum Efficiency 64.2857142857\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 7700.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=0.6\n", + "VR=MA/Efficiency #Velocity Ratio\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "W2 = 13200.0 #Load 2\n", + "P2= 250.0 #Effort2\n", + "MA=W2/P2\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "\n", + "\n", + "MMA=1/m #Maximum Mechanical advantage\n", + "print \"Maximum Mechanical advantage--\",MMA\n", + "\n", + "MaxEfficiency=MMA/VR*100\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.06 W + 10.5\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('<div/>');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " this.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", + " 'ui-helper-clearfix\"/>');\n", + " var titletext = $(\n", + " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", + " 'text-align: center; padding: 3px;\"/>');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('<div/>');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('<canvas/>');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var rubberband = $('<canvas/>');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width);\n", + " canvas.attr('height', height);\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('<button/>');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('<span/>');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('<span/>');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('<span/>');\n", + "\n", + " var fmt_picker = $('<select/>');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('<span class=\"mpl-message\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "}\n", + "\n", + "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", + " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", + " // which will in turn request a refresh of the image.\n", + " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", + "}\n", + "\n", + "mpl.figure.prototype.send_message = function(type, properties) {\n", + " properties['type'] = type;\n", + " properties['figure_id'] = this.id;\n", + " this.ws.send(JSON.stringify(properties));\n", + "}\n", + "\n", + "mpl.figure.prototype.send_draw_message = function() {\n", + " if (!this.waiting) {\n", + " this.waiting = true;\n", + " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", + " }\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " var format_dropdown = fig.format_dropdown;\n", + " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", + " fig.ondownload(fig, format);\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", + " var size = msg['size'];\n", + " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", + " fig._resize_canvas(size[0], size[1]);\n", + " fig.send_message(\"refresh\", {});\n", + " };\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", + " var x0 = msg['x0'];\n", + " var y0 = fig.canvas.height - msg['y0'];\n", + " var x1 = msg['x1'];\n", + " var y1 = fig.canvas.height - msg['y1'];\n", + " x0 = Math.floor(x0) + 0.5;\n", + " y0 = Math.floor(y0) + 0.5;\n", + " x1 = Math.floor(x1) + 0.5;\n", + " y1 = Math.floor(y1) + 0.5;\n", + " var min_x = Math.min(x0, x1);\n", + " var min_y = Math.min(y0, y1);\n", + " var width = Math.abs(x1 - x0);\n", + " var height = Math.abs(y1 - y0);\n", + "\n", + " fig.rubberband_context.clearRect(\n", + " 0, 0, fig.canvas.width, fig.canvas.height);\n", + "\n", + " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", + " // Updates the figure title.\n", + " fig.header.textContent = msg['label'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", + " var cursor = msg['cursor'];\n", + " switch(cursor)\n", + " {\n", + " case 0:\n", + " cursor = 'pointer';\n", + " break;\n", + " case 1:\n", + " cursor = 'default';\n", + " break;\n", + " case 2:\n", + " cursor = 'crosshair';\n", + " break;\n", + " case 3:\n", + " cursor = 'move';\n", + " break;\n", + " }\n", + " fig.rubberband_canvas.style.cursor = cursor;\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_message = function(fig, msg) {\n", + " fig.message.textContent = msg['message'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", + " // Request the server to send over a new figure.\n", + " fig.send_draw_message();\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", + " fig.image_mode = msg['mode'];\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Called whenever the canvas gets updated.\n", + " this.send_message(\"ack\", {});\n", + "}\n", + "\n", + "// A function to construct a web socket function for onmessage handling.\n", + "// Called in the figure constructor.\n", + "mpl.figure.prototype._make_on_message_function = function(fig) {\n", + " return function socket_on_message(evt) {\n", + " if (evt.data instanceof Blob) {\n", + " /* FIXME: We get \"Resource interpreted as Image but\n", + " * transferred with MIME type text/plain:\" errors on\n", + " * Chrome. But how to set the MIME type? It doesn't seem\n", + " * to be part of the websocket stream */\n", + " evt.data.type = \"image/png\";\n", + "\n", + " /* Free the memory for the previous frames */\n", + " if (fig.imageObj.src) {\n", + " (window.URL || window.webkitURL).revokeObjectURL(\n", + " fig.imageObj.src);\n", + " }\n", + "\n", + " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", + " evt.data);\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", + " fig.imageObj.src = evt.data;\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + "\n", + " var msg = JSON.parse(evt.data);\n", + " var msg_type = msg['type'];\n", + "\n", + " // Call the \"handle_{type}\" callback, which takes\n", + " // the figure and JSON message as its only arguments.\n", + " try {\n", + " var callback = fig[\"handle_\" + msg_type];\n", + " } catch (e) {\n", + " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", + " return;\n", + " }\n", + "\n", + " if (callback) {\n", + " try {\n", + " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", + " callback(fig, msg);\n", + " } catch (e) {\n", + " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", + " }\n", + " }\n", + " };\n", + "}\n", + "\n", + "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", + "mpl.findpos = function(e) {\n", + " //this section is from http://www.quirksmode.org/js/events_properties.html\n", + " var targ;\n", + " if (!e)\n", + " e = window.event;\n", + " if (e.target)\n", + " targ = e.target;\n", + " else if (e.srcElement)\n", + " targ = e.srcElement;\n", + " if (targ.nodeType == 3) // defeat Safari bug\n", + " targ = targ.parentNode;\n", + "\n", + " // jQuery normalizes the pageX and pageY\n", + " // pageX,Y are the mouse positions relative to the document\n", + " // offset() returns the position of the element relative to the document\n", + " var x = e.pageX - $(targ).offset().left;\n", + " var y = e.pageY - $(targ).offset().top;\n", + "\n", + " return {\"x\": x, \"y\": y};\n", + "};\n", + "\n", + "/*\n", + " * return a copy of an object with only non-object keys\n", + " * we need this to avoid circular references\n", + " * http://stackoverflow.com/a/24161582/3208463\n", + " */\n", + "function simpleKeys (original) {\n", + " return Object.keys(original).reduce(function (obj, key) {\n", + " if (typeof original[key] !== 'object')\n", + " obj[key] = original[key]\n", + " return obj;\n", + " }, {});\n", + "}\n", + "\n", + "mpl.figure.prototype.mouse_event = function(event, name) {\n", + " var canvas_pos = mpl.findpos(event)\n", + "\n", + " if (name === 'button_press')\n", + " {\n", + " this.canvas.focus();\n", + " this.canvas_div.focus();\n", + " }\n", + "\n", + " var x = canvas_pos.x;\n", + " var y = canvas_pos.y;\n", + "\n", + " this.send_message(name, {x: x, y: y, button: event.button,\n", + " step: event.step,\n", + " guiEvent: simpleKeys(event)});\n", + "\n", + " /* This prevents the web browser from automatically changing to\n", + " * the text insertion cursor when the button is pressed. We want\n", + " * to control all of the cursor setting manually through the\n", + " * 'cursor' event from matplotlib */\n", + " event.preventDefault();\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " // Handle any extra behaviour associated with a key event\n", + "}\n", + "\n", + "mpl.figure.prototype.key_event = function(event, name) {\n", + "\n", + " // Prevent repeat events\n", + " if (name == 'key_press')\n", + " {\n", + " if (event.which === this._key)\n", + " return;\n", + " else\n", + " this._key = event.which;\n", + " }\n", + " if (name == 'key_release')\n", + " this._key = null;\n", + "\n", + " var value = '';\n", + " if (event.ctrlKey && event.which != 17)\n", + " value += \"ctrl+\";\n", + " if (event.altKey && event.which != 18)\n", + " value += \"alt+\";\n", + " if (event.shiftKey && event.which != 16)\n", + " value += \"shift+\";\n", + "\n", + " value += 'k';\n", + " value += event.which.toString();\n", + "\n", + " this._key_event_extra(event, name);\n", + "\n", + " this.send_message(name, {key: value,\n", + " guiEvent: simpleKeys(event)});\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", + " if (name == 'download') {\n", + " this.handle_save(this, null);\n", + " } else {\n", + " this.send_message(\"toolbar_button\", {name: name});\n", + " }\n", + "};\n", + "\n", + "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", + " this.message.textContent = tooltip;\n", + "};\n", + "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", + "\n", + "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", + "\n", + "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", + " // Create a \"websocket\"-like object which calls the given IPython comm\n", + " // object with the appropriate methods. Currently this is a non binary\n", + " // socket, so there is still some room for performance tuning.\n", + " var ws = {};\n", + "\n", + " ws.close = function() {\n", + " comm.close()\n", + " };\n", + " ws.send = function(m) {\n", + " //console.log('sending', m);\n", + " comm.send(m);\n", + " };\n", + " // Register the callback with on_msg.\n", + " comm.on_msg(function(msg) {\n", + " //console.log('receiving', msg['content']['data'], msg);\n", + " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", + " ws.onmessage(msg['content']['data'])\n", + " });\n", + " return ws;\n", + "}\n", + "\n", + "mpl.mpl_figure_comm = function(comm, msg) {\n", + " // This is the function which gets called when the mpl process\n", + " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", + "\n", + " var id = msg.content.data.id;\n", + " // Get hold of the div created by the display call when the Comm\n", + " // socket was opened in Python.\n", + " var element = $(\"#\" + id);\n", + " var ws_proxy = comm_websocket_adapter(comm)\n", + "\n", + " function ondownload(figure, format) {\n", + " window.open(figure.imageObj.src);\n", + " }\n", + "\n", + " var fig = new mpl.figure(id, ws_proxy,\n", + " ondownload,\n", + " element.get(0));\n", + "\n", + " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", + " // web socket which is closed, not our websocket->open comm proxy.\n", + " ws_proxy.onopen();\n", + "\n", + " fig.parent_element = element.get(0);\n", + " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", + " if (!fig.cell_info) {\n", + " console.error(\"Failed to find cell for figure\", id, fig);\n", + " return;\n", + " }\n", + "\n", + " var output_index = fig.cell_info[2]\n", + " var cell = fig.cell_info[0];\n", + "\n", + "};\n", + "\n", + "mpl.figure.prototype.handle_close = function(fig, msg) {\n", + " fig.root.unbind('remove')\n", + "\n", + " // Update the output cell to use the data from the current canvas.\n", + " fig.push_to_output();\n", + " var dataURL = fig.canvas.toDataURL();\n", + " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", + " // the notebook keyboard shortcuts fail.\n", + " IPython.keyboard_manager.enable()\n", + " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", + " fig.close_ws(fig, msg);\n", + "}\n", + "\n", + "mpl.figure.prototype.close_ws = function(fig, msg){\n", + " fig.send_message('closing', msg);\n", + " // fig.ws.close()\n", + "}\n", + "\n", + "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", + " // Turn the data on the canvas into data in the output cell.\n", + " var dataURL = this.canvas.toDataURL();\n", + " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Tell IPython that the notebook contents must change.\n", + " IPython.notebook.set_dirty(true);\n", + " this.send_message(\"ack\", {});\n", + " var fig = this;\n", + " // Wait a second, then push the new image to the DOM so\n", + " // that it is saved nicely (might be nice to debounce this).\n", + " setTimeout(function () { fig.push_to_output() }, 1000);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items){\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) { continue; };\n", + "\n", + " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " // Add the status bar.\n", + " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "\n", + " // Add the close button to the window.\n", + " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", + " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", + " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", + " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", + " buttongrp.append(button);\n", + " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", + " titlebar.prepend(buttongrp);\n", + "}\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(el){\n", + " var fig = this\n", + " el.on(\"remove\", function(){\n", + "\tfig.close_ws(fig, {});\n", + " });\n", + "}\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(el){\n", + " // this is important to make the div 'focusable\n", + " el.attr('tabindex', 0)\n", + " // reach out to IPython and tell the keyboard manager to turn it's self\n", + " // off when our div gets focus\n", + "\n", + " // location in version 3\n", + " if (IPython.notebook.keyboard_manager) {\n", + " IPython.notebook.keyboard_manager.register_events(el);\n", + " }\n", + " else {\n", + " // location in version 2\n", + " IPython.keyboard_manager.register_events(el);\n", + " }\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " var manager = IPython.notebook.keyboard_manager;\n", + " if (!manager)\n", + " manager = IPython.keyboard_manager;\n", + "\n", + " // Check for shift+enter\n", + " if (event.shiftKey && event.which == 13) {\n", + " this.canvas_div.blur();\n", + " event.shiftKey = false;\n", + " // Send a \"J\" for go to next cell\n", + " event.which = 74;\n", + " event.keyCode = 74;\n", + " manager.command_mode();\n", + " manager.handle_keydown(event);\n", + " }\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " fig.ondownload(fig, null);\n", + "}\n", + "\n", + "\n", + "mpl.find_output_cell = function(html_output) {\n", + " // Return the cell and output element which can be found *uniquely* in the notebook.\n", + " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", + " // IPython event is triggered only after the cells have been serialised, which for\n", + " // our purposes (turning an active figure into a static one), is too late.\n", + " var cells = IPython.notebook.get_cells();\n", + " var ncells = cells.length;\n", + " for (var i=0; i<ncells; i++) {\n", + " var cell = cells[i];\n", + " if (cell.cell_type === 'code'){\n", + " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", + " var data = cell.output_area.outputs[j];\n", + " if (data.data) {\n", + " // IPython >= 3 moved mimebundle to data attribute of output\n", + " data = data.data;\n", + " }\n", + " if (data['text/html'] == html_output) {\n", + " return [cell, data, j];\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "\n", + "// Register the function which deals with the matplotlib target/channel.\n", + "// The kernel may be null if the page has been refreshed.\n", + "if (IPython.notebook.kernel != null) {\n", + " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", + "}\n" + ], + "text/plain": [ + "<IPython.core.display.Javascript object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<img src=\"data:image/png;base64,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\">" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum Efficiency 66.6666666667\n" + ] + } + ], + "source": [ + "%matplotlib notebook\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt2\n", + "W=[100.0,200.0,300.0,400.0,500.0,600.0] #loads \n", + "P=[16.0,22.5,28.0,34.0,40.5,46.5] #Efforts\n", + "VR=25.0 #velocity ratio\n", + "E=[0,0,0,0,0,0] #Efficiency\n", + "#calculating average slope\n", + "m=(P[4]-P[1])/(W[4]-W[1])\n", + "C=P[4]-m*W[4]\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "for i in range(0,6):\n", + " \n", + " E[i]=W[i]/(25*P[i])*100 #E=W/(P*VR)\n", + " \n", + "plt2.plot(W,E)\n", + "plt2.ylabel(\"Efficiency\")\n", + "plt2.xlabel(\"Load\")\n", + "plt2.show() \n", + "\n", + " \n", + "MaxEfficiency=1/VR*100*1/m\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency\n", + "\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 13.8888888889\n", + "Velocity Ratio 30.0\n", + "Efficiency 46.2962962963\n", + "self-locking machine\n", + "Ideal Load 10800.0\n", + "frictional resistance 5800.0\n" + ] + } + ], + "source": [ + "\n", + "W = 5000.0 #Load\n", + "P = 360.0 #Effort\n", + "\n", + "MA=W/P #Mechanical advantage\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100.0\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "\n", + "\n", + "\n", + "Wi = P*VR #ideal load\n", + "\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print var\n", + "print \"Ideal Load\",Wi\n", + "\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 937.5 N\n", + "number of pulley is 4\n" + ] + } + ], + "source": [ + "import math\n", + "W = 6000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.8\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n", + "#second case\n", + "P=520.0\n", + "n=0,\n", + "for i in range(3,20):\n", + " if((P*(0.8-(i-3)*0.05)*(2**i)))>6000:\n", + " n=i\n", + " break\n", + " \n", + " \n", + "print \"number of pulley is \",n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exmple 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 2352.94117647 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N=3.0 #number of movable pulleys\n", + "VR=2*N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.85\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1923.07692308 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1\n", + "N2=2.0 #number of movable puleys in system 2\n", + "VR=2*N1+2*N2 #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.78\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 79.3650793651\n", + "Effort lost in friction 37.1428571429\n" + ] + } + ], + "source": [ + "import math\n", + "W = 1000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N-1 #Velocity Ratio\n", + "P = 180.0 #Effort\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "Pi =W/VR #Ideal effort\n", + "\n", + "efl=P-Pi #Effort lost in friction\n", + "print \"Effort lost in friction\",efl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 595.238095238 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 2500.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1 in figure B\n", + "N2=2.0 #number of movable puleys in system 2 in figure C\n", + "VR=2**N1-1+2**N2-1 #Velocity Ratio\n", + "Efficiency=0.70\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.11" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 2.3\n", + "Effort is 745.341614907 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle\n", + "tcw=6.0 #thickness of the cord on the wheel\n", + "tca=20.0 #thickness of the cord on the axle\n", + "W=1200 #effort\n", + "ED=D+tcw #Effective diameter of the wheel\n", + "Ed=d+tca #Effectivediameter of axle\n", + "VR=ED/Ed #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.7\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 32.0\n", + "Effort is 1136.36363636 N\n" + ] + } + ], + "source": [ + "D=800.0 #diameter of the wheel\n", + "d1=250.0 #diameter of axle 1\n", + "d2=300.0 #diameter of axle 2\n", + "\n", + "W=20000.0 #effort\n", + "\n", + "VR=(2*D)/(d2-d1) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.55\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 3.33333333333\n", + "Effort is 2500.0 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle \n", + "\n", + "W=5000.0 #effort\n", + "\n", + "VR=(2*D)/(D-d) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.6\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.14" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1741.88034188 N\n" + ] + } + ], + "source": [ + "D=40.0 #Screw diameter\n", + "l=20.0 #Screw lwngth\n", + "p=l/3.0 #Lead of the screw\n", + "W=40000.0 #effort\n", + "R = 400 #Lever length\n", + "u = 0.12 #coefficient of friction between screw and nut\n", + "P = (d/(2*R))*W*((u+(p/(3.14*D)))/(1-u*(p/(3.14*D)))) #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.15" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 57.0287539936 N\n", + "Efficiency 55.8439936484 %\n", + "reversible machine\n", + "The torque required to keep the load from descending 2047.61904762 Nm\n" + ] + } + ], + "source": [ + "import math\n", + "d=50.0 #mean diameter of screw\n", + "p=10.0 #pitch of screw\n", + "u=0.05 #coefficient of friction at the screw thread\n", + "R=300.0 ##Lever length\n", + "W=6000.0 #Load\n", + "o1=math.atan(p/(3.14*d))\n", + "o2=math.atan(0.05)\n", + "P=d/(2*R)*(W*math.tan(o1+o2)) #effort\n", + "print \"Effort is\",P,\"N\"\n", + "VR=2*3.14*R/p #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "print \"Efficiency\",Efficiency,\"%\"\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "print var\n", + "T =d/2.0*W*math.tan(o1-o2) #The torque required to keep the load from descending\n", + "print \"The torque required to keep the load from descending\",T,\"Nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.16" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 12.9110001721 %\n" + ] + } + ], + "source": [ + "import math\n", + "p1=5.0 #Pitch of smaller screw\n", + "p2=10.0 #Pitch of larger screw\n", + "R=500.0 #Lever arm length from centre of screw\n", + "W=15000.0 #Load\n", + "P=185.0 #Effort\n", + "VR=2*3.14*R/(p2-p1) #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency\",Efficiency,\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.17" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 120.0\n", + "Law of machine is P= 0.01 W + 70.0\n", + "Efficiency for first case 25.0 %\n", + "Efficiency for second case 46.875 %\n" + ] + } + ], + "source": [ + "d=200.0 #Diameter of the load drum \n", + "R = 1200.0 # Length of lever arm \n", + "T1 = 10.0 #Number of teeth on pinion, \n", + "T2 = 100.0 #Number of teeth on spur wheel\n", + "VR=R*T2/(d*T1)*2.0 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "W1 = 3000.0 #Load 1\n", + "P1= 100.0 #Effort1\n", + "\n", + "W2 = 9000.0 #Load 2\n", + "P2= 160.0 #Effort2\n", + "\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for first case\",Efficiency,\"%\"\n", + "MA=W2/P2 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for second case\",Efficiency,\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.18" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 32.0\n", + "LOad 3200.0 N\n" + ] + } + ], + "source": [ + "d=150.0 #Diameter of the load drum \n", + "R = 400.0 # Length of lever arm \n", + "T1 = 15.0 #Number of teeth on pinion, \n", + "T3 = 20.0 #Number of teeth on pinion, \n", + "T2 = 45.0 #Number of teeth on spur wheel\n", + "T4 = 40.0 #Number of teeth on spur wheel\n", + "P= 250.0 #Effort\n", + "Efficiency=0.4\n", + "VR=R*T2/(d*T1)*2.0*T4/T3 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "\n", + "W=VR*Efficiency*P #Load \n", + "\n", + "print \"LOad\",W,\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_RVkqLSe.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_RVkqLSe.ipynb new file mode 100644 index 00000000..55339520 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_RVkqLSe.ipynb @@ -0,0 +1,1593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6-SIMPLE MACHINES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 20.0\n", + "Velocity Ratio 25.0\n", + "Efficiency 0.8\n", + "Ideal Load 12500.0\n", + "Ideal Effort 400.0\n", + "Effort lost in friction 100.0\n", + "frictional resistance 2500.0\n" + ] + } + ], + "source": [ + "import math\n", + "W = 10000.0 #Load\n", + "P = 500.0 #Effort\n", + "D = 20.0 #Distance moved by the effort \n", + "d = 0.8 #Distance moved by the load \n", + "MA=W/P #Mechanical advantage\n", + "VR=D/d #Velocity Ratio\n", + "Efficiency=MA/VR\n", + "Pi =W/VR #Ideal effort\n", + "Wi = P*VR #ideal load\n", + "efl=P-Pi #Effort lost in friction\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print \"Ideal Load\",Wi\n", + "print \"Ideal Effort\",Pi\n", + "print \"Effort lost in friction\",efl\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.05 W + 30.0\n", + "Load is 3400.0 N\n", + "Mechanical advantage-- 17.0\n", + "Ideal effort is 113.333333333 N\n", + "Effort lost in friction 86.6666666667\n", + "Efficiency 56.6666666667\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 2400.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "\n", + "W2 = 3000.0 #Load 2\n", + "P2= 180.0 #Effort2\n", + "P3= 200.0 #Effort3\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "W3=(P3-C)/m #Load 2\n", + "print \"Load is \",W3,\"N\"\n", + "MA=W3/P3 #Mechanical advantage\n", + "print \"Mechanical advantage--\",MA\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100\n", + "Pi =W3/VR #Ideal effort\n", + "print \"Ideal effort is\",Pi,\"N\"\n", + "\n", + "efl=P3-Pi #Effort lost in friction\n", + "\n", + "print \"Effort lost in friction\",efl\n", + "print \"Efficiency\",Efficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 51.3333333333\n", + "Velocity Ratio 85.5555555556\n", + "Efficiency 61.7142857143\n", + "Maximum Mechanical advantage-- 55.0\n", + "Maximum Efficiency 64.2857142857\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 7700.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=0.6\n", + "VR=MA/Efficiency #Velocity Ratio\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "W2 = 13200.0 #Load 2\n", + "P2= 250.0 #Effort2\n", + "MA=W2/P2\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "\n", + "\n", + "MMA=1/m #Maximum Mechanical advantage\n", + "print \"Maximum Mechanical advantage--\",MMA\n", + "\n", + "MaxEfficiency=MMA/VR*100\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.06 W + 10.5\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('<div/>');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " this.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", + " 'ui-helper-clearfix\"/>');\n", + " var titletext = $(\n", + " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", + " 'text-align: center; padding: 3px;\"/>');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('<div/>');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('<canvas/>');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var rubberband = $('<canvas/>');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width);\n", + " canvas.attr('height', height);\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('<button/>');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('<span/>');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('<span/>');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('<span/>');\n", + "\n", + " var fmt_picker = $('<select/>');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('<span class=\"mpl-message\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "}\n", + "\n", + "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", + " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", + " // which will in turn request a refresh of the image.\n", + " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", + "}\n", + "\n", + "mpl.figure.prototype.send_message = function(type, properties) {\n", + " properties['type'] = type;\n", + " properties['figure_id'] = this.id;\n", + " this.ws.send(JSON.stringify(properties));\n", + "}\n", + "\n", + "mpl.figure.prototype.send_draw_message = function() {\n", + " if (!this.waiting) {\n", + " this.waiting = true;\n", + " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", + " }\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " var format_dropdown = fig.format_dropdown;\n", + " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", + " fig.ondownload(fig, format);\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", + " var size = msg['size'];\n", + " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", + " fig._resize_canvas(size[0], size[1]);\n", + " fig.send_message(\"refresh\", {});\n", + " };\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", + " var x0 = msg['x0'];\n", + " var y0 = fig.canvas.height - msg['y0'];\n", + " var x1 = msg['x1'];\n", + " var y1 = fig.canvas.height - msg['y1'];\n", + " x0 = Math.floor(x0) + 0.5;\n", + " y0 = Math.floor(y0) + 0.5;\n", + " x1 = Math.floor(x1) + 0.5;\n", + " y1 = Math.floor(y1) + 0.5;\n", + " var min_x = Math.min(x0, x1);\n", + " var min_y = Math.min(y0, y1);\n", + " var width = Math.abs(x1 - x0);\n", + " var height = Math.abs(y1 - y0);\n", + "\n", + " fig.rubberband_context.clearRect(\n", + " 0, 0, fig.canvas.width, fig.canvas.height);\n", + "\n", + " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", + " // Updates the figure title.\n", + " fig.header.textContent = msg['label'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", + " var cursor = msg['cursor'];\n", + " switch(cursor)\n", + " {\n", + " case 0:\n", + " cursor = 'pointer';\n", + " break;\n", + " case 1:\n", + " cursor = 'default';\n", + " break;\n", + " case 2:\n", + " cursor = 'crosshair';\n", + " break;\n", + " case 3:\n", + " cursor = 'move';\n", + " break;\n", + " }\n", + " fig.rubberband_canvas.style.cursor = cursor;\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_message = function(fig, msg) {\n", + " fig.message.textContent = msg['message'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", + " // Request the server to send over a new figure.\n", + " fig.send_draw_message();\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", + " fig.image_mode = msg['mode'];\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Called whenever the canvas gets updated.\n", + " this.send_message(\"ack\", {});\n", + "}\n", + "\n", + "// A function to construct a web socket function for onmessage handling.\n", + "// Called in the figure constructor.\n", + "mpl.figure.prototype._make_on_message_function = function(fig) {\n", + " return function socket_on_message(evt) {\n", + " if (evt.data instanceof Blob) {\n", + " /* FIXME: We get \"Resource interpreted as Image but\n", + " * transferred with MIME type text/plain:\" errors on\n", + " * Chrome. But how to set the MIME type? It doesn't seem\n", + " * to be part of the websocket stream */\n", + " evt.data.type = \"image/png\";\n", + "\n", + " /* Free the memory for the previous frames */\n", + " if (fig.imageObj.src) {\n", + " (window.URL || window.webkitURL).revokeObjectURL(\n", + " fig.imageObj.src);\n", + " }\n", + "\n", + " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", + " evt.data);\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", + " fig.imageObj.src = evt.data;\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + "\n", + " var msg = JSON.parse(evt.data);\n", + " var msg_type = msg['type'];\n", + "\n", + " // Call the \"handle_{type}\" callback, which takes\n", + " // the figure and JSON message as its only arguments.\n", + " try {\n", + " var callback = fig[\"handle_\" + msg_type];\n", + " } catch (e) {\n", + " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", + " return;\n", + " }\n", + "\n", + " if (callback) {\n", + " try {\n", + " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", + " callback(fig, msg);\n", + " } catch (e) {\n", + " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", + " }\n", + " }\n", + " };\n", + "}\n", + "\n", + "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", + "mpl.findpos = function(e) {\n", + " //this section is from http://www.quirksmode.org/js/events_properties.html\n", + " var targ;\n", + " if (!e)\n", + " e = window.event;\n", + " if (e.target)\n", + " targ = e.target;\n", + " else if (e.srcElement)\n", + " targ = e.srcElement;\n", + " if (targ.nodeType == 3) // defeat Safari bug\n", + " targ = targ.parentNode;\n", + "\n", + " // jQuery normalizes the pageX and pageY\n", + " // pageX,Y are the mouse positions relative to the document\n", + " // offset() returns the position of the element relative to the document\n", + " var x = e.pageX - $(targ).offset().left;\n", + " var y = e.pageY - $(targ).offset().top;\n", + "\n", + " return {\"x\": x, \"y\": y};\n", + "};\n", + "\n", + "/*\n", + " * return a copy of an object with only non-object keys\n", + " * we need this to avoid circular references\n", + " * http://stackoverflow.com/a/24161582/3208463\n", + " */\n", + "function simpleKeys (original) {\n", + " return Object.keys(original).reduce(function (obj, key) {\n", + " if (typeof original[key] !== 'object')\n", + " obj[key] = original[key]\n", + " return obj;\n", + " }, {});\n", + "}\n", + "\n", + "mpl.figure.prototype.mouse_event = function(event, name) {\n", + " var canvas_pos = mpl.findpos(event)\n", + "\n", + " if (name === 'button_press')\n", + " {\n", + " this.canvas.focus();\n", + " this.canvas_div.focus();\n", + " }\n", + "\n", + " var x = canvas_pos.x;\n", + " var y = canvas_pos.y;\n", + "\n", + " this.send_message(name, {x: x, y: y, button: event.button,\n", + " step: event.step,\n", + " guiEvent: simpleKeys(event)});\n", + "\n", + " /* This prevents the web browser from automatically changing to\n", + " * the text insertion cursor when the button is pressed. We want\n", + " * to control all of the cursor setting manually through the\n", + " * 'cursor' event from matplotlib */\n", + " event.preventDefault();\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " // Handle any extra behaviour associated with a key event\n", + "}\n", + "\n", + "mpl.figure.prototype.key_event = function(event, name) {\n", + "\n", + " // Prevent repeat events\n", + " if (name == 'key_press')\n", + " {\n", + " if (event.which === this._key)\n", + " return;\n", + " else\n", + " this._key = event.which;\n", + " }\n", + " if (name == 'key_release')\n", + " this._key = null;\n", + "\n", + " var value = '';\n", + " if (event.ctrlKey && event.which != 17)\n", + " value += \"ctrl+\";\n", + " if (event.altKey && event.which != 18)\n", + " value += \"alt+\";\n", + " if (event.shiftKey && event.which != 16)\n", + " value += \"shift+\";\n", + "\n", + " value += 'k';\n", + " value += event.which.toString();\n", + "\n", + " this._key_event_extra(event, name);\n", + "\n", + " this.send_message(name, {key: value,\n", + " guiEvent: simpleKeys(event)});\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", + " if (name == 'download') {\n", + " this.handle_save(this, null);\n", + " } else {\n", + " this.send_message(\"toolbar_button\", {name: name});\n", + " }\n", + "};\n", + "\n", + "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", + " this.message.textContent = tooltip;\n", + "};\n", + "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", + "\n", + "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", + "\n", + "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", + " // Create a \"websocket\"-like object which calls the given IPython comm\n", + " // object with the appropriate methods. Currently this is a non binary\n", + " // socket, so there is still some room for performance tuning.\n", + " var ws = {};\n", + "\n", + " ws.close = function() {\n", + " comm.close()\n", + " };\n", + " ws.send = function(m) {\n", + " //console.log('sending', m);\n", + " comm.send(m);\n", + " };\n", + " // Register the callback with on_msg.\n", + " comm.on_msg(function(msg) {\n", + " //console.log('receiving', msg['content']['data'], msg);\n", + " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", + " ws.onmessage(msg['content']['data'])\n", + " });\n", + " return ws;\n", + "}\n", + "\n", + "mpl.mpl_figure_comm = function(comm, msg) {\n", + " // This is the function which gets called when the mpl process\n", + " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", + "\n", + " var id = msg.content.data.id;\n", + " // Get hold of the div created by the display call when the Comm\n", + " // socket was opened in Python.\n", + " var element = $(\"#\" + id);\n", + " var ws_proxy = comm_websocket_adapter(comm)\n", + "\n", + " function ondownload(figure, format) {\n", + " window.open(figure.imageObj.src);\n", + " }\n", + "\n", + " var fig = new mpl.figure(id, ws_proxy,\n", + " ondownload,\n", + " element.get(0));\n", + "\n", + " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", + " // web socket which is closed, not our websocket->open comm proxy.\n", + " ws_proxy.onopen();\n", + "\n", + " fig.parent_element = element.get(0);\n", + " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", + " if (!fig.cell_info) {\n", + " console.error(\"Failed to find cell for figure\", id, fig);\n", + " return;\n", + " }\n", + "\n", + " var output_index = fig.cell_info[2]\n", + " var cell = fig.cell_info[0];\n", + "\n", + "};\n", + "\n", + "mpl.figure.prototype.handle_close = function(fig, msg) {\n", + " fig.root.unbind('remove')\n", + "\n", + " // Update the output cell to use the data from the current canvas.\n", + " fig.push_to_output();\n", + " var dataURL = fig.canvas.toDataURL();\n", + " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", + " // the notebook keyboard shortcuts fail.\n", + " IPython.keyboard_manager.enable()\n", + " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", + " fig.close_ws(fig, msg);\n", + "}\n", + "\n", + "mpl.figure.prototype.close_ws = function(fig, msg){\n", + " fig.send_message('closing', msg);\n", + " // fig.ws.close()\n", + "}\n", + "\n", + "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", + " // Turn the data on the canvas into data in the output cell.\n", + " var dataURL = this.canvas.toDataURL();\n", + " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Tell IPython that the notebook contents must change.\n", + " IPython.notebook.set_dirty(true);\n", + " this.send_message(\"ack\", {});\n", + " var fig = this;\n", + " // Wait a second, then push the new image to the DOM so\n", + " // that it is saved nicely (might be nice to debounce this).\n", + " setTimeout(function () { fig.push_to_output() }, 1000);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items){\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) { continue; };\n", + "\n", + " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " // Add the status bar.\n", + " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "\n", + " // Add the close button to the window.\n", + " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", + " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", + " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", + " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", + " buttongrp.append(button);\n", + " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", + " titlebar.prepend(buttongrp);\n", + "}\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(el){\n", + " var fig = this\n", + " el.on(\"remove\", function(){\n", + "\tfig.close_ws(fig, {});\n", + " });\n", + "}\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(el){\n", + " // this is important to make the div 'focusable\n", + " el.attr('tabindex', 0)\n", + " // reach out to IPython and tell the keyboard manager to turn it's self\n", + " // off when our div gets focus\n", + "\n", + " // location in version 3\n", + " if (IPython.notebook.keyboard_manager) {\n", + " IPython.notebook.keyboard_manager.register_events(el);\n", + " }\n", + " else {\n", + " // location in version 2\n", + " IPython.keyboard_manager.register_events(el);\n", + " }\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " var manager = IPython.notebook.keyboard_manager;\n", + " if (!manager)\n", + " manager = IPython.keyboard_manager;\n", + "\n", + " // Check for shift+enter\n", + " if (event.shiftKey && event.which == 13) {\n", + " this.canvas_div.blur();\n", + " event.shiftKey = false;\n", + " // Send a \"J\" for go to next cell\n", + " event.which = 74;\n", + " event.keyCode = 74;\n", + " manager.command_mode();\n", + " manager.handle_keydown(event);\n", + " }\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " fig.ondownload(fig, null);\n", + "}\n", + "\n", + "\n", + "mpl.find_output_cell = function(html_output) {\n", + " // Return the cell and output element which can be found *uniquely* in the notebook.\n", + " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", + " // IPython event is triggered only after the cells have been serialised, which for\n", + " // our purposes (turning an active figure into a static one), is too late.\n", + " var cells = IPython.notebook.get_cells();\n", + " var ncells = cells.length;\n", + " for (var i=0; i<ncells; i++) {\n", + " var cell = cells[i];\n", + " if (cell.cell_type === 'code'){\n", + " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", + " var data = cell.output_area.outputs[j];\n", + " if (data.data) {\n", + " // IPython >= 3 moved mimebundle to data attribute of output\n", + " data = data.data;\n", + " }\n", + " if (data['text/html'] == html_output) {\n", + " return [cell, data, j];\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "\n", + "// Register the function which deals with the matplotlib target/channel.\n", + "// The kernel may be null if the page has been refreshed.\n", + "if (IPython.notebook.kernel != null) {\n", + " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", + "}\n" + ], + "text/plain": [ + "<IPython.core.display.Javascript object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<img src=\"data:image/png;base64,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\">" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum Efficiency 66.6666666667\n" + ] + } + ], + "source": [ + "%matplotlib notebook\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt2\n", + "W=[100.0,200.0,300.0,400.0,500.0,600.0] #loads \n", + "P=[16.0,22.5,28.0,34.0,40.5,46.5] #Efforts\n", + "VR=25.0 #velocity ratio\n", + "E=[0,0,0,0,0,0] #Efficiency\n", + "#calculating average slope\n", + "m=(P[4]-P[1])/(W[4]-W[1])\n", + "C=P[4]-m*W[4]\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "for i in range(0,6):\n", + " \n", + " E[i]=W[i]/(25*P[i])*100 #E=W/(P*VR)\n", + " \n", + "plt2.plot(W,E)\n", + "plt2.ylabel(\"Efficiency\")\n", + "plt2.xlabel(\"Load\")\n", + "plt2.show() \n", + "\n", + " \n", + "MaxEfficiency=1/VR*100*1/m\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency\n", + "\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 13.8888888889\n", + "Velocity Ratio 30.0\n", + "Efficiency 46.2962962963\n", + "self-locking machine\n", + "Ideal Load 10800.0\n", + "frictional resistance 5800.0\n" + ] + } + ], + "source": [ + "\n", + "W = 5000.0 #Load\n", + "P = 360.0 #Effort\n", + "\n", + "MA=W/P #Mechanical advantage\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100.0\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "\n", + "\n", + "\n", + "Wi = P*VR #ideal load\n", + "\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print var\n", + "print \"Ideal Load\",Wi\n", + "\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 937.5 N\n", + "number of pulley is 4\n" + ] + } + ], + "source": [ + "import math\n", + "W = 6000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.8\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n", + "#second case\n", + "P=520.0\n", + "n=0,\n", + "for i in range(3,20):\n", + " if((P*(0.8-(i-3)*0.05)*(2**i)))>6000:\n", + " n=i\n", + " break\n", + " \n", + " \n", + "print \"number of pulley is \",n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exmple 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 2352.94117647 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N=3.0 #number of movable pulleys\n", + "VR=2*N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.85\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1923.07692308 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1\n", + "N2=2.0 #number of movable puleys in system 2\n", + "VR=2*N1+2*N2 #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.78\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 79.3650793651\n", + "Effort lost in friction 37.1428571429\n" + ] + } + ], + "source": [ + "import math\n", + "W = 1000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N-1 #Velocity Ratio\n", + "P = 180.0 #Effort\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "Pi =W/VR #Ideal effort\n", + "\n", + "efl=P-Pi #Effort lost in friction\n", + "print \"Effort lost in friction\",efl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 595.238095238 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 2500.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1 in figure B\n", + "N2=2.0 #number of movable puleys in system 2 in figure C\n", + "VR=2**N1-1+2**N2-1 #Velocity Ratio\n", + "Efficiency=0.70\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.11" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 2.3\n", + "Effort is 745.341614907 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle\n", + "tcw=6.0 #thickness of the cord on the wheel\n", + "tca=20.0 #thickness of the cord on the axle\n", + "W=1200 #effort\n", + "ED=D+tcw #Effective diameter of the wheel\n", + "Ed=d+tca #Effectivediameter of axle\n", + "VR=ED/Ed #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.7\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 32.0\n", + "Effort is 1136.36363636 N\n" + ] + } + ], + "source": [ + "D=800.0 #diameter of the wheel\n", + "d1=250.0 #diameter of axle 1\n", + "d2=300.0 #diameter of axle 2\n", + "\n", + "W=20000.0 #effort\n", + "\n", + "VR=(2*D)/(d2-d1) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.55\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 3.33333333333\n", + "Effort is 2500.0 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle \n", + "\n", + "W=5000.0 #effort\n", + "\n", + "VR=(2*D)/(D-d) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.6\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.14" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1741.88034188 N\n" + ] + } + ], + "source": [ + "D=40.0 #Screw diameter\n", + "l=20.0 #Screw lwngth\n", + "p=l/3.0 #Lead of the screw\n", + "W=40000.0 #effort\n", + "R = 400 #Lever length\n", + "u = 0.12 #coefficient of friction between screw and nut\n", + "P = (d/(2*R))*W*((u+(p/(3.14*D)))/(1-u*(p/(3.14*D)))) #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.15" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 57.0287539936 N\n", + "Efficiency 55.8439936484 %\n", + "reversible machine\n", + "The torque required to keep the load from descending 2047.61904762 Nm\n" + ] + } + ], + "source": [ + "import math\n", + "d=50.0 #mean diameter of screw\n", + "p=10.0 #pitch of screw\n", + "u=0.05 #coefficient of friction at the screw thread\n", + "R=300.0 ##Lever length\n", + "W=6000.0 #Load\n", + "o1=math.atan(p/(3.14*d))\n", + "o2=math.atan(0.05)\n", + "P=d/(2*R)*(W*math.tan(o1+o2)) #effort\n", + "print \"Effort is\",P,\"N\"\n", + "VR=2*3.14*R/p #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "print \"Efficiency\",Efficiency,\"%\"\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "print var\n", + "T =d/2.0*W*math.tan(o1-o2) #The torque required to keep the load from descending\n", + "print \"The torque required to keep the load from descending\",T,\"Nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.16" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 12.9110001721 %\n" + ] + } + ], + "source": [ + "import math\n", + "p1=5.0 #Pitch of smaller screw\n", + "p2=10.0 #Pitch of larger screw\n", + "R=500.0 #Lever arm length from centre of screw\n", + "W=15000.0 #Load\n", + "P=185.0 #Effort\n", + "VR=2*3.14*R/(p2-p1) #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency\",Efficiency,\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.17" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 120.0\n", + "Law of machine is P= 0.01 W + 70.0\n", + "Efficiency for first case 25.0 %\n", + "Efficiency for second case 46.875 %\n" + ] + } + ], + "source": [ + "d=200.0 #Diameter of the load drum \n", + "R = 1200.0 # Length of lever arm \n", + "T1 = 10.0 #Number of teeth on pinion, \n", + "T2 = 100.0 #Number of teeth on spur wheel\n", + "VR=R*T2/(d*T1)*2.0 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "W1 = 3000.0 #Load 1\n", + "P1= 100.0 #Effort1\n", + "\n", + "W2 = 9000.0 #Load 2\n", + "P2= 160.0 #Effort2\n", + "\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for first case\",Efficiency,\"%\"\n", + "MA=W2/P2 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for second case\",Efficiency,\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.18" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 32.0\n", + "LOad 3200.0 N\n" + ] + } + ], + "source": [ + "d=150.0 #Diameter of the load drum \n", + "R = 400.0 # Length of lever arm \n", + "T1 = 15.0 #Number of teeth on pinion, \n", + "T3 = 20.0 #Number of teeth on pinion, \n", + "T2 = 45.0 #Number of teeth on spur wheel\n", + "T4 = 40.0 #Number of teeth on spur wheel\n", + "P= 250.0 #Effort\n", + "Efficiency=0.4\n", + "VR=R*T2/(d*T1)*2.0*T4/T3 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "\n", + "W=VR*Efficiency*P #Load \n", + "\n", + "print \"LOad\",W,\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_gyVuqN8.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_gyVuqN8.ipynb new file mode 100644 index 00000000..55339520 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_gyVuqN8.ipynb @@ -0,0 +1,1593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6-SIMPLE MACHINES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 20.0\n", + "Velocity Ratio 25.0\n", + "Efficiency 0.8\n", + "Ideal Load 12500.0\n", + "Ideal Effort 400.0\n", + "Effort lost in friction 100.0\n", + "frictional resistance 2500.0\n" + ] + } + ], + "source": [ + "import math\n", + "W = 10000.0 #Load\n", + "P = 500.0 #Effort\n", + "D = 20.0 #Distance moved by the effort \n", + "d = 0.8 #Distance moved by the load \n", + "MA=W/P #Mechanical advantage\n", + "VR=D/d #Velocity Ratio\n", + "Efficiency=MA/VR\n", + "Pi =W/VR #Ideal effort\n", + "Wi = P*VR #ideal load\n", + "efl=P-Pi #Effort lost in friction\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print \"Ideal Load\",Wi\n", + "print \"Ideal Effort\",Pi\n", + "print \"Effort lost in friction\",efl\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.05 W + 30.0\n", + "Load is 3400.0 N\n", + "Mechanical advantage-- 17.0\n", + "Ideal effort is 113.333333333 N\n", + "Effort lost in friction 86.6666666667\n", + "Efficiency 56.6666666667\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 2400.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "\n", + "W2 = 3000.0 #Load 2\n", + "P2= 180.0 #Effort2\n", + "P3= 200.0 #Effort3\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "W3=(P3-C)/m #Load 2\n", + "print \"Load is \",W3,\"N\"\n", + "MA=W3/P3 #Mechanical advantage\n", + "print \"Mechanical advantage--\",MA\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100\n", + "Pi =W3/VR #Ideal effort\n", + "print \"Ideal effort is\",Pi,\"N\"\n", + "\n", + "efl=P3-Pi #Effort lost in friction\n", + "\n", + "print \"Effort lost in friction\",efl\n", + "print \"Efficiency\",Efficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 51.3333333333\n", + "Velocity Ratio 85.5555555556\n", + "Efficiency 61.7142857143\n", + "Maximum Mechanical advantage-- 55.0\n", + "Maximum Efficiency 64.2857142857\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 7700.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=0.6\n", + "VR=MA/Efficiency #Velocity Ratio\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "W2 = 13200.0 #Load 2\n", + "P2= 250.0 #Effort2\n", + "MA=W2/P2\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "\n", + "\n", + "MMA=1/m #Maximum Mechanical advantage\n", + "print \"Maximum Mechanical advantage--\",MMA\n", + "\n", + "MaxEfficiency=MMA/VR*100\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.06 W + 10.5\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('<div/>');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " this.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", + " 'ui-helper-clearfix\"/>');\n", + " var titletext = $(\n", + " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", + " 'text-align: center; padding: 3px;\"/>');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('<div/>');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('<canvas/>');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var rubberband = $('<canvas/>');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width);\n", + " canvas.attr('height', height);\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('<button/>');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('<span/>');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('<span/>');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('<span/>');\n", + "\n", + " var fmt_picker = $('<select/>');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('<span class=\"mpl-message\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "}\n", + "\n", + "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", + " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", + " // which will in turn request a refresh of the image.\n", + " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", + "}\n", + "\n", + "mpl.figure.prototype.send_message = function(type, properties) {\n", + " properties['type'] = type;\n", + " properties['figure_id'] = this.id;\n", + " this.ws.send(JSON.stringify(properties));\n", + "}\n", + "\n", + "mpl.figure.prototype.send_draw_message = function() {\n", + " if (!this.waiting) {\n", + " this.waiting = true;\n", + " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", + " }\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " var format_dropdown = fig.format_dropdown;\n", + " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", + " fig.ondownload(fig, format);\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", + " var size = msg['size'];\n", + " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", + " fig._resize_canvas(size[0], size[1]);\n", + " fig.send_message(\"refresh\", {});\n", + " };\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", + " var x0 = msg['x0'];\n", + " var y0 = fig.canvas.height - msg['y0'];\n", + " var x1 = msg['x1'];\n", + " var y1 = fig.canvas.height - msg['y1'];\n", + " x0 = Math.floor(x0) + 0.5;\n", + " y0 = Math.floor(y0) + 0.5;\n", + " x1 = Math.floor(x1) + 0.5;\n", + " y1 = Math.floor(y1) + 0.5;\n", + " var min_x = Math.min(x0, x1);\n", + " var min_y = Math.min(y0, y1);\n", + " var width = Math.abs(x1 - x0);\n", + " var height = Math.abs(y1 - y0);\n", + "\n", + " fig.rubberband_context.clearRect(\n", + " 0, 0, fig.canvas.width, fig.canvas.height);\n", + "\n", + " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", + " // Updates the figure title.\n", + " fig.header.textContent = msg['label'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", + " var cursor = msg['cursor'];\n", + " switch(cursor)\n", + " {\n", + " case 0:\n", + " cursor = 'pointer';\n", + " break;\n", + " case 1:\n", + " cursor = 'default';\n", + " break;\n", + " case 2:\n", + " cursor = 'crosshair';\n", + " break;\n", + " case 3:\n", + " cursor = 'move';\n", + " break;\n", + " }\n", + " fig.rubberband_canvas.style.cursor = cursor;\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_message = function(fig, msg) {\n", + " fig.message.textContent = msg['message'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", + " // Request the server to send over a new figure.\n", + " fig.send_draw_message();\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", + " fig.image_mode = msg['mode'];\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Called whenever the canvas gets updated.\n", + " this.send_message(\"ack\", {});\n", + "}\n", + "\n", + "// A function to construct a web socket function for onmessage handling.\n", + "// Called in the figure constructor.\n", + "mpl.figure.prototype._make_on_message_function = function(fig) {\n", + " return function socket_on_message(evt) {\n", + " if (evt.data instanceof Blob) {\n", + " /* FIXME: We get \"Resource interpreted as Image but\n", + " * transferred with MIME type text/plain:\" errors on\n", + " * Chrome. But how to set the MIME type? It doesn't seem\n", + " * to be part of the websocket stream */\n", + " evt.data.type = \"image/png\";\n", + "\n", + " /* Free the memory for the previous frames */\n", + " if (fig.imageObj.src) {\n", + " (window.URL || window.webkitURL).revokeObjectURL(\n", + " fig.imageObj.src);\n", + " }\n", + "\n", + " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", + " evt.data);\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", + " fig.imageObj.src = evt.data;\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + "\n", + " var msg = JSON.parse(evt.data);\n", + " var msg_type = msg['type'];\n", + "\n", + " // Call the \"handle_{type}\" callback, which takes\n", + " // the figure and JSON message as its only arguments.\n", + " try {\n", + " var callback = fig[\"handle_\" + msg_type];\n", + " } catch (e) {\n", + " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", + " return;\n", + " }\n", + "\n", + " if (callback) {\n", + " try {\n", + " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", + " callback(fig, msg);\n", + " } catch (e) {\n", + " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", + " }\n", + " }\n", + " };\n", + "}\n", + "\n", + "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", + "mpl.findpos = function(e) {\n", + " //this section is from http://www.quirksmode.org/js/events_properties.html\n", + " var targ;\n", + " if (!e)\n", + " e = window.event;\n", + " if (e.target)\n", + " targ = e.target;\n", + " else if (e.srcElement)\n", + " targ = e.srcElement;\n", + " if (targ.nodeType == 3) // defeat Safari bug\n", + " targ = targ.parentNode;\n", + "\n", + " // jQuery normalizes the pageX and pageY\n", + " // pageX,Y are the mouse positions relative to the document\n", + " // offset() returns the position of the element relative to the document\n", + " var x = e.pageX - $(targ).offset().left;\n", + " var y = e.pageY - $(targ).offset().top;\n", + "\n", + " return {\"x\": x, \"y\": y};\n", + "};\n", + "\n", + "/*\n", + " * return a copy of an object with only non-object keys\n", + " * we need this to avoid circular references\n", + " * http://stackoverflow.com/a/24161582/3208463\n", + " */\n", + "function simpleKeys (original) {\n", + " return Object.keys(original).reduce(function (obj, key) {\n", + " if (typeof original[key] !== 'object')\n", + " obj[key] = original[key]\n", + " return obj;\n", + " }, {});\n", + "}\n", + "\n", + "mpl.figure.prototype.mouse_event = function(event, name) {\n", + " var canvas_pos = mpl.findpos(event)\n", + "\n", + " if (name === 'button_press')\n", + " {\n", + " this.canvas.focus();\n", + " this.canvas_div.focus();\n", + " }\n", + "\n", + " var x = canvas_pos.x;\n", + " var y = canvas_pos.y;\n", + "\n", + " this.send_message(name, {x: x, y: y, button: event.button,\n", + " step: event.step,\n", + " guiEvent: simpleKeys(event)});\n", + "\n", + " /* This prevents the web browser from automatically changing to\n", + " * the text insertion cursor when the button is pressed. We want\n", + " * to control all of the cursor setting manually through the\n", + " * 'cursor' event from matplotlib */\n", + " event.preventDefault();\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " // Handle any extra behaviour associated with a key event\n", + "}\n", + "\n", + "mpl.figure.prototype.key_event = function(event, name) {\n", + "\n", + " // Prevent repeat events\n", + " if (name == 'key_press')\n", + " {\n", + " if (event.which === this._key)\n", + " return;\n", + " else\n", + " this._key = event.which;\n", + " }\n", + " if (name == 'key_release')\n", + " this._key = null;\n", + "\n", + " var value = '';\n", + " if (event.ctrlKey && event.which != 17)\n", + " value += \"ctrl+\";\n", + " if (event.altKey && event.which != 18)\n", + " value += \"alt+\";\n", + " if (event.shiftKey && event.which != 16)\n", + " value += \"shift+\";\n", + "\n", + " value += 'k';\n", + " value += event.which.toString();\n", + "\n", + " this._key_event_extra(event, name);\n", + "\n", + " this.send_message(name, {key: value,\n", + " guiEvent: simpleKeys(event)});\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", + " if (name == 'download') {\n", + " this.handle_save(this, null);\n", + " } else {\n", + " this.send_message(\"toolbar_button\", {name: name});\n", + " }\n", + "};\n", + "\n", + "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", + " this.message.textContent = tooltip;\n", + "};\n", + "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", + "\n", + "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", + "\n", + "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", + " // Create a \"websocket\"-like object which calls the given IPython comm\n", + " // object with the appropriate methods. Currently this is a non binary\n", + " // socket, so there is still some room for performance tuning.\n", + " var ws = {};\n", + "\n", + " ws.close = function() {\n", + " comm.close()\n", + " };\n", + " ws.send = function(m) {\n", + " //console.log('sending', m);\n", + " comm.send(m);\n", + " };\n", + " // Register the callback with on_msg.\n", + " comm.on_msg(function(msg) {\n", + " //console.log('receiving', msg['content']['data'], msg);\n", + " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", + " ws.onmessage(msg['content']['data'])\n", + " });\n", + " return ws;\n", + "}\n", + "\n", + "mpl.mpl_figure_comm = function(comm, msg) {\n", + " // This is the function which gets called when the mpl process\n", + " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", + "\n", + " var id = msg.content.data.id;\n", + " // Get hold of the div created by the display call when the Comm\n", + " // socket was opened in Python.\n", + " var element = $(\"#\" + id);\n", + " var ws_proxy = comm_websocket_adapter(comm)\n", + "\n", + " function ondownload(figure, format) {\n", + " window.open(figure.imageObj.src);\n", + " }\n", + "\n", + " var fig = new mpl.figure(id, ws_proxy,\n", + " ondownload,\n", + " element.get(0));\n", + "\n", + " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", + " // web socket which is closed, not our websocket->open comm proxy.\n", + " ws_proxy.onopen();\n", + "\n", + " fig.parent_element = element.get(0);\n", + " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", + " if (!fig.cell_info) {\n", + " console.error(\"Failed to find cell for figure\", id, fig);\n", + " return;\n", + " }\n", + "\n", + " var output_index = fig.cell_info[2]\n", + " var cell = fig.cell_info[0];\n", + "\n", + "};\n", + "\n", + "mpl.figure.prototype.handle_close = function(fig, msg) {\n", + " fig.root.unbind('remove')\n", + "\n", + " // Update the output cell to use the data from the current canvas.\n", + " fig.push_to_output();\n", + " var dataURL = fig.canvas.toDataURL();\n", + " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", + " // the notebook keyboard shortcuts fail.\n", + " IPython.keyboard_manager.enable()\n", + " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", + " fig.close_ws(fig, msg);\n", + "}\n", + "\n", + "mpl.figure.prototype.close_ws = function(fig, msg){\n", + " fig.send_message('closing', msg);\n", + " // fig.ws.close()\n", + "}\n", + "\n", + "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", + " // Turn the data on the canvas into data in the output cell.\n", + " var dataURL = this.canvas.toDataURL();\n", + " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Tell IPython that the notebook contents must change.\n", + " IPython.notebook.set_dirty(true);\n", + " this.send_message(\"ack\", {});\n", + " var fig = this;\n", + " // Wait a second, then push the new image to the DOM so\n", + " // that it is saved nicely (might be nice to debounce this).\n", + " setTimeout(function () { fig.push_to_output() }, 1000);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items){\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) { continue; };\n", + "\n", + " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " // Add the status bar.\n", + " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "\n", + " // Add the close button to the window.\n", + " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", + " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", + " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", + " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", + " buttongrp.append(button);\n", + " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", + " titlebar.prepend(buttongrp);\n", + "}\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(el){\n", + " var fig = this\n", + " el.on(\"remove\", function(){\n", + "\tfig.close_ws(fig, {});\n", + " });\n", + "}\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(el){\n", + " // this is important to make the div 'focusable\n", + " el.attr('tabindex', 0)\n", + " // reach out to IPython and tell the keyboard manager to turn it's self\n", + " // off when our div gets focus\n", + "\n", + " // location in version 3\n", + " if (IPython.notebook.keyboard_manager) {\n", + " IPython.notebook.keyboard_manager.register_events(el);\n", + " }\n", + " else {\n", + " // location in version 2\n", + " IPython.keyboard_manager.register_events(el);\n", + " }\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " var manager = IPython.notebook.keyboard_manager;\n", + " if (!manager)\n", + " manager = IPython.keyboard_manager;\n", + "\n", + " // Check for shift+enter\n", + " if (event.shiftKey && event.which == 13) {\n", + " this.canvas_div.blur();\n", + " event.shiftKey = false;\n", + " // Send a \"J\" for go to next cell\n", + " event.which = 74;\n", + " event.keyCode = 74;\n", + " manager.command_mode();\n", + " manager.handle_keydown(event);\n", + " }\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " fig.ondownload(fig, null);\n", + "}\n", + "\n", + "\n", + "mpl.find_output_cell = function(html_output) {\n", + " // Return the cell and output element which can be found *uniquely* in the notebook.\n", + " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", + " // IPython event is triggered only after the cells have been serialised, which for\n", + " // our purposes (turning an active figure into a static one), is too late.\n", + " var cells = IPython.notebook.get_cells();\n", + " var ncells = cells.length;\n", + " for (var i=0; i<ncells; i++) {\n", + " var cell = cells[i];\n", + " if (cell.cell_type === 'code'){\n", + " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", + " var data = cell.output_area.outputs[j];\n", + " if (data.data) {\n", + " // IPython >= 3 moved mimebundle to data attribute of output\n", + " data = data.data;\n", + " }\n", + " if (data['text/html'] == html_output) {\n", + " return [cell, data, j];\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "\n", + "// Register the function which deals with the matplotlib target/channel.\n", + "// The kernel may be null if the page has been refreshed.\n", + "if (IPython.notebook.kernel != null) {\n", + " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", + "}\n" + ], + "text/plain": [ + "<IPython.core.display.Javascript object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<img src=\"data:image/png;base64,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\">" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum Efficiency 66.6666666667\n" + ] + } + ], + "source": [ + "%matplotlib notebook\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt2\n", + "W=[100.0,200.0,300.0,400.0,500.0,600.0] #loads \n", + "P=[16.0,22.5,28.0,34.0,40.5,46.5] #Efforts\n", + "VR=25.0 #velocity ratio\n", + "E=[0,0,0,0,0,0] #Efficiency\n", + "#calculating average slope\n", + "m=(P[4]-P[1])/(W[4]-W[1])\n", + "C=P[4]-m*W[4]\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "for i in range(0,6):\n", + " \n", + " E[i]=W[i]/(25*P[i])*100 #E=W/(P*VR)\n", + " \n", + "plt2.plot(W,E)\n", + "plt2.ylabel(\"Efficiency\")\n", + "plt2.xlabel(\"Load\")\n", + "plt2.show() \n", + "\n", + " \n", + "MaxEfficiency=1/VR*100*1/m\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency\n", + "\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 13.8888888889\n", + "Velocity Ratio 30.0\n", + "Efficiency 46.2962962963\n", + "self-locking machine\n", + "Ideal Load 10800.0\n", + "frictional resistance 5800.0\n" + ] + } + ], + "source": [ + "\n", + "W = 5000.0 #Load\n", + "P = 360.0 #Effort\n", + "\n", + "MA=W/P #Mechanical advantage\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100.0\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "\n", + "\n", + "\n", + "Wi = P*VR #ideal load\n", + "\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print var\n", + "print \"Ideal Load\",Wi\n", + "\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 937.5 N\n", + "number of pulley is 4\n" + ] + } + ], + "source": [ + "import math\n", + "W = 6000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.8\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n", + "#second case\n", + "P=520.0\n", + "n=0,\n", + "for i in range(3,20):\n", + " if((P*(0.8-(i-3)*0.05)*(2**i)))>6000:\n", + " n=i\n", + " break\n", + " \n", + " \n", + "print \"number of pulley is \",n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exmple 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 2352.94117647 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N=3.0 #number of movable pulleys\n", + "VR=2*N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.85\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1923.07692308 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1\n", + "N2=2.0 #number of movable puleys in system 2\n", + "VR=2*N1+2*N2 #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.78\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 79.3650793651\n", + "Effort lost in friction 37.1428571429\n" + ] + } + ], + "source": [ + "import math\n", + "W = 1000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N-1 #Velocity Ratio\n", + "P = 180.0 #Effort\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "Pi =W/VR #Ideal effort\n", + "\n", + "efl=P-Pi #Effort lost in friction\n", + "print \"Effort lost in friction\",efl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 595.238095238 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 2500.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1 in figure B\n", + "N2=2.0 #number of movable puleys in system 2 in figure C\n", + "VR=2**N1-1+2**N2-1 #Velocity Ratio\n", + "Efficiency=0.70\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.11" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 2.3\n", + "Effort is 745.341614907 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle\n", + "tcw=6.0 #thickness of the cord on the wheel\n", + "tca=20.0 #thickness of the cord on the axle\n", + "W=1200 #effort\n", + "ED=D+tcw #Effective diameter of the wheel\n", + "Ed=d+tca #Effectivediameter of axle\n", + "VR=ED/Ed #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.7\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 32.0\n", + "Effort is 1136.36363636 N\n" + ] + } + ], + "source": [ + "D=800.0 #diameter of the wheel\n", + "d1=250.0 #diameter of axle 1\n", + "d2=300.0 #diameter of axle 2\n", + "\n", + "W=20000.0 #effort\n", + "\n", + "VR=(2*D)/(d2-d1) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.55\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 3.33333333333\n", + "Effort is 2500.0 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle \n", + "\n", + "W=5000.0 #effort\n", + "\n", + "VR=(2*D)/(D-d) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.6\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.14" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1741.88034188 N\n" + ] + } + ], + "source": [ + "D=40.0 #Screw diameter\n", + "l=20.0 #Screw lwngth\n", + "p=l/3.0 #Lead of the screw\n", + "W=40000.0 #effort\n", + "R = 400 #Lever length\n", + "u = 0.12 #coefficient of friction between screw and nut\n", + "P = (d/(2*R))*W*((u+(p/(3.14*D)))/(1-u*(p/(3.14*D)))) #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.15" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 57.0287539936 N\n", + "Efficiency 55.8439936484 %\n", + "reversible machine\n", + "The torque required to keep the load from descending 2047.61904762 Nm\n" + ] + } + ], + "source": [ + "import math\n", + "d=50.0 #mean diameter of screw\n", + "p=10.0 #pitch of screw\n", + "u=0.05 #coefficient of friction at the screw thread\n", + "R=300.0 ##Lever length\n", + "W=6000.0 #Load\n", + "o1=math.atan(p/(3.14*d))\n", + "o2=math.atan(0.05)\n", + "P=d/(2*R)*(W*math.tan(o1+o2)) #effort\n", + "print \"Effort is\",P,\"N\"\n", + "VR=2*3.14*R/p #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "print \"Efficiency\",Efficiency,\"%\"\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "print var\n", + "T =d/2.0*W*math.tan(o1-o2) #The torque required to keep the load from descending\n", + "print \"The torque required to keep the load from descending\",T,\"Nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.16" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 12.9110001721 %\n" + ] + } + ], + "source": [ + "import math\n", + "p1=5.0 #Pitch of smaller screw\n", + "p2=10.0 #Pitch of larger screw\n", + "R=500.0 #Lever arm length from centre of screw\n", + "W=15000.0 #Load\n", + "P=185.0 #Effort\n", + "VR=2*3.14*R/(p2-p1) #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency\",Efficiency,\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.17" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 120.0\n", + "Law of machine is P= 0.01 W + 70.0\n", + "Efficiency for first case 25.0 %\n", + "Efficiency for second case 46.875 %\n" + ] + } + ], + "source": [ + "d=200.0 #Diameter of the load drum \n", + "R = 1200.0 # Length of lever arm \n", + "T1 = 10.0 #Number of teeth on pinion, \n", + "T2 = 100.0 #Number of teeth on spur wheel\n", + "VR=R*T2/(d*T1)*2.0 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "W1 = 3000.0 #Load 1\n", + "P1= 100.0 #Effort1\n", + "\n", + "W2 = 9000.0 #Load 2\n", + "P2= 160.0 #Effort2\n", + "\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for first case\",Efficiency,\"%\"\n", + "MA=W2/P2 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for second case\",Efficiency,\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.18" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 32.0\n", + "LOad 3200.0 N\n" + ] + } + ], + "source": [ + "d=150.0 #Diameter of the load drum \n", + "R = 400.0 # Length of lever arm \n", + "T1 = 15.0 #Number of teeth on pinion, \n", + "T3 = 20.0 #Number of teeth on pinion, \n", + "T2 = 45.0 #Number of teeth on spur wheel\n", + "T4 = 40.0 #Number of teeth on spur wheel\n", + "P= 250.0 #Effort\n", + "Efficiency=0.4\n", + "VR=R*T2/(d*T1)*2.0*T4/T3 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "\n", + "W=VR*Efficiency*P #Load \n", + "\n", + "print \"LOad\",W,\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_jOUBDFo.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_jOUBDFo.ipynb new file mode 100644 index 00000000..55339520 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_jOUBDFo.ipynb @@ -0,0 +1,1593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6-SIMPLE MACHINES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 20.0\n", + "Velocity Ratio 25.0\n", + "Efficiency 0.8\n", + "Ideal Load 12500.0\n", + "Ideal Effort 400.0\n", + "Effort lost in friction 100.0\n", + "frictional resistance 2500.0\n" + ] + } + ], + "source": [ + "import math\n", + "W = 10000.0 #Load\n", + "P = 500.0 #Effort\n", + "D = 20.0 #Distance moved by the effort \n", + "d = 0.8 #Distance moved by the load \n", + "MA=W/P #Mechanical advantage\n", + "VR=D/d #Velocity Ratio\n", + "Efficiency=MA/VR\n", + "Pi =W/VR #Ideal effort\n", + "Wi = P*VR #ideal load\n", + "efl=P-Pi #Effort lost in friction\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print \"Ideal Load\",Wi\n", + "print \"Ideal Effort\",Pi\n", + "print \"Effort lost in friction\",efl\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.05 W + 30.0\n", + "Load is 3400.0 N\n", + "Mechanical advantage-- 17.0\n", + "Ideal effort is 113.333333333 N\n", + "Effort lost in friction 86.6666666667\n", + "Efficiency 56.6666666667\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 2400.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "\n", + "W2 = 3000.0 #Load 2\n", + "P2= 180.0 #Effort2\n", + "P3= 200.0 #Effort3\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "W3=(P3-C)/m #Load 2\n", + "print \"Load is \",W3,\"N\"\n", + "MA=W3/P3 #Mechanical advantage\n", + "print \"Mechanical advantage--\",MA\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100\n", + "Pi =W3/VR #Ideal effort\n", + "print \"Ideal effort is\",Pi,\"N\"\n", + "\n", + "efl=P3-Pi #Effort lost in friction\n", + "\n", + "print \"Effort lost in friction\",efl\n", + "print \"Efficiency\",Efficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 51.3333333333\n", + "Velocity Ratio 85.5555555556\n", + "Efficiency 61.7142857143\n", + "Maximum Mechanical advantage-- 55.0\n", + "Maximum Efficiency 64.2857142857\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 7700.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=0.6\n", + "VR=MA/Efficiency #Velocity Ratio\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "W2 = 13200.0 #Load 2\n", + "P2= 250.0 #Effort2\n", + "MA=W2/P2\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "\n", + "\n", + "MMA=1/m #Maximum Mechanical advantage\n", + "print \"Maximum Mechanical advantage--\",MMA\n", + "\n", + "MaxEfficiency=MMA/VR*100\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.06 W + 10.5\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('<div/>');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " this.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", + " 'ui-helper-clearfix\"/>');\n", + " var titletext = $(\n", + " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", + " 'text-align: center; padding: 3px;\"/>');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('<div/>');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('<canvas/>');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var rubberband = $('<canvas/>');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width);\n", + " canvas.attr('height', height);\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('<button/>');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('<span/>');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('<span/>');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('<span/>');\n", + "\n", + " var fmt_picker = $('<select/>');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('<span class=\"mpl-message\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "}\n", + "\n", + "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", + " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", + " // which will in turn request a refresh of the image.\n", + " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", + "}\n", + "\n", + "mpl.figure.prototype.send_message = function(type, properties) {\n", + " properties['type'] = type;\n", + " properties['figure_id'] = this.id;\n", + " this.ws.send(JSON.stringify(properties));\n", + "}\n", + "\n", + "mpl.figure.prototype.send_draw_message = function() {\n", + " if (!this.waiting) {\n", + " this.waiting = true;\n", + " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", + " }\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " var format_dropdown = fig.format_dropdown;\n", + " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", + " fig.ondownload(fig, format);\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", + " var size = msg['size'];\n", + " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", + " fig._resize_canvas(size[0], size[1]);\n", + " fig.send_message(\"refresh\", {});\n", + " };\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", + " var x0 = msg['x0'];\n", + " var y0 = fig.canvas.height - msg['y0'];\n", + " var x1 = msg['x1'];\n", + " var y1 = fig.canvas.height - msg['y1'];\n", + " x0 = Math.floor(x0) + 0.5;\n", + " y0 = Math.floor(y0) + 0.5;\n", + " x1 = Math.floor(x1) + 0.5;\n", + " y1 = Math.floor(y1) + 0.5;\n", + " var min_x = Math.min(x0, x1);\n", + " var min_y = Math.min(y0, y1);\n", + " var width = Math.abs(x1 - x0);\n", + " var height = Math.abs(y1 - y0);\n", + "\n", + " fig.rubberband_context.clearRect(\n", + " 0, 0, fig.canvas.width, fig.canvas.height);\n", + "\n", + " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", + " // Updates the figure title.\n", + " fig.header.textContent = msg['label'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", + " var cursor = msg['cursor'];\n", + " switch(cursor)\n", + " {\n", + " case 0:\n", + " cursor = 'pointer';\n", + " break;\n", + " case 1:\n", + " cursor = 'default';\n", + " break;\n", + " case 2:\n", + " cursor = 'crosshair';\n", + " break;\n", + " case 3:\n", + " cursor = 'move';\n", + " break;\n", + " }\n", + " fig.rubberband_canvas.style.cursor = cursor;\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_message = function(fig, msg) {\n", + " fig.message.textContent = msg['message'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", + " // Request the server to send over a new figure.\n", + " fig.send_draw_message();\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", + " fig.image_mode = msg['mode'];\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Called whenever the canvas gets updated.\n", + " this.send_message(\"ack\", {});\n", + "}\n", + "\n", + "// A function to construct a web socket function for onmessage handling.\n", + "// Called in the figure constructor.\n", + "mpl.figure.prototype._make_on_message_function = function(fig) {\n", + " return function socket_on_message(evt) {\n", + " if (evt.data instanceof Blob) {\n", + " /* FIXME: We get \"Resource interpreted as Image but\n", + " * transferred with MIME type text/plain:\" errors on\n", + " * Chrome. But how to set the MIME type? It doesn't seem\n", + " * to be part of the websocket stream */\n", + " evt.data.type = \"image/png\";\n", + "\n", + " /* Free the memory for the previous frames */\n", + " if (fig.imageObj.src) {\n", + " (window.URL || window.webkitURL).revokeObjectURL(\n", + " fig.imageObj.src);\n", + " }\n", + "\n", + " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", + " evt.data);\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", + " fig.imageObj.src = evt.data;\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + "\n", + " var msg = JSON.parse(evt.data);\n", + " var msg_type = msg['type'];\n", + "\n", + " // Call the \"handle_{type}\" callback, which takes\n", + " // the figure and JSON message as its only arguments.\n", + " try {\n", + " var callback = fig[\"handle_\" + msg_type];\n", + " } catch (e) {\n", + " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", + " return;\n", + " }\n", + "\n", + " if (callback) {\n", + " try {\n", + " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", + " callback(fig, msg);\n", + " } catch (e) {\n", + " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", + " }\n", + " }\n", + " };\n", + "}\n", + "\n", + "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", + "mpl.findpos = function(e) {\n", + " //this section is from http://www.quirksmode.org/js/events_properties.html\n", + " var targ;\n", + " if (!e)\n", + " e = window.event;\n", + " if (e.target)\n", + " targ = e.target;\n", + " else if (e.srcElement)\n", + " targ = e.srcElement;\n", + " if (targ.nodeType == 3) // defeat Safari bug\n", + " targ = targ.parentNode;\n", + "\n", + " // jQuery normalizes the pageX and pageY\n", + " // pageX,Y are the mouse positions relative to the document\n", + " // offset() returns the position of the element relative to the document\n", + " var x = e.pageX - $(targ).offset().left;\n", + " var y = e.pageY - $(targ).offset().top;\n", + "\n", + " return {\"x\": x, \"y\": y};\n", + "};\n", + "\n", + "/*\n", + " * return a copy of an object with only non-object keys\n", + " * we need this to avoid circular references\n", + " * http://stackoverflow.com/a/24161582/3208463\n", + " */\n", + "function simpleKeys (original) {\n", + " return Object.keys(original).reduce(function (obj, key) {\n", + " if (typeof original[key] !== 'object')\n", + " obj[key] = original[key]\n", + " return obj;\n", + " }, {});\n", + "}\n", + "\n", + "mpl.figure.prototype.mouse_event = function(event, name) {\n", + " var canvas_pos = mpl.findpos(event)\n", + "\n", + " if (name === 'button_press')\n", + " {\n", + " this.canvas.focus();\n", + " this.canvas_div.focus();\n", + " }\n", + "\n", + " var x = canvas_pos.x;\n", + " var y = canvas_pos.y;\n", + "\n", + " this.send_message(name, {x: x, y: y, button: event.button,\n", + " step: event.step,\n", + " guiEvent: simpleKeys(event)});\n", + "\n", + " /* This prevents the web browser from automatically changing to\n", + " * the text insertion cursor when the button is pressed. We want\n", + " * to control all of the cursor setting manually through the\n", + " * 'cursor' event from matplotlib */\n", + " event.preventDefault();\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " // Handle any extra behaviour associated with a key event\n", + "}\n", + "\n", + "mpl.figure.prototype.key_event = function(event, name) {\n", + "\n", + " // Prevent repeat events\n", + " if (name == 'key_press')\n", + " {\n", + " if (event.which === this._key)\n", + " return;\n", + " else\n", + " this._key = event.which;\n", + " }\n", + " if (name == 'key_release')\n", + " this._key = null;\n", + "\n", + " var value = '';\n", + " if (event.ctrlKey && event.which != 17)\n", + " value += \"ctrl+\";\n", + " if (event.altKey && event.which != 18)\n", + " value += \"alt+\";\n", + " if (event.shiftKey && event.which != 16)\n", + " value += \"shift+\";\n", + "\n", + " value += 'k';\n", + " value += event.which.toString();\n", + "\n", + " this._key_event_extra(event, name);\n", + "\n", + " this.send_message(name, {key: value,\n", + " guiEvent: simpleKeys(event)});\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", + " if (name == 'download') {\n", + " this.handle_save(this, null);\n", + " } else {\n", + " this.send_message(\"toolbar_button\", {name: name});\n", + " }\n", + "};\n", + "\n", + "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", + " this.message.textContent = tooltip;\n", + "};\n", + "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", + "\n", + "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", + "\n", + "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", + " // Create a \"websocket\"-like object which calls the given IPython comm\n", + " // object with the appropriate methods. Currently this is a non binary\n", + " // socket, so there is still some room for performance tuning.\n", + " var ws = {};\n", + "\n", + " ws.close = function() {\n", + " comm.close()\n", + " };\n", + " ws.send = function(m) {\n", + " //console.log('sending', m);\n", + " comm.send(m);\n", + " };\n", + " // Register the callback with on_msg.\n", + " comm.on_msg(function(msg) {\n", + " //console.log('receiving', msg['content']['data'], msg);\n", + " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", + " ws.onmessage(msg['content']['data'])\n", + " });\n", + " return ws;\n", + "}\n", + "\n", + "mpl.mpl_figure_comm = function(comm, msg) {\n", + " // This is the function which gets called when the mpl process\n", + " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", + "\n", + " var id = msg.content.data.id;\n", + " // Get hold of the div created by the display call when the Comm\n", + " // socket was opened in Python.\n", + " var element = $(\"#\" + id);\n", + " var ws_proxy = comm_websocket_adapter(comm)\n", + "\n", + " function ondownload(figure, format) {\n", + " window.open(figure.imageObj.src);\n", + " }\n", + "\n", + " var fig = new mpl.figure(id, ws_proxy,\n", + " ondownload,\n", + " element.get(0));\n", + "\n", + " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", + " // web socket which is closed, not our websocket->open comm proxy.\n", + " ws_proxy.onopen();\n", + "\n", + " fig.parent_element = element.get(0);\n", + " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", + " if (!fig.cell_info) {\n", + " console.error(\"Failed to find cell for figure\", id, fig);\n", + " return;\n", + " }\n", + "\n", + " var output_index = fig.cell_info[2]\n", + " var cell = fig.cell_info[0];\n", + "\n", + "};\n", + "\n", + "mpl.figure.prototype.handle_close = function(fig, msg) {\n", + " fig.root.unbind('remove')\n", + "\n", + " // Update the output cell to use the data from the current canvas.\n", + " fig.push_to_output();\n", + " var dataURL = fig.canvas.toDataURL();\n", + " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", + " // the notebook keyboard shortcuts fail.\n", + " IPython.keyboard_manager.enable()\n", + " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", + " fig.close_ws(fig, msg);\n", + "}\n", + "\n", + "mpl.figure.prototype.close_ws = function(fig, msg){\n", + " fig.send_message('closing', msg);\n", + " // fig.ws.close()\n", + "}\n", + "\n", + "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", + " // Turn the data on the canvas into data in the output cell.\n", + " var dataURL = this.canvas.toDataURL();\n", + " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Tell IPython that the notebook contents must change.\n", + " IPython.notebook.set_dirty(true);\n", + " this.send_message(\"ack\", {});\n", + " var fig = this;\n", + " // Wait a second, then push the new image to the DOM so\n", + " // that it is saved nicely (might be nice to debounce this).\n", + " setTimeout(function () { fig.push_to_output() }, 1000);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items){\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) { continue; };\n", + "\n", + " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " // Add the status bar.\n", + " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "\n", + " // Add the close button to the window.\n", + " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", + " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", + " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", + " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", + " buttongrp.append(button);\n", + " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", + " titlebar.prepend(buttongrp);\n", + "}\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(el){\n", + " var fig = this\n", + " el.on(\"remove\", function(){\n", + "\tfig.close_ws(fig, {});\n", + " });\n", + "}\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(el){\n", + " // this is important to make the div 'focusable\n", + " el.attr('tabindex', 0)\n", + " // reach out to IPython and tell the keyboard manager to turn it's self\n", + " // off when our div gets focus\n", + "\n", + " // location in version 3\n", + " if (IPython.notebook.keyboard_manager) {\n", + " IPython.notebook.keyboard_manager.register_events(el);\n", + " }\n", + " else {\n", + " // location in version 2\n", + " IPython.keyboard_manager.register_events(el);\n", + " }\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " var manager = IPython.notebook.keyboard_manager;\n", + " if (!manager)\n", + " manager = IPython.keyboard_manager;\n", + "\n", + " // Check for shift+enter\n", + " if (event.shiftKey && event.which == 13) {\n", + " this.canvas_div.blur();\n", + " event.shiftKey = false;\n", + " // Send a \"J\" for go to next cell\n", + " event.which = 74;\n", + " event.keyCode = 74;\n", + " manager.command_mode();\n", + " manager.handle_keydown(event);\n", + " }\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " fig.ondownload(fig, null);\n", + "}\n", + "\n", + "\n", + "mpl.find_output_cell = function(html_output) {\n", + " // Return the cell and output element which can be found *uniquely* in the notebook.\n", + " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", + " // IPython event is triggered only after the cells have been serialised, which for\n", + " // our purposes (turning an active figure into a static one), is too late.\n", + " var cells = IPython.notebook.get_cells();\n", + " var ncells = cells.length;\n", + " for (var i=0; i<ncells; i++) {\n", + " var cell = cells[i];\n", + " if (cell.cell_type === 'code'){\n", + " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", + " var data = cell.output_area.outputs[j];\n", + " if (data.data) {\n", + " // IPython >= 3 moved mimebundle to data attribute of output\n", + " data = data.data;\n", + " }\n", + " if (data['text/html'] == html_output) {\n", + " return [cell, data, j];\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "\n", + "// Register the function which deals with the matplotlib target/channel.\n", + "// The kernel may be null if the page has been refreshed.\n", + "if (IPython.notebook.kernel != null) {\n", + " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", + "}\n" + ], + "text/plain": [ + "<IPython.core.display.Javascript object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADQfSURBVHhe7d0HnFTV/f7xh1AtgF1BjVgwYlQUYwdsCCiWxEhQUESDooLlL1YERCXEFjtElIgiKPyMvQREEQRbFAto7DGKomIBFkRZYPf//c65I8tKn92Ze+d+3q/X85uZM6O/uBd2nz3nnnsFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoFhcbllsKbHMix5HWbLKLAssFd//rQUAAAAJ5QXw+fB0ubwAHhyeAgAAFJ9fRY9YVo3oEQAAoOiktQDuYfna8onFl3+bWCoaafnG8pqluw8AAAAUizTOdO1s8XP7ZlgaWa6z7GvZzeLn/vny74uWJZbDLF4QL7UMtVTmX7/GFv/3AQCA5KhvmWkpz7xKGZY6pTqWuZajLM/4QCX9LW0tLTOvlrWl5fPwFAAAJMxWli/C03ShAC4tgEdbxvtAJV4A21kOyLxaVgPL3BkzZqhBA3+KQurTp48GDRoUvUIhcSziheMRHxyLeCgpKdHWW2/tTxv6S3+SNmksgB0tEyzfWTa3+BKwz+7tatnR4l+T6RbfDXyo5X6Ll8DBlsoyBdBQAGPg/PPP1w033BC9QiFxLOKF4xEfHIt48ALYsKF3v/QWwDRuAjnR8h/LfItv8qhpaWP5weJLur4BxMuhbwK5xnKJZXnlDwAAIJHSWACPsfjM3/oWn//tYvmvxT1h8U0iPp23kcV3C99pQQK0a+cr9YgDjkW8cDzig2OBuOAcwNywBAwAQMKwBMyFoAEAAFKHAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAACkyqxZ0ZMUowACAICitmSJ9PLLUv/+0l57STvuGL2RYhRAAABQdL79Vho1SurSRdp8c+mII6QPP5TOOSc8pl2N6BFrp4FlrlGDBv4UAAAUQlmZ9Prr0lNPhbz2mtS8uXT44aH87b23VKtW+GxJSYkaNmzoT/3/lPiTtKEA5oYCCABAgcyeLT39dCh8Y8dKCxdKbduG0te+vdSoUfTBSiiAFMBcUQABAMiT8nLpzTelf/0rlD4/r++3vw0zfF769ttPql07+vBKUAApgLmiAAIAUI3sR6zGjw+lzzNvnnTYYaH0+SzfVltFH1wDFEAKYK4ogAAAVCGf5Xv77TDD54XvhRfCrl0vfJ4DDpDq1Ik+vJYogBTAXFEAAQDIkc/qPfvs0tL3/ffSoYcuXdrdZpvog1WEAkgBzBUFEACANeSzfO+9FwqfZ/Jkabvtlu7YbdVKqlcv+nA1oABSAHNFAQQAYDX88IP03HNLS9/XX0uHHBJKn2f77aMP5gEFkAKYKwogAADL4bN8fsHl7I7dSZOkLbeUOnQIhe+gg6R11ok+nGcUQApgriiAAABEfvxRmjhxaembMSMUvey5fE2bWvGIQfOgAFIAc0UBBACk2n//G8qel74JE5beds1z8MHSeutFH4wRCiAFMFcUQABAqvjdNp5/fmnp8wLomzaypW+nneIxy7cyFEAKYK4ogACAovfpp0uXdf1yLRtttHTHrl+upX796IMJQQGkAOaKAggAKDqlpeECzF74PB98EC7AnC19u+wS/1m+laEASr+KHtPkcstiix/wedHjKEvWbpZJlvmWzy3+eQAAitoXX0jDhknHHittvLHUuXO4IPMVV0jffBM2d1x8sbTrrskufwjSWADdixafsvNJa3/sYnHrW8ZaJls2srS3dLecawEAoGgsWhTO5bv0Uql583C3jbvvln73uzA+c6b0j39Ixx0nbbBB9A+haKS1AK7IHy3+NelvKbW8bbnO0ssCAECiffmlNHy49Kc/SZtuGsqdF70+faRZs6QpU8LzPfZglq/YpbUA2h9tfW35xOLLv00szn4H0huWssyr4FXLdhafHQQAIDGWLJFefFHq21fac09pq62koUPDOXzPPCN99ZV0zz1Sp05hYwfSI40F8AHLzpbNLftbyi3jLetafDl4jqWi2dEjuzwAALHnM3n33iudcEKY5Tv6aOmTT6Tzzw+3X3v5Zal//7DU+yvWAVOLCV6pjmWu5SjLEZZmlsMtWftZplh8p5BvDKnIS+Hcnj17qk4d/9dI7dq1ywQAgHwoK5Nee23pjt2pU6UWLZbu2N1rL6lmzejDKTZu3LhMXGlpqQYPHuxPuQxMimULoP2OpEaWay2NLdllYN8A4ucANs28WlamAHIZGABAPn33nReacG2+sWOlxYt9AiKUvvbtw904sGJcBiadS8AdLRuHp5ll4GGWLy2+M/ghyxLLFZZ6ll0tvS23WQAAKAif5fOZvYEDpf33DwXvuuukX/9aevjhcJmW0aOlk0+m/GH1pHEG8FHLvha/O6Gf3/e8pZ/lvxa3i2WIZU+Lzwz+3XKVZXmYAQQAVIvZ9hNq/Pgwy+dZsEBq2zYs6/osX2Nfq8JaYQaQJeBcUQABAFWivFyaNm3puXwvvSQ1axYKn8dn/mrXjj6MnFAAKYC5ogACANaa9ZDM5Vi88Pksn/04UZs2ofD5+Xxbbx19EFWKAkgBzBUFEACw2nyW7513Qtnz0ucXXm7adOmO3ZYtpbp1ow+j2lAAKYC5ogACAFbqxx+lCROkxx8Ppe/bb6VDDw2lz7PtttEHkTcUQApgriiAAIBf8FuuPfFEKH2+xOs7c486SurQQTrwQKmeX2cCBUMBpADmigIIAMgs7b7xRih8Xvz8+T77hNLn2Xln+4HLT9zYoABSAHNFAQSAlPKl3WefDYXPY50iczFmL3y+tOu3YUM8UQApgLmiAAJAisycKT355C+Xdj2+tBvdFRQxRwGkAOaKAggARazi0q7nzTdZ2i0GFEAKYK4ogABQZLJLu9nz+ebNW7q065dq2WST6INILAogBTBXFEAAKAK+tJs9l8+XdrfYYuksX+vWLO0WGwogBTBXFEAASCBf2n399VD4sku7++4bCt+RR7K0W+wogBTAXFEAASAhFixYekHm7NJu+/ah8LG0my4UQApgriiAABBj2aVdL31+Xh9Lu3AUQApgriiAABAj2aXd7CxfxaVdT7NmLO2CAuj4a5AbCiAAFJgv7Va8IHN2adcLn1+QmaVdVEYBpADmigIIAAXwxRfLXpC5USOWdrH6KIAUwFxRAAEgD8rKlr0g81tvsbSLtUcBpADmigIIANUku7Trhc9n+1jaRVWhAFIAc0UBBIAq5Eu7FXftNm68dJavVSuWdlE1KIAUwFxRAAEgB760W3HXri/t7rdfKHx+fT6WdlEdKIAUwFxRAAFgDVVc2vXS98MPS++1y9Iu8oECSAHMFQUQAFYDS7uIEwogBTBXFEAAWI6KS7ueadOWLu16dtqJpV0UDgWQApgrCiAARHxp16/J54XPd+360m52164/srSLuKAAUgBzRQEEkGqffx6Wdj2+tLvllqHw+QYOlnYRVxRACmCuKIAAUmV5S7v77x8KH0u7SAoKIAUwVxRAAEVvZUu7vmt3442jDwIJQQGkAOaKAgigKGWXdr30TZiwdGnX07IlS7tINgogBTBXFEAARcGXdqdOXbq0O316WNrNns/H0i6KCQWQApgrCiCAxPKlXF/azW7i8KVelnaRBhRACmCuKIAAEmVlS7u+a7d27eiDQBGjAFIAc0UBBBBrK1va9fzmNyztIn0ogBTAXFEAAcTS4sXS3XdLV17pP+yWvSAzS7tIOwogBTBXFEAAsVJeHmb6LrlEWrRIGjhQOvZYlnaBiiiA0q+iRwBAwr30ktS6tdS9u9Szp/Sf/0idOlH+APwSBRAAEu7998MsX9u20qGHSh9/HAogxQ/AilAAASChvvxS6tFD2n13aYstpA8/lAYMkOrXjz4AACtAAQSAhPFNHf36SU2bSt9/L731ljRkSCiBALA6KIAAkBClpdKtt0rbby89/7z07LPSAw9IO+4YfQAAVhMFEABizq/lN3q01KyZNHSoNHy4NHGitM8+0QcAYA1RAAEgxvxuHXvvLV14odS3b1ju9XvzcvFmALmgAAJADHnR84s2++7ejh2lDz6QTjlFqlkz+gAA5IACCAAx8umnUteu0n77SbvsEi7pcvHF0jrrRB8AgCpAAQSAGPDdvBdcEM7zc+++K11/PbdtA1A9KIAAUEA//ihdc4203XbS22+Hu3mMGCFts030AQCoBhRAACiAJUvCbl6/hItfyuXBB6WxY6XmzaMPAEA1ogACQB6Vl0tPPBGK3sCB0nXXSf/+d7iFGwDkCwUQAPLklVekgw4Ku3n9Fm5+nt/xx9s3Yr4TA8gzvu0AQDXze/T6pVx8lq9167Cz9+yzpTp1og8AQJ5RAAGgmnz9tXTWWdJuu0kbbRSK4FVXSQ0aRB8AgAKhAAJAFZs3TxowQNphB+mrr6Q33gi3cGvUKPoAABQYBRAAqsiiRdKQIaH4PfOMNG6c9NBD0k47RR8AgJigAAJAjnxnr1/KZeedpVtvle64Q5o8Wdp//+gDABAzFEAAyMGkSdK++0rnnRdu2TZ9unTMMVKNGtEHACCG0l4AH7aUWQ7JvAr89QJLiWVe9PhbCwD8zIvekUdKRx8dCp9v8OjeXapVK/oAAMRYmgtgV4vfXr0882pZHSy+T69+9PiOBQA0Y0a4jt/ee0tNm4ZLuvTpI627bvQBAEiAtBbArSxXWuz3dS1voYbFGwDLmD07LPH+5jdSaan0n/9IN94obbJJ9AEASJC0FsB/WK6yfJ559UsjLd9YXrN4SQSQUj/9JF1/vbT99tLrr0tTpkijRknbbht9AAASKI0F8Kzo0Uvg8vgdOf1bu1+xq5/lWksPC4AUWbJEGjEizPh54RszRho/XmrRIvoAACRY2pY6t7PY7+/axzLDB4xv+mhjmZB59Uv9LW0tLTOvluXnB87t2bOn6kT3dGrXrl0mAJLJL+kydqx0ySVSSYk0cKB0wgn223Lat8wBCTdu3LhMXGlpqQYPHuxPG1p8s2fqpK0AnmwZavGDnf1v39gy12K/3+sMH6jEC6A3ugMyr5aVKYBGDbi3E5B4r70mXXSRNG2a1LevdOaZUt260ZsAikaJ/XbXsKF3v/QWwLT9Tuslz2cBd7c0j+JOt9jv+9rD4gs8tS01LT7zd67lPguAIuU7eY8/XjrwwHBNP3/t1/Wj/AEoVmkrgD9ZZlaKXwbmO8scy5YW3wDir30TyDUWL4aZeWIAxWXWLOnss6VddpHWX1/64ANp0CApTAwAQPHirJYw05c9/+8Jy84WX8/dyOIzgndaABSRH36Qrroq3LP3s8+kqVOlYcPsN0D/FRAAUoACCCA1Fi2Shg4Nxe+pp6Qnn5QefTTcwxcA0oQCCKDo+c7ehx4KS7033CD55r8XX5RatYo+AAApQwEEUNT8ws0HHCD17Cmdf770zjvSscdKNbjfD4AUowACKEp+q7ajj5aOOEI6/HDpo4+kHj2kWrWiDwBAilEAARSVL76QuneX9txTatIkFL9+/aT11os+AACgAAIoDnPnSn36SDvuKM2fL739tnTLLdJmm0UfAAD8jAIIINEWLpRuvFHabjvp5ZeliROl0aOl7bePPgAA+AUKIIBEKiuTRo2SdtpJuvvu8PzZZ6W99oo+AABYIQoggMR5+ulwjp8v+V5xhfT661L79uzsBYDVRQEEkBhe9A47LNy398QTpfffl7p2lWr6/XwAAKuNAggg9j75ROrSRWrZUmrRQvr4Y6l3b6levegDAIA1QgEEEFvffiudd164VVvdumHG75prpA03jD4AAFgrFEAAsbNggTRoUNjJ69fxe/VV6a67pK23jj4AAMgJBRBAbCxeLA0bJjVtKj36qPTYY9ITT4R7+AIAqg4FEEDBlZeHwrfbbmGJ96abwjX9Djww+gAAoEpRAAEU1IsvSq1aSaefLvXqFe7h27Ejl3QBgOpEAQRQEO+9Jx17rNSundSmTTjX76yzpNq1ow8AAKoNBRBAXn35pdSjh7THHlKjRqH4DRgg1a8ffQAAUO0ogADyoqRE6tcvbPD4/ntp2jRp8GBp882jDwAA8oYCCKBalZZKt9wSLuny/PPhfr0PPBCKIACgMCiAAKpFWZk0erTUrJl0xx3S3XdLEydK++wTfQAAUDAUQABVbsIEae+9pQsvlPr2ld56S+rQgZ29ABAXFEAAVcav53flldIf/iD96U/SBx9Ip5wi1awZfQAAEAsUQABVwsvfBRdIf/+79MIL0kUXSeusE70JAIgVCiCAnC1ZEi7k/NBD0pQp3LoNAOKOAgggJ4sWSV26hOI3eXLY7QsAiDcKIIC19uOP4Xw/P9fPL/Gy1VbRGwCAWKMAAlgr8+ZJhx8uzZkTdv1uumn0BgAg9iiAANbYd99Jhx4q1a0rjRsnbbBB9AYAIBEogADWiN/L96CDpK23lh57TFpvvegNAEBiJK0AnmNpEJ4CyLf//U9q1Upq0UIaMybMAAIAkidpBbC7ZablLsvePgAgP957T2rZMpz3N3y4VKtW9AYAIHGSVgB3s7Sz+H0FJlresJxhWd8CoJq8YX/TWreWunWTbrnFvnFw8ggAJFoSv42/YDnZ0thyt+U8i88KDrXsZAFQhfyuHgcfHO7yMXAg9/MFgGKQ5N/jt7F44Wtkec/S0PK6pbcFQBUYP15q3166+upwazcAQHFIWgFc1/Jny78tPhNY23KIxc8HPN6yv6WfBUCOHn44XOR56FDpDD/RAgBQNJJWAL+0XGC5z+L3HPBNIVMtWW9apoWnANbWiBHSSSfZXzT7m9a5czQIACgaSSuAf7A0s9xkmeMDy9E6egSwFgYPlnr1kh59VDr66GgQAFBUklYAv7dsHZ7+7NeW5uEpgFz89a9Sv37S00+HO30AAIpT0gqgX/+v8n0H/LWPA1hL5eXSJZdIN98sTZwo7btv9AYAoCglrQBub/EdvxW9a/FxAGuhrEw666xwvt/zz0u7+dU2AQBFLWkFsMSyYXj6s40tC8JTAGti0SKpa1fp2WelKVOkHXeM3gAAFLWkFcBJluss2ZtQ+eNfLX5XEABr4KefpI4dpenTpcmTpV/72bQAgFRIWgG82NLK4peDeTV6PMjCJWqBNTB/vnTkkdLXX4dz/jbfPHoDAJAKSSuAX1h8x++ZljHRo5+x9LkFwGqYPVs67LCw8cPv9LFh5ZMqAABFj7t65qaBZa5Rgwb+FIg3n/Fr21Zq0sR+g7JfoerVi94AgBQpKSlRw4Z+B9nMbWR9f0HqJK0A+ozlSRa/9Vt9H6iga/SYTxRAJMZnn4WZv732koYPl2r7jRQBIIUogMlbAh5iucGyqWVJpQBYgQ8+kFq2lA45JNzmjfIHAOmWtBnAby37WT7MvCo8ZgARe9OmhZm/bt2kq6+2v/Sc+AEg5ZgBTN4MYKnlk/AUwKq8/LJ00EHSeedJ11xD+QMABEkrgLdbzg5PAazMhAlhw8dVV0mXXhoNAgBgkjYfMNniG0BmWGb6QAWto8d8YgkYsfTYY1LnztKQIeFOHwCApVgCTl4BvDx6XJ4rosd8ogAidvyevqedJo0cKf3hD9EgAOBnFMDkFcC4oQAiVoYOlS64QHroobDxAwDwSxTA5J0D6LxpdbZkb//mN7HaIjxdYw9byiyHZF4FfmcRv+fwfIvfYWRls45AbFx7rXTxxdLYsZQ/AMDKJa0A7m7xS8AMsPT3AbOH5bbwdI34mVHrWMozr4L1LfbjM3Ou4UaW9pbulnMtQCz5Ld0uu0y67jrpueekAw6I3gAAYAWSVgBvsvi5fjtaFvmAecGyb3i62rayXGnxcldxGfyPFv+aeLn0S868bbEfq+plAWKnrEw65xzpnnvstxb7tWUP/3UIAIBVSFoB3NXil4Jx2Zm7eZbKt4VblX9YrrL4Em9FzS1vWHxZOOtVy3YWnx0EYmPxYunUU6V//UuaMkXaaafoDQAAViFpBXC2xc/5q+jXlq/C09VyVvToJbAyP79wTnj6M///6djlgdhYuFDq1EmaOjXM/DVpEr0BAMBqSNou4EGW31l6Wl6x+IaNwRb7MZhZ0l0Vn8mbYtnH4tcSdD7b18YyweL3GW5mOdyS5bee83/Gdwr5xpCKMruAe/bsqTp16mQG2rVrlwlQXX74QTr2WPvNxH418dm/jTeO3gAArNC4ceMycaWlpRo82OsDl4FJirqWoZbspW19GfgRi+8KXugDq3Cyxf95P9jZ/3b/8TnXMsbyosXP+WtkyS4D+wYQPwewaebVsjIFkMvAIF/sj5o6dJBq1ZIef1yqv6YnPwAAuAyMSep1AL20bW/xpd/PfGA11bP47t6K/DzATpbxlsWW9y13Wf5i8dL3pOVvlpstlVEAkTfffOMzzFLjxtIDD0jr+B52AMAaowAm7xzArO8s/7asSflzP1n8FnIV47OI/u/zc/98idfXbw+Mxnyu+E7L8sofkDef268prVtLO+4YLvJM+QMA5CIJM4B+XT6/Hp/z6/NVvG5fRdwLGEXp44+lQw8NF3e+/XapZs3oDQDAWmEGMBkzgH5XjqxnLM+uIEDRefttqVUr6bjjpDvuoPwBAKpGUs8BjAtmAFFtXn1Vat9eOu88qW9f+8vK31YAqBLMACbvHEC/w2nly936a7+MC1A0Jk2yP9T2p7p/f6lfP8ofAKBqJa0A+mYM38hRkb9mkwaKxlNPhUu93HijdC53oQYAVIOkFUC/h+//wtOf+WsfBxJvzBipY0dp+PBwmzcAAKpD0grgt5Ytw9Of+Wu/kDOQaMOGSX/+s/TPf4YSCABAdUlaAfRLwvidPLIXc/bHIZanMq+AhPLl3t69w/Lv4RVvRAgAQDVIWgG8zOLbbWdZvokeN7RcagESp7xcGjBA+stfpGefDRd7BgCguiV1b+HvLE0sfv7faz5QIFwGBmvNy9/554fz/p55Rtp55+gNAEC14jIwyZsBzPLS98/oEUicJUuk006THn1UmjKF8gcAyK8kzADeYTk9PNWI6HF5ukaP+cQMINZYaal00knS9OnS+PHSlpW3NQEAqhUzgMmYAVwSPboyi79eXoDYW7BA+v3vw/19n3+e8gcAKIwkzAAeYYnrLl9mALHa7BdOHXWU/RZjv8Y88YT92pn55RMAkG/MACZjBnB09OhSeZCQfN99Jx16qLTuutK4cZQ/AEBhJaEAzre0sNS0+Iylx/93Vw4QSzNnhsu7NGkSNn14CQQAoJCSUJxusLxqKbX4j87FlkXLCRA7n3witWol7b23dP/9Up060RsAABRQUq4D2NiyneVpy4rukzApeswnzgHECr37rtSmjXTcceFOH79inhoAYoFzAJMxA3iGZaZliuVqixe95QWIjddfD8u+fm/fm26i/AEA4iUJP5aujR7dBdEjEFt+YedDDpEuuUS68kqpRlLm2QEAqZGEAjjbcqzFl4D9f++20fPKAQrOd/gefrj91mK/tvTuHQ0CABAzSZib6GIZalkn8yrw/93l4enPz32XcL5xDiB+9uCDUteu0rBh0gknRIMAgNjhHMBkzACOsvgB2sbyo8Vn+yrOAmafAwVzzz3SySdLY8ZQ/gAA8ZeUU9N9CfhzyzGWTy21osdsOlqAgrj1Vunss6XHH5eOPDIaBAAgxpJyerpPz1ZcY/3eslF4mlH5/XxhCTjFysulv/xFuuEGaezYcK0/AED8sQScnBnAykV1Va+BauXl76KLpNtukyZNovwBAJIlKQUwu+Eja1WvgWqzZIl05pnSAw+ES77sumv0BgAACZGUAgjEwqJF0kknSc89J02eLO2wQ/QGAAAJkpSl04WWa8LTjAst14WnGRdZ6oWnecU5gCny00/Sn/4kzZgRrve32WbRGwCAROEcwOQUwImWVS3zHhw95hMFMCXmzZOOOcZ+E7FfRZ58Utpgg+gNAEDiUADZPJErCmAKfP+9dMQRdrDtED/8sLTeetEbAIBEogByDiCwUl99JR10kNSoUbjOH+UPAFAMKIDACnz6qdSqlbT77mHHb9260RsAACQcBRBYjvffD+WvbVvp7rulWn7vGQAAigQFEKjkzTdD+TvxxHCh51/xtwQAUGT40QZU8NJL0sEHS+efLw0aJNVgmxQAoAhRAIHIM89I7dqF4nfJJdEgAABFiAIImEcflX7/e2nIkHCbNwAAihkFEKk3cqTUpYs0alQ47w8AgGJHAUSq/f3vYcbvkUfCnT4AAEgDCiBS6+qrpT59pKefltq0iQYBAEgBCiBSp7xcuvRS6cYbpYkTpf32i94AACAlKIBIlbIyqVevcN7f889LzZtHbwAAkCIUQKTG4sVSt25hyXfKFOk3v4neAAAgZSiASIWFC6WOHcNdPiZPlrbZJnoDAIAUogCi6P3wg3TkkdKXX4Zz/rbYInoDAICUogCiqM2ZI7VtKy1ZIo0fL220UfQGAAApRgFE0Zo1K9zXd+ONpaeekurXj94AACDlKIAoSjNmSK1bS82aSQ8+KNWrF70BAAAogCg+H30ktWwpHXigdO+9Uu3a0RsAACCDAoiiMn261KqV1KmTdPvtUs2a0RsAAOBnFEAUjX//WzrooHCh52uukWrUiN4AAADLoACiKLzySrif74AB0mWXUf4AAFgZCiASb/bssOTbv7909tnRIAAAWCEKIBKtvFw67TRp112l3r2jQQAAsFJpLID9LR9Z5lhmWf5laW6pqMyywFJimRc9/taCmBk6VHrpJWn4cJZ9AQBYXWksgPdb9rRsYGlsGW8ZZ6lcHzpYGlj88sH++I4FMTJtWpj1u+8+aZNNokEAALBKaSyAH1rmhqfyi4T4bN+mlso3CWM+Kcb8/r7HHy9deGG43h8AAFh9aT0H8AjLbMuPlustN1i+s1Q00vKN5TVLdx9AfJx7rrV2q+19+0YDAABgtaW1AD5l2dDis36+deBlS0WHWra1NLL0s1xr6WFBDNx/v/Tww9KoUVKtWtEgAABYbSxzhq+Bzwa2skz3geXwjSNtLS0zr5bycwPn9uzZU3Xq1MkMtGvXLhNUj48/llq0kEaOlI46KhoEAGAVxo0bl4krLS3V4MGD/WlDi2/0TB0KoORzSH5O4EmWh3xgObwAeqs7IPNqqUwBNGrQwJ+iOtnfVx1gR8Bz003RIAAAa6ikpEQNG3r3S28BTOMS8DmWzcLTzOaPIZaFlhd8wOxhaWGpbfFNIj7zd67lPgsKqE8facmScJs3AACw9tJYAA+zvGXx6/u9afEy2MbytcVtafENIL4pxDeBeN24xJKZK0ZhPPWUdMcd0pgxUt260SAAAFgrLAHnhiXgPJg5U2reXLrxRunEE6NBAADWEkvA6d0FjITwJV8vfR06UP4AAKgqFEDE2l//Kn3xhXTbbdEAAADIGQUQsTV5ciiAo0dL668fDQIAgJxRABFL338vde4sXX21tIfvywYAAFWGAojYKS+XTj01XPC5V69oEAAAVBkKIGLHL84+dap0111SDfapAwBQ5SiAiJU335Quvli67z5p442jQQAAUKUogIiN+fOlTp2kSy6RWvmdmQEAQLWgACI2/Hy/xo3DLd8AAED1oQAiFu69V3rySWnUKKmm34EZAABUGwogCu7DD6WePaW77w4zgAAAoHpRAFFQCxdKxx8vnXZauN0bAACofhRAFJRv+PBLvfgdPwAAQH5QAFEwjz8ervXnt3qrUycaBAAA1Y4CiIL4/HPplFOk22+XdtghGgQAAHlBAUTeLVkidekiHXOMdMIJ0SAAAMgbCiDybuBAadYs6ZZbogEAAJBXFEDk1aRJ0rXXSmPGSOutFw0CAIC8ogAib779Niz9Xn+9tNtu0SAAAMg7CiDyorw8bPrYZx/pjDOiQQAAUBAUQOSFn+83bZo0bFi47h8AACgcCiCq3dSpUp8+0v33SxtuGA0CAICCoQCiWs2bF2711revtP/+0SAAACgoCiCqjZ/3d+aZUpMm0sUXR4MAAKDgKICoNiNGSOPHS/fea3/Q+JMGAEBs8GMZ1eL996VevUIJ3GKLaBAAAMQCBRBV7qefpE6dwvJvu3bRIAAAiA0KIKrchRdKdeuGW74BAID4oQCiSj3ySDjnzy/5UqdONAgAAGKFAogq89ln0qmnSkOHStttFw0CAIDYoQCiSixeLHXuLB13XDj/DwAAxBcFEFXiiiuk2bOlm26KBgAAQGxRAJGzCROkG2+UxoyR1l03GgQAALFFAUROZs2SunSRbrhB2mWXaBAAAMQaBRBrraxM6tZNatVKOu20aBAAAMQeBRBrzc/3e/dd6Y47pBo1okEAABB7FECslVdflfr1C9f722CDaBAAACQCBRBrrKREOv546fLLpX33jQYBAEBiUACxRsrLpR49pB12kC64IBoEAACJQgHEGhk+XHruOWnECPvDw58eAAASiR/hWG2+4ePcc6WRI6XNN48GAQBA4lAAsVp+/DHc4u3ss6U2baJBAACQSBRArJbevaX11w+3fAMAAMlGAcQqPfhguNzLffdJtWtHgwAAILEogFip//1P6t5dGjZMatIkGgQAAIlGAcQKLVokde4snXCC9Mc/RoMAACDxKIBYIb/Q8/z50t/+Fg0AAICiQAHEco0fL916qzRmjLTOOtEgAAAoChRA/MLXX0snnSTdfLPUrFk0CAAAigYFEMsoK5O6dpUOPlg65ZRoEAAAFBUKIJZx/fXSRx9Jt98u1agRDQIAgKJCAcTPXn5ZGjBAGj1aatgwGgQAAEWHAoiMOXPC5V6uukraa69oEAAAFCUKIFReLp1+etjw8f/+XzQIAACKVhoLYH/LR5Y5llmWf1maWyrazTLJMt/yueVyS9G6805pyhTp7rvtDwS/EgAAUPTS+OP+fsuelg0sjS3jLeMs2S0P61vGWiZbNrK0t3S3nGspOm+/LZ1/vjRypLTZZtEgAAAoamksgB9a5oanqmkps2xq8bLn/KZn/nXxmcJSi1UkXWfpZSkqCxZInTqFZd9DDokGAQBA0Uvrgt8RltmWHy3XW26wfGdxvhz8hsWLYdarlu0sPjtYNM47T9pww3DLNwAAkB5pLYBPWaz6ZGb9eltetmQ1sPj5gRV5WXT+XlH4v/+T/vlP6b77pFq1okEAAJAKXOo3fA284LWyTLf4bKDfAO1wS9Z+likWvzqebwzJ8kI4t2fPnqpTp05moF27dpnE2SefSHvsETZ9/P730SAAAEVs3LhxmbjS0lINHjzYn/rP9RJ/kjYUQMnnv/ycwJMsD1m6Wq61+AaR7DKwbwDxcwCbZl4tlSmARg0aJGNycNEiqWVLae+9pVtvjQYBAEiRkpISNQx3PEhtAUzjEvA5lux+V9/8McSy0PKCDxgvgUssV1jqWXa1+DLxbZbE69vX/mPtv/Y639YCAABSKY0F8DDLW5Z5ljctXgbbWL62OF/i9TXcAy2+McTni++03GxJNJ/5HmJ1d8wYa7ZebQEAQCqxBJybxCwBf/ml1Lx5mPk7+eRoEACAFGIJOL27gFOlrEw66STfoCJ19TMcAQBAqlEAU+Caa6RPPw3LvzWY8wUAIPUogEXuxRelgQPDeX/160eDAAAg1SiARWz2bOmEE6RBg6QWLaJBAACQehTAIlVeLnXvLu22m3SOX/gGAAAgQgEsUrffLr3yijR8OOf9AQCAZVEAi9C0adIFF0ijRkmbbBINAgAARCiAReaHH6ROnaSLLpIO9EtZAwAAVEIBLDJ+vt/mm4dbvgEAACwPBbCI3Hef9Oij0siRUs2a0SAAAEAlFMAi8dFH0hlnhE0fW20VDQIAACwHBbAIlJZKxx8vnXqqdNRR0SAAAMAKUACLwKWXhvv9+i3fAAAAVoUCmHBPPindeWe41VvdutEgAADASlAAE+yLL6Ru3aQhQ6SmTaNBAACAVaAAJtSSJdKJJ0odOoRHAACA1UUBTKhBg6SZM6XbbosGAAAAVhMFMIEmT5auvjqc97f++tEgAADAaqIAJsz330udO4cdv7vvHg0CAACsAQpggpSXh2v97bmn1LNnNAgAALCGKIAJMniw9Prr0l13STVqRIMAAABriAKYEG++KV18cbjf70YbRYMAAABrgQKYAPPnS506hTt+tGwZDQIAAKwlCmAC9OolbbllKIAAAAC5ogDG3L33htu9jRwp1awZDQIAAOSAAhhjH3wQdvvec4/UuHE0CAAAkCMKYEwtXCgdf7x0+unSEUdEgwAAAFWAAhhTvuPXl3z9lm8AAABViQIYQ489Jg0fLo0eLdWpEw0CAABUEQpgzHz+uXTKKdLQodL220eDAAAAVYgCGCOLF4f7/P7hD+H8PwAAgOpAAYyRgQOlb7+Vbr45GgAAAKgGFMCYmDhRuv56acwYab31okEAAIBqQAGMAZ/169IlFMBdd40GAQAAqgkFsMDKy6Vu3aT99pN69IgGAQAAqhEFsMD8fL/p06U775Rq1IgGAQAAqhEFsICmTpUuu0y6/35pww2jQQAAgGpGASyQkhKpUyepb19p//2jQQAAgDygABaAn/d35pnSttuGW74BAADkEwWwAO65R3rmGenee+0AcAQAAECeUT/y7L33pLPPlkaMkLbYIhoEAADIIwpgHv30U7jF21lnSe3aRYMAAAB5RgHMowsvlOrVC7d8AwAAKBQKYJ488kg4588v+VK7djQIAABQABTAPPjsM+nUU8PFnn3nLwAAQCFRAKvZ4sVS585Sx44hAAAAhUYBrGZXXCHNmSPdeGM0AAAAUGAUwGo0YUIofmPGSOuuGw0CAAAUGAWwmsyaJXXpEgrgb38bDQIAAMQABbAalJVJ3bpJrVtL3btHgwAAADFBAawGPuv37rvSHXdINWpEgwAAADFBAaxir74q9e8vjR4tNWwYDQIAAMQIBbAKzZ0bbvU2YIC0zz7RIAAAQMxQAKtIebnUo4fUtKnUu3c0CAAAEENpLIB/tUyzzLV8YbnPspWlojLLAkuJZV70uNK9vHfdJU2aJI0YYV9UajUAAIixNFYVL3cnWza2NLOUWx63VNbB0sBSP3p8x7Jc770nnXtuuNfvZptFg8i7cePGRc9QaByLeOF4xAfHAnGRxgJ4meUNy2KLz+xda9nNUnnLxmrv3/VLvngBbNMmGkBB8I01PjgW8cLxiA+OBeKCxUqpneVTiy8JVzTS8o3lNctKr+ZXv37Y+AEAAJAEab9Knc/ZPWw51jLeByIHW160LLEcZhlludQy1FKRLw3PfemlGdp5Z3+KQurTp48GDRoUvUIhcSziheMRHxyLeCgpKdHWW2/tT331z1cDUyfNBfBIy70WPx/wMR9Yif6WtpaWmVdLbWn5PDwFAAAJ45tAfUNo6qS1AHax3GbpaHnGB1bBC6AvFR+QebWUf/0aW3ynMAAASA7f5DnT4ptBkQK9LN9bKpe5rD0sLSy1LTUtPvP3naWnBQAAAAnkl4FZaPE1/4rX+csWQl8a/o/Fx7wo+o7h0ywAAAAAAAAAikUny/MWvzSM7wSufLkcv27gJMt8i28CudxS2RUWP7HUZxgnWlZ6JxEs1+rctYVjkT9+LuxHljmWWZZ/WZpbKuJ45J9fycBXNg7JvAo4DvnjX9vsdWWzK0p+5YgsjkX+7Wd51uLHYrZliiWL44GV8ku/eAk8xVK5AK5v8ZNGB1rqWHaxzLCca8m60OLXFtzZUtfie/79D9q6Fqy+v1j8nMxaFr/Ojn9T9SX5LI5FfjW1ZC+Y7sfkfMtXluxmMo5H/nW1jLX496lsAeQ45JcXCJ8wWB6ORf55+fPS55s9/evpP7/3sjiOB1bbgZbKBdAvG+M/9CqOnWP5MDzN+K/FN5tk+WaSry3+BxJrz2eb/HhkSwjHonD8G+N5Fj8efltFx/HIL58N/1/0WHEGkOOQXysrgByL/PNjcV14+gscjwoqfhGweryE+CyUf8PNetWyncV/u/CZqibRWJb/kHzT4rNZWHuV79rCsci/Iyz+2/WPlustN1h8l7zjeOTXPyxXWXx2oiKOQ/75181LwicWX6nwr6/jWOTXOpb9Lf71fsXyrcW/tn6zB8fxqIACuOb8D4ifA1WR/0B0/p7HLe8z2few5vyuLf0sPTKvAo5F/j1l2dCykaW35WVLFscjf86KHr0EVsZxyK8HLL5cuLnFy4dfU87vLOVLhhyL/PLvS95r/NSIMy2bWXwJ937LvhaORwUUwDXnJ5VuEJ7+zH8gOn/P45b3mex7WDN+aR7/JutT8BVv2cexKBz/BnmLxQvIrj5gOB754bMVfS0rukc5xyG//LJhfh6Z+9JyqsWX5b0McizyyzdtuOGW1y0+0+ebpJ6zHGPheFRAAVxz2angil+7vS1+3oDvKvI/JH5eTvakU+fnEPg/41PPWDNe+vyWfX7Xlsq37ONYFJZ/Lf2C6b45xHE88qOVxWc6plq+ieIetNxu8ePgF7PnOBSWb47i70R++dfz4/B0uTgeWCX/w+EnuftdQHz936fy/bX/hfbzBHx7uJ97U8/isx+fWSruIrrA4n+IfOu4n5PglzPx3xDZRbRm/ETcld21hWORX36ytC+puE0td1j8+PjSl+N45Id/bf0WlBXjMx3+S5LPXHAc8su/7tmNUP53YYTFC8V6Fo5F/vn3Kd/p6+f7+c/soy0LLL+zcDywSr5TyL+hevnzZJ+3tjjfOu47jX6w+B80PzetsgEWXw7w3yq4jtDa8a/7yu7a4jgW+fO4xb+Ofhz8m+gjFp9pqojjURj+/anidQA5DvnzqMU3gPjX0YuCbwLxZfosjkX+XWzxYucbBl+z+GlEWRwPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACSYnuL38Hm15lXABBTFW+IDADF6DnLleFpXpRHjwAQWxRAAACAlKEAAkizbpbpljmWaZaulqy6lv+zfG4psbxrOctSkd/0/xmL33T+HcvBFgAAABTYipaA/2jx4naQpYblUMs8y9EWV89ysqV+5pV0uOUny2GZV+EXaC99wyz+2caWVyxLLJwDCAAAUEArKoBjLX8LT392k+Wp8HS5HrFcF57qAMsiy/qZV8GRFgoggNhjCRhAWm1t+Tg8/dlHlmx5q2O53vK+xZeIZ1vaWzazuC0tPjY/8yr4JHoEgFijAAJIqxkWv2xLRTtYPgtP1dvSIcoGlg0tPmvoy8XOzw30sewSsds2egSAWKMAAkiDmhbf1FExd1lOtRxo8e+Fh1hOsQy1uAaWhZbvLP7Pd7S0tWT5+X4fWm6wrGvxGcHLLAAAACgwPwfQz8vLxi/U7I9e+LwA+kYO3wziu4F900fWxpYnLL4D+CvLEMsoywhLls8gPmvJ7gL+s4VzAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOJA+v9AkmDBbNm4yQAAAABJRU5ErkJggg==\">" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum Efficiency 66.6666666667\n" + ] + } + ], + "source": [ + "%matplotlib notebook\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt2\n", + "W=[100.0,200.0,300.0,400.0,500.0,600.0] #loads \n", + "P=[16.0,22.5,28.0,34.0,40.5,46.5] #Efforts\n", + "VR=25.0 #velocity ratio\n", + "E=[0,0,0,0,0,0] #Efficiency\n", + "#calculating average slope\n", + "m=(P[4]-P[1])/(W[4]-W[1])\n", + "C=P[4]-m*W[4]\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "for i in range(0,6):\n", + " \n", + " E[i]=W[i]/(25*P[i])*100 #E=W/(P*VR)\n", + " \n", + "plt2.plot(W,E)\n", + "plt2.ylabel(\"Efficiency\")\n", + "plt2.xlabel(\"Load\")\n", + "plt2.show() \n", + "\n", + " \n", + "MaxEfficiency=1/VR*100*1/m\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency\n", + "\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 13.8888888889\n", + "Velocity Ratio 30.0\n", + "Efficiency 46.2962962963\n", + "self-locking machine\n", + "Ideal Load 10800.0\n", + "frictional resistance 5800.0\n" + ] + } + ], + "source": [ + "\n", + "W = 5000.0 #Load\n", + "P = 360.0 #Effort\n", + "\n", + "MA=W/P #Mechanical advantage\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100.0\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "\n", + "\n", + "\n", + "Wi = P*VR #ideal load\n", + "\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print var\n", + "print \"Ideal Load\",Wi\n", + "\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 937.5 N\n", + "number of pulley is 4\n" + ] + } + ], + "source": [ + "import math\n", + "W = 6000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.8\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n", + "#second case\n", + "P=520.0\n", + "n=0,\n", + "for i in range(3,20):\n", + " if((P*(0.8-(i-3)*0.05)*(2**i)))>6000:\n", + " n=i\n", + " break\n", + " \n", + " \n", + "print \"number of pulley is \",n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exmple 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 2352.94117647 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N=3.0 #number of movable pulleys\n", + "VR=2*N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.85\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1923.07692308 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1\n", + "N2=2.0 #number of movable puleys in system 2\n", + "VR=2*N1+2*N2 #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.78\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 79.3650793651\n", + "Effort lost in friction 37.1428571429\n" + ] + } + ], + "source": [ + "import math\n", + "W = 1000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N-1 #Velocity Ratio\n", + "P = 180.0 #Effort\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "Pi =W/VR #Ideal effort\n", + "\n", + "efl=P-Pi #Effort lost in friction\n", + "print \"Effort lost in friction\",efl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 595.238095238 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 2500.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1 in figure B\n", + "N2=2.0 #number of movable puleys in system 2 in figure C\n", + "VR=2**N1-1+2**N2-1 #Velocity Ratio\n", + "Efficiency=0.70\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.11" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 2.3\n", + "Effort is 745.341614907 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle\n", + "tcw=6.0 #thickness of the cord on the wheel\n", + "tca=20.0 #thickness of the cord on the axle\n", + "W=1200 #effort\n", + "ED=D+tcw #Effective diameter of the wheel\n", + "Ed=d+tca #Effectivediameter of axle\n", + "VR=ED/Ed #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.7\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 32.0\n", + "Effort is 1136.36363636 N\n" + ] + } + ], + "source": [ + "D=800.0 #diameter of the wheel\n", + "d1=250.0 #diameter of axle 1\n", + "d2=300.0 #diameter of axle 2\n", + "\n", + "W=20000.0 #effort\n", + "\n", + "VR=(2*D)/(d2-d1) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.55\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 3.33333333333\n", + "Effort is 2500.0 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle \n", + "\n", + "W=5000.0 #effort\n", + "\n", + "VR=(2*D)/(D-d) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.6\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.14" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1741.88034188 N\n" + ] + } + ], + "source": [ + "D=40.0 #Screw diameter\n", + "l=20.0 #Screw lwngth\n", + "p=l/3.0 #Lead of the screw\n", + "W=40000.0 #effort\n", + "R = 400 #Lever length\n", + "u = 0.12 #coefficient of friction between screw and nut\n", + "P = (d/(2*R))*W*((u+(p/(3.14*D)))/(1-u*(p/(3.14*D)))) #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.15" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 57.0287539936 N\n", + "Efficiency 55.8439936484 %\n", + "reversible machine\n", + "The torque required to keep the load from descending 2047.61904762 Nm\n" + ] + } + ], + "source": [ + "import math\n", + "d=50.0 #mean diameter of screw\n", + "p=10.0 #pitch of screw\n", + "u=0.05 #coefficient of friction at the screw thread\n", + "R=300.0 ##Lever length\n", + "W=6000.0 #Load\n", + "o1=math.atan(p/(3.14*d))\n", + "o2=math.atan(0.05)\n", + "P=d/(2*R)*(W*math.tan(o1+o2)) #effort\n", + "print \"Effort is\",P,\"N\"\n", + "VR=2*3.14*R/p #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "print \"Efficiency\",Efficiency,\"%\"\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "print var\n", + "T =d/2.0*W*math.tan(o1-o2) #The torque required to keep the load from descending\n", + "print \"The torque required to keep the load from descending\",T,\"Nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.16" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 12.9110001721 %\n" + ] + } + ], + "source": [ + "import math\n", + "p1=5.0 #Pitch of smaller screw\n", + "p2=10.0 #Pitch of larger screw\n", + "R=500.0 #Lever arm length from centre of screw\n", + "W=15000.0 #Load\n", + "P=185.0 #Effort\n", + "VR=2*3.14*R/(p2-p1) #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency\",Efficiency,\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.17" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 120.0\n", + "Law of machine is P= 0.01 W + 70.0\n", + "Efficiency for first case 25.0 %\n", + "Efficiency for second case 46.875 %\n" + ] + } + ], + "source": [ + "d=200.0 #Diameter of the load drum \n", + "R = 1200.0 # Length of lever arm \n", + "T1 = 10.0 #Number of teeth on pinion, \n", + "T2 = 100.0 #Number of teeth on spur wheel\n", + "VR=R*T2/(d*T1)*2.0 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "W1 = 3000.0 #Load 1\n", + "P1= 100.0 #Effort1\n", + "\n", + "W2 = 9000.0 #Load 2\n", + "P2= 160.0 #Effort2\n", + "\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for first case\",Efficiency,\"%\"\n", + "MA=W2/P2 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for second case\",Efficiency,\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.18" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 32.0\n", + "LOad 3200.0 N\n" + ] + } + ], + "source": [ + "d=150.0 #Diameter of the load drum \n", + "R = 400.0 # Length of lever arm \n", + "T1 = 15.0 #Number of teeth on pinion, \n", + "T3 = 20.0 #Number of teeth on pinion, \n", + "T2 = 45.0 #Number of teeth on spur wheel\n", + "T4 = 40.0 #Number of teeth on spur wheel\n", + "P= 250.0 #Effort\n", + "Efficiency=0.4\n", + "VR=R*T2/(d*T1)*2.0*T4/T3 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "\n", + "W=VR*Efficiency*P #Load \n", + "\n", + "print \"LOad\",W,\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_otmOyr2.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_otmOyr2.ipynb new file mode 100644 index 00000000..55339520 --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_otmOyr2.ipynb @@ -0,0 +1,1593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6-SIMPLE MACHINES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 20.0\n", + "Velocity Ratio 25.0\n", + "Efficiency 0.8\n", + "Ideal Load 12500.0\n", + "Ideal Effort 400.0\n", + "Effort lost in friction 100.0\n", + "frictional resistance 2500.0\n" + ] + } + ], + "source": [ + "import math\n", + "W = 10000.0 #Load\n", + "P = 500.0 #Effort\n", + "D = 20.0 #Distance moved by the effort \n", + "d = 0.8 #Distance moved by the load \n", + "MA=W/P #Mechanical advantage\n", + "VR=D/d #Velocity Ratio\n", + "Efficiency=MA/VR\n", + "Pi =W/VR #Ideal effort\n", + "Wi = P*VR #ideal load\n", + "efl=P-Pi #Effort lost in friction\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print \"Ideal Load\",Wi\n", + "print \"Ideal Effort\",Pi\n", + "print \"Effort lost in friction\",efl\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.05 W + 30.0\n", + "Load is 3400.0 N\n", + "Mechanical advantage-- 17.0\n", + "Ideal effort is 113.333333333 N\n", + "Effort lost in friction 86.6666666667\n", + "Efficiency 56.6666666667\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 2400.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "\n", + "W2 = 3000.0 #Load 2\n", + "P2= 180.0 #Effort2\n", + "P3= 200.0 #Effort3\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "W3=(P3-C)/m #Load 2\n", + "print \"Load is \",W3,\"N\"\n", + "MA=W3/P3 #Mechanical advantage\n", + "print \"Mechanical advantage--\",MA\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100\n", + "Pi =W3/VR #Ideal effort\n", + "print \"Ideal effort is\",Pi,\"N\"\n", + "\n", + "efl=P3-Pi #Effort lost in friction\n", + "\n", + "print \"Effort lost in friction\",efl\n", + "print \"Efficiency\",Efficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 51.3333333333\n", + "Velocity Ratio 85.5555555556\n", + "Efficiency 61.7142857143\n", + "Maximum Mechanical advantage-- 55.0\n", + "Maximum Efficiency 64.2857142857\n" + ] + } + ], + "source": [ + "import math\n", + "W1 = 7700.0 #Load 1\n", + "P1= 150.0 #Effort1\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=0.6\n", + "VR=MA/Efficiency #Velocity Ratio\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "W2 = 13200.0 #Load 2\n", + "P2= 250.0 #Effort2\n", + "MA=W2/P2\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "\n", + "\n", + "MMA=1/m #Maximum Mechanical advantage\n", + "print \"Maximum Mechanical advantage--\",MMA\n", + "\n", + "MaxEfficiency=MMA/VR*100\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Law of machine is P= 0.06 W + 10.5\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('<div/>');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " this.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", + " 'ui-helper-clearfix\"/>');\n", + " var titletext = $(\n", + " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", + " 'text-align: center; padding: 3px;\"/>');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('<div/>');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('<canvas/>');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var rubberband = $('<canvas/>');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width);\n", + " canvas.attr('height', height);\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('<button/>');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('<span/>');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('<span/>');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('<span/>');\n", + "\n", + " var fmt_picker = $('<select/>');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('<span class=\"mpl-message\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "}\n", + "\n", + "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", + " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", + " // which will in turn request a refresh of the image.\n", + " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", + "}\n", + "\n", + "mpl.figure.prototype.send_message = function(type, properties) {\n", + " properties['type'] = type;\n", + " properties['figure_id'] = this.id;\n", + " this.ws.send(JSON.stringify(properties));\n", + "}\n", + "\n", + "mpl.figure.prototype.send_draw_message = function() {\n", + " if (!this.waiting) {\n", + " this.waiting = true;\n", + " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", + " }\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " var format_dropdown = fig.format_dropdown;\n", + " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", + " fig.ondownload(fig, format);\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", + " var size = msg['size'];\n", + " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", + " fig._resize_canvas(size[0], size[1]);\n", + " fig.send_message(\"refresh\", {});\n", + " };\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", + " var x0 = msg['x0'];\n", + " var y0 = fig.canvas.height - msg['y0'];\n", + " var x1 = msg['x1'];\n", + " var y1 = fig.canvas.height - msg['y1'];\n", + " x0 = Math.floor(x0) + 0.5;\n", + " y0 = Math.floor(y0) + 0.5;\n", + " x1 = Math.floor(x1) + 0.5;\n", + " y1 = Math.floor(y1) + 0.5;\n", + " var min_x = Math.min(x0, x1);\n", + " var min_y = Math.min(y0, y1);\n", + " var width = Math.abs(x1 - x0);\n", + " var height = Math.abs(y1 - y0);\n", + "\n", + " fig.rubberband_context.clearRect(\n", + " 0, 0, fig.canvas.width, fig.canvas.height);\n", + "\n", + " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", + " // Updates the figure title.\n", + " fig.header.textContent = msg['label'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", + " var cursor = msg['cursor'];\n", + " switch(cursor)\n", + " {\n", + " case 0:\n", + " cursor = 'pointer';\n", + " break;\n", + " case 1:\n", + " cursor = 'default';\n", + " break;\n", + " case 2:\n", + " cursor = 'crosshair';\n", + " break;\n", + " case 3:\n", + " cursor = 'move';\n", + " break;\n", + " }\n", + " fig.rubberband_canvas.style.cursor = cursor;\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_message = function(fig, msg) {\n", + " fig.message.textContent = msg['message'];\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", + " // Request the server to send over a new figure.\n", + " fig.send_draw_message();\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", + " fig.image_mode = msg['mode'];\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Called whenever the canvas gets updated.\n", + " this.send_message(\"ack\", {});\n", + "}\n", + "\n", + "// A function to construct a web socket function for onmessage handling.\n", + "// Called in the figure constructor.\n", + "mpl.figure.prototype._make_on_message_function = function(fig) {\n", + " return function socket_on_message(evt) {\n", + " if (evt.data instanceof Blob) {\n", + " /* FIXME: We get \"Resource interpreted as Image but\n", + " * transferred with MIME type text/plain:\" errors on\n", + " * Chrome. But how to set the MIME type? It doesn't seem\n", + " * to be part of the websocket stream */\n", + " evt.data.type = \"image/png\";\n", + "\n", + " /* Free the memory for the previous frames */\n", + " if (fig.imageObj.src) {\n", + " (window.URL || window.webkitURL).revokeObjectURL(\n", + " fig.imageObj.src);\n", + " }\n", + "\n", + " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", + " evt.data);\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", + " fig.imageObj.src = evt.data;\n", + " fig.updated_canvas_event();\n", + " fig.waiting = false;\n", + " return;\n", + " }\n", + "\n", + " var msg = JSON.parse(evt.data);\n", + " var msg_type = msg['type'];\n", + "\n", + " // Call the \"handle_{type}\" callback, which takes\n", + " // the figure and JSON message as its only arguments.\n", + " try {\n", + " var callback = fig[\"handle_\" + msg_type];\n", + " } catch (e) {\n", + " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", + " return;\n", + " }\n", + "\n", + " if (callback) {\n", + " try {\n", + " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", + " callback(fig, msg);\n", + " } catch (e) {\n", + " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", + " }\n", + " }\n", + " };\n", + "}\n", + "\n", + "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", + "mpl.findpos = function(e) {\n", + " //this section is from http://www.quirksmode.org/js/events_properties.html\n", + " var targ;\n", + " if (!e)\n", + " e = window.event;\n", + " if (e.target)\n", + " targ = e.target;\n", + " else if (e.srcElement)\n", + " targ = e.srcElement;\n", + " if (targ.nodeType == 3) // defeat Safari bug\n", + " targ = targ.parentNode;\n", + "\n", + " // jQuery normalizes the pageX and pageY\n", + " // pageX,Y are the mouse positions relative to the document\n", + " // offset() returns the position of the element relative to the document\n", + " var x = e.pageX - $(targ).offset().left;\n", + " var y = e.pageY - $(targ).offset().top;\n", + "\n", + " return {\"x\": x, \"y\": y};\n", + "};\n", + "\n", + "/*\n", + " * return a copy of an object with only non-object keys\n", + " * we need this to avoid circular references\n", + " * http://stackoverflow.com/a/24161582/3208463\n", + " */\n", + "function simpleKeys (original) {\n", + " return Object.keys(original).reduce(function (obj, key) {\n", + " if (typeof original[key] !== 'object')\n", + " obj[key] = original[key]\n", + " return obj;\n", + " }, {});\n", + "}\n", + "\n", + "mpl.figure.prototype.mouse_event = function(event, name) {\n", + " var canvas_pos = mpl.findpos(event)\n", + "\n", + " if (name === 'button_press')\n", + " {\n", + " this.canvas.focus();\n", + " this.canvas_div.focus();\n", + " }\n", + "\n", + " var x = canvas_pos.x;\n", + " var y = canvas_pos.y;\n", + "\n", + " this.send_message(name, {x: x, y: y, button: event.button,\n", + " step: event.step,\n", + " guiEvent: simpleKeys(event)});\n", + "\n", + " /* This prevents the web browser from automatically changing to\n", + " * the text insertion cursor when the button is pressed. We want\n", + " * to control all of the cursor setting manually through the\n", + " * 'cursor' event from matplotlib */\n", + " event.preventDefault();\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " // Handle any extra behaviour associated with a key event\n", + "}\n", + "\n", + "mpl.figure.prototype.key_event = function(event, name) {\n", + "\n", + " // Prevent repeat events\n", + " if (name == 'key_press')\n", + " {\n", + " if (event.which === this._key)\n", + " return;\n", + " else\n", + " this._key = event.which;\n", + " }\n", + " if (name == 'key_release')\n", + " this._key = null;\n", + "\n", + " var value = '';\n", + " if (event.ctrlKey && event.which != 17)\n", + " value += \"ctrl+\";\n", + " if (event.altKey && event.which != 18)\n", + " value += \"alt+\";\n", + " if (event.shiftKey && event.which != 16)\n", + " value += \"shift+\";\n", + "\n", + " value += 'k';\n", + " value += event.which.toString();\n", + "\n", + " this._key_event_extra(event, name);\n", + "\n", + " this.send_message(name, {key: value,\n", + " guiEvent: simpleKeys(event)});\n", + " return false;\n", + "}\n", + "\n", + "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", + " if (name == 'download') {\n", + " this.handle_save(this, null);\n", + " } else {\n", + " this.send_message(\"toolbar_button\", {name: name});\n", + " }\n", + "};\n", + "\n", + "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", + " this.message.textContent = tooltip;\n", + "};\n", + "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", + "\n", + "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", + "\n", + "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", + " // Create a \"websocket\"-like object which calls the given IPython comm\n", + " // object with the appropriate methods. Currently this is a non binary\n", + " // socket, so there is still some room for performance tuning.\n", + " var ws = {};\n", + "\n", + " ws.close = function() {\n", + " comm.close()\n", + " };\n", + " ws.send = function(m) {\n", + " //console.log('sending', m);\n", + " comm.send(m);\n", + " };\n", + " // Register the callback with on_msg.\n", + " comm.on_msg(function(msg) {\n", + " //console.log('receiving', msg['content']['data'], msg);\n", + " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", + " ws.onmessage(msg['content']['data'])\n", + " });\n", + " return ws;\n", + "}\n", + "\n", + "mpl.mpl_figure_comm = function(comm, msg) {\n", + " // This is the function which gets called when the mpl process\n", + " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", + "\n", + " var id = msg.content.data.id;\n", + " // Get hold of the div created by the display call when the Comm\n", + " // socket was opened in Python.\n", + " var element = $(\"#\" + id);\n", + " var ws_proxy = comm_websocket_adapter(comm)\n", + "\n", + " function ondownload(figure, format) {\n", + " window.open(figure.imageObj.src);\n", + " }\n", + "\n", + " var fig = new mpl.figure(id, ws_proxy,\n", + " ondownload,\n", + " element.get(0));\n", + "\n", + " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", + " // web socket which is closed, not our websocket->open comm proxy.\n", + " ws_proxy.onopen();\n", + "\n", + " fig.parent_element = element.get(0);\n", + " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", + " if (!fig.cell_info) {\n", + " console.error(\"Failed to find cell for figure\", id, fig);\n", + " return;\n", + " }\n", + "\n", + " var output_index = fig.cell_info[2]\n", + " var cell = fig.cell_info[0];\n", + "\n", + "};\n", + "\n", + "mpl.figure.prototype.handle_close = function(fig, msg) {\n", + " fig.root.unbind('remove')\n", + "\n", + " // Update the output cell to use the data from the current canvas.\n", + " fig.push_to_output();\n", + " var dataURL = fig.canvas.toDataURL();\n", + " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", + " // the notebook keyboard shortcuts fail.\n", + " IPython.keyboard_manager.enable()\n", + " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", + " fig.close_ws(fig, msg);\n", + "}\n", + "\n", + "mpl.figure.prototype.close_ws = function(fig, msg){\n", + " fig.send_message('closing', msg);\n", + " // fig.ws.close()\n", + "}\n", + "\n", + "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", + " // Turn the data on the canvas into data in the output cell.\n", + " var dataURL = this.canvas.toDataURL();\n", + " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", + "}\n", + "\n", + "mpl.figure.prototype.updated_canvas_event = function() {\n", + " // Tell IPython that the notebook contents must change.\n", + " IPython.notebook.set_dirty(true);\n", + " this.send_message(\"ack\", {});\n", + " var fig = this;\n", + " // Wait a second, then push the new image to the DOM so\n", + " // that it is saved nicely (might be nice to debounce this).\n", + " setTimeout(function () { fig.push_to_output() }, 1000);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('<div/>')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items){\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) { continue; };\n", + "\n", + " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " // Add the status bar.\n", + " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", + " nav_element.append(status_bar);\n", + " this.message = status_bar[0];\n", + "\n", + " // Add the close button to the window.\n", + " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", + " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", + " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", + " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", + " buttongrp.append(button);\n", + " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", + " titlebar.prepend(buttongrp);\n", + "}\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(el){\n", + " var fig = this\n", + " el.on(\"remove\", function(){\n", + "\tfig.close_ws(fig, {});\n", + " });\n", + "}\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(el){\n", + " // this is important to make the div 'focusable\n", + " el.attr('tabindex', 0)\n", + " // reach out to IPython and tell the keyboard manager to turn it's self\n", + " // off when our div gets focus\n", + "\n", + " // location in version 3\n", + " if (IPython.notebook.keyboard_manager) {\n", + " IPython.notebook.keyboard_manager.register_events(el);\n", + " }\n", + " else {\n", + " // location in version 2\n", + " IPython.keyboard_manager.register_events(el);\n", + " }\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._key_event_extra = function(event, name) {\n", + " var manager = IPython.notebook.keyboard_manager;\n", + " if (!manager)\n", + " manager = IPython.keyboard_manager;\n", + "\n", + " // Check for shift+enter\n", + " if (event.shiftKey && event.which == 13) {\n", + " this.canvas_div.blur();\n", + " event.shiftKey = false;\n", + " // Send a \"J\" for go to next cell\n", + " event.which = 74;\n", + " event.keyCode = 74;\n", + " manager.command_mode();\n", + " manager.handle_keydown(event);\n", + " }\n", + "}\n", + "\n", + "mpl.figure.prototype.handle_save = function(fig, msg) {\n", + " fig.ondownload(fig, null);\n", + "}\n", + "\n", + "\n", + "mpl.find_output_cell = function(html_output) {\n", + " // Return the cell and output element which can be found *uniquely* in the notebook.\n", + " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", + " // IPython event is triggered only after the cells have been serialised, which for\n", + " // our purposes (turning an active figure into a static one), is too late.\n", + " var cells = IPython.notebook.get_cells();\n", + " var ncells = cells.length;\n", + " for (var i=0; i<ncells; i++) {\n", + " var cell = cells[i];\n", + " if (cell.cell_type === 'code'){\n", + " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", + " var data = cell.output_area.outputs[j];\n", + " if (data.data) {\n", + " // IPython >= 3 moved mimebundle to data attribute of output\n", + " data = data.data;\n", + " }\n", + " if (data['text/html'] == html_output) {\n", + " return [cell, data, j];\n", + " }\n", + " }\n", + " }\n", + " }\n", + "}\n", + "\n", + "// Register the function which deals with the matplotlib target/channel.\n", + "// The kernel may be null if the page has been refreshed.\n", + "if (IPython.notebook.kernel != null) {\n", + " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", + "}\n" + ], + "text/plain": [ + "<IPython.core.display.Javascript object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADQfSURBVHhe7d0HnFTV/f7xh1AtgF1BjVgwYlQUYwdsCCiWxEhQUESDooLlL1YERCXEFjtElIgiKPyMvQREEQRbFAto7DGKomIBFkRZYPf//c65I8tKn92Ze+d+3q/X85uZM6O/uBd2nz3nnnsFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoFhcbllsKbHMix5HWbLKLAssFd//rQUAAAAJ5QXw+fB0ubwAHhyeAgAAFJ9fRY9YVo3oEQAAoOiktQDuYfna8onFl3+bWCoaafnG8pqluw8AAAAUizTOdO1s8XP7ZlgaWa6z7GvZzeLn/vny74uWJZbDLF4QL7UMtVTmX7/GFv/3AQCA5KhvmWkpz7xKGZY6pTqWuZajLM/4QCX9LW0tLTOvlrWl5fPwFAAAJMxWli/C03ShAC4tgEdbxvtAJV4A21kOyLxaVgPL3BkzZqhBA3+KQurTp48GDRoUvUIhcSziheMRHxyLeCgpKdHWW2/tTxv6S3+SNmksgB0tEyzfWTa3+BKwz+7tatnR4l+T6RbfDXyo5X6Ll8DBlsoyBdBQAGPg/PPP1w033BC9QiFxLOKF4xEfHIt48ALYsKF3v/QWwDRuAjnR8h/LfItv8qhpaWP5weJLur4BxMuhbwK5xnKJZXnlDwAAIJHSWACPsfjM3/oWn//tYvmvxT1h8U0iPp23kcV3C99pQQK0a+cr9YgDjkW8cDzig2OBuOAcwNywBAwAQMKwBMyFoAEAAFKHAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAAAgZSiAAAAAKUMBBAAASBkKIAAAQMpQAAEAAFKGAggAAJAyFEAAAICUoQACAACkDAUQAACkyqxZ0ZMUowACAICitmSJ9PLLUv/+0l57STvuGL2RYhRAAABQdL79Vho1SurSRdp8c+mII6QPP5TOOSc8pl2N6BFrp4FlrlGDBv4UAAAUQlmZ9Prr0lNPhbz2mtS8uXT44aH87b23VKtW+GxJSYkaNmzoT/3/lPiTtKEA5oYCCABAgcyeLT39dCh8Y8dKCxdKbduG0te+vdSoUfTBSiiAFMBcUQABAMiT8nLpzTelf/0rlD4/r++3vw0zfF769ttPql07+vBKUAApgLmiAAIAUI3sR6zGjw+lzzNvnnTYYaH0+SzfVltFH1wDFEAKYK4ogAAAVCGf5Xv77TDD54XvhRfCrl0vfJ4DDpDq1Ik+vJYogBTAXFEAAQDIkc/qPfvs0tL3/ffSoYcuXdrdZpvog1WEAkgBzBUFEACANeSzfO+9FwqfZ/Jkabvtlu7YbdVKqlcv+nA1oABSAHNFAQQAYDX88IP03HNLS9/XX0uHHBJKn2f77aMP5gEFkAKYKwogAADL4bN8fsHl7I7dSZOkLbeUOnQIhe+gg6R11ok+nGcUQApgriiAAABEfvxRmjhxaembMSMUvey5fE2bWvGIQfOgAFIAc0UBBACk2n//G8qel74JE5beds1z8MHSeutFH4wRCiAFMFcUQABAqvjdNp5/fmnp8wLomzaypW+nneIxy7cyFEAKYK4ogACAovfpp0uXdf1yLRtttHTHrl+upX796IMJQQGkAOaKAggAKDqlpeECzF74PB98EC7AnC19u+wS/1m+laEASr+KHtPkcstiix/wedHjKEvWbpZJlvmWzy3+eQAAitoXX0jDhknHHittvLHUuXO4IPMVV0jffBM2d1x8sbTrrskufwjSWADdixafsvNJa3/sYnHrW8ZaJls2srS3dLecawEAoGgsWhTO5bv0Uql583C3jbvvln73uzA+c6b0j39Ixx0nbbBB9A+haKS1AK7IHy3+NelvKbW8bbnO0ssCAECiffmlNHy49Kc/SZtuGsqdF70+faRZs6QpU8LzPfZglq/YpbUA2h9tfW35xOLLv00szn4H0huWssyr4FXLdhafHQQAIDGWLJFefFHq21fac09pq62koUPDOXzPPCN99ZV0zz1Sp05hYwfSI40F8AHLzpbNLftbyi3jLetafDl4jqWi2dEjuzwAALHnM3n33iudcEKY5Tv6aOmTT6Tzzw+3X3v5Zal//7DU+yvWAVOLCV6pjmWu5SjLEZZmlsMtWftZplh8p5BvDKnIS+Hcnj17qk4d/9dI7dq1ywQAgHwoK5Nee23pjt2pU6UWLZbu2N1rL6lmzejDKTZu3LhMXGlpqQYPHuxPuQxMimULoP2OpEaWay2NLdllYN8A4ucANs28WlamAHIZGABAPn33nReacG2+sWOlxYt9AiKUvvbtw904sGJcBiadS8AdLRuHp5ll4GGWLy2+M/ghyxLLFZZ6ll0tvS23WQAAKAif5fOZvYEDpf33DwXvuuukX/9aevjhcJmW0aOlk0+m/GH1pHEG8FHLvha/O6Gf3/e8pZ/lvxa3i2WIZU+Lzwz+3XKVZXmYAQQAVIvZ9hNq/Pgwy+dZsEBq2zYs6/osX2Nfq8JaYQaQJeBcUQABAFWivFyaNm3puXwvvSQ1axYKn8dn/mrXjj6MnFAAKYC5ogACANaa9ZDM5Vi88Pksn/04UZs2ofD5+Xxbbx19EFWKAkgBzBUFEACw2nyW7513Qtnz0ucXXm7adOmO3ZYtpbp1ow+j2lAAKYC5ogACAFbqxx+lCROkxx8Ppe/bb6VDDw2lz7PtttEHkTcUQApgriiAAIBf8FuuPfFEKH2+xOs7c486SurQQTrwQKmeX2cCBUMBpADmigIIAMgs7b7xRih8Xvz8+T77hNLn2Xln+4HLT9zYoABSAHNFAQSAlPKl3WefDYXPY50iczFmL3y+tOu3YUM8UQApgLmiAAJAisycKT355C+Xdj2+tBvdFRQxRwGkAOaKAggARazi0q7nzTdZ2i0GFEAKYK4ogABQZLJLu9nz+ebNW7q065dq2WST6INILAogBTBXFEAAKAK+tJs9l8+XdrfYYuksX+vWLO0WGwogBTBXFEAASCBf2n399VD4sku7++4bCt+RR7K0W+wogBTAXFEAASAhFixYekHm7NJu+/ah8LG0my4UQApgriiAABBj2aVdL31+Xh9Lu3AUQApgriiAABAj2aXd7CxfxaVdT7NmLO2CAuj4a5AbCiAAFJgv7Va8IHN2adcLn1+QmaVdVEYBpADmigIIAAXwxRfLXpC5USOWdrH6KIAUwFxRAAEgD8rKlr0g81tvsbSLtUcBpADmigIIANUku7Trhc9n+1jaRVWhAFIAc0UBBIAq5Eu7FXftNm68dJavVSuWdlE1KIAUwFxRAAEgB760W3HXri/t7rdfKHx+fT6WdlEdKIAUwFxRAAFgDVVc2vXS98MPS++1y9Iu8oECSAHMFQUQAFYDS7uIEwogBTBXFEAAWI6KS7ueadOWLu16dtqJpV0UDgWQApgrCiAARHxp16/J54XPd+360m52164/srSLuKAAUgBzRQEEkGqffx6Wdj2+tLvllqHw+QYOlnYRVxRACmCuKIAAUmV5S7v77x8KH0u7SAoKIAUwVxRAAEVvZUu7vmt3442jDwIJQQGkAOaKAgigKGWXdr30TZiwdGnX07IlS7tINgogBTBXFEAARcGXdqdOXbq0O316WNrNns/H0i6KCQWQApgrCiCAxPKlXF/azW7i8KVelnaRBhRACmCuKIAAEmVlS7u+a7d27eiDQBGjAFIAc0UBBBBrK1va9fzmNyztIn0ogBTAXFEAAcTS4sXS3XdLV17pP+yWvSAzS7tIOwogBTBXFEAAsVJeHmb6LrlEWrRIGjhQOvZYlnaBiiiA0q+iRwBAwr30ktS6tdS9u9Szp/Sf/0idOlH+APwSBRAAEu7998MsX9u20qGHSh9/HAogxQ/AilAAASChvvxS6tFD2n13aYstpA8/lAYMkOrXjz4AACtAAQSAhPFNHf36SU2bSt9/L731ljRkSCiBALA6KIAAkBClpdKtt0rbby89/7z07LPSAw9IO+4YfQAAVhMFEABizq/lN3q01KyZNHSoNHy4NHGitM8+0QcAYA1RAAEgxvxuHXvvLV14odS3b1ju9XvzcvFmALmgAAJADHnR84s2++7ejh2lDz6QTjlFqlkz+gAA5IACCAAx8umnUteu0n77SbvsEi7pcvHF0jrrRB8AgCpAAQSAGPDdvBdcEM7zc+++K11/PbdtA1A9KIAAUEA//ihdc4203XbS22+Hu3mMGCFts030AQCoBhRAACiAJUvCbl6/hItfyuXBB6WxY6XmzaMPAEA1ogACQB6Vl0tPPBGK3sCB0nXXSf/+d7iFGwDkCwUQAPLklVekgw4Ku3n9Fm5+nt/xx9s3Yr4TA8gzvu0AQDXze/T6pVx8lq9167Cz9+yzpTp1og8AQJ5RAAGgmnz9tXTWWdJuu0kbbRSK4FVXSQ0aRB8AgAKhAAJAFZs3TxowQNphB+mrr6Q33gi3cGvUKPoAABQYBRAAqsiiRdKQIaH4PfOMNG6c9NBD0k47RR8AgJigAAJAjnxnr1/KZeedpVtvle64Q5o8Wdp//+gDABAzFEAAyMGkSdK++0rnnRdu2TZ9unTMMVKNGtEHACCG0l4AH7aUWQ7JvAr89QJLiWVe9PhbCwD8zIvekUdKRx8dCp9v8OjeXapVK/oAAMRYmgtgV4vfXr0882pZHSy+T69+9PiOBQA0Y0a4jt/ee0tNm4ZLuvTpI627bvQBAEiAtBbArSxXWuz3dS1voYbFGwDLmD07LPH+5jdSaan0n/9IN94obbJJ9AEASJC0FsB/WK6yfJ559UsjLd9YXrN4SQSQUj/9JF1/vbT99tLrr0tTpkijRknbbht9AAASKI0F8Kzo0Uvg8vgdOf1bu1+xq5/lWksPC4AUWbJEGjEizPh54RszRho/XmrRIvoAACRY2pY6t7PY7+/axzLDB4xv+mhjmZB59Uv9LW0tLTOvluXnB87t2bOn6kT3dGrXrl0mAJLJL+kydqx0ySVSSYk0cKB0wgn223Lat8wBCTdu3LhMXGlpqQYPHuxPG1p8s2fqpK0AnmwZavGDnf1v39gy12K/3+sMH6jEC6A3ugMyr5aVKYBGDbi3E5B4r70mXXSRNG2a1LevdOaZUt260ZsAikaJ/XbXsKF3v/QWwLT9Tuslz2cBd7c0j+JOt9jv+9rD4gs8tS01LT7zd67lPguAIuU7eY8/XjrwwHBNP3/t1/Wj/AEoVmkrgD9ZZlaKXwbmO8scy5YW3wDir30TyDUWL4aZeWIAxWXWLOnss6VddpHWX1/64ANp0CApTAwAQPHirJYw05c9/+8Jy84WX8/dyOIzgndaABSRH36Qrroq3LP3s8+kqVOlYcPsN0D/FRAAUoACCCA1Fi2Shg4Nxe+pp6Qnn5QefTTcwxcA0oQCCKDo+c7ehx4KS7033CD55r8XX5RatYo+AAApQwEEUNT8ws0HHCD17Cmdf770zjvSscdKNbjfD4AUowACKEp+q7ajj5aOOEI6/HDpo4+kHj2kWrWiDwBAilEAARSVL76QuneX9txTatIkFL9+/aT11os+AACgAAIoDnPnSn36SDvuKM2fL739tnTLLdJmm0UfAAD8jAIIINEWLpRuvFHabjvp5ZeliROl0aOl7bePPgAA+AUKIIBEKiuTRo2SdtpJuvvu8PzZZ6W99oo+AABYIQoggMR5+ulwjp8v+V5xhfT661L79uzsBYDVRQEEkBhe9A47LNy398QTpfffl7p2lWr6/XwAAKuNAggg9j75ROrSRWrZUmrRQvr4Y6l3b6levegDAIA1QgEEEFvffiudd164VVvdumHG75prpA03jD4AAFgrFEAAsbNggTRoUNjJ69fxe/VV6a67pK23jj4AAMgJBRBAbCxeLA0bJjVtKj36qPTYY9ITT4R7+AIAqg4FEEDBlZeHwrfbbmGJ96abwjX9Djww+gAAoEpRAAEU1IsvSq1aSaefLvXqFe7h27Ejl3QBgOpEAQRQEO+9Jx17rNSundSmTTjX76yzpNq1ow8AAKoNBRBAXn35pdSjh7THHlKjRqH4DRgg1a8ffQAAUO0ogADyoqRE6tcvbPD4/ntp2jRp8GBp882jDwAA8oYCCKBalZZKt9wSLuny/PPhfr0PPBCKIACgMCiAAKpFWZk0erTUrJl0xx3S3XdLEydK++wTfQAAUDAUQABVbsIEae+9pQsvlPr2ld56S+rQgZ29ABAXFEAAVcav53flldIf/iD96U/SBx9Ip5wi1awZfQAAEAsUQABVwsvfBRdIf/+79MIL0kUXSeusE70JAIgVCiCAnC1ZEi7k/NBD0pQp3LoNAOKOAgggJ4sWSV26hOI3eXLY7QsAiDcKIIC19uOP4Xw/P9fPL/Gy1VbRGwCAWKMAAlgr8+ZJhx8uzZkTdv1uumn0BgAg9iiAANbYd99Jhx4q1a0rjRsnbbBB9AYAIBEogADWiN/L96CDpK23lh57TFpvvegNAEBiJK0AnmNpEJ4CyLf//U9q1Upq0UIaMybMAAIAkidpBbC7ZablLsvePgAgP957T2rZMpz3N3y4VKtW9AYAIHGSVgB3s7Sz+H0FJlresJxhWd8CoJq8YX/TWreWunWTbrnFvnFw8ggAJFoSv42/YDnZ0thyt+U8i88KDrXsZAFQhfyuHgcfHO7yMXAg9/MFgGKQ5N/jt7F44Wtkec/S0PK6pbcFQBUYP15q3166+upwazcAQHFIWgFc1/Jny78tPhNY23KIxc8HPN6yv6WfBUCOHn44XOR56FDpDD/RAgBQNJJWAL+0XGC5z+L3HPBNIVMtWW9apoWnANbWiBHSSSfZXzT7m9a5czQIACgaSSuAf7A0s9xkmeMDy9E6egSwFgYPlnr1kh59VDr66GgQAFBUklYAv7dsHZ7+7NeW5uEpgFz89a9Sv37S00+HO30AAIpT0gqgX/+v8n0H/LWPA1hL5eXSJZdIN98sTZwo7btv9AYAoCglrQBub/EdvxW9a/FxAGuhrEw666xwvt/zz0u7+dU2AQBFLWkFsMSyYXj6s40tC8JTAGti0SKpa1fp2WelKVOkHXeM3gAAFLWkFcBJluss2ZtQ+eNfLX5XEABr4KefpI4dpenTpcmTpV/72bQAgFRIWgG82NLK4peDeTV6PMjCJWqBNTB/vnTkkdLXX4dz/jbfPHoDAJAKSSuAX1h8x++ZljHRo5+x9LkFwGqYPVs67LCw8cPv9LFh5ZMqAABFj7t65qaBZa5Rgwb+FIg3n/Fr21Zq0sR+g7JfoerVi94AgBQpKSlRw4Z+B9nMbWR9f0HqJK0A+ozlSRa/9Vt9H6iga/SYTxRAJMZnn4WZv732koYPl2r7jRQBIIUogMlbAh5iucGyqWVJpQBYgQ8+kFq2lA45JNzmjfIHAOmWtBnAby37WT7MvCo8ZgARe9OmhZm/bt2kq6+2v/Sc+AEg5ZgBTN4MYKnlk/AUwKq8/LJ00EHSeedJ11xD+QMABEkrgLdbzg5PAazMhAlhw8dVV0mXXhoNAgBgkjYfMNniG0BmWGb6QAWto8d8YgkYsfTYY1LnztKQIeFOHwCApVgCTl4BvDx6XJ4rosd8ogAidvyevqedJo0cKf3hD9EgAOBnFMDkFcC4oQAiVoYOlS64QHroobDxAwDwSxTA5J0D6LxpdbZkb//mN7HaIjxdYw9byiyHZF4FfmcRv+fwfIvfYWRls45AbFx7rXTxxdLYsZQ/AMDKJa0A7m7xS8AMsPT3AbOH5bbwdI34mVHrWMozr4L1LfbjM3Ou4UaW9pbulnMtQCz5Ld0uu0y67jrpueekAw6I3gAAYAWSVgBvsvi5fjtaFvmAecGyb3i62rayXGnxcldxGfyPFv+aeLn0S868bbEfq+plAWKnrEw65xzpnnvstxb7tWUP/3UIAIBVSFoB3NXil4Jx2Zm7eZbKt4VblX9YrrL4Em9FzS1vWHxZOOtVy3YWnx0EYmPxYunUU6V//UuaMkXaaafoDQAAViFpBXC2xc/5q+jXlq/C09VyVvToJbAyP79wTnj6M///6djlgdhYuFDq1EmaOjXM/DVpEr0BAMBqSNou4EGW31l6Wl6x+IaNwRb7MZhZ0l0Vn8mbYtnH4tcSdD7b18YyweL3GW5mOdyS5bee83/Gdwr5xpCKMruAe/bsqTp16mQG2rVrlwlQXX74QTr2WPvNxH418dm/jTeO3gAArNC4ceMycaWlpRo82OsDl4FJirqWoZbspW19GfgRi+8KXugDq3Cyxf95P9jZ/3b/8TnXMsbyosXP+WtkyS4D+wYQPwewaebVsjIFkMvAIF/sj5o6dJBq1ZIef1yqv6YnPwAAuAyMSep1AL20bW/xpd/PfGA11bP47t6K/DzATpbxlsWW9y13Wf5i8dL3pOVvlpstlVEAkTfffOMzzFLjxtIDD0jr+B52AMAaowAm7xzArO8s/7asSflzP1n8FnIV47OI/u/zc/98idfXbw+Mxnyu+E7L8sofkDef268prVtLO+4YLvJM+QMA5CIJM4B+XT6/Hp/z6/NVvG5fRdwLGEXp44+lQw8NF3e+/XapZs3oDQDAWmEGMBkzgH5XjqxnLM+uIEDRefttqVUr6bjjpDvuoPwBAKpGUs8BjAtmAFFtXn1Vat9eOu88qW9f+8vK31YAqBLMACbvHEC/w2nly936a7+MC1A0Jk2yP9T2p7p/f6lfP8ofAKBqJa0A+mYM38hRkb9mkwaKxlNPhUu93HijdC53oQYAVIOkFUC/h+//wtOf+WsfBxJvzBipY0dp+PBwmzcAAKpD0grgt5Ytw9Of+Wu/kDOQaMOGSX/+s/TPf4YSCABAdUlaAfRLwvidPLIXc/bHIZanMq+AhPLl3t69w/Lv4RVvRAgAQDVIWgG8zOLbbWdZvokeN7RcagESp7xcGjBA+stfpGefDRd7BgCguiV1b+HvLE0sfv7faz5QIFwGBmvNy9/554fz/p55Rtp55+gNAEC14jIwyZsBzPLS98/oEUicJUuk006THn1UmjKF8gcAyK8kzADeYTk9PNWI6HF5ukaP+cQMINZYaal00knS9OnS+PHSlpW3NQEAqhUzgMmYAVwSPboyi79eXoDYW7BA+v3vw/19n3+e8gcAKIwkzAAeYYnrLl9mALHa7BdOHXWU/RZjv8Y88YT92pn55RMAkG/MACZjBnB09OhSeZCQfN99Jx16qLTuutK4cZQ/AEBhJaEAzre0sNS0+Iylx/93Vw4QSzNnhsu7NGkSNn14CQQAoJCSUJxusLxqKbX4j87FlkXLCRA7n3witWol7b23dP/9Up060RsAABRQUq4D2NiyneVpy4rukzApeswnzgHECr37rtSmjXTcceFOH79inhoAYoFzAJMxA3iGZaZliuVqixe95QWIjddfD8u+fm/fm26i/AEA4iUJP5aujR7dBdEjEFt+YedDDpEuuUS68kqpRlLm2QEAqZGEAjjbcqzFl4D9f++20fPKAQrOd/gefrj91mK/tvTuHQ0CABAzSZib6GIZalkn8yrw/93l4enPz32XcL5xDiB+9uCDUteu0rBh0gknRIMAgNjhHMBkzACOsvgB2sbyo8Vn+yrOAmafAwVzzz3SySdLY8ZQ/gAA8ZeUU9N9CfhzyzGWTy21osdsOlqAgrj1Vunss6XHH5eOPDIaBAAgxpJyerpPz1ZcY/3eslF4mlH5/XxhCTjFysulv/xFuuEGaezYcK0/AED8sQScnBnAykV1Va+BauXl76KLpNtukyZNovwBAJIlKQUwu+Eja1WvgWqzZIl05pnSAw+ES77sumv0BgAACZGUAgjEwqJF0kknSc89J02eLO2wQ/QGAAAJkpSl04WWa8LTjAst14WnGRdZ6oWnecU5gCny00/Sn/4kzZgRrve32WbRGwCAROEcwOQUwImWVS3zHhw95hMFMCXmzZOOOcZ+E7FfRZ58Utpgg+gNAEDiUADZPJErCmAKfP+9dMQRdrDtED/8sLTeetEbAIBEogByDiCwUl99JR10kNSoUbjOH+UPAFAMKIDACnz6qdSqlbT77mHHb9260RsAACQcBRBYjvffD+WvbVvp7rulWn7vGQAAigQFEKjkzTdD+TvxxHCh51/xtwQAUGT40QZU8NJL0sEHS+efLw0aJNVgmxQAoAhRAIHIM89I7dqF4nfJJdEgAABFiAIImEcflX7/e2nIkHCbNwAAihkFEKk3cqTUpYs0alQ47w8AgGJHAUSq/f3vYcbvkUfCnT4AAEgDCiBS6+qrpT59pKefltq0iQYBAEgBCiBSp7xcuvRS6cYbpYkTpf32i94AACAlKIBIlbIyqVevcN7f889LzZtHbwAAkCIUQKTG4sVSt25hyXfKFOk3v4neAAAgZSiASIWFC6WOHcNdPiZPlrbZJnoDAIAUogCi6P3wg3TkkdKXX4Zz/rbYInoDAICUogCiqM2ZI7VtKy1ZIo0fL220UfQGAAApRgFE0Zo1K9zXd+ONpaeekurXj94AACDlKIAoSjNmSK1bS82aSQ8+KNWrF70BAAAogCg+H30ktWwpHXigdO+9Uu3a0RsAACCDAoiiMn261KqV1KmTdPvtUs2a0RsAAOBnFEAUjX//WzrooHCh52uukWrUiN4AAADLoACiKLzySrif74AB0mWXUf4AAFgZCiASb/bssOTbv7909tnRIAAAWCEKIBKtvFw67TRp112l3r2jQQAAsFJpLID9LR9Z5lhmWf5laW6pqMyywFJimRc9/taCmBk6VHrpJWn4cJZ9AQBYXWksgPdb9rRsYGlsGW8ZZ6lcHzpYGlj88sH++I4FMTJtWpj1u+8+aZNNokEAALBKaSyAH1rmhqfyi4T4bN+mlso3CWM+Kcb8/r7HHy9deGG43h8AAFh9aT0H8AjLbMuPlustN1i+s1Q00vKN5TVLdx9AfJx7rrV2q+19+0YDAABgtaW1AD5l2dDis36+deBlS0WHWra1NLL0s1xr6WFBDNx/v/Tww9KoUVKtWtEgAABYbSxzhq+Bzwa2skz3geXwjSNtLS0zr5bycwPn9uzZU3Xq1MkMtGvXLhNUj48/llq0kEaOlI46KhoEAGAVxo0bl4krLS3V4MGD/WlDi2/0TB0KoORzSH5O4EmWh3xgObwAeqs7IPNqqUwBNGrQwJ+iOtnfVx1gR8Bz003RIAAAa6ikpEQNG3r3S28BTOMS8DmWzcLTzOaPIZaFlhd8wOxhaWGpbfFNIj7zd67lPgsKqE8facmScJs3AACw9tJYAA+zvGXx6/u9afEy2MbytcVtafENIL4pxDeBeN24xJKZK0ZhPPWUdMcd0pgxUt260SAAAFgrLAHnhiXgPJg5U2reXLrxRunEE6NBAADWEkvA6d0FjITwJV8vfR06UP4AAKgqFEDE2l//Kn3xhXTbbdEAAADIGQUQsTV5ciiAo0dL668fDQIAgJxRABFL338vde4sXX21tIfvywYAAFWGAojYKS+XTj01XPC5V69oEAAAVBkKIGLHL84+dap0111SDfapAwBQ5SiAiJU335Quvli67z5p442jQQAAUKUogIiN+fOlTp2kSy6RWvmdmQEAQLWgACI2/Hy/xo3DLd8AAED1oQAiFu69V3rySWnUKKmm34EZAABUGwogCu7DD6WePaW77w4zgAAAoHpRAFFQCxdKxx8vnXZauN0bAACofhRAFJRv+PBLvfgdPwAAQH5QAFEwjz8ervXnt3qrUycaBAAA1Y4CiIL4/HPplFOk22+XdtghGgQAAHlBAUTeLVkidekiHXOMdMIJ0SAAAMgbCiDybuBAadYs6ZZbogEAAJBXFEDk1aRJ0rXXSmPGSOutFw0CAIC8ogAib779Niz9Xn+9tNtu0SAAAMg7CiDyorw8bPrYZx/pjDOiQQAAUBAUQOSFn+83bZo0bFi47h8AACgcCiCq3dSpUp8+0v33SxtuGA0CAICCoQCiWs2bF2711revtP/+0SAAACgoCiCqjZ/3d+aZUpMm0sUXR4MAAKDgKICoNiNGSOPHS/fea3/Q+JMGAEBs8GMZ1eL996VevUIJ3GKLaBAAAMQCBRBV7qefpE6dwvJvu3bRIAAAiA0KIKrchRdKdeuGW74BAID4oQCiSj3ySDjnzy/5UqdONAgAAGKFAogq89ln0qmnSkOHStttFw0CAIDYoQCiSixeLHXuLB13XDj/DwAAxBcFEFXiiiuk2bOlm26KBgAAQGxRAJGzCROkG2+UxoyR1l03GgQAALFFAUROZs2SunSRbrhB2mWXaBAAAMQaBRBrraxM6tZNatVKOu20aBAAAMQeBRBrzc/3e/dd6Y47pBo1okEAABB7FECslVdflfr1C9f722CDaBAAACQCBRBrrKREOv546fLLpX33jQYBAEBiUACxRsrLpR49pB12kC64IBoEAACJQgHEGhk+XHruOWnECPvDw58eAAASiR/hWG2+4ePcc6WRI6XNN48GAQBA4lAAsVp+/DHc4u3ss6U2baJBAACQSBRArJbevaX11w+3fAMAAMlGAcQqPfhguNzLffdJtWtHgwAAILEogFip//1P6t5dGjZMatIkGgQAAIlGAcQKLVokde4snXCC9Mc/RoMAACDxKIBYIb/Q8/z50t/+Fg0AAICiQAHEco0fL916qzRmjLTOOtEgAAAoChRA/MLXX0snnSTdfLPUrFk0CAAAigYFEMsoK5O6dpUOPlg65ZRoEAAAFBUKIJZx/fXSRx9Jt98u1agRDQIAgKJCAcTPXn5ZGjBAGj1aatgwGgQAAEWHAoiMOXPC5V6uukraa69oEAAAFCUKIFReLp1+etjw8f/+XzQIAACKVhoLYH/LR5Y5llmWf1maWyrazTLJMt/yueVyS9G6805pyhTp7rvtDwS/EgAAUPTS+OP+fsuelg0sjS3jLeMs2S0P61vGWiZbNrK0t3S3nGspOm+/LZ1/vjRypLTZZtEgAAAoamksgB9a5oanqmkps2xq8bLn/KZn/nXxmcJSi1UkXWfpZSkqCxZInTqFZd9DDokGAQBA0Uvrgt8RltmWHy3XW26wfGdxvhz8hsWLYdarlu0sPjtYNM47T9pww3DLNwAAkB5pLYBPWaz6ZGb9eltetmQ1sPj5gRV5WXT+XlH4v/+T/vlP6b77pFq1okEAAJAKXOo3fA284LWyTLf4bKDfAO1wS9Z+likWvzqebwzJ8kI4t2fPnqpTp05moF27dpnE2SefSHvsETZ9/P730SAAAEVs3LhxmbjS0lINHjzYn/rP9RJ/kjYUQMnnv/ycwJMsD1m6Wq61+AaR7DKwbwDxcwCbZl4tlSmARg0aJGNycNEiqWVLae+9pVtvjQYBAEiRkpISNQx3PEhtAUzjEvA5lux+V9/8McSy0PKCDxgvgUssV1jqWXa1+DLxbZbE69vX/mPtv/Y639YCAABSKY0F8DDLW5Z5ljctXgbbWL62OF/i9TXcAy2+McTni++03GxJNJ/5HmJ1d8wYa7ZebQEAQCqxBJybxCwBf/ml1Lx5mPk7+eRoEACAFGIJOL27gFOlrEw66STfoCJ19TMcAQBAqlEAU+Caa6RPPw3LvzWY8wUAIPUogEXuxRelgQPDeX/160eDAAAg1SiARWz2bOmEE6RBg6QWLaJBAACQehTAIlVeLnXvLu22m3SOX/gGAAAgQgEsUrffLr3yijR8OOf9AQCAZVEAi9C0adIFF0ijRkmbbBINAgAARCiAReaHH6ROnaSLLpIO9EtZAwAAVEIBLDJ+vt/mm4dbvgEAACwPBbCI3Hef9Oij0siRUs2a0SAAAEAlFMAi8dFH0hlnhE0fW20VDQIAACwHBbAIlJZKxx8vnXqqdNRR0SAAAMAKUACLwKWXhvv9+i3fAAAAVoUCmHBPPindeWe41VvdutEgAADASlAAE+yLL6Ru3aQhQ6SmTaNBAACAVaAAJtSSJdKJJ0odOoRHAACA1UUBTKhBg6SZM6XbbosGAAAAVhMFMIEmT5auvjqc97f++tEgAADAaqIAJsz330udO4cdv7vvHg0CAACsAQpggpSXh2v97bmn1LNnNAgAALCGKIAJMniw9Prr0l13STVqRIMAAABriAKYEG++KV18cbjf70YbRYMAAABrgQKYAPPnS506hTt+tGwZDQIAAKwlCmAC9OolbbllKIAAAAC5ogDG3L33htu9jRwp1awZDQIAAOSAAhhjH3wQdvvec4/UuHE0CAAAkCMKYEwtXCgdf7x0+unSEUdEgwAAAFWAAhhTvuPXl3z9lm8AAABViQIYQ489Jg0fLo0eLdWpEw0CAABUEQpgzHz+uXTKKdLQodL220eDAAAAVYgCGCOLF4f7/P7hD+H8PwAAgOpAAYyRgQOlb7+Vbr45GgAAAKgGFMCYmDhRuv56acwYab31okEAAIBqQAGMAZ/169IlFMBdd40GAQAAqgkFsMDKy6Vu3aT99pN69IgGAQAAqhEFsMD8fL/p06U775Rq1IgGAQAAqhEFsICmTpUuu0y6/35pww2jQQAAgGpGASyQkhKpUyepb19p//2jQQAAgDygABaAn/d35pnSttuGW74BAADkEwWwAO65R3rmGenee+0AcAQAAECeUT/y7L33pLPPlkaMkLbYIhoEAADIIwpgHv30U7jF21lnSe3aRYMAAAB5RgHMowsvlOrVC7d8AwAAKBQKYJ488kg4588v+VK7djQIAABQABTAPPjsM+nUU8PFnn3nLwAAQCFRAKvZ4sVS585Sx44hAAAAhUYBrGZXXCHNmSPdeGM0AAAAUGAUwGo0YUIofmPGSOuuGw0CAAAUGAWwmsyaJXXpEgrgb38bDQIAAMQABbAalJVJ3bpJrVtL3btHgwAAADFBAawGPuv37rvSHXdINWpEgwAAADFBAaxir74q9e8vjR4tNWwYDQIAAMQIBbAKzZ0bbvU2YIC0zz7RIAAAQMxQAKtIebnUo4fUtKnUu3c0CAAAEENpLIB/tUyzzLV8YbnPspWlojLLAkuJZV70uNK9vHfdJU2aJI0YYV9UajUAAIixNFYVL3cnWza2NLOUWx63VNbB0sBSP3p8x7Jc770nnXtuuNfvZptFg8i7cePGRc9QaByLeOF4xAfHAnGRxgJ4meUNy2KLz+xda9nNUnnLxmrv3/VLvngBbNMmGkBB8I01PjgW8cLxiA+OBeKCxUqpneVTiy8JVzTS8o3lNctKr+ZXv37Y+AEAAJAEab9Knc/ZPWw51jLeByIHW160LLEcZhlludQy1FKRLw3PfemlGdp5Z3+KQurTp48GDRoUvUIhcSziheMRHxyLeCgpKdHWW2/tT331z1cDUyfNBfBIy70WPx/wMR9Yif6WtpaWmVdLbWn5PDwFAAAJ45tAfUNo6qS1AHax3GbpaHnGB1bBC6AvFR+QebWUf/0aW3ynMAAASA7f5DnT4ptBkQK9LN9bKpe5rD0sLSy1LTUtPvP3naWnBQAAAAnkl4FZaPE1/4rX+csWQl8a/o/Fx7wo+o7h0ywAAAAAAAAAikUny/MWvzSM7wSufLkcv27gJMt8i28CudxS2RUWP7HUZxgnWlZ6JxEs1+rctYVjkT9+LuxHljmWWZZ/WZpbKuJ45J9fycBXNg7JvAo4DvnjX9vsdWWzK0p+5YgsjkX+7Wd51uLHYrZliiWL44GV8ku/eAk8xVK5AK5v8ZNGB1rqWHaxzLCca8m60OLXFtzZUtfie/79D9q6Fqy+v1j8nMxaFr/Ojn9T9SX5LI5FfjW1ZC+Y7sfkfMtXluxmMo5H/nW1jLX496lsAeQ45JcXCJ8wWB6ORf55+fPS55s9/evpP7/3sjiOB1bbgZbKBdAvG+M/9CqOnWP5MDzN+K/FN5tk+WaSry3+BxJrz2eb/HhkSwjHonD8G+N5Fj8efltFx/HIL58N/1/0WHEGkOOQXysrgByL/PNjcV14+gscjwoqfhGweryE+CyUf8PNetWyncV/u/CZqibRWJb/kHzT4rNZWHuV79rCsci/Iyz+2/WPlustN1h8l7zjeOTXPyxXWXx2oiKOQ/75181LwicWX6nwr6/jWOTXOpb9Lf71fsXyrcW/tn6zB8fxqIACuOb8D4ifA1WR/0B0/p7HLe8z2few5vyuLf0sPTKvAo5F/j1l2dCykaW35WVLFscjf86KHr0EVsZxyK8HLL5cuLnFy4dfU87vLOVLhhyL/PLvS95r/NSIMy2bWXwJ937LvhaORwUUwDXnJ5VuEJ7+zH8gOn/P45b3mex7WDN+aR7/JutT8BVv2cexKBz/BnmLxQvIrj5gOB754bMVfS0rukc5xyG//LJhfh6Z+9JyqsWX5b0McizyyzdtuOGW1y0+0+ebpJ6zHGPheFRAAVxz2angil+7vS1+3oDvKvI/JH5eTvakU+fnEPg/41PPWDNe+vyWfX7Xlsq37ONYFJZ/Lf2C6b45xHE88qOVxWc6plq+ieIetNxu8ePgF7PnOBSWb47i70R++dfz4/B0uTgeWCX/w+EnuftdQHz936fy/bX/hfbzBHx7uJ97U8/isx+fWSruIrrA4n+IfOu4n5PglzPx3xDZRbRm/ETcld21hWORX36ytC+puE0td1j8+PjSl+N45Id/bf0WlBXjMx3+S5LPXHAc8su/7tmNUP53YYTFC8V6Fo5F/vn3Kd/p6+f7+c/soy0LLL+zcDywSr5TyL+hevnzZJ+3tjjfOu47jX6w+B80PzetsgEWXw7w3yq4jtDa8a/7yu7a4jgW+fO4xb+Ofhz8m+gjFp9pqojjURj+/anidQA5DvnzqMU3gPjX0YuCbwLxZfosjkX+XWzxYucbBl+z+GlEWRwPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACSYnuL38Hm15lXABBTFW+IDADF6DnLleFpXpRHjwAQWxRAAACAlKEAAkizbpbpljmWaZaulqy6lv+zfG4psbxrOctSkd/0/xmL33T+HcvBFgAAABTYipaA/2jx4naQpYblUMs8y9EWV89ysqV+5pV0uOUny2GZV+EXaC99wyz+2caWVyxLLJwDCAAAUEArKoBjLX8LT392k+Wp8HS5HrFcF57qAMsiy/qZV8GRFgoggNhjCRhAWm1t+Tg8/dlHlmx5q2O53vK+xZeIZ1vaWzazuC0tPjY/8yr4JHoEgFijAAJIqxkWv2xLRTtYPgtP1dvSIcoGlg0tPmvoy8XOzw30sewSsds2egSAWKMAAkiDmhbf1FExd1lOtRxo8e+Fh1hOsQy1uAaWhZbvLP7Pd7S0tWT5+X4fWm6wrGvxGcHLLAAAACgwPwfQz8vLxi/U7I9e+LwA+kYO3wziu4F900fWxpYnLL4D+CvLEMsoywhLls8gPmvJ7gL+s4VzAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOJA+v9AkmDBbNm4yQAAAABJRU5ErkJggg==\">" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum Efficiency 66.6666666667\n" + ] + } + ], + "source": [ + "%matplotlib notebook\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt2\n", + "W=[100.0,200.0,300.0,400.0,500.0,600.0] #loads \n", + "P=[16.0,22.5,28.0,34.0,40.5,46.5] #Efforts\n", + "VR=25.0 #velocity ratio\n", + "E=[0,0,0,0,0,0] #Efficiency\n", + "#calculating average slope\n", + "m=(P[4]-P[1])/(W[4]-W[1])\n", + "C=P[4]-m*W[4]\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "for i in range(0,6):\n", + " \n", + " E[i]=W[i]/(25*P[i])*100 #E=W/(P*VR)\n", + " \n", + "plt2.plot(W,E)\n", + "plt2.ylabel(\"Efficiency\")\n", + "plt2.xlabel(\"Load\")\n", + "plt2.show() \n", + "\n", + " \n", + "MaxEfficiency=1/VR*100*1/m\n", + "\n", + "print \"Maximum Efficiency\",MaxEfficiency\n", + "\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mechanical advantage-- 13.8888888889\n", + "Velocity Ratio 30.0\n", + "Efficiency 46.2962962963\n", + "self-locking machine\n", + "Ideal Load 10800.0\n", + "frictional resistance 5800.0\n" + ] + } + ], + "source": [ + "\n", + "W = 5000.0 #Load\n", + "P = 360.0 #Effort\n", + "\n", + "MA=W/P #Mechanical advantage\n", + "VR=30.0 #Velocity Ratio\n", + "Efficiency=MA/VR*100.0\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "\n", + "\n", + "\n", + "Wi = P*VR #ideal load\n", + "\n", + "Fr=Wi-W #frictional resistance\n", + "print \"Mechanical advantage--\",MA\n", + "print \"Velocity Ratio\",VR\n", + "print \"Efficiency\",Efficiency\n", + "print var\n", + "print \"Ideal Load\",Wi\n", + "\n", + "print \"frictional resistance\",Fr\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 937.5 N\n", + "number of pulley is 4\n" + ] + } + ], + "source": [ + "import math\n", + "W = 6000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.8\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n", + "#second case\n", + "P=520.0\n", + "n=0,\n", + "for i in range(3,20):\n", + " if((P*(0.8-(i-3)*0.05)*(2**i)))>6000:\n", + " n=i\n", + " break\n", + " \n", + " \n", + "print \"number of pulley is \",n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exmple 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 2352.94117647 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N=3.0 #number of movable pulleys\n", + "VR=2*N #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.85\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1923.07692308 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 12000.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1\n", + "N2=2.0 #number of movable puleys in system 2\n", + "VR=2*N1+2*N2 #Velocity Ratio\n", + "L=0.05 #Efficiency loss in each pulley\n", + "Efficiency=0.78\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 79.3650793651\n", + "Effort lost in friction 37.1428571429\n" + ] + } + ], + "source": [ + "import math\n", + "W = 1000.0 #Load\n", + "N=3.0 #number of pulleys\n", + "VR=2**N-1 #Velocity Ratio\n", + "P = 180.0 #Effort\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100\n", + "print \"Efficiency\",Efficiency\n", + "Pi =W/VR #Ideal effort\n", + "\n", + "efl=P-Pi #Effort lost in friction\n", + "print \"Effort lost in friction\",efl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 595.238095238 N\n" + ] + } + ], + "source": [ + "import math\n", + "W = 2500.0 #Load\n", + "N1=2.0 #number of movable pulleys in system 1 in figure B\n", + "N2=2.0 #number of movable puleys in system 2 in figure C\n", + "VR=2**N1-1+2**N2-1 #Velocity Ratio\n", + "Efficiency=0.70\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.11" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 2.3\n", + "Effort is 745.341614907 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle\n", + "tcw=6.0 #thickness of the cord on the wheel\n", + "tca=20.0 #thickness of the cord on the axle\n", + "W=1200 #effort\n", + "ED=D+tcw #Effective diameter of the wheel\n", + "Ed=d+tca #Effectivediameter of axle\n", + "VR=ED/Ed #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.7\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 32.0\n", + "Effort is 1136.36363636 N\n" + ] + } + ], + "source": [ + "D=800.0 #diameter of the wheel\n", + "d1=250.0 #diameter of axle 1\n", + "d2=300.0 #diameter of axle 2\n", + "\n", + "W=20000.0 #effort\n", + "\n", + "VR=(2*D)/(d2-d1) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.55\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity ratio is 3.33333333333\n", + "Effort is 2500.0 N\n" + ] + } + ], + "source": [ + "D=500.0 #diameter of the wheel\n", + "d=200.0 #diameter of axle \n", + "\n", + "W=5000.0 #effort\n", + "\n", + "VR=(2*D)/(D-d) #Velocity Ratio\n", + "print \"Velocity ratio is \",VR\n", + "Efficiency=0.6\n", + "MA=Efficiency*VR #Mechanical advantage\n", + "P = W/MA #Effort\n", + "print \"Effort is\",P,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.14" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 1741.88034188 N\n" + ] + } + ], + "source": [ + "D=40.0 #Screw diameter\n", + "l=20.0 #Screw lwngth\n", + "p=l/3.0 #Lead of the screw\n", + "W=40000.0 #effort\n", + "R = 400 #Lever length\n", + "u = 0.12 #coefficient of friction between screw and nut\n", + "P = (d/(2*R))*W*((u+(p/(3.14*D)))/(1-u*(p/(3.14*D)))) #Effort\n", + "print \"Effort is\",P,\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.15" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Effort is 57.0287539936 N\n", + "Efficiency 55.8439936484 %\n", + "reversible machine\n", + "The torque required to keep the load from descending 2047.61904762 Nm\n" + ] + } + ], + "source": [ + "import math\n", + "d=50.0 #mean diameter of screw\n", + "p=10.0 #pitch of screw\n", + "u=0.05 #coefficient of friction at the screw thread\n", + "R=300.0 ##Lever length\n", + "W=6000.0 #Load\n", + "o1=math.atan(p/(3.14*d))\n", + "o2=math.atan(0.05)\n", + "P=d/(2*R)*(W*math.tan(o1+o2)) #effort\n", + "print \"Effort is\",P,\"N\"\n", + "VR=2*3.14*R/p #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "print \"Efficiency\",Efficiency,\"%\"\n", + "var=\"reversible machine\"\n", + "if Efficiency < 50.0:\n", + " var=\"self-locking machine\"\n", + "print var\n", + "T =d/2.0*W*math.tan(o1-o2) #The torque required to keep the load from descending\n", + "print \"The torque required to keep the load from descending\",T,\"Nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.16" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency 12.9110001721 %\n" + ] + } + ], + "source": [ + "import math\n", + "p1=5.0 #Pitch of smaller screw\n", + "p2=10.0 #Pitch of larger screw\n", + "R=500.0 #Lever arm length from centre of screw\n", + "W=15000.0 #Load\n", + "P=185.0 #Effort\n", + "VR=2*3.14*R/(p2-p1) #Velocity Ratio\n", + "MA=W/P #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency\",Efficiency,\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.17" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 120.0\n", + "Law of machine is P= 0.01 W + 70.0\n", + "Efficiency for first case 25.0 %\n", + "Efficiency for second case 46.875 %\n" + ] + } + ], + "source": [ + "d=200.0 #Diameter of the load drum \n", + "R = 1200.0 # Length of lever arm \n", + "T1 = 10.0 #Number of teeth on pinion, \n", + "T2 = 100.0 #Number of teeth on spur wheel\n", + "VR=R*T2/(d*T1)*2.0 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "W1 = 3000.0 #Load 1\n", + "P1= 100.0 #Effort1\n", + "\n", + "W2 = 9000.0 #Load 2\n", + "P2= 160.0 #Effort2\n", + "\n", + "#law of machine is given by P=mW+C\n", + "m=(P2-P1)/(W2-W1)\n", + "C=P2-m*W2\n", + "print \"Law of machine is P=\",m,\"W\",\"+\",C\n", + "MA=W1/P1 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for first case\",Efficiency,\"%\"\n", + "MA=W2/P2 #Mechanical advantage\n", + "Efficiency=MA/VR*100.0\n", + "\n", + "print \"Efficiency for second case\",Efficiency,\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example 6.18" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity Ratio is 32.0\n", + "LOad 3200.0 N\n" + ] + } + ], + "source": [ + "d=150.0 #Diameter of the load drum \n", + "R = 400.0 # Length of lever arm \n", + "T1 = 15.0 #Number of teeth on pinion, \n", + "T3 = 20.0 #Number of teeth on pinion, \n", + "T2 = 45.0 #Number of teeth on spur wheel\n", + "T4 = 40.0 #Number of teeth on spur wheel\n", + "P= 250.0 #Effort\n", + "Efficiency=0.4\n", + "VR=R*T2/(d*T1)*2.0*T4/T3 #Velocity Ratio\n", + "print \"Velocity Ratio is \",VR\n", + "\n", + "W=VR*Efficiency*P #Load \n", + "\n", + "print \"LOad\",W,\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_CCZqXKR.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_CCZqXKR.ipynb new file mode 100644 index 00000000..1204506a --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_CCZqXKR.ipynb @@ -0,0 +1,1325 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter8-SIMPLE STRESSES AND STRAINS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.1 Page number243" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sectional area= 201.06 mm^2\n", + "stress= 198.94 N/mm^2\n", + "strain= 0.000994718394324 N/mm^2\n", + "Elongation= 0.497 mm\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(40000) #Load,N\n", + "E=float(200000) #Modulus of elasticity for steel,N/mm^2\n", + "L=500 #length of circular rod,mm\n", + "d=float(16) #diameter of rod,mm\n", + " \n", + "A=(pi*(pow(d,2)))/4 #sectional area, mm^2\n", + "p=P/A #stress, N/mm^2\n", + "e=p/E #strain\n", + "delta=(P*L)/(A*E) #Elongation,mm\n", + "\n", + "print \"sectional area=\",round(A,2),\"mm^2\"\n", + "print \"stress=\",round(p,2),\"N/mm^2\"\n", + "print \"strain=\",e,\"N/mm^2\"\n", + "print \"Elongation=\",round(delta,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.2 Page number243" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "area= 11.25 mm^2\n", + "Elongation= 1.6 mm\n", + "Hence, if measured length is 30.0 m.\n", + "Actual length is 30.0016 m\n", + "Actual length of line AB= 150.008 m.\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "P=float(120) # force applied during measurement,N\n", + "E=float(200000) #Modulus of elasticity for steel,N/mm^2\n", + "L=float(30) #length of Surveyor’s steel tape,mm\n", + " \n", + " \n", + "A=15*0.75 #area, mm^2\n", + "delta=((P*L*1000)/(A*E)) #Elongation,mm\n", + "\n", + "print \"area=\",round(A,2),\"mm^2\"\n", + "print \"Elongation=\",round(delta,3),\"mm\"\n", + "\n", + "print \"Hence, if measured length is\", L,\"m.\"\n", + "print \"Actual length is\" ,round((L+(delta/1000)),6),\"m\"\n", + "\n", + "print \"Actual length of line AB=\",round((150*(L+(delta/1000))/30),3),\"m.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.3 Page number 244\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Therefore, permissible stress\n", + "p= 142.857 N/mm^2\n", + "Load P= 160000.0 N\n", + "A= 1120.0 mm^2\n", + "d= 94.32 mm\n", + "t= 3.64 mm\n", + "Hence, use of light section is recommended.\n" + ] + } + ], + "source": [ + "from math import pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "Y=float(250) #Yield stress, N/mm^2\n", + "FOS=float(1.75) #Factor of safety\n", + "P=float(160) #Load,KN\n", + "\n", + "p=Y/FOS\n", + "\n", + "print \"Therefore, permissible stress\"\n", + "print \"p=\",round(p,3), \"N/mm^2\"\n", + "print \"Load P=\",P*1000,\"N\"\n", + "\n", + "#p=P/A\n", + "\n", + "A=P*1000/p #area,mm^2\n", + "\n", + "print \"A=\",round(A),\"mm^2\"\n", + "\n", + "#For hollow section of outer diameter ‘D’ and inner diameter ‘d’ A=pi*(D^2-d^2)/4\n", + "D=float(101.6) #outer diameter,mm\n", + "\n", + "d=sqrt(pow(D,2)-(4*A/pi))\n", + "\n", + "print \"d=\",round(d,2),\"mm\"\n", + "\n", + "t=(D-d)/2\n", + "print \"t=\",round(t,2),\"mm\"\n", + "\n", + "print \"Hence, use of light section is recommended.\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.4 page number 245" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Area= 314.16 mm^2\n", + "Stress at elastic limit= 324.68 N/mm^2\n", + "Young's modulus E= 12732.4 N/mm^22\n", + "Percentage elongation= 28.0 %\n", + "Percentage reduction in area= 43.75 %\n", + "Ultimate Tensile Stress= 0.41 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration \n", + "\n", + "d=float(20) #Diameter ,mm\n", + "Loadatelasticlimit=float(102) #Load at elastic limit,KN\n", + "P=80 #Load for extension of o.25mm , KN\n", + "delta=float(0.25) #extension in specimen of steel,mm\n", + "L=200 #gauge length of specimen of steel,mm\n", + "Finalextension=float(56) #total extension at fracture,mm\n", + "\n", + "\n", + "A=(pi*pow(d,2))/4 #Area,mm^2\n", + "print \"Area=\", round(A,2),\"mm^2\"\n", + "\n", + "Stressatelasticlimit=Loadatelasticlimit*1000/A #Stress at elastic limit,N/mm^2 \n", + "print \"Stress at elastic limit=\",round(Stressatelasticlimit,2),\"N/mm^2\"\n", + "\n", + "E=(P*1000/A)*(delta*L) #Young’s modulus ,N/mm^2\n", + "print \"Young's modulus E=\", round(E,2),\"N/mm^22\"\n", + "\n", + "Percentageelongation=Finalextension*100/L #percentage elongation,%\n", + "print \"Percentage elongation=\", round(Percentageelongation,2),\"%\"\n", + "\n", + "Initialarea=(pi*pow(d,2))/4\n", + "Finalarea=(pi*pow(15,2))/4 # total extension at fracture is 56 mm and diameter at neck is 15 mm.\n", + "Percentagereductioninarea=(Initialarea-Finalarea)*100/Initialarea\n", + "\n", + "print \"Percentage reduction in area=\",round(Percentagereductioninarea,2),\"%\"\n", + "\n", + "UltimateLoad=130 #Maximum Load=130,kN\n", + "UltimateTensileStress=UltimateLoad/A\n", + "\n", + "print\"Ultimate Tensile Stress=\",round(UltimateTensileStress,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.5 Page number247\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "E= 56277.19 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(40) #Load,KN\n", + "L1=150 #length of 1st portion,mm\n", + "A1=pi*pow(25,2)/4 #Area of 1st portion,mm^2\n", + "L2=250 #length of 2nd portion,mm\n", + "A2=pi*pow(20,2)/4 #Area of 2nd portion,mm^2\n", + "L3=150 #length of 3rd portion,mm\n", + "A3=pi*pow(25,2)/4 #Area of 3rd portion,mm^2\n", + "\n", + "#E,Young's modulus ,N/mm^2\n", + "\n", + "#Total extension= Extension of portion 1+Extension of portion 2+Extension of portion 3\n", + "\n", + "#Extension=(P*1000*L)/(A*E)\n", + "\n", + "E=(P*1000*L1/A1)+(P*1000*L2/A2)+(P*1000*L3/A3)\n", + "\n", + "print \"E=\",round(E,2),\"N/mm^2\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.6 Page number247" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total extension of the bar= 0.5125 mm\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(30) #Load,KN\n", + "L1=600 #length of 1st portion,mm\n", + "A1=40*20 #Area of 1st portion,mm^2\n", + "\n", + "E1=200000 # material 1 Young’s modulus,N/mm^2\n", + " \n", + "E2=100000 # material 2 Young’s modulus,N/mm^2\n", + " \n", + "\n", + "L2=800 #length of 2nd portion,mm\n", + "A2=30*20 #Area of 2nd portion,mm^2\n", + "\n", + "Extensionofportion1=(P*1000*L1)/(A1*E1) #mm\n", + "Extensionofportion2=(P*1000*L2)/(A2*E2) #mm\n", + "\n", + "Totalextensionofthebar= Extensionofportion1 + Extensionofportion2\n", + "\n", + "print\"Total extension of the bar=\",round(Totalextensionofthebar,4),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.7 Page number248\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "E= 200735.96 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(30) #Load,KN\n", + "L1=600 #length of 1st portion,mm\n", + "A1=pi*pow(30,2)/4 #Area of 1st portion,mm^2\n", + "L2=400 #length of 2nd portion,mm\n", + "A2=pi*(pow(30,2)-pow(10,2))/4 #Area of 2nd portion,mm^2\n", + "\n", + "#E,Young's modulus ,N/mm^2\n", + "\n", + "#Total extension= Extension of portion 1+Extension of portion 2\n", + "\n", + "#Extension=(P*1000*L)/(A*E)\n", + "\n", + "T=float(0.222) #Total extension of the bar,mm\n", + "\n", + "E=((P*1000*L1/A1)+(P*1000*L2/A2))/T \n", + "\n", + "print \"E=\",round(E,2),\"N/mm^2\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.10 Page number 251" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "delta1= 0.2113 mm\n", + "there is calculation mistake in book\n", + "delta2= 0.48 mm^2\n", + "Percentage error= 55.977 %\n", + "there is calculation mistake in book\n" + ] + } + ], + "source": [ + "import math\n", + "#variable declaration\n", + "\n", + "t=10 #steel flat thickness,mm\n", + "b1=float(60) #tapering from b1 to b2\n", + "b2=40\n", + "L=600 #steel flat length\n", + "P=float(80) #Load,KN\n", + "E=2*100000 #Young's Modulus,N/mm^2\n", + "\n", + "#Extension of the tapering bar of rectangular section\n", + "\n", + "delta1=(P*1000*L*math.log((b1/b2),10))/(t*E*(b1-b2))\n", + "\n", + "print \"delta1=\",round(delta1,4),\"mm\"\n", + "print \"there is calculation mistake in book\"\n", + "\n", + "#If averages cross-section is considered instead of tapering cross-section, extension is given by \n", + "\n", + "Aav=(b1+b2)*t/2 #mm^2\n", + "\n", + "delta2=(P*1000*L)/(Aav*E) #mm\n", + "print\"delta2=\",round(delta2,3),\"mm^2\"\n", + "\n", + "P= (delta2-delta1)*100/delta2\n", + "\n", + "print\"Percentage error=\",round(P,3),\"%\"\n", + "\n", + "print \"there is calculation mistake in book\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.11 page number251" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "delta1= 1.194 mm\n", + "delta2= 0.265 mm\n", + "Total extension 1.459 mm\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(200) #loading,KN\n", + "E=200*1000\n", + "d1=40 #Young's modulus,N/mm^2\n", + "A= pi*pow(d1,2)/4 #Area of uniform portion,mm^2 \n", + "L1=1500 #length of uniform portion,mm \n", + "d2=60 #diameter of tapered section,mm\n", + "L2=500 #length of tapered section,mm\n", + "#Extensions of uniform portion and tapering portion are worked out separately and then added to get extension of the given bar. \n", + "\n", + "#Extension of uniform portion\n", + "\n", + "delta1=(P*1000*L1)/(A*E)\n", + "\n", + "print \"delta1=\",round(delta1,3),\"mm\"\n", + "\n", + "delta2=(P*1000*4*L2)/(E*pi*d1*d2)\n", + "\n", + "print \"delta2=\",round(delta2,3),\"mm\"\n", + "\n", + "T=delta1 + delta2 \n", + "print \"Total extension\",round(T,3),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.13 page number259" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Poisson's ratio= 0.3\n", + "E= 203718.33 N/mm^2\n", + "G= 78353.2 N/mm^2\n", + "K= 169765.27 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(60) #load,KN\n", + "d=float(25) #diameter,mm\n", + "A=pi*pow(d,2)/4 #Area,mm^2\n", + "L=float(200) #gauge length,mm\n", + "\n", + "delta=0.12 #extension,mm\n", + "deltad=0.0045 #contraction in diameter,mm\n", + "Linearstrain=delta/L\n", + "Lateralstrain=deltad/d\n", + "\n", + "Pr=Lateralstrain/Linearstrain\n", + "\n", + "print \"Poisson's ratio=\",round(Pr,1)\n", + "\n", + "E=(P*1000*L)/(A*delta)\n", + "\n", + "print \"E=\",round(E,2),\"N/mm^2\"\n", + "\n", + "G=E/(2*(1+Pr)) #Rigidity modulus\n", + "\n", + "print \"G=\",round(G,1),\"N/mm^2\"\n", + "\n", + "K=E/(3*(1-(2*Pr))) #bulk modulus\n", + "\n", + "print \"K=\",round(K,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.14 page number 260" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "G= 76923.1 N/mm^2\n", + "K= 166666.67 N/mm^2\n", + "change in volume 60.0 mm^3\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "E=float(2*100000) #Young's modulus,N/mm^2\n", + "Pr=float(0.3) #poisson's ratio\n", + "\n", + "G=E/(2*(1+Pr)) #Rigidity modulus\n", + "\n", + "K=E/(3*(1-2*(Pr))) #Bulk modulus\n", + "\n", + "print \"G=\", round(G,1),\"N/mm^2\"\n", + "\n", + "print \"K=\", round(K,2), \"N/mm^2\"\n", + "\n", + "P=60 #Load,kN\n", + "A=pi*pow(25,2)/4 #Area,mm^2\n", + "\n", + "Stress=P*1000/A #N/mm^2\n", + "#Linear strain,ex\n", + "\n", + "ex=Stress/E\n", + " \n", + "#Lateralstrain,ey,ez\n", + "\n", + "ey=-1*Pr*ex\n", + "ez=-1*Pr*ex\n", + "\n", + "#volumetric strain,ev=ex+ey+ez\n", + "\n", + "ev=ex+ey+ez\n", + "\n", + "v=pi*pow(25,2)*500/4\n", + "Changeinvolume=ev*v\n", + "\n", + "print\"change in volume\",round(Changeinvolume,2),\"mm^3\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.15 page number261" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in volume= 10.8 mm^3\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "# Let the x, y, z be the mutually perpendicular directions\n", + "\n", + "pr=float(0.3)\n", + "PX=float(15) #Loading in x-direction,KN\n", + "PY=float(80) #Loading in Y-direction(compressive),KN\n", + "PZ=float(180) #Loading in Z-direction,KN\n", + "\n", + "#Area in X-,Y-,Z-Direction is AX,AY,AZ respectively,mm^2\n", + "\n", + "AX=float(10*30)\n", + "AY=float(10*400)\n", + "AZ=float(30*400)\n", + "\n", + "#stress devoloped in X-,Y-,Z- direction as px,py,pz respectively,N/mm^2\n", + "\n", + "px=PX*1000/AX\n", + "py=PY*1000/AY\n", + "pz=PZ*1000/AZ\n", + "\n", + "#Noting that a stress produces a strain of p/E in its own direction, the nature being same as that of stress and µ p E in lateral direction of opposite nature, and taking tensile stress as +ve, we can write expression for strains ex, ey, ez.\n", + "E=2*100000 #young's modulus,N/mm^2\n", + "\n", + "ex=(px/E)+(pr*py/E)-(pr*pz/E)\n", + "ey=(-pr*px/E)-(py/E)-(pr*pz/E)\n", + "ez=(-pr*px/E)+(pr*py/E)+(pz/E)\n", + "\n", + "ev=ex+ey+ez #Volumetric strain\n", + "\n", + "volume=10*30*400\n", + "\n", + "Changeinvolume=ev*volume\n", + "\n", + "print \"Change in volume=\",round(Changeinvolume,2),\"mm^3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.17 page number 263" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poisson's Ratio= 0.346\n", + "Bulk modulus= 227500.0 N/mm^2\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "E=float(2.1*100000) #Young’s modulus of the material,N/mm^2\n", + "G=float(0.78*100000) #modulus of rigidity,N/mm^2\n", + "\n", + "pr=(E/(2*G))-1\n", + "\n", + "print \"poisson's Ratio=\",round(pr,3)\n", + "\n", + "K=E/(3*(1-2*pr))\n", + "\n", + "print \"Bulk modulus=\",round(K,3),\"N/mm^2\" " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.18 page number 263" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Young's modulus= 102857.143 N\n", + "Poisson's Ratio 0.2857\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "G=float(0.4*100000) #modulus of rigidity of material,N/mm^2\n", + "K=float(0.8*100000) #bulk modulus,N/mm^2\n", + "\n", + "E=(9*G*K)/(3*K+G)\n", + "\n", + "\n", + "print \"Young's modulus=\",round(E,3),\"N\"\n", + "\n", + "pr=(E/(2*G))-1\n", + "\n", + "print \"Poisson's Ratio\",round(pr,4)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.19 page number 264" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Stress in aluminium strip= 23.08 N/mm^2\n", + "Stress in steel strip= 46.15 N/mm^2\n", + "Extension of the compound bar= 0.138 mm\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "L=float(600) #compound bar of length,mm\n", + "P=float(60) #compound bar when axial tensile force ,KN\n", + "\n", + "Aa=float(40*20) #area of aluminium strip,mm^2\n", + "As=float(60*15) #area of steel strip,mm^2\n", + "\n", + "Ea=1*100000 # elastic modulus of aluminium,N/mm^2\n", + "Es=2*100000 # elastic modulus of steel,N/mm^2\n", + "\n", + "#load shared by aluminium strip be Pa and that shared by steel be Ps. Then from equilibrium condition Pa+Ps=P\n", + "#From compatibility condition, deltaAL=deltaS\n", + "Pa=(P*1000)/(1+((As*Es)/(Aa*Ea)))\n", + "Ps=Pa*((As*Es)/(Aa*Ea))\n", + "\n", + "Sias=Pa/Aa\n", + "print \"Stress in aluminium strip=\",round(Sias,2),\"N/mm^2\"\n", + "Siss=Ps/As\n", + "print \"Stress in steel strip=\",round(Siss,2),\"N/mm^2\"\n", + "\n", + "L=600\n", + "#Extension of the compound bar \n", + "deltal=(Pa*L)/(Aa*Ea)\n", + "print\"Extension of the compound bar=\",round(deltal,3),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.20 page number 265" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in Copper= 75.76 N/mm^2\n", + "stress in Steel= 126.27 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Es=float(2*100000) #Young's modulus of steel rod ,N/mm^2\n", + "Ec=float(1.2*100000) #Young's modulus of copper tube,N/mm^2\n", + "\n", + "di=float(25) #internal diameter,mm\n", + "de=float(40) #external diameter,mm\n", + "\n", + "As=pi*pow(di,2)/4 #Area of steel rod,mm^2\n", + "Ac=pi*(pow(de,2)-pow(di,2))/4 #Area of copper tube,mm^2\n", + "P=120 #load, KN\n", + "#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel rod and Pc is the load shared by the copper tube.\n", + "#From compatibility condition,deltaS=deltaC\n", + "\n", + "Pc=(P*1000)/(1+((As*Es)/(Ac*Ec)))\n", + "Ps=Pc*((As*Es)/(Ac*Ec))\n", + "\n", + "SIC=Pc/Ac #stress in copper, N/mm^2\n", + "SIS=Ps/As #stress in steel,N/mm^2\n", + "\n", + "print \"stress in Copper=\",round(SIC,2),\"N/mm^2\"\n", + "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.21 page number 266" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in Concrete= 4.51 N/mm^2\n", + "stress in Steel= 81.2 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "#Es/Ec=18(given)\n", + "Er=float(18) #young modulus ratio Er=Es/Ec\n", + "d=float(16) #steel bar diameter,mm\n", + "#8 steel bars\n", + "As=8*pi*pow(d,2)/4 #Area of steel bar,mm^2\n", + "Ac=(300*500)-As #Area of concrete,mm^2\n", + "\n", + "P=800 #Compressive force, KN\n", + "#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel bar and Pc is the load shared by the Concrete\n", + "#From compatibility condition,deltaS=deltaC\n", + "\n", + "Pc=(P*1000)/(1+((As*Er)/(Ac)))\n", + "Ps=Pc*((As*Er)/(Ac))\n", + "\n", + "SIC=Pc/Ac #stress in Concrete, N/mm^2\n", + "SIS=Ps/As #stress in steel,N/mm^2\n", + "\n", + "print \"stress in Concrete=\",round(SIC,2),\"N/mm^2\"\n", + "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.22 page number 267" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in Aluminium= 66.96 N/mm^2\n", + "stress in Steel= 89.29 N/mm^2\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "Es=float(2*100000) #Young's modulus of steel ,N/mm^2\n", + "Ea=float(1*100000) #Young's modulus of aluminium,N/mm^2\n", + "Ls=240 #length of steel,mm\n", + "La=160 #length of aluminium,mm\n", + "Aa=1200 #Area of aluminium,mm^2\n", + "As=1000 #Area of steel,mm^2\n", + "P=250 #load, KN\n", + "#From equation of equilibrium, Ps+2Pa=P,et force shared by each aluminium pillar be Pa and that shared by steel pillar be Ps. \n", + "#From compatibility condition,deltaS=deltaC\n", + "\n", + "Pa=(P*1000)/(2+((As*Es*La)/(Aa*Ea*Ls)))\n", + "Ps=Pa*((As*Es*La)/(Aa*Ea*Ls))\n", + "\n", + "SIA=Pa/Aa #stress in aluminium, N/mm^2\n", + "SIS=Ps/As #stress in steel,N/mm^2\n", + "\n", + "print \"stress in Aluminium=\",round(SIA,2),\"N/mm^2\"\n", + "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.23 page number 268\n" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ps= 91.73 N/mm^2\n", + "pc= 44.96 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "# Let the force shared by bolt be Ps and that by tube be Pc. Since there is no external force, static equilibrium condition gives Ps + Pc = 0 or Ps = – Pc i.e., the two forces are equal in magnitude but opposite in nature. Obviously bolt is in tension and tube is in compression.\n", + "#Let the magnitude of force be P. Due to quarter turn of the nut\n", + "\n", + "#[Note. Pitch means advancement of nut in one full turn] \n", + "\n", + "Ls=float(600) #length of whole assembly,mm\n", + "Lc=float(600) #length of whole assembly,mm\n", + "delta=float(0.5)\n", + "ds=float(20) #diameter,mm\n", + "di=float(28) #internal diameter,mm\n", + "de=float(40) #external diameter,mm\n", + "Es=float(2*100000) #Young's modulus, N/mm^2\n", + "Ec=float(1.2*100000)\n", + "As=pi*pow(ds,2)/4 #area of steel bolt,mm^2\n", + "Ac=pi*(pow(de,2)-pow(di,2))/4 #area of copper tube,mm^2\n", + "\n", + "P= (delta*(1/Ls))/((1/(As*Es))+(1/(Ac*Ec))) #Load,N\n", + "\n", + "ps=P/As #stress,N/mm^2\n", + "pc=P/Ac #copper,N/mm^2\n", + "\n", + "print \"ps=\",round(ps,2),\"N/mm^2\"\n", + "print \"pc=\",round(pc,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.24 page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) p= 52.8 \tN/mm^2\n", + "(b) p= 27.8 \tN/mm^2\n", + " (iii) delta= 1.968 mm\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "E=float(2*100000) #Young's modulus,N/mm^2\n", + "alpha=float(0.000012) #expansion coeffecient,/°c\n", + "L=float(12) #length,m\n", + "t=float(40-18) #temperature difference,°c\n", + "\n", + "delta=alpha*t*L*1000 #free expansion of the rails,mm \n", + "# Provide a minimum gap of 3.168 mm between the rails, so that temperature stresses do not develop\n", + " \n", + "# a) If no expansion joint is provided, free expansion prevented is equal to 3.168 mm.\n", + "\n", + "#delta=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area \n", + "\n", + "p1=(delta*E)/(L*1000) #stress developed , N/mm^2\n", + "\n", + "print \"(a) p=\", round(p1,1),\"\tN/mm^2\"\n", + "\n", + "#(b) If a gap of 1.5 mm is provided, free expansion prevented delta2 = 3.168 – 1.5 = 1.668 mm.\n", + "\n", + "delta2=1.668 #mm\n", + "#delta2=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area \n", + "\n", + "p2=(delta2*E)/(L*1000) #stress developed , N/mm^2\n", + "\n", + "print \"(b) p=\", round(p2,1),\"\tN/mm^2\"\n", + "\n", + "# If the stress developed is 20 N/mm2, then p = P/ A\n", + "p3=20 #stress developed,N/mm^2\n", + "delta3=delta-(p3*L*1000/E)\n", + "\n", + "print \" (iii) delta=\",round(delta3,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.25 page number 272\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress p= 360.0 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "# Let D be the diameter of ring after heating and ‘d’ be its diameter before heating\n", + "D=float(1.2*1000) #mm\n", + "\n", + "#Circumference of ring after heating Ca= pi*D & Circumference of ring before heating Cb= pi*d\n", + "\n", + "Ca=pi*D\n", + "Cb=pi*d\n", + "alphas=float(0.000012) #coefficient of expansion,/°C\n", + "t=150 #temperature change,°C\n", + "Es=2*100000 #young's modulus,N/mm^2\n", + "d=(Ca-Cb)/(alphas*t*pi)\n", + "\n", + "#when it cools expansion prevented\n", + "#delta=pi*(D-d)\n", + "delta=alphas*t*pi*d\n", + "\n", + "p=(delta*Es)/(pi*d) #stress,N/mm^2\n", + "\n", + "print \"stress p=\",round(p,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.26 page number 272\n" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 12907.3 N\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "Ea=70*1000 #Young's modulus of aluminium,N/mm^2\n", + "Es=200*1000 #Young's modulus of steel,N/mm^2\n", + "\n", + "alphaa=float(0.000011) #expansion coefficient,/°C\n", + "alphas=float(0.000012) #expansion coefficient,/°C\n", + "\n", + "Aa=600 #Area of aluminium portion,mm^2\n", + "As=400 #Area of steel, mm^2\n", + "La=float(1.5) #length of aluminium portion,m\n", + "Ls=float(3.0) #length of steel portion,m\n", + "t=18 #temperature,°C\n", + "\n", + "delta=(alphaa*t*La*1000)+(alphas*t*Ls*1000) #mm\n", + "\n", + "P=(delta)/(((La*1000)/(Aa*Ea))+((Ls*1000)/(As*Es)))\n", + "\n", + "print \"P=\" ,round(P,1),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.27 page number 273" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Corresponding maximum stress = 120.0 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "d1=float(25) # variation linearly in diameter from 25 mm to 50 mm \n", + "d2=float(50)\n", + "L=float(500) #length,mm\n", + "alpha=float(0.000012) #expansion coeffecient,/°C\n", + "t=25 #rise in temperture,°C\n", + "E=2*100000 #Young's modulus,N/mm^2\n", + "\n", + "delta=alpha*t*L\n", + "\n", + "#If P is the force developed by supports, then it can cause a contraction of 4*P*L/(pi*d1*d2*E)\n", + "\n", + "P=(delta*pi*d1*d2*E)/(4*L)\n", + "Am=pi*pow(d1,2)/4\n", + "Ms=P/Am\n", + "\n", + "print \"Corresponding maximum stress = \",round(Ms,1),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.28 page number 275" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in steel= 12.17 N/mm^2\n", + "Stress in brass= 36.51 N/mm^2\n", + "Shear stress in pin 18.26 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Db=float(20) #diameter of brass rod,mm\n", + "Dse=float(40) #external diameter of steel tube,mm\n", + "Dsi=float(20) #internal diameter of steel tube,mm\n", + "Es=float(2*100000 ) #Young's modulus steel, N/mm^2\n", + "Eb=float(1*100000 ) #Young's modulus brass, N/mm^2\n", + "alphas=float(0.0000116) #coeffcient of expansion of steel,/°C\n", + "alphab=float(0.0000187) #coeffcient of expansion of brass,/°C\n", + "t=60 #raise in temperature, °C\n", + "As=pi*(pow(Dse,2)-pow(Dsi,2))/4 #Area of steel tube, mm^2\n", + "Ab=pi*(pow(Db,2))/4 #Area of brass rod,mm^2\n", + "L=1200 #length,mm\n", + "#Since free expansion of brass is more than free expansion of steel , compressive force Pb develops in brass and tensile force Ps develops in steel to keep the final position at CC \n", + "\n", + "#Horizontal equilibrium condition gives Pb = Ps, say P. \n", + "\n", + "P=((alphab-alphas)*t*L)/((L/(As*Es))+(L/(Ab*Eb)))\n", + "\n", + "ps=P/As\n", + "pb=P/Ab\n", + "\n", + "print \"stress in steel=\",round(ps,2),\"N/mm^2\"\n", + "print \"Stress in brass=\",round(pb,2),\"N/mm^2\"\n", + "\n", + "#the pin resist the force P at the two cross- sections at junction of two bars.\n", + "\n", + "Shearstress=P/(2*Ab)\n", + "print \"Shear stress in pin\",round(Shearstress,2),\"N/mm^2\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.29 page number 276" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in length= 1.07 mm\n", + "Hoop stress f= 83.33 N/mm^2\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "L=float(1000) #length of the bar at normal temperature,mm\n", + "As=float(50*10) #Area of steel,mm^2\n", + "Ac=float(40*5) #Area of copper,mm^2\n", + "#Ac = Free expansion of copper is greater than free expansion of steel . To bring them to the same position, tensile force Ps acts on steel plate and compressive force Pc acts on each copper plate. \n", + "alphas=float(0.000012) #Expansion of coeffcient of steel,/°C\n", + "alphac=float(0.000017 ) #Expansion of coeffcient of copper,/°C\n", + "t=80 #raise by temperature, °C\n", + "Es=2*100000 #Young's modulus of steel,N/mm^2\n", + "Ec=1*100000 #Young's modulus of copper,N/mm^2\n", + "Pc=((alphac-alphas)*t*L)/((2*L/(As*Es)) +(L/(Ac*Ec)))\n", + "Ps=2*Pc\n", + "\n", + "pc=Pc/Ac #Stress in copper,N/mm^2\n", + "ps=Ps/As #Stress in steel, N/mm^2\n", + "\n", + "Changeinlength=alphas*t*L+(Ps*L/(As*Es))\n", + "\n", + "\n", + "print\"Change in length=\",round(Changeinlength,2),\"mm\"\n", + "\n", + "##example 8.30 page number 278\n", + "\n", + "#variable declaration\n", + "\n", + "p=float(2) #internal pressure, N/mm^2\n", + "t=12 #thickness of thin cylinder,mm\n", + "D=float(1000) #internal diameter,mm\n", + "\n", + "f=(p*D)/(2*t) #Hoop stress,N/mm^2\n", + "\n", + "print \"Hoop stress f=\",round(f,2),\"N/mm^2\"\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_JTyCJsL.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_JTyCJsL.ipynb new file mode 100644 index 00000000..1204506a --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_JTyCJsL.ipynb @@ -0,0 +1,1325 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter8-SIMPLE STRESSES AND STRAINS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.1 Page number243" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sectional area= 201.06 mm^2\n", + "stress= 198.94 N/mm^2\n", + "strain= 0.000994718394324 N/mm^2\n", + "Elongation= 0.497 mm\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(40000) #Load,N\n", + "E=float(200000) #Modulus of elasticity for steel,N/mm^2\n", + "L=500 #length of circular rod,mm\n", + "d=float(16) #diameter of rod,mm\n", + " \n", + "A=(pi*(pow(d,2)))/4 #sectional area, mm^2\n", + "p=P/A #stress, N/mm^2\n", + "e=p/E #strain\n", + "delta=(P*L)/(A*E) #Elongation,mm\n", + "\n", + "print \"sectional area=\",round(A,2),\"mm^2\"\n", + "print \"stress=\",round(p,2),\"N/mm^2\"\n", + "print \"strain=\",e,\"N/mm^2\"\n", + "print \"Elongation=\",round(delta,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.2 Page number243" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "area= 11.25 mm^2\n", + "Elongation= 1.6 mm\n", + "Hence, if measured length is 30.0 m.\n", + "Actual length is 30.0016 m\n", + "Actual length of line AB= 150.008 m.\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "P=float(120) # force applied during measurement,N\n", + "E=float(200000) #Modulus of elasticity for steel,N/mm^2\n", + "L=float(30) #length of Surveyor’s steel tape,mm\n", + " \n", + " \n", + "A=15*0.75 #area, mm^2\n", + "delta=((P*L*1000)/(A*E)) #Elongation,mm\n", + "\n", + "print \"area=\",round(A,2),\"mm^2\"\n", + "print \"Elongation=\",round(delta,3),\"mm\"\n", + "\n", + "print \"Hence, if measured length is\", L,\"m.\"\n", + "print \"Actual length is\" ,round((L+(delta/1000)),6),\"m\"\n", + "\n", + "print \"Actual length of line AB=\",round((150*(L+(delta/1000))/30),3),\"m.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.3 Page number 244\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Therefore, permissible stress\n", + "p= 142.857 N/mm^2\n", + "Load P= 160000.0 N\n", + "A= 1120.0 mm^2\n", + "d= 94.32 mm\n", + "t= 3.64 mm\n", + "Hence, use of light section is recommended.\n" + ] + } + ], + "source": [ + "from math import pi,sqrt\n", + "\n", + "#variable declaration\n", + "\n", + "Y=float(250) #Yield stress, N/mm^2\n", + "FOS=float(1.75) #Factor of safety\n", + "P=float(160) #Load,KN\n", + "\n", + "p=Y/FOS\n", + "\n", + "print \"Therefore, permissible stress\"\n", + "print \"p=\",round(p,3), \"N/mm^2\"\n", + "print \"Load P=\",P*1000,\"N\"\n", + "\n", + "#p=P/A\n", + "\n", + "A=P*1000/p #area,mm^2\n", + "\n", + "print \"A=\",round(A),\"mm^2\"\n", + "\n", + "#For hollow section of outer diameter ‘D’ and inner diameter ‘d’ A=pi*(D^2-d^2)/4\n", + "D=float(101.6) #outer diameter,mm\n", + "\n", + "d=sqrt(pow(D,2)-(4*A/pi))\n", + "\n", + "print \"d=\",round(d,2),\"mm\"\n", + "\n", + "t=(D-d)/2\n", + "print \"t=\",round(t,2),\"mm\"\n", + "\n", + "print \"Hence, use of light section is recommended.\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.4 page number 245" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Area= 314.16 mm^2\n", + "Stress at elastic limit= 324.68 N/mm^2\n", + "Young's modulus E= 12732.4 N/mm^22\n", + "Percentage elongation= 28.0 %\n", + "Percentage reduction in area= 43.75 %\n", + "Ultimate Tensile Stress= 0.41 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration \n", + "\n", + "d=float(20) #Diameter ,mm\n", + "Loadatelasticlimit=float(102) #Load at elastic limit,KN\n", + "P=80 #Load for extension of o.25mm , KN\n", + "delta=float(0.25) #extension in specimen of steel,mm\n", + "L=200 #gauge length of specimen of steel,mm\n", + "Finalextension=float(56) #total extension at fracture,mm\n", + "\n", + "\n", + "A=(pi*pow(d,2))/4 #Area,mm^2\n", + "print \"Area=\", round(A,2),\"mm^2\"\n", + "\n", + "Stressatelasticlimit=Loadatelasticlimit*1000/A #Stress at elastic limit,N/mm^2 \n", + "print \"Stress at elastic limit=\",round(Stressatelasticlimit,2),\"N/mm^2\"\n", + "\n", + "E=(P*1000/A)*(delta*L) #Young’s modulus ,N/mm^2\n", + "print \"Young's modulus E=\", round(E,2),\"N/mm^22\"\n", + "\n", + "Percentageelongation=Finalextension*100/L #percentage elongation,%\n", + "print \"Percentage elongation=\", round(Percentageelongation,2),\"%\"\n", + "\n", + "Initialarea=(pi*pow(d,2))/4\n", + "Finalarea=(pi*pow(15,2))/4 # total extension at fracture is 56 mm and diameter at neck is 15 mm.\n", + "Percentagereductioninarea=(Initialarea-Finalarea)*100/Initialarea\n", + "\n", + "print \"Percentage reduction in area=\",round(Percentagereductioninarea,2),\"%\"\n", + "\n", + "UltimateLoad=130 #Maximum Load=130,kN\n", + "UltimateTensileStress=UltimateLoad/A\n", + "\n", + "print\"Ultimate Tensile Stress=\",round(UltimateTensileStress,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.5 Page number247\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "E= 56277.19 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(40) #Load,KN\n", + "L1=150 #length of 1st portion,mm\n", + "A1=pi*pow(25,2)/4 #Area of 1st portion,mm^2\n", + "L2=250 #length of 2nd portion,mm\n", + "A2=pi*pow(20,2)/4 #Area of 2nd portion,mm^2\n", + "L3=150 #length of 3rd portion,mm\n", + "A3=pi*pow(25,2)/4 #Area of 3rd portion,mm^2\n", + "\n", + "#E,Young's modulus ,N/mm^2\n", + "\n", + "#Total extension= Extension of portion 1+Extension of portion 2+Extension of portion 3\n", + "\n", + "#Extension=(P*1000*L)/(A*E)\n", + "\n", + "E=(P*1000*L1/A1)+(P*1000*L2/A2)+(P*1000*L3/A3)\n", + "\n", + "print \"E=\",round(E,2),\"N/mm^2\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.6 Page number247" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total extension of the bar= 0.5125 mm\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(30) #Load,KN\n", + "L1=600 #length of 1st portion,mm\n", + "A1=40*20 #Area of 1st portion,mm^2\n", + "\n", + "E1=200000 # material 1 Young’s modulus,N/mm^2\n", + " \n", + "E2=100000 # material 2 Young’s modulus,N/mm^2\n", + " \n", + "\n", + "L2=800 #length of 2nd portion,mm\n", + "A2=30*20 #Area of 2nd portion,mm^2\n", + "\n", + "Extensionofportion1=(P*1000*L1)/(A1*E1) #mm\n", + "Extensionofportion2=(P*1000*L2)/(A2*E2) #mm\n", + "\n", + "Totalextensionofthebar= Extensionofportion1 + Extensionofportion2\n", + "\n", + "print\"Total extension of the bar=\",round(Totalextensionofthebar,4),\"mm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.7 Page number248\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "E= 200735.96 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(30) #Load,KN\n", + "L1=600 #length of 1st portion,mm\n", + "A1=pi*pow(30,2)/4 #Area of 1st portion,mm^2\n", + "L2=400 #length of 2nd portion,mm\n", + "A2=pi*(pow(30,2)-pow(10,2))/4 #Area of 2nd portion,mm^2\n", + "\n", + "#E,Young's modulus ,N/mm^2\n", + "\n", + "#Total extension= Extension of portion 1+Extension of portion 2\n", + "\n", + "#Extension=(P*1000*L)/(A*E)\n", + "\n", + "T=float(0.222) #Total extension of the bar,mm\n", + "\n", + "E=((P*1000*L1/A1)+(P*1000*L2/A2))/T \n", + "\n", + "print \"E=\",round(E,2),\"N/mm^2\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.10 Page number 251" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "delta1= 0.2113 mm\n", + "there is calculation mistake in book\n", + "delta2= 0.48 mm^2\n", + "Percentage error= 55.977 %\n", + "there is calculation mistake in book\n" + ] + } + ], + "source": [ + "import math\n", + "#variable declaration\n", + "\n", + "t=10 #steel flat thickness,mm\n", + "b1=float(60) #tapering from b1 to b2\n", + "b2=40\n", + "L=600 #steel flat length\n", + "P=float(80) #Load,KN\n", + "E=2*100000 #Young's Modulus,N/mm^2\n", + "\n", + "#Extension of the tapering bar of rectangular section\n", + "\n", + "delta1=(P*1000*L*math.log((b1/b2),10))/(t*E*(b1-b2))\n", + "\n", + "print \"delta1=\",round(delta1,4),\"mm\"\n", + "print \"there is calculation mistake in book\"\n", + "\n", + "#If averages cross-section is considered instead of tapering cross-section, extension is given by \n", + "\n", + "Aav=(b1+b2)*t/2 #mm^2\n", + "\n", + "delta2=(P*1000*L)/(Aav*E) #mm\n", + "print\"delta2=\",round(delta2,3),\"mm^2\"\n", + "\n", + "P= (delta2-delta1)*100/delta2\n", + "\n", + "print\"Percentage error=\",round(P,3),\"%\"\n", + "\n", + "print \"there is calculation mistake in book\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.11 page number251" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "delta1= 1.194 mm\n", + "delta2= 0.265 mm\n", + "Total extension 1.459 mm\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(200) #loading,KN\n", + "E=200*1000\n", + "d1=40 #Young's modulus,N/mm^2\n", + "A= pi*pow(d1,2)/4 #Area of uniform portion,mm^2 \n", + "L1=1500 #length of uniform portion,mm \n", + "d2=60 #diameter of tapered section,mm\n", + "L2=500 #length of tapered section,mm\n", + "#Extensions of uniform portion and tapering portion are worked out separately and then added to get extension of the given bar. \n", + "\n", + "#Extension of uniform portion\n", + "\n", + "delta1=(P*1000*L1)/(A*E)\n", + "\n", + "print \"delta1=\",round(delta1,3),\"mm\"\n", + "\n", + "delta2=(P*1000*4*L2)/(E*pi*d1*d2)\n", + "\n", + "print \"delta2=\",round(delta2,3),\"mm\"\n", + "\n", + "T=delta1 + delta2 \n", + "print \"Total extension\",round(T,3),\"mm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.13 page number259" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Poisson's ratio= 0.3\n", + "E= 203718.33 N/mm^2\n", + "G= 78353.2 N/mm^2\n", + "K= 169765.27 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "P=float(60) #load,KN\n", + "d=float(25) #diameter,mm\n", + "A=pi*pow(d,2)/4 #Area,mm^2\n", + "L=float(200) #gauge length,mm\n", + "\n", + "delta=0.12 #extension,mm\n", + "deltad=0.0045 #contraction in diameter,mm\n", + "Linearstrain=delta/L\n", + "Lateralstrain=deltad/d\n", + "\n", + "Pr=Lateralstrain/Linearstrain\n", + "\n", + "print \"Poisson's ratio=\",round(Pr,1)\n", + "\n", + "E=(P*1000*L)/(A*delta)\n", + "\n", + "print \"E=\",round(E,2),\"N/mm^2\"\n", + "\n", + "G=E/(2*(1+Pr)) #Rigidity modulus\n", + "\n", + "print \"G=\",round(G,1),\"N/mm^2\"\n", + "\n", + "K=E/(3*(1-(2*Pr))) #bulk modulus\n", + "\n", + "print \"K=\",round(K,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.14 page number 260" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "G= 76923.1 N/mm^2\n", + "K= 166666.67 N/mm^2\n", + "change in volume 60.0 mm^3\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "E=float(2*100000) #Young's modulus,N/mm^2\n", + "Pr=float(0.3) #poisson's ratio\n", + "\n", + "G=E/(2*(1+Pr)) #Rigidity modulus\n", + "\n", + "K=E/(3*(1-2*(Pr))) #Bulk modulus\n", + "\n", + "print \"G=\", round(G,1),\"N/mm^2\"\n", + "\n", + "print \"K=\", round(K,2), \"N/mm^2\"\n", + "\n", + "P=60 #Load,kN\n", + "A=pi*pow(25,2)/4 #Area,mm^2\n", + "\n", + "Stress=P*1000/A #N/mm^2\n", + "#Linear strain,ex\n", + "\n", + "ex=Stress/E\n", + " \n", + "#Lateralstrain,ey,ez\n", + "\n", + "ey=-1*Pr*ex\n", + "ez=-1*Pr*ex\n", + "\n", + "#volumetric strain,ev=ex+ey+ez\n", + "\n", + "ev=ex+ey+ez\n", + "\n", + "v=pi*pow(25,2)*500/4\n", + "Changeinvolume=ev*v\n", + "\n", + "print\"change in volume\",round(Changeinvolume,2),\"mm^3\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.15 page number261" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in volume= 10.8 mm^3\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "# Let the x, y, z be the mutually perpendicular directions\n", + "\n", + "pr=float(0.3)\n", + "PX=float(15) #Loading in x-direction,KN\n", + "PY=float(80) #Loading in Y-direction(compressive),KN\n", + "PZ=float(180) #Loading in Z-direction,KN\n", + "\n", + "#Area in X-,Y-,Z-Direction is AX,AY,AZ respectively,mm^2\n", + "\n", + "AX=float(10*30)\n", + "AY=float(10*400)\n", + "AZ=float(30*400)\n", + "\n", + "#stress devoloped in X-,Y-,Z- direction as px,py,pz respectively,N/mm^2\n", + "\n", + "px=PX*1000/AX\n", + "py=PY*1000/AY\n", + "pz=PZ*1000/AZ\n", + "\n", + "#Noting that a stress produces a strain of p/E in its own direction, the nature being same as that of stress and µ p E in lateral direction of opposite nature, and taking tensile stress as +ve, we can write expression for strains ex, ey, ez.\n", + "E=2*100000 #young's modulus,N/mm^2\n", + "\n", + "ex=(px/E)+(pr*py/E)-(pr*pz/E)\n", + "ey=(-pr*px/E)-(py/E)-(pr*pz/E)\n", + "ez=(-pr*px/E)+(pr*py/E)+(pz/E)\n", + "\n", + "ev=ex+ey+ez #Volumetric strain\n", + "\n", + "volume=10*30*400\n", + "\n", + "Changeinvolume=ev*volume\n", + "\n", + "print \"Change in volume=\",round(Changeinvolume,2),\"mm^3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.17 page number 263" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "poisson's Ratio= 0.346\n", + "Bulk modulus= 227500.0 N/mm^2\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "E=float(2.1*100000) #Young’s modulus of the material,N/mm^2\n", + "G=float(0.78*100000) #modulus of rigidity,N/mm^2\n", + "\n", + "pr=(E/(2*G))-1\n", + "\n", + "print \"poisson's Ratio=\",round(pr,3)\n", + "\n", + "K=E/(3*(1-2*pr))\n", + "\n", + "print \"Bulk modulus=\",round(K,3),\"N/mm^2\" " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.18 page number 263" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Young's modulus= 102857.143 N\n", + "Poisson's Ratio 0.2857\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "G=float(0.4*100000) #modulus of rigidity of material,N/mm^2\n", + "K=float(0.8*100000) #bulk modulus,N/mm^2\n", + "\n", + "E=(9*G*K)/(3*K+G)\n", + "\n", + "\n", + "print \"Young's modulus=\",round(E,3),\"N\"\n", + "\n", + "pr=(E/(2*G))-1\n", + "\n", + "print \"Poisson's Ratio\",round(pr,4)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.19 page number 264" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Stress in aluminium strip= 23.08 N/mm^2\n", + "Stress in steel strip= 46.15 N/mm^2\n", + "Extension of the compound bar= 0.138 mm\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "L=float(600) #compound bar of length,mm\n", + "P=float(60) #compound bar when axial tensile force ,KN\n", + "\n", + "Aa=float(40*20) #area of aluminium strip,mm^2\n", + "As=float(60*15) #area of steel strip,mm^2\n", + "\n", + "Ea=1*100000 # elastic modulus of aluminium,N/mm^2\n", + "Es=2*100000 # elastic modulus of steel,N/mm^2\n", + "\n", + "#load shared by aluminium strip be Pa and that shared by steel be Ps. Then from equilibrium condition Pa+Ps=P\n", + "#From compatibility condition, deltaAL=deltaS\n", + "Pa=(P*1000)/(1+((As*Es)/(Aa*Ea)))\n", + "Ps=Pa*((As*Es)/(Aa*Ea))\n", + "\n", + "Sias=Pa/Aa\n", + "print \"Stress in aluminium strip=\",round(Sias,2),\"N/mm^2\"\n", + "Siss=Ps/As\n", + "print \"Stress in steel strip=\",round(Siss,2),\"N/mm^2\"\n", + "\n", + "L=600\n", + "#Extension of the compound bar \n", + "deltal=(Pa*L)/(Aa*Ea)\n", + "print\"Extension of the compound bar=\",round(deltal,3),\"mm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.20 page number 265" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in Copper= 75.76 N/mm^2\n", + "stress in Steel= 126.27 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Es=float(2*100000) #Young's modulus of steel rod ,N/mm^2\n", + "Ec=float(1.2*100000) #Young's modulus of copper tube,N/mm^2\n", + "\n", + "di=float(25) #internal diameter,mm\n", + "de=float(40) #external diameter,mm\n", + "\n", + "As=pi*pow(di,2)/4 #Area of steel rod,mm^2\n", + "Ac=pi*(pow(de,2)-pow(di,2))/4 #Area of copper tube,mm^2\n", + "P=120 #load, KN\n", + "#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel rod and Pc is the load shared by the copper tube.\n", + "#From compatibility condition,deltaS=deltaC\n", + "\n", + "Pc=(P*1000)/(1+((As*Es)/(Ac*Ec)))\n", + "Ps=Pc*((As*Es)/(Ac*Ec))\n", + "\n", + "SIC=Pc/Ac #stress in copper, N/mm^2\n", + "SIS=Ps/As #stress in steel,N/mm^2\n", + "\n", + "print \"stress in Copper=\",round(SIC,2),\"N/mm^2\"\n", + "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.21 page number 266" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in Concrete= 4.51 N/mm^2\n", + "stress in Steel= 81.2 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "#Es/Ec=18(given)\n", + "Er=float(18) #young modulus ratio Er=Es/Ec\n", + "d=float(16) #steel bar diameter,mm\n", + "#8 steel bars\n", + "As=8*pi*pow(d,2)/4 #Area of steel bar,mm^2\n", + "Ac=(300*500)-As #Area of concrete,mm^2\n", + "\n", + "P=800 #Compressive force, KN\n", + "#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel bar and Pc is the load shared by the Concrete\n", + "#From compatibility condition,deltaS=deltaC\n", + "\n", + "Pc=(P*1000)/(1+((As*Er)/(Ac)))\n", + "Ps=Pc*((As*Er)/(Ac))\n", + "\n", + "SIC=Pc/Ac #stress in Concrete, N/mm^2\n", + "SIS=Ps/As #stress in steel,N/mm^2\n", + "\n", + "print \"stress in Concrete=\",round(SIC,2),\"N/mm^2\"\n", + "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.22 page number 267" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in Aluminium= 66.96 N/mm^2\n", + "stress in Steel= 89.29 N/mm^2\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "Es=float(2*100000) #Young's modulus of steel ,N/mm^2\n", + "Ea=float(1*100000) #Young's modulus of aluminium,N/mm^2\n", + "Ls=240 #length of steel,mm\n", + "La=160 #length of aluminium,mm\n", + "Aa=1200 #Area of aluminium,mm^2\n", + "As=1000 #Area of steel,mm^2\n", + "P=250 #load, KN\n", + "#From equation of equilibrium, Ps+2Pa=P,et force shared by each aluminium pillar be Pa and that shared by steel pillar be Ps. \n", + "#From compatibility condition,deltaS=deltaC\n", + "\n", + "Pa=(P*1000)/(2+((As*Es*La)/(Aa*Ea*Ls)))\n", + "Ps=Pa*((As*Es*La)/(Aa*Ea*Ls))\n", + "\n", + "SIA=Pa/Aa #stress in aluminium, N/mm^2\n", + "SIS=Ps/As #stress in steel,N/mm^2\n", + "\n", + "print \"stress in Aluminium=\",round(SIA,2),\"N/mm^2\"\n", + "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.23 page number 268\n" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ps= 91.73 N/mm^2\n", + "pc= 44.96 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "# Let the force shared by bolt be Ps and that by tube be Pc. Since there is no external force, static equilibrium condition gives Ps + Pc = 0 or Ps = – Pc i.e., the two forces are equal in magnitude but opposite in nature. Obviously bolt is in tension and tube is in compression.\n", + "#Let the magnitude of force be P. Due to quarter turn of the nut\n", + "\n", + "#[Note. Pitch means advancement of nut in one full turn] \n", + "\n", + "Ls=float(600) #length of whole assembly,mm\n", + "Lc=float(600) #length of whole assembly,mm\n", + "delta=float(0.5)\n", + "ds=float(20) #diameter,mm\n", + "di=float(28) #internal diameter,mm\n", + "de=float(40) #external diameter,mm\n", + "Es=float(2*100000) #Young's modulus, N/mm^2\n", + "Ec=float(1.2*100000)\n", + "As=pi*pow(ds,2)/4 #area of steel bolt,mm^2\n", + "Ac=pi*(pow(de,2)-pow(di,2))/4 #area of copper tube,mm^2\n", + "\n", + "P= (delta*(1/Ls))/((1/(As*Es))+(1/(Ac*Ec))) #Load,N\n", + "\n", + "ps=P/As #stress,N/mm^2\n", + "pc=P/Ac #copper,N/mm^2\n", + "\n", + "print \"ps=\",round(ps,2),\"N/mm^2\"\n", + "print \"pc=\",round(pc,2),\"N/mm^2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.24 page number 271" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) p= 52.8 \tN/mm^2\n", + "(b) p= 27.8 \tN/mm^2\n", + " (iii) delta= 1.968 mm\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "E=float(2*100000) #Young's modulus,N/mm^2\n", + "alpha=float(0.000012) #expansion coeffecient,/°c\n", + "L=float(12) #length,m\n", + "t=float(40-18) #temperature difference,°c\n", + "\n", + "delta=alpha*t*L*1000 #free expansion of the rails,mm \n", + "# Provide a minimum gap of 3.168 mm between the rails, so that temperature stresses do not develop\n", + " \n", + "# a) If no expansion joint is provided, free expansion prevented is equal to 3.168 mm.\n", + "\n", + "#delta=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area \n", + "\n", + "p1=(delta*E)/(L*1000) #stress developed , N/mm^2\n", + "\n", + "print \"(a) p=\", round(p1,1),\"\tN/mm^2\"\n", + "\n", + "#(b) If a gap of 1.5 mm is provided, free expansion prevented delta2 = 3.168 – 1.5 = 1.668 mm.\n", + "\n", + "delta2=1.668 #mm\n", + "#delta2=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area \n", + "\n", + "p2=(delta2*E)/(L*1000) #stress developed , N/mm^2\n", + "\n", + "print \"(b) p=\", round(p2,1),\"\tN/mm^2\"\n", + "\n", + "# If the stress developed is 20 N/mm2, then p = P/ A\n", + "p3=20 #stress developed,N/mm^2\n", + "delta3=delta-(p3*L*1000/E)\n", + "\n", + "print \" (iii) delta=\",round(delta3,3),\"mm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.25 page number 272\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress p= 360.0 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "# Let D be the diameter of ring after heating and ‘d’ be its diameter before heating\n", + "D=float(1.2*1000) #mm\n", + "\n", + "#Circumference of ring after heating Ca= pi*D & Circumference of ring before heating Cb= pi*d\n", + "\n", + "Ca=pi*D\n", + "Cb=pi*d\n", + "alphas=float(0.000012) #coefficient of expansion,/°C\n", + "t=150 #temperature change,°C\n", + "Es=2*100000 #young's modulus,N/mm^2\n", + "d=(Ca-Cb)/(alphas*t*pi)\n", + "\n", + "#when it cools expansion prevented\n", + "#delta=pi*(D-d)\n", + "delta=alphas*t*pi*d\n", + "\n", + "p=(delta*Es)/(pi*d) #stress,N/mm^2\n", + "\n", + "print \"stress p=\",round(p,2),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.26 page number 272\n" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P= 12907.3 N\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "Ea=70*1000 #Young's modulus of aluminium,N/mm^2\n", + "Es=200*1000 #Young's modulus of steel,N/mm^2\n", + "\n", + "alphaa=float(0.000011) #expansion coefficient,/°C\n", + "alphas=float(0.000012) #expansion coefficient,/°C\n", + "\n", + "Aa=600 #Area of aluminium portion,mm^2\n", + "As=400 #Area of steel, mm^2\n", + "La=float(1.5) #length of aluminium portion,m\n", + "Ls=float(3.0) #length of steel portion,m\n", + "t=18 #temperature,°C\n", + "\n", + "delta=(alphaa*t*La*1000)+(alphas*t*Ls*1000) #mm\n", + "\n", + "P=(delta)/(((La*1000)/(Aa*Ea))+((Ls*1000)/(As*Es)))\n", + "\n", + "print \"P=\" ,round(P,1),\"N\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example8.27 page number 273" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Corresponding maximum stress = 120.0 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "d1=float(25) # variation linearly in diameter from 25 mm to 50 mm \n", + "d2=float(50)\n", + "L=float(500) #length,mm\n", + "alpha=float(0.000012) #expansion coeffecient,/°C\n", + "t=25 #rise in temperture,°C\n", + "E=2*100000 #Young's modulus,N/mm^2\n", + "\n", + "delta=alpha*t*L\n", + "\n", + "#If P is the force developed by supports, then it can cause a contraction of 4*P*L/(pi*d1*d2*E)\n", + "\n", + "P=(delta*pi*d1*d2*E)/(4*L)\n", + "Am=pi*pow(d1,2)/4\n", + "Ms=P/Am\n", + "\n", + "print \"Corresponding maximum stress = \",round(Ms,1),\"N/mm^2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.28 page number 275" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "stress in steel= 12.17 N/mm^2\n", + "Stress in brass= 36.51 N/mm^2\n", + "Shear stress in pin 18.26 N/mm^2\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "#variable declaration\n", + "\n", + "Db=float(20) #diameter of brass rod,mm\n", + "Dse=float(40) #external diameter of steel tube,mm\n", + "Dsi=float(20) #internal diameter of steel tube,mm\n", + "Es=float(2*100000 ) #Young's modulus steel, N/mm^2\n", + "Eb=float(1*100000 ) #Young's modulus brass, N/mm^2\n", + "alphas=float(0.0000116) #coeffcient of expansion of steel,/°C\n", + "alphab=float(0.0000187) #coeffcient of expansion of brass,/°C\n", + "t=60 #raise in temperature, °C\n", + "As=pi*(pow(Dse,2)-pow(Dsi,2))/4 #Area of steel tube, mm^2\n", + "Ab=pi*(pow(Db,2))/4 #Area of brass rod,mm^2\n", + "L=1200 #length,mm\n", + "#Since free expansion of brass is more than free expansion of steel , compressive force Pb develops in brass and tensile force Ps develops in steel to keep the final position at CC \n", + "\n", + "#Horizontal equilibrium condition gives Pb = Ps, say P. \n", + "\n", + "P=((alphab-alphas)*t*L)/((L/(As*Es))+(L/(Ab*Eb)))\n", + "\n", + "ps=P/As\n", + "pb=P/Ab\n", + "\n", + "print \"stress in steel=\",round(ps,2),\"N/mm^2\"\n", + "print \"Stress in brass=\",round(pb,2),\"N/mm^2\"\n", + "\n", + "#the pin resist the force P at the two cross- sections at junction of two bars.\n", + "\n", + "Shearstress=P/(2*Ab)\n", + "print \"Shear stress in pin\",round(Shearstress,2),\"N/mm^2\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 8.29 page number 276" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in length= 1.07 mm\n", + "Hoop stress f= 83.33 N/mm^2\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "L=float(1000) #length of the bar at normal temperature,mm\n", + "As=float(50*10) #Area of steel,mm^2\n", + "Ac=float(40*5) #Area of copper,mm^2\n", + "#Ac = Free expansion of copper is greater than free expansion of steel . To bring them to the same position, tensile force Ps acts on steel plate and compressive force Pc acts on each copper plate. \n", + "alphas=float(0.000012) #Expansion of coeffcient of steel,/°C\n", + "alphac=float(0.000017 ) #Expansion of coeffcient of copper,/°C\n", + "t=80 #raise by temperature, °C\n", + "Es=2*100000 #Young's modulus of steel,N/mm^2\n", + "Ec=1*100000 #Young's modulus of copper,N/mm^2\n", + "Pc=((alphac-alphas)*t*L)/((2*L/(As*Es)) +(L/(Ac*Ec)))\n", + "Ps=2*Pc\n", + "\n", + "pc=Pc/Ac #Stress in copper,N/mm^2\n", + "ps=Ps/As #Stress in steel, N/mm^2\n", + "\n", + "Changeinlength=alphas*t*L+(Ps*L/(As*Es))\n", + "\n", + "\n", + "print\"Change in length=\",round(Changeinlength,2),\"mm\"\n", + "\n", + "##example 8.30 page number 278\n", + "\n", + "#variable declaration\n", + "\n", + "p=float(2) #internal pressure, N/mm^2\n", + "t=12 #thickness of thin cylinder,mm\n", + "D=float(1000) #internal diameter,mm\n", + "\n", + "f=(p*D)/(2*t) #Hoop stress,N/mm^2\n", + "\n", + "print \"Hoop stress f=\",round(f,2),\"N/mm^2\"\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_f3CqV2f.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_f3CqV2f.ipynb new file mode 100644 index 00000000..6496faeb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_f3CqV2f.ipynb @@ -0,0 +1,466 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter9-Beams" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.1 page number 286" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 18.8684 KN\n", + "RA= 29.989 KN\n", + "alpha= 25.21 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "P1=float(10) #Vertical down Load at 4m from A,KN\n", + "P2=float(15) #Inclined down Load at angle 30° at 6m from A,KN\n", + "P3=float(20) #Inclined down Load at angle 45° at 10m from A,KN\n", + "theta2=30\n", + "theta3=45\n", + "#horizontal,vertical component at A is Ha,Va respectively.\n", + "\n", + "Ha=P2*cos(theta2*pi/180)+P3*cos(theta3*pi/180)\n", + "Rb=(P1*4+P2*6*sin(theta2*pi/180)+P3*10*sin(theta3*pi/180))/12 #reaction at B point,KN\n", + "\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "#now vertical component\n", + "Va=P2*sin(theta2*pi/180)+P3*sin(theta3*pi/180)+P1-Rb\n", + "\n", + "Ra=sqrt(pow(Ha,2)+pow(Va,2))\n", + "\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "alpha=(atan(Va/Ha))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.2 page number 287" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 100.4475 KN\n", + "RA= 87.0172 KN\n", + "alpha= 79.45 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "P1=float(60) #inclined down to right Load at angle 60 at 1m from A,KN\n", + "P2=float(80) #Inclined down to left Load at angle 75° at 3m from A,KN\n", + "P3=float(50) #Inclined down to left Load at angle 60° at 5.5m from A,KN\n", + "theta1=60 \n", + "theta2=75\n", + "theta3=60\n", + "thetaRb=60\n", + "#horizontal,vertical component at A is Ha,Va respectively.\n", + "\n", + "Rb=(P1*1*sin(theta1*pi/180)+P2*3*sin(theta2*pi/180)+P3*5.5*sin(theta3*pi/180))/(6*sin(thetaRb*pi/180)) #reaction at B point,KN\n", + "Ha=-P1*cos(theta1*pi/180)+P2*cos(theta2*pi/180)-P3*cos(theta3*pi/180)+Rb*cos(thetaRb*pi/180)\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "#now vertical component\n", + "Va=P1*sin(theta1*pi/180)+P2*sin(theta2*pi/180)+P3*sin(theta3*pi/180)-Rb*sin(thetaRb*pi/180)\n", + "\n", + "Ra=sqrt(pow(Ha,2)+pow(Va,2))\n", + "\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "alpha=(atan(Va/Ha))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.3 page number 288\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RA= 91.6503 KN\n", + "HB= 42.4264 KN\n", + "VB= 90.7761 KN\n", + "RB= 100.2013 KN\n", + "alpha= 64.95 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "P1=float(20) #vertical down Load at 2m from A,KN\n", + "P2=float(30) #uniform distributed load from 2m to 6m from A,KN/m(in 4m of span)\n", + "P3=float(60) #Inclined down to right Load at angle 45° at 7m from A,KN\n", + "\n", + "theta3=45\n", + "#horizontal,vertical component at B is Hb,Vb respectively.\n", + "\n", + "Ra=(P1*7+P2*4*5+P3*2*sin(theta3*pi/180))/(9) #reaction at B point,KN\n", + "\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "Hb=P3*cos(theta3*pi/180)\n", + "print \"HB=\",round(Hb,4),\"KN\"\n", + "#now vertical component\n", + "Vb=P1+P2*4+P3*sin(theta3*pi/180)-Ra\n", + "print \"VB=\",round(Vb,4),\"KN\"\n", + "\n", + "Rb=sqrt(pow(Hb,2)+pow(Vb,2))\n", + "\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "alpha=(atan(Vb/Hb))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.4 page number 288" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no horizontal force HA=0\n", + "VA= 74.0 KN\n", + "MA= 148.0 KN-m\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "#Let the reactions at A be Ha, Va and Ma\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(20) #vertical down Load at 2m from A,KN\n", + "P2=float(12) #vertical down Load at 3m from A,KN \n", + "P3=float(10) #vertical down Load at 4m from A,KN\n", + "Pu=float(16) #uniform distributed load from A to 2m from A,KN/m(in 2m of span)\n", + "##horizontal,vertical component at A is Ha,Va respectively.\n", + "print\"no horizontal force \",\"HA=0\"\n", + "Va=Pu*2+P1+P2+P3\n", + "print \"VA=\", round(Va,2),\"KN\"\n", + "Ma=Pu*2*1+P1*2+P2*3+P3*4\n", + "print \"MA=\", round(Ma,2),\"KN-m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.5 page number 288\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no horizontal force HA=0\n", + "VA= 65.0 KN\n", + "MA= 165.0 KN-m\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "#Let the reactions at A be Va and Ma\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(15) #vertical down Load at 3m from A,KN\n", + "P2=float(10) #vertical down Load at 5m from A,KN \n", + "M=float(30) #CW moment at 4m distance from A, KN-m\n", + "Pu=float(20) #uniform distributed load from A to 2m from A,KN/m(in 2m of span)\n", + "##horizontal,vertical component at A is Ha,Va respectively.\n", + "print\"no horizontal force \",\"HA=0\"\n", + "Va=Pu*2+P1+P2\n", + "print \"VA=\", round(Va,2),\"KN\"\n", + "Ma=Pu*2*1+P1*3+P2*5+M\n", + "print \"MA=\", round(Ma,2),\"KN-m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.6 page number 289" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 100.0 KN\n", + "RA= 30.0 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#As supports A and B are simple supports and loading is only in vertical direction, the reactions RA and RB are in vertical directions only.\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(30) #vertical down Load at 1m from A,KN\n", + "P2=float(40) #vertical down Load at 6.5m from A,KN \n", + "Pu=float(20) #uniform distributed load from 2m to 5m from A,KN/m(in 3m of span).\n", + "\n", + "Rb=(Pu*3*3.5+P1*1+P2*6.5)/5\n", + "print \"RB=\", round(Rb,2),\"KN\"\n", + "Ra=Pu*3+P1+P2-Rb\n", + "print \"RA=\", round(Ra,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.7 page number 289\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no horizontal force HA=0\n", + "VB= 50.0 KN\n", + "VA= 70.0 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "#Let the reactions at A be Va and Ma.\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(60) #vertical down Load at 4m from A to right,KN\n", + "P2=float(20) #vertical down Load at 11m from A to right,KN \n", + "M=float(30) #CW moment at 7m distance from A to right, KN-m\n", + "Pu=float(20) #uniform distributed load from A to 2m from A to left ,KN/m(in 2m of span)\n", + "##horizontal,vertical component at A is Ha,Va respectively.\n", + "print\"no horizontal force \",\"HA=0\"\n", + "Vb=(-Pu*2*1+P1*4+P2*11+M)/9\n", + "print \"VB=\", round(Vb,2),\"KN\"\n", + "Va=Pu*2+P1+P2-Vb\n", + "print \"VA=\", round(Va,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.8 page number 290\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 71.011 KN\n", + "(Negative sign show that the assumed direction of VA is wrong. In other words, VA is acting vertically downwards). \n", + "RA= 23.3666 KN\n", + "alpha= 24.79 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + " \n", + "P1=float(30) #Inclined down Load at angle 45° to left at 5m from A,KN\n", + "Pu=float(20) #uniformly distributed load from 6m to 8m from A ,KN,(2m of span)\n", + "theta1=45\n", + "M=40 #ACW moment at 3m from A, KN-m\n", + "#horizontal,vertical component at A is Ha,Va respectively.\n", + "\n", + "Rb=(M+P1*5*sin(theta1*pi/180)+Pu*2*7)/6 #reaction at B point,KN\n", + "\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "Ha=P1*cos(theta1*pi/180)\n", + "\n", + "#now vertical component\n", + "Va=P1*sin(theta1*pi/180)-Rb+Pu*2\n", + "\n", + "Ra=sqrt(pow(Ha,2)+pow(Va,2))\n", + "\n", + "print \"(Negative sign show that the assumed direction of VA is wrong. In other words, VA is acting vertically downwards). \"\n", + "\n", + "Va1=-1*Va\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "alpha=(atan(Va1/Ha))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.9 page number 290\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "X= 5.0 m\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + " \n", + "#Let the left support C be at a distance x metres from A. \n", + "\n", + "P1=float(30) #vertical down load at A,KN\n", + "Pu=float(6) #uniform distributed load over whole span,KN/m,(20m of span)\n", + "P2=float(50) #vertical down load at B, KN\n", + "\n", + "#Rc=Rd(given) reaction at C & D is equal.\n", + "\n", + "Rc=(P1+P2+Pu*20)/2\n", + "Rd=Rc\n", + "\n", + "#taking moment at A \n", + "x=(((Pu*20*10+P2*20)/100)-12)/2\n", + "\n", + "print \"X=\", round(x,2),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_lYxlTcT.ipynb b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_lYxlTcT.ipynb new file mode 100644 index 00000000..6496faeb --- /dev/null +++ b/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_lYxlTcT.ipynb @@ -0,0 +1,466 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter9-Beams" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.1 page number 286" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 18.8684 KN\n", + "RA= 29.989 KN\n", + "alpha= 25.21 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "P1=float(10) #Vertical down Load at 4m from A,KN\n", + "P2=float(15) #Inclined down Load at angle 30° at 6m from A,KN\n", + "P3=float(20) #Inclined down Load at angle 45° at 10m from A,KN\n", + "theta2=30\n", + "theta3=45\n", + "#horizontal,vertical component at A is Ha,Va respectively.\n", + "\n", + "Ha=P2*cos(theta2*pi/180)+P3*cos(theta3*pi/180)\n", + "Rb=(P1*4+P2*6*sin(theta2*pi/180)+P3*10*sin(theta3*pi/180))/12 #reaction at B point,KN\n", + "\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "#now vertical component\n", + "Va=P2*sin(theta2*pi/180)+P3*sin(theta3*pi/180)+P1-Rb\n", + "\n", + "Ra=sqrt(pow(Ha,2)+pow(Va,2))\n", + "\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "alpha=(atan(Va/Ha))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.2 page number 287" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 100.4475 KN\n", + "RA= 87.0172 KN\n", + "alpha= 79.45 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "P1=float(60) #inclined down to right Load at angle 60 at 1m from A,KN\n", + "P2=float(80) #Inclined down to left Load at angle 75° at 3m from A,KN\n", + "P3=float(50) #Inclined down to left Load at angle 60° at 5.5m from A,KN\n", + "theta1=60 \n", + "theta2=75\n", + "theta3=60\n", + "thetaRb=60\n", + "#horizontal,vertical component at A is Ha,Va respectively.\n", + "\n", + "Rb=(P1*1*sin(theta1*pi/180)+P2*3*sin(theta2*pi/180)+P3*5.5*sin(theta3*pi/180))/(6*sin(thetaRb*pi/180)) #reaction at B point,KN\n", + "Ha=-P1*cos(theta1*pi/180)+P2*cos(theta2*pi/180)-P3*cos(theta3*pi/180)+Rb*cos(thetaRb*pi/180)\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "#now vertical component\n", + "Va=P1*sin(theta1*pi/180)+P2*sin(theta2*pi/180)+P3*sin(theta3*pi/180)-Rb*sin(thetaRb*pi/180)\n", + "\n", + "Ra=sqrt(pow(Ha,2)+pow(Va,2))\n", + "\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "alpha=(atan(Va/Ha))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.3 page number 288\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RA= 91.6503 KN\n", + "HB= 42.4264 KN\n", + "VB= 90.7761 KN\n", + "RB= 100.2013 KN\n", + "alpha= 64.95 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "P1=float(20) #vertical down Load at 2m from A,KN\n", + "P2=float(30) #uniform distributed load from 2m to 6m from A,KN/m(in 4m of span)\n", + "P3=float(60) #Inclined down to right Load at angle 45° at 7m from A,KN\n", + "\n", + "theta3=45\n", + "#horizontal,vertical component at B is Hb,Vb respectively.\n", + "\n", + "Ra=(P1*7+P2*4*5+P3*2*sin(theta3*pi/180))/(9) #reaction at B point,KN\n", + "\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "Hb=P3*cos(theta3*pi/180)\n", + "print \"HB=\",round(Hb,4),\"KN\"\n", + "#now vertical component\n", + "Vb=P1+P2*4+P3*sin(theta3*pi/180)-Ra\n", + "print \"VB=\",round(Vb,4),\"KN\"\n", + "\n", + "Rb=sqrt(pow(Hb,2)+pow(Vb,2))\n", + "\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "alpha=(atan(Vb/Hb))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.4 page number 288" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no horizontal force HA=0\n", + "VA= 74.0 KN\n", + "MA= 148.0 KN-m\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "#Let the reactions at A be Ha, Va and Ma\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(20) #vertical down Load at 2m from A,KN\n", + "P2=float(12) #vertical down Load at 3m from A,KN \n", + "P3=float(10) #vertical down Load at 4m from A,KN\n", + "Pu=float(16) #uniform distributed load from A to 2m from A,KN/m(in 2m of span)\n", + "##horizontal,vertical component at A is Ha,Va respectively.\n", + "print\"no horizontal force \",\"HA=0\"\n", + "Va=Pu*2+P1+P2+P3\n", + "print \"VA=\", round(Va,2),\"KN\"\n", + "Ma=Pu*2*1+P1*2+P2*3+P3*4\n", + "print \"MA=\", round(Ma,2),\"KN-m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.5 page number 288\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no horizontal force HA=0\n", + "VA= 65.0 KN\n", + "MA= 165.0 KN-m\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "#Let the reactions at A be Va and Ma\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(15) #vertical down Load at 3m from A,KN\n", + "P2=float(10) #vertical down Load at 5m from A,KN \n", + "M=float(30) #CW moment at 4m distance from A, KN-m\n", + "Pu=float(20) #uniform distributed load from A to 2m from A,KN/m(in 2m of span)\n", + "##horizontal,vertical component at A is Ha,Va respectively.\n", + "print\"no horizontal force \",\"HA=0\"\n", + "Va=Pu*2+P1+P2\n", + "print \"VA=\", round(Va,2),\"KN\"\n", + "Ma=Pu*2*1+P1*3+P2*5+M\n", + "print \"MA=\", round(Ma,2),\"KN-m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.6 page number 289" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 100.0 KN\n", + "RA= 30.0 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#As supports A and B are simple supports and loading is only in vertical direction, the reactions RA and RB are in vertical directions only.\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(30) #vertical down Load at 1m from A,KN\n", + "P2=float(40) #vertical down Load at 6.5m from A,KN \n", + "Pu=float(20) #uniform distributed load from 2m to 5m from A,KN/m(in 3m of span).\n", + "\n", + "Rb=(Pu*3*3.5+P1*1+P2*6.5)/5\n", + "print \"RB=\", round(Rb,2),\"KN\"\n", + "Ra=Pu*3+P1+P2-Rb\n", + "print \"RA=\", round(Ra,2),\"KN\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.7 page number 289\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no horizontal force HA=0\n", + "VB= 50.0 KN\n", + "VA= 70.0 KN\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "#Let the reactions at A be Va and Ma.\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + "\n", + "P1=float(60) #vertical down Load at 4m from A to right,KN\n", + "P2=float(20) #vertical down Load at 11m from A to right,KN \n", + "M=float(30) #CW moment at 7m distance from A to right, KN-m\n", + "Pu=float(20) #uniform distributed load from A to 2m from A to left ,KN/m(in 2m of span)\n", + "##horizontal,vertical component at A is Ha,Va respectively.\n", + "print\"no horizontal force \",\"HA=0\"\n", + "Vb=(-Pu*2*1+P1*4+P2*11+M)/9\n", + "print \"VB=\", round(Vb,2),\"KN\"\n", + "Va=Pu*2+P1+P2-Vb\n", + "print \"VA=\", round(Va,2),\"KN\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.8 page number 290\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RB= 71.011 KN\n", + "(Negative sign show that the assumed direction of VA is wrong. In other words, VA is acting vertically downwards). \n", + "RA= 23.3666 KN\n", + "alpha= 24.79 °\n" + ] + } + ], + "source": [ + "from math import pi,atan,sqrt,cos,sin\n", + "\n", + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + " \n", + "P1=float(30) #Inclined down Load at angle 45° to left at 5m from A,KN\n", + "Pu=float(20) #uniformly distributed load from 6m to 8m from A ,KN,(2m of span)\n", + "theta1=45\n", + "M=40 #ACW moment at 3m from A, KN-m\n", + "#horizontal,vertical component at A is Ha,Va respectively.\n", + "\n", + "Rb=(M+P1*5*sin(theta1*pi/180)+Pu*2*7)/6 #reaction at B point,KN\n", + "\n", + "print \"RB=\",round(Rb,4),\"KN\"\n", + "\n", + "Ha=P1*cos(theta1*pi/180)\n", + "\n", + "#now vertical component\n", + "Va=P1*sin(theta1*pi/180)-Rb+Pu*2\n", + "\n", + "Ra=sqrt(pow(Ha,2)+pow(Va,2))\n", + "\n", + "print \"(Negative sign show that the assumed direction of VA is wrong. In other words, VA is acting vertically downwards). \"\n", + "\n", + "Va1=-1*Va\n", + "print \"RA=\",round(Ra,4),\"KN\"\n", + "\n", + "alpha=(atan(Va1/Ha))*180/pi\n", + "\n", + "print \"alpha=\",round(alpha,2),\"°\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# example 9.9 page number 290\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "X= 5.0 m\n" + ] + } + ], + "source": [ + "#variable declaration\n", + "\n", + "#summation of all horizontal forces is zero & vertical forces is zero.\n", + " \n", + "#Let the left support C be at a distance x metres from A. \n", + "\n", + "P1=float(30) #vertical down load at A,KN\n", + "Pu=float(6) #uniform distributed load over whole span,KN/m,(20m of span)\n", + "P2=float(50) #vertical down load at B, KN\n", + "\n", + "#Rc=Rd(given) reaction at C & D is equal.\n", + "\n", + "Rc=(P1+P2+Pu*20)/2\n", + "Rd=Rc\n", + "\n", + "#taking moment at A \n", + "x=(((Pu*20*10+P2*20)/100)-12)/2\n", + "\n", + "print \"X=\", round(x,2),\"m\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_1aLh7y0.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_1aLh7y0.ipynb new file mode 100644 index 00000000..486ad42a --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_1aLh7y0.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 39 ELECTROMAGNETIC WAVES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 39.6 Magnitude of electric and magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of E in volts/meter= 244.94897\n", + "B in weber/meter^2= 0.00000082\n" + ] + } + ], + "source": [ + "import math\n", + "r=1 #in m\n", + "p=10**3 \n", + "m=4*math.pi*10**-7 #weber/amp-m\n", + "c=3*10**8 #speed of light\n", + "x=2*math.pi\n", + "E_m=(1/r)*(math.sqrt((p*m*c)/x))\n", + "print(\"The value of E in volts/meter= %.5f\"%E_m)\n", + "B=E_m/c\n", + "print(\"B in weber/meter^2= %.8f\"%B)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_2XXGNQt.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_2XXGNQt.ipynb new file mode 100644 index 00000000..d8f167d7 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_2XXGNQt.ipynb @@ -0,0 +1,181 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 37 MAGNETIC PROPERTIES OF MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.2 Orbital dipole moment" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Orbital dipole moment in amp-m2 is 9.061e-24\n" + ] + } + ], + "source": [ + "import math\n", + "e=1.6*10**-19 #in coul\n", + "r=5.1*10**-11 #radius of hydrogen atom in meter\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "p=((e**2)/4)*math.sqrt(r/(math.pi*epsilon0*m))\n", + "print(\"Orbital dipole moment in amp-m2 is %.3e\"%p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.4 Change in magnetic moment" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in Orbital dipole moment in amp-m2 is + 0r - 3.659e-29\n" + ] + } + ], + "source": [ + "e=1.6*10**-19 #in coul\n", + "r=5.1*10**-11 #radius of hydrogen atom in meter\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "B=2 #in wb/m2\n", + "delta_p=(e**2*B*r**2)/(4*m)\n", + "print(\"Change in Orbital dipole moment in amp-m2 is + 0r - %.3e\"%delta_p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.5 Precession frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Precession frequency of phoyon in given magnetic field in cps is 21020464.18\n" + ] + } + ], + "source": [ + "import math\n", + "u=1.4*10**-26 #in amp-m2\n", + "B=0.50 #wb/m2\n", + "Lp=0.53*10**-34 #in joule-sec\n", + "fp=u*B/(2*math.pi*Lp)\n", + "print(\"Precession frequency of phoyon in given magnetic field in cps is %.2f\"%fp)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.6 Magnetic field strength Magnetisation Effective magnetising current and Permeability" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic field strength in amp/m is 2000\n", + "(B) Magnetisation is Zero when core is removed\n", + " Magnetisation when the core is replaced in amp/m 793774.72\n", + "(C) Effective magnetizing current i=i(M,0)=M*(2*math.pi*r0/N0)=M/n\n", + " Effective magnetizing current in amp is 793.77472\n", + "(D) Permeability 397.88736\n" + ] + } + ], + "source": [ + "import math\n", + "n=10*10**2 #turns/m\n", + "i=2 #in amp\n", + "B=1.0 #in wb/m\n", + "u0=4*math.pi*10**-7 #in wb/amp-m\n", + "#(A)\n", + "H=n*i\n", + "print(\"(A) Magnetic field strength in amp/m is\",H)\n", + "#(B)\n", + "M=(B-u0*H)/u0\n", + "print(\"(B) Magnetisation is Zero when core is removed\")\n", + "print(\" Magnetisation when the core is replaced in amp/m %.2f\"%M)\n", + "#(C)\n", + "print(\"(C) Effective magnetizing current i=i(M,0)=M*(2*math.pi*r0/N0)=M/n\")\n", + "i=M/n\n", + "print(\" Effective magnetizing current in amp is %.5f\"%i)\n", + "#D\n", + "Km=B/(u0*H)\n", + "print(\"(D) Permeability %.5f\"%Km)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_3V8tDtA.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_3V8tDtA.ipynb new file mode 100644 index 00000000..57d1a771 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_3V8tDtA.ipynb @@ -0,0 +1,227 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 45 GRATING AND SPECTRA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.1 Calculation of angle" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The first order diffraction pattern in degree= 7.249\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "m=1\n", + "lamda=4000 #in A\n", + "d=31700 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"The first order diffraction pattern in degree= %.3f\"%theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.2 Calculation of angle theta" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) The first order diffraction pattern in degree= 13.408\n", + "(B) Angle of seperation in degree= 0.0002388\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "m=1\n", + "lamda=5890 #in A\n", + "d=25400 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"(A) The first order diffraction pattern in degree= %.3f\"%theta)\n", + "del_lambda=5.9 #in A\n", + "delta_theta=(m*(del_lambda))/(d*(math.cos(theta*math.pi/180)))\n", + "print(\"(B) Angle of seperation in degree= %.7f\"%delta_theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.3 Calculation of Sodium Doublet" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resolving power= 998.305\n", + "Number of rulings needed is= 332.768\n" + ] + } + ], + "source": [ + "lamda=5890 #A\n", + "lamda_1=5895.9 #A\n", + "m=3\n", + "delta_lambda=(lamda_1-lamda) #in A\n", + "R=lamda/(delta_lambda)\n", + "print(\"Resolving power= %.3f\"%R)\n", + "N=(R/m)\n", + "print(\"Number of rulings needed is= %.3f\"%N)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.4 Calculation of Dispersion" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The first order diffraction pattern in degree= 31.11244\n", + "(A) The dispersion in radian/A= 0.0001105\n", + "(B) Wave length difference in A= 0.13650\n" + ] + } + ], + "source": [ + "import math\n", + "m=3\n", + "m1=5\n", + "lamda=5460 #in A\n", + "d=31700 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"The first order diffraction pattern in degree= %.5f\"%theta)\n", + "D=m/(d*math.cos(theta*math.pi/180))\n", + "print(\"(A) The dispersion in radian/A= %.7f\"%D)\n", + "N=8000\n", + "lamda=5460\n", + "R=N*m1\n", + "delta_lambda=lamda/R\n", + "print(\"(B) Wave length difference in A= %.5f\"%delta_lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.5 Calculation of Angles" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Interplanar spacing d in A= 2.51781\n", + "Diffracted beam occurs when m=1,m=2 and m=3\n", + "When m1=1, Theta in degree= 12.61763\n", + "When m1=2, Theta in degree= 25.90544\n", + "When m1=3, Theta in degree= 40.94473\n" + ] + } + ], + "source": [ + "import math\n", + "a_o=5.63 #A\n", + "d=a_o/math.sqrt(5)\n", + "lamda=1.10 #in A\n", + "print(\"Interplanar spacing d in A= %.5f\"%d)\n", + "print(\"Diffracted beam occurs when m=1,m=2 and m=3\")\n", + "m1=1\n", + "x=(m1*lamda)/(2*d)\n", + "theta_1=math.degrees(math.asin(x))\n", + "print(\"When m1=1, Theta in degree= %.5f\"%theta_1)\n", + "m2=2\n", + "x=(m2*lamda)/(2*d)\n", + "theta_2=math.degrees(math.asin(x))\n", + "print('When m1=2, Theta in degree= %.5f'%theta_2)\n", + "m3=3\n", + "x=(m3*lamda)/(2*d)\n", + "theta_3=math.degrees(math.asin(x))\n", + "print('When m1=3, Theta in degree= %.5f'%theta_3)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_43oToOV.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_43oToOV.ipynb new file mode 100644 index 00000000..7cae8043 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_43oToOV.ipynb @@ -0,0 +1,167 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 40 NATURE AND PROPOGATION OF LIGHT" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.1 Force and energy reflected" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Energy reflected from mirror in joule= 36000.0\n", + "Momentum after 1 hr illumination in kg-m/sec= 0.00024\n", + "(B) Force in newton= 6.667e-08\n" + ] + } + ], + "source": [ + "u=(10)*(1.0)*3600 #in Joules\n", + "c=3*10**8 #in m/sec\n", + "t=3600 #in sec\n", + "print(\"(A) Energy reflected from mirror in joule=\",u)\n", + "p=(2*u)/c\n", + "print(\"Momentum after 1 hr illumination in kg-m/sec= %.5f\"%p)\n", + "f=p/t\n", + "print(\"(B) Force in newton= %.3e\"%f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.2 Angular speed" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular speed in rev/sec= 12.07030\n" + ] + } + ], + "source": [ + "theta=1/1440\n", + "c=3*10**8 #in m/sec\n", + "l=8630 #in m\n", + "w=(c*theta)/(2*l)\n", + "print(\"Angular speed in rev/sec= %.5f\"%w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.3 Calculation of c" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Lambda_g in cm= 3.9\n", + "Value of c in m/sec= 2.992e+10\n" + ] + } + ], + "source": [ + "l=15.6 #in cm\n", + "n=8\n", + "lambda_g=(2*l)/n\n", + "print(\"Lambda_g in cm=\",lambda_g)\n", + "lamda=3.15 #in cm\n", + "f=9.5*10**9 #cycles/sec\n", + "c=lamda*f\n", + "print(\"Value of c in m/sec= %.3e\"%c)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.4 Percentage error" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of light in miles/hour= 50000\n" + ] + } + ], + "source": [ + "v_1=25000 #miles/hr\n", + "u=25000 #miles/hr\n", + "c=6.7*10**8 #miles/hr\n", + "x=1+((v_1*u)/(c)**2)\n", + "v=(v_1+u)/x\n", + "print(\"Speed of light in miles/hour= %.0f\"%v)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_4fqVxcE.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_4fqVxcE.ipynb new file mode 100644 index 00000000..5d6ec9b4 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_4fqVxcE.ipynb @@ -0,0 +1,177 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 43 INTERFERENCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.1 Angular position of first minimum" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sin theta = 0.00273\n", + "Angle in degree= 0.15642\n" + ] + } + ], + "source": [ + "import math\n", + "m=1\n", + "lamda=546*10**-9\n", + "d=0.10*10**-3 #in m\n", + "sin_theta=((m-0.5)*lamda)/(d)\n", + "print(\"Sin theta = %.5f\"%sin_theta)\n", + "theta=math.degrees(math.asin(sin_theta))\n", + "print(\"Angle in degree= %.5f\"%theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.2 Linear distance" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Linear distance in meter= 0.00109\n" + ] + } + ], + "source": [ + "delta=546*10**-9 #in meter\n", + "D=20*10**-2 #in meter\n", + "d=0.10*10**-3 #in meter\n", + "delta_y=(delta*D)/d\n", + "print(\"Linear distance in meter= %.5f\"%delta_y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.4 Refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When m= 1\n", + "Lambda_max= 5674.666666666667\n", + "Lambda_min= 8500.0\n", + "When m= 2\n", + "Lambda_max= 3404.8\n", + "Lambda_min= 4250.0\n" + ] + } + ], + "source": [ + "d=3200 #in A\n", + "n=1.33\n", + "for m in range(1,3):\n", + " lambda_max=(2*d*n)/(m+0.5)\n", + " lambda_min=(8500/m)\n", + " print(\"When m=\",m)\n", + " print(\"Lambda_max=\",lambda_max)\n", + " print(\"Lambda_min=\",lambda_min)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.5 Refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When m= 0\n", + "d in A=905.797\n", + "When m= 1\n", + "d in A=2717.391\n", + "When m= 2\n", + "d in A=4528.986\n", + "When m= 3\n", + "d in A=6340.580\n" + ] + } + ], + "source": [ + "lamda=5000 #in A\n", + "n=1.38\n", + "for m in range(0,4):\n", + " print(\"When m=\",m)\n", + " d=((m+0.5)*lamda)/(2*n)\n", + " print(\"d in A=%.3f\"%d)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5XodvPd.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5XodvPd.ipynb new file mode 100644 index 00000000..2b7da278 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5XodvPd.ipynb @@ -0,0 +1,183 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 27 THE ELECTRIC FIELD" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.1 Electric field strength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength E=F/q where F=mg\n", + "electric field strength in nt/coul is 5.574e-11\n" + ] + } + ], + "source": [ + "m=9.1*10**-31 #mass of electron in kg\n", + "g=9.8 #acceleration due to gravity in m/s\n", + "q=1.6*10**-19 #charge of electron in coul\n", + "print(\"Electric field strength E=F/q where F=mg\")\n", + "E=m*g/q\n", + "print(\"electric field strength in nt/coul is %.3e\"%E)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.4 The point on the line joining two charges for the electric field strength to be zero" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For the electric field strength to be zero the point should lie between the charges where E1=E2\n", + "E1=E2 which implies q1/4πϵx2 = q2/4πϵ(l-x)2\n", + "Electric field strength is zero at x=4.142 cm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "q1=1.0*10**-6 #in coul\n", + "q2=2.0*10**-6 #in coul\n", + "l=10 #sepearation b/w q1 and q2 in cm\n", + "print(\"For the electric field strength to be zero the point should lie between the charges where E1=E2\")\n", + "#\"Refer to the fig 27.9\"\n", + "#E1=electric fied strength due to q1\n", + "#E2=electric fied strength due to q2\n", + "print(\"E1=E2 which implies q1/4πϵx2 = q2/4πϵ(l-x)2\")\n", + "x=l/(1+math.sqrt(q2/q1))\n", + "print(\"Electric field strength is zero at x=%.3f cm\"%x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.9 Deflection of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Corresponding deflection in meters is 0.000337\n" + ] + } + ], + "source": [ + "e=1.6*10**-19 #charge in coul\n", + "E=1.2*10**4 #electric field in nt/coul\n", + "x=1.5*10**-2 #length of deflecting assembly in m\n", + "K0=3.2*10**-16 #kinetic energy of electron in joule\n", + "#calculation\n", + "y=e*E*x**2/(4*K0)\n", + "print(\"Corresponding deflection in meters is %.6f\"%y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.11 Torque and work done by external agent on electric dipole" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Maximum torque exerted by the fied in nt-m is\n", + "0.002\n", + "(b) Work done by the external agent to turn dipole end for end in joule is \n", + "0.004\n" + ] + } + ], + "source": [ + "import math\n", + "q=1.0*10**-6 #magnitude of two opposite charges of a electric dipole in coul\n", + "d=2.0*10**-2 #seperation b/w charges in m\n", + "E=1.0*10**5 #external field in nt/coul\n", + "#calculations\n", + "#(a)Max torque if found when theta=90 degrees\n", + "#Torque =pEsin(theta)\n", + "p=q*d #electric dipole moment\n", + "T=p*E*math.sin(math.pi/2)\n", + "print(\"(a)Maximum torque exerted by the fied in nt-m is\")\n", + "print(T)\n", + "#(b)work done by the external agent is the potential energy b/w the positions theta=180 and 0 degree\n", + "W=(-p*E*math.cos(math.pi))-(-p*E*math.cos(0))\n", + "print(\"(b) Work done by the external agent to turn dipole end for end in joule is \")\n", + "print(W)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5alZU29.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5alZU29.ipynb new file mode 100644 index 00000000..d8f167d7 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_5alZU29.ipynb @@ -0,0 +1,181 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 37 MAGNETIC PROPERTIES OF MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.2 Orbital dipole moment" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Orbital dipole moment in amp-m2 is 9.061e-24\n" + ] + } + ], + "source": [ + "import math\n", + "e=1.6*10**-19 #in coul\n", + "r=5.1*10**-11 #radius of hydrogen atom in meter\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "p=((e**2)/4)*math.sqrt(r/(math.pi*epsilon0*m))\n", + "print(\"Orbital dipole moment in amp-m2 is %.3e\"%p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.4 Change in magnetic moment" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in Orbital dipole moment in amp-m2 is + 0r - 3.659e-29\n" + ] + } + ], + "source": [ + "e=1.6*10**-19 #in coul\n", + "r=5.1*10**-11 #radius of hydrogen atom in meter\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "B=2 #in wb/m2\n", + "delta_p=(e**2*B*r**2)/(4*m)\n", + "print(\"Change in Orbital dipole moment in amp-m2 is + 0r - %.3e\"%delta_p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.5 Precession frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Precession frequency of phoyon in given magnetic field in cps is 21020464.18\n" + ] + } + ], + "source": [ + "import math\n", + "u=1.4*10**-26 #in amp-m2\n", + "B=0.50 #wb/m2\n", + "Lp=0.53*10**-34 #in joule-sec\n", + "fp=u*B/(2*math.pi*Lp)\n", + "print(\"Precession frequency of phoyon in given magnetic field in cps is %.2f\"%fp)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.6 Magnetic field strength Magnetisation Effective magnetising current and Permeability" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic field strength in amp/m is 2000\n", + "(B) Magnetisation is Zero when core is removed\n", + " Magnetisation when the core is replaced in amp/m 793774.72\n", + "(C) Effective magnetizing current i=i(M,0)=M*(2*math.pi*r0/N0)=M/n\n", + " Effective magnetizing current in amp is 793.77472\n", + "(D) Permeability 397.88736\n" + ] + } + ], + "source": [ + "import math\n", + "n=10*10**2 #turns/m\n", + "i=2 #in amp\n", + "B=1.0 #in wb/m\n", + "u0=4*math.pi*10**-7 #in wb/amp-m\n", + "#(A)\n", + "H=n*i\n", + "print(\"(A) Magnetic field strength in amp/m is\",H)\n", + "#(B)\n", + "M=(B-u0*H)/u0\n", + "print(\"(B) Magnetisation is Zero when core is removed\")\n", + "print(\" Magnetisation when the core is replaced in amp/m %.2f\"%M)\n", + "#(C)\n", + "print(\"(C) Effective magnetizing current i=i(M,0)=M*(2*math.pi*r0/N0)=M/n\")\n", + "i=M/n\n", + "print(\" Effective magnetizing current in amp is %.5f\"%i)\n", + "#D\n", + "Km=B/(u0*H)\n", + "print(\"(D) Permeability %.5f\"%Km)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_61hsExw.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_61hsExw.ipynb new file mode 100644 index 00000000..c497e908 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_61hsExw.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 26:CHARGE AND MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_6qwmhHU.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_6qwmhHU.ipynb new file mode 100644 index 00000000..a0180572 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_6qwmhHU.ipynb @@ -0,0 +1,139 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 41 REFLECTION AND REFRACTION OF PLANE WAVES AND PLANE SURFACES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.1 Angle between two refracted beams" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For 4000 A beam, theta_2 in degree= 19.88234\n", + "For 5000 A beam, theta_2 in degree= 19.99290\n" + ] + } + ], + "source": [ + "import math\n", + "theta_1=30\n", + "n_qa=1.4702\n", + "theta2=math.degrees(math.asin(math.sin(theta_1*math.pi/180)/n_qa))\n", + "print(\"For 4000 A beam, theta_2 in degree= %.5f\"%theta2)\n", + "\n", + "theta_1=30\n", + "n_qa=1.4624\n", + "theta2=math.degrees(math.asin(math.sin(theta_1*math.pi/180)/n_qa))\n", + "print(\"For 5000 A beam, theta_2 in degree= %.5f\"%theta2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.4 Index of glass" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Index reflection= 1.41421\n" + ] + } + ], + "source": [ + "import math\n", + "n=1/math.sin(45*math.pi/180)\n", + "print(\"Index reflection= %.5f\"%n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.5 Calculation of Angle" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle theta_c in degree= 62.45732\n", + "Actual angle of indices = 45 is less than theta_ c, so there is no internal angle reflection\n", + "Angle of refraction:\n", + "Theta_2 in degree= 52.89097\n" + ] + } + ], + "source": [ + "import math\n", + "n2=1.33\n", + "n1=1.50\n", + "theta_c=math.degrees(math.asin(n2/n1))\n", + "print(\"Angle theta_c in degree= %.5f\"%theta_c)\n", + "print(\"Actual angle of indices = 45 is less than theta_ c, so there is no internal angle reflection\")\n", + "print(\"Angle of refraction:\")\n", + "x=n1/n2\n", + "theta_2=(math.asin(x*math.sin(45*math.pi/180))*180/math.pi)\n", + "print(\"Theta_2 in degree= %.5f\"%theta_2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7lzRnr0.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7lzRnr0.ipynb new file mode 100644 index 00000000..5d6ec9b4 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7lzRnr0.ipynb @@ -0,0 +1,177 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 43 INTERFERENCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.1 Angular position of first minimum" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sin theta = 0.00273\n", + "Angle in degree= 0.15642\n" + ] + } + ], + "source": [ + "import math\n", + "m=1\n", + "lamda=546*10**-9\n", + "d=0.10*10**-3 #in m\n", + "sin_theta=((m-0.5)*lamda)/(d)\n", + "print(\"Sin theta = %.5f\"%sin_theta)\n", + "theta=math.degrees(math.asin(sin_theta))\n", + "print(\"Angle in degree= %.5f\"%theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.2 Linear distance" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Linear distance in meter= 0.00109\n" + ] + } + ], + "source": [ + "delta=546*10**-9 #in meter\n", + "D=20*10**-2 #in meter\n", + "d=0.10*10**-3 #in meter\n", + "delta_y=(delta*D)/d\n", + "print(\"Linear distance in meter= %.5f\"%delta_y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.4 Refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When m= 1\n", + "Lambda_max= 5674.666666666667\n", + "Lambda_min= 8500.0\n", + "When m= 2\n", + "Lambda_max= 3404.8\n", + "Lambda_min= 4250.0\n" + ] + } + ], + "source": [ + "d=3200 #in A\n", + "n=1.33\n", + "for m in range(1,3):\n", + " lambda_max=(2*d*n)/(m+0.5)\n", + " lambda_min=(8500/m)\n", + " print(\"When m=\",m)\n", + " print(\"Lambda_max=\",lambda_max)\n", + " print(\"Lambda_min=\",lambda_min)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.5 Refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When m= 0\n", + "d in A=905.797\n", + "When m= 1\n", + "d in A=2717.391\n", + "When m= 2\n", + "d in A=4528.986\n", + "When m= 3\n", + "d in A=6340.580\n" + ] + } + ], + "source": [ + "lamda=5000 #in A\n", + "n=1.38\n", + "for m in range(0,4):\n", + " print(\"When m=\",m)\n", + " d=((m+0.5)*lamda)/(2*n)\n", + " print(\"d in A=%.3f\"%d)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7pdEUt8.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7pdEUt8.ipynb new file mode 100644 index 00000000..cd850cd0 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_7pdEUt8.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 46 POLARIZATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.1 Calculation of theta" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polarization angle theta= 135.0\n" + ] + } + ], + "source": [ + "import math\n", + "theta=math.degrees(math.acos(1/math.sqrt(2)))\n", + "theta=180-theta\n", + "print(\"Polarization angle theta=\",theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.2 Angle of refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Theta_p in degrees=56.30993\n", + "Angle of refraction fron Snells law in degrees=33.69007\n" + ] + } + ], + "source": [ + "import math\n", + "theta_p= math.degrees(math.atan(1.5))\n", + "print(\"Theta_p in degrees=%.5f\"%theta_p)\n", + "sin_theta_r= (math.sin(theta_p*math.pi/180))/1.5\n", + "theta_r=math.degrees(math.asin(sin_theta_r))\n", + "print(\"Angle of refraction fron Snells law in degrees=%.5f\"%theta_r)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.3 Thickness of slab" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Value of x in m= 163611.111111113\n" + ] + } + ], + "source": [ + "lamda=5890 #A\n", + "n_e=1.553\n", + "n_o=1.544\n", + "s=(n_e)-(n_o)\n", + "x=(lamda)/(4*s)\n", + "\n", + "print(\"The Value of x in m=\",x)\n", + "#The answer provided in the textbook is wrong" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_96rcQDS.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_96rcQDS.ipynb new file mode 100644 index 00000000..486ad42a --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_96rcQDS.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 39 ELECTROMAGNETIC WAVES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 39.6 Magnitude of electric and magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of E in volts/meter= 244.94897\n", + "B in weber/meter^2= 0.00000082\n" + ] + } + ], + "source": [ + "import math\n", + "r=1 #in m\n", + "p=10**3 \n", + "m=4*math.pi*10**-7 #weber/amp-m\n", + "c=3*10**8 #speed of light\n", + "x=2*math.pi\n", + "E_m=(1/r)*(math.sqrt((p*m*c)/x))\n", + "print(\"The value of E in volts/meter= %.5f\"%E_m)\n", + "B=E_m/c\n", + "print(\"B in weber/meter^2= %.8f\"%B)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_986l79d.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_986l79d.ipynb new file mode 100644 index 00000000..cd850cd0 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_986l79d.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 46 POLARIZATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.1 Calculation of theta" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polarization angle theta= 135.0\n" + ] + } + ], + "source": [ + "import math\n", + "theta=math.degrees(math.acos(1/math.sqrt(2)))\n", + "theta=180-theta\n", + "print(\"Polarization angle theta=\",theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.2 Angle of refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Theta_p in degrees=56.30993\n", + "Angle of refraction fron Snells law in degrees=33.69007\n" + ] + } + ], + "source": [ + "import math\n", + "theta_p= math.degrees(math.atan(1.5))\n", + "print(\"Theta_p in degrees=%.5f\"%theta_p)\n", + "sin_theta_r= (math.sin(theta_p*math.pi/180))/1.5\n", + "theta_r=math.degrees(math.asin(sin_theta_r))\n", + "print(\"Angle of refraction fron Snells law in degrees=%.5f\"%theta_r)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.3 Thickness of slab" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Value of x in m= 163611.111111113\n" + ] + } + ], + "source": [ + "lamda=5890 #A\n", + "n_e=1.553\n", + "n_o=1.544\n", + "s=(n_e)-(n_o)\n", + "x=(lamda)/(4*s)\n", + "\n", + "print(\"The Value of x in m=\",x)\n", + "#The answer provided in the textbook is wrong" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9ErC6RA.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9ErC6RA.ipynb new file mode 100644 index 00000000..c497e908 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9ErC6RA.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 26:CHARGE AND MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9Rw4WUL.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9Rw4WUL.ipynb new file mode 100644 index 00000000..c497e908 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9Rw4WUL.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 26:CHARGE AND MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": "markdown", + "metadata": { + "collapsed": true + }, + "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": [ + "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": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9cwcC1v.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9cwcC1v.ipynb new file mode 100644 index 00000000..904b1c32 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9cwcC1v.ipynb @@ -0,0 +1,220 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 31 CURRENT AND RESISTANCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.1 Current density" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current density in Aluminium wire in amp/square inches 1273.240\n", + "Current density in copper wire in amp/square inches 3108.495\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "d1=0.10 #diameter of aluminium wire in inches\n", + "d2=0.064 #diameter of copper wire in inches\n", + "i=10 #current carried by composite wire in amperes\n", + "A1=math.pi*(d1/2)**2 #crosssectional area of aluminium wire in square inches\n", + "A2=math.pi*(d2/2)**2 #crosssectional area of copper wire in square inches\n", + "j1=i/A1\n", + "j2=i/A2\n", + "print(\"Current density in Aluminium wire in amp/square inches %.3f\"%j1)\n", + "print(\"Current density in copper wire in amp/square inches %.3f\"%j2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.2 Drift speed" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "No.of free electrons per unit volume in atoms/mole 8.438e+22\n", + "Drift speed of electron in cm/sec is 0.03556\n" + ] + } + ], + "source": [ + "j=480 #current density for copper wire in amp/cm2\n", + "N0=6*10**23 #avagadro number in atoms/mole\n", + "M=64 #molecular wt in gm/mole\n", + "d=9.0 #density in gm/cm3\n", + "e=1.6*10**-19 #elecron charge in coul\n", + "n=d*N0/M \n", + "print(\"No.of free electrons per unit volume in atoms/mole %.3e\"%n)\n", + "Vd=j/(n*e)\n", + "print(\"Drift speed of electron in cm/sec is %.5f\"%Vd)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.3 Resistance and resistivity" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of rectangular carbon block are 1.0cm*1.0cm*50cm\n", + "(a) Resistance measured b/w the two square ends in ohm is 0.175\n", + "(a) Resistance measured b/w the two opposite rectangular faces in ohm is 7.0e-05\n" + ] + } + ], + "source": [ + "\n", + "print(\"Dimensions of rectangular carbon block are 1.0cm*1.0cm*50cm\")\n", + "l=1.0*10**-2 #in meter\n", + "b=1.0*10**-2#in meter\n", + "h=50*10**-2 #in meter\n", + "p=3.5*10**-5 #resisivity of carbon in ohm-m\n", + "#(a)Resistance b/w two square ends\n", + "l1=h\n", + "A1=b*l\n", + "R1=p*l1/A1\n", + "print(\"(a) Resistance measured b/w the two square ends in ohm is %.3f\"%R1)\n", + "l2=l\n", + "A2=b*h\n", + "R2=p*l2/A2\n", + "print(\"(a) Resistance measured b/w the two opposite rectangular faces in ohm is %.1e\"%R2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.4 Mean time and Mean free path" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Mean time b/w collisions in sec is 4.979e-14\n", + "(b) Mean free path in cm is 0.000008\n" + ] + } + ], + "source": [ + "m=9.1*10**-31 #in kg\n", + "n=8.4*10**28 #in m-1\n", + "e=1.6*10**-19 #in coul\n", + "p=1.7*10**-8 #in ohm-m\n", + "v=1.6*10**8 #in cm/sec\n", + "T=2*m/(n*p*e**2)\n", + "print(\"(a) Mean time b/w collisions in sec is %.3e\"%T)\n", + "Lambda=T*v\n", + "print(\"(b) Mean free path in cm is %f\"%Lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.5 Power" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Power for the single coil in watts is 504.167\n", + "(b)Power for a coil of half the length in watts is 1008.333\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "\n", + "V=110 #in volt\n", + "R=24 #ohms\n", + "P1=V**2/R\n", + "print(\"(a)Power for the single coil in watts is %.3f\"%P1)\n", + "P2=V**2/(R/2)\n", + "print(\"(b)Power for a coil of half the length in watts is %.3f\"%P2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9dxIAgL.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9dxIAgL.ipynb new file mode 100644 index 00000000..21e23dc9 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9dxIAgL.ipynb @@ -0,0 +1,168 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 30 CAPACITORS AND DIELECTRICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.1 Plate area" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Plate area in square meter is 1.130e+08\n" + ] + } + ], + "source": [ + "C=1.0 #capacitance in farad\n", + "d=1.0*10**-3 #separation b/w plates in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=d*C/epsilon0\n", + "print(\"Plate area in square meter is %.3e\"%A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.5 To calculate Capacitance Free charge Electric field strength Potential diffrence between plates" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Capacitance before the slab is inserted in farad is 8.850e-12\n", + "(b)Free charge in coul is 8.850e-10\n", + "(c)Electric field strength in the gap in volts/meter is 10000\n", + "(d)Electric field strength in the dielectric in volts/meter is 1428.5714\n", + "(e)Potential difference between the plates in volts is 57.1429\n", + "(f)Capacitance with the slab in place in farads is 1.549e-11\n" + ] + } + ], + "source": [ + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=100*10**-4#area of the plate in square meter\n", + "d=1*10**-2 #separation b/w plates in meter\n", + "b=5*10**-3 #thickness of dielectric lab in meter\n", + "V0=100#in volts\n", + "k=7\n", + "#(a)\n", + "C0=epsilon0*A/d\n", + "print(\"(a)Capacitance before the slab is inserted in farad is %.3e\"%C0)\n", + "#(b)\n", + "q=C0*V0\n", + "print(\"(b)Free charge in coul is %.3e\"%q)\n", + "#(c)\n", + "E0=q/(epsilon0*A)\n", + "print(\"(c)Electric field strength in the gap in volts/meter is %d\"%E0)\n", + "#(d)\n", + "E=q/(k*epsilon0*A)\n", + "print(\"(d)Electric field strength in the dielectric in volts/meter is %.4f\"%E)\n", + "#(e)\n", + "#Refer to fig30-12\n", + "V=E0*(d-b)+E*b\n", + "print(\"(e)Potential difference between the plates in volts is %.4f\"%V)\n", + "#(f)\n", + "C=q/V\n", + "print(\"(f)Capacitance with the slab in place in farads is %.3e\"%C)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.6 To calculate Electric displacement and Electric polarisation in dielectric and air gap" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Electric displacement in dielectric in coul/square metre is 8.859e-08\n", + "Electric polarisation in dielectric in coul/square meter is 7.593e-08\n", + "(b)Electric displacement in air gap in coul/square metre is 8.850e-08\n", + "Electric polarisation in air gap in coul/square meter is 0.0\n" + ] + } + ], + "source": [ + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=100*10**-4#area of the plate in square meter\n", + "d=1*10**-2 #separation b/w plates in meter\n", + "V0=100#in volts\n", + "E0=1*10**4 #Electric field in the air gap in volts/meter\n", + "k=7\n", + "k0=1\n", + "E=1.43*10**3 #in volts/metre\n", + "D=k*E*epsilon0\n", + "P=epsilon0*(k-1)*E\n", + "#(a)\n", + "print(\"(a)Electric displacement in dielectric in coul/square metre is %.3e\"%D)\n", + "print(\"Electric polarisation in dielectric in coul/square meter is %.3e\"%P)\n", + "#(b)\n", + "D0=k0*epsilon0*E0\n", + "print(\"(b)Electric displacement in air gap in coul/square metre is %.3e\"%D0)\n", + "P0=epsilon0*(k0-1)*E0\n", + "print(\"Electric polarisation in air gap in coul/square meter is\",P0)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9saU825.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9saU825.ipynb new file mode 100644 index 00000000..ee009cd1 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_9saU825.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 36 INDUCTANCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.1 Inductance of a toroid" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inductance of a toroid of recyangular cross section in henry is 0.0013863\n" + ] + } + ], + "source": [ + "import math\n", + "from __future__ import division\n", + "\n", + "u0=4*math.pi*10**-7 #in weber/amp-m Mu-not=u0\n", + "N=10**3 #no.of turns\n", + "a=5*10**-2 #im meter\n", + "b=10*10**-2 #in meter\n", + "h=1*10**-2 #in metre\n", + "L=(u0*N**2*h)/(2*math.pi)*math.log(b/a)\n", + "print(\"Inductance of a toroid of recyangular cross section in henry is %.7f\"%L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.2 Time" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time taken for the current to reach one-half of its final equilibrium in sec is 1.1552453\n" + ] + } + ], + "source": [ + "import math\n", + "L=50 #inductance in henry\n", + "R=30 #resistance in ohms\n", + "t0=math.log(2)*(L/R)\n", + "print(\"Time taken for the current to reach one-half of its final equilibrium in sec is %.7f\"%t0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.3 Maximum Current and Energy stored" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum current in amp is 5.0\n", + "Energy stored in the magnetic field in joules is 62.5\n" + ] + } + ], + "source": [ + "L=5 #inductance in henry\n", + "V=100 #emf in volts\n", + "R=20 #resistance in ohms\n", + "i=V/R\n", + "print(\"Maximum current in amp is\",i)\n", + "U=(L*i**2)/2\n", + "print(\"Energy stored in the magnetic field in joules is %.1f\"%U)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.4 Rate at which energy is stored and delivered and appeared" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The rate at which energy is delivred by the battery in watt is 0.5689085\n", + "The rate at which energy appears as Joule heat in the resistor in watt is 0.3596188\n", + "Let D=di/dt\n", + "The desired rate at which energy is being stored in the magnetic field in watt is 0.2092897\n" + ] + } + ], + "source": [ + "L=3 #inductance in henry\n", + "R=10 #resistance in ohm\n", + "V=3 #emf in volts\n", + "t=0.30 #in sec\n", + "T=0.30 #inductive time constant in sec\n", + "#(a)\n", + "i=(V/R)*(1-math.exp(-t/T))\n", + "P1=V*i\n", + "print(\"The rate at which energy is delivred by the battery in watt is %.7f\"%P1)\n", + "#(b)\n", + "P2=i**2*R\n", + "print(\"The rate at which energy appears as Joule heat in the resistor in watt is %.7f\"%P2)\n", + "#(c)\n", + "print(\"Let D=di/dt\")\n", + "D=(V/L)*math.exp(-t/T) #in amp/sec\n", + "P3=L*i*D\n", + "print(\"The desired rate at which energy is being stored in the magnetic field in watt is %.7f\"%P3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.6 Energy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Energy required to set up in the given cube on edge in electric field in joules is 0.0000445\n", + "(b)Energy required to set up in the given cube on edge in magnetic field in joules is 397.887\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "E=10**5 #elelctric field in volts/meter\n", + "B=1 #magnetic field in weber/meter2\n", + "u0=4*math.pi*10**-7 #in weber/amp-m Mu-not=u0\n", + "a=0.1 #side of the cube in meter\n", + "V0=a**3 #volume of the cube in meter3\n", + "#(a)\n", + "U1=epsilon0*E**2*V0/2 #in elelctric field\n", + "print(\"(a)Energy required to set up in the given cube on edge in electric field in joules is %.7f\"%U1)\n", + "#(b)\n", + "U2=(B**2/(2*u0))*V0\n", + "print(\"(b)Energy required to set up in the given cube on edge in magnetic field in joules is %.3f\"%U2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_BUWDqRo.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_BUWDqRo.ipynb new file mode 100644 index 00000000..4651a1a4 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_BUWDqRo.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 44 DIFFRACTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.1 Calculation of wavelength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a in A=13000\n" + ] + } + ], + "source": [ + "import math\n", + "m=1\n", + "lamda=6500 #in A\n", + "a=(m*lamda)/math.sin(30*math.pi/180)\n", + "print(\"a in A=%d\"%a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.2 Calculation of wavelength" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Wavelength in A = 4333.333\n" + ] + } + ], + "source": [ + "lamda=6500\n", + "lambda_1=lamda/1.5\n", + "print(\"Wavelength in A = %.3f\"%lambda_1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.5 Current" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current in amp= 0.06990\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "byd=10**12\n", + "i_d=(e_0*math.pi*R*R*byd)\n", + "print(\"Current in amp= %.5f\"%i_d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.7 Delta Y" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) D in m= 0.00240\n" + ] + } + ], + "source": [ + "lamda=480*10**-9 #in m\n", + "d=0.10*10**-3 #in m\n", + "D=50*10**-2 #in m\n", + "a=0.02*10**-3\n", + "delta_y=(lamda*D)/d\n", + "print(\"(A) D in m= %.5f\"%delta_y)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_GefqDaC.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_GefqDaC.ipynb new file mode 100644 index 00000000..047fa477 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_GefqDaC.ipynb @@ -0,0 +1,260 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 33 THE MAGNETIC FIELD" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.1 Force acting on a proton" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of the proton in meters/sec is 30678599.55\n", + "Force acting on proton in nt is 7.363e-12\n" + ] + } + ], + "source": [ + "import math\n", + "K=5*10**6 #ev\n", + "e=1.6*10**-19 #in coul\n", + "K1=K*e #in joules\n", + "m=1.7*10**-27 #in kg\n", + "B=1.5 #wb/m\n", + "theta=math.pi/2\n", + "v=math.sqrt(2*K1/m)\n", + "print(\"Speed of the proton in meters/sec is %.2f\"%v)\n", + "F=e*v*B*math.sin(theta)\n", + "print(\"Force acting on proton in nt is %.3e\"%F)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.3 Torsional constant of the spring" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Torssional constant in nt-m/deg is 3.333e-08\n" + ] + } + ], + "source": [ + "N=250 #turns in coil\n", + "i=1.0*10**-4 #in amp\n", + "B=0.2 #wb/m2\n", + "h=2*10**-2 #coil height in m\n", + "w=1.0*10**-2 #width of coil in m\n", + "Q=30 #angular deflectin in degrees\n", + "theta=math.pi/2\n", + "A=h*w\n", + "k=N*i*A*B*math.sin(theta)/Q\n", + "print(\"Torssional constant in nt-m/deg is %.3e\"%k)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.4 Work done" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is 0.23561944901923454\n" + ] + } + ], + "source": [ + "import math\n", + "N=100 #turns in circular coil\n", + "i=0.10 #in amp\n", + "B=1.5 #in wb/m2\n", + "a=5*10**-2 #radius of coil in meter\n", + "u=N*i*math.pi*(a**2) #u is dipole moment\n", + "U1=(-u*B*math.cos(0))\n", + "U2=-u*B*math.cos(math.pi)\n", + "W=U2-U1\n", + "print(\"Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is \",W)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.5 Hall potential difference" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hall potential difference aross strip in volt is 2.232142857142857e-05 or 0.0000223\n" + ] + } + ], + "source": [ + "i=200 #current in the strip in amp\n", + "B=1.5 #magnetic field in wb/m2\n", + "n=8.4*10**28 #in m-3\n", + "e=1.6*10**-19 #in coul\n", + "h=1.0*10**-3 #thickness of copper strip in metre\n", + "w=2*10**-2 #width of copper strip in meter\n", + "Vxy=i*B/(n*e*h)\n", + "print(\"Hall potential difference aross strip in volt is\",Vxy,\"or\",\"%.7f\"%Vxy)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.6 Orbital radius Cyclotron frequency and Period of revolution" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Orbit radius in meter is 0.1080625\n", + "(B) Cyclotron frequency in rev/sec is 2798328.7\n", + "(C) Period of revolution in sec is 0.0000004\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "m=9.1*10**-31 # in kg\n", + "v=1.9*10**6 #in m/sec\n", + "q=1.6*10**-19 #charge in coul\n", + "B=1.0*10**-4 #in wb/m2\n", + "\n", + "#(A)\n", + "r=m*v/(q*B)\n", + "print(\"(A) Orbit radius in meter is %.7f\"%r)\n", + "#(B)\n", + "f=q*B/(2*math.pi*m)\n", + "print(\"(B) Cyclotron frequency in rev/sec is %.1f\"%f)\n", + "#(C)\n", + "T=1/f\n", + "print(\"(C) Period of revolution in sec is %.7f\"%T)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.7 Magnetic induction and Deuteron energy" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic induction needed to accelerate deuterons in wb/m2 is 1.5550883635269475\n", + "(B) Deuteron energy in joule is 2.669e-12\n", + " Deuteron energy in ev is 16679852\n" + ] + } + ], + "source": [ + "import math\n", + "f0=12*10**6 #cyclotron frequency in cycles/sec\n", + "r=21#dee radius in inches\n", + "R=r*0.0254 #dee radius in meter\n", + "q=1.6*10**-19 #charge in coul\n", + "m=3.3*10**-27 #in kg\n", + "#(A)\n", + "B=2*math.pi*f0*m/q\n", + "print(\"(A) Magnetic induction needed to accelerate deuterons in wb/m2 is\",B)\n", + "#(B)\n", + "K=((q**2*B**2*R**2)/(2*m))\n", + "print(\"(B) Deuteron energy in joule is %.3e\"%K)\n", + "K1=K*(1/(1.6*10**-19))\n", + "print(\" Deuteron energy in ev is %d\"%K1)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_HyPiW9H.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_HyPiW9H.ipynb new file mode 100644 index 00000000..34883c4a --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_HyPiW9H.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 35 FARADAYS LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 35.1 Induced EMF" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field at center in wb/m2 is 0.0376991\n", + "Magnetic flux at the center of the solenoid in weber is 0.0000118\n", + "Induced EMF in volts is -0.0473741\n" + ] + } + ], + "source": [ + "import math \n", + "l=1.0 #length of solenoid in meter\n", + "r=3*10**-2 #radius of solenoid in meter\n", + "n=200*10**2 #number of turns in solenoid per meter\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "i=1.5 #current in amp\n", + "N=100 #no.of turns in a close packed coil placed at the center of solenoid\n", + "d=2*10**-2 #diameter of coil in meter\n", + "delta_T=0.050 #in sec\n", + "#(A)\n", + "B=u0*i*n\n", + "print(\"Magnetic field at center in wb/m2 is %.7f\"%B)\n", + "#(B)\n", + "A=math.pi*(d/2)**2\n", + "Q=B*A\n", + "print(\"Magnetic flux at the center of the solenoid in weber is %.7f\"%Q)\n", + "delta_Q=Q-(-Q)\n", + "E=-(N*delta_Q/delta_T)\n", + "print(\"Induced EMF in volts is %.7f\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 35.7 Induced electric field and EMF" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let S be the frame of reference fixed w.r.t the magnet and Z be the frame of reference w.r.t the loop\n", + "(A) Induced electric field in volt/m observed by Z 2.0\n", + "(B) Force acting on charge carrier in nt w.r.t S is 3.2e-19\n", + "Force acting on charge carrier in nt w.r.t Z is 3.2e-19\n", + "(C) Induced emf in volt observed by S is 0.2\n", + "Induced emf in volt observed by Z is 0.2\n" + ] + } + ], + "source": [ + "B=2 #magnetic field in wb/m2\n", + "l=10*10**-2 #in m\n", + "v=1.0 #in m/sec\n", + "q=1.6*10**-19 #charge in coul\n", + "print(\"Let S be the frame of reference fixed w.r.t the magnet and Z be the frame of reference w.r.t the loop\")\n", + "#(A)\n", + "E=v*B\n", + "print(\"(A) Induced electric field in volt/m observed by Z\",E)\n", + "#(B)\n", + "F=q*v*B\n", + "print(\"(B) Force acting on charge carrier in nt w.r.t S is %.1e\"%F)\n", + "F1=q*E\n", + "print(\"Force acting on charge carrier in nt w.r.t Z is %.1e\"%F1)\n", + "#(C)\n", + "emf1=B*l*v\n", + "print(\"(C) Induced emf in volt observed by S is\",emf1)\n", + "emf2=E*l\n", + "print(\"Induced emf in volt observed by Z is\",emf2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Jzzhgw5.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Jzzhgw5.ipynb new file mode 100644 index 00000000..7cae8043 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Jzzhgw5.ipynb @@ -0,0 +1,167 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 40 NATURE AND PROPOGATION OF LIGHT" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.1 Force and energy reflected" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Energy reflected from mirror in joule= 36000.0\n", + "Momentum after 1 hr illumination in kg-m/sec= 0.00024\n", + "(B) Force in newton= 6.667e-08\n" + ] + } + ], + "source": [ + "u=(10)*(1.0)*3600 #in Joules\n", + "c=3*10**8 #in m/sec\n", + "t=3600 #in sec\n", + "print(\"(A) Energy reflected from mirror in joule=\",u)\n", + "p=(2*u)/c\n", + "print(\"Momentum after 1 hr illumination in kg-m/sec= %.5f\"%p)\n", + "f=p/t\n", + "print(\"(B) Force in newton= %.3e\"%f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.2 Angular speed" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular speed in rev/sec= 12.07030\n" + ] + } + ], + "source": [ + "theta=1/1440\n", + "c=3*10**8 #in m/sec\n", + "l=8630 #in m\n", + "w=(c*theta)/(2*l)\n", + "print(\"Angular speed in rev/sec= %.5f\"%w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.3 Calculation of c" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Lambda_g in cm= 3.9\n", + "Value of c in m/sec= 2.992e+10\n" + ] + } + ], + "source": [ + "l=15.6 #in cm\n", + "n=8\n", + "lambda_g=(2*l)/n\n", + "print(\"Lambda_g in cm=\",lambda_g)\n", + "lamda=3.15 #in cm\n", + "f=9.5*10**9 #cycles/sec\n", + "c=lamda*f\n", + "print(\"Value of c in m/sec= %.3e\"%c)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.4 Percentage error" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of light in miles/hour= 50000\n" + ] + } + ], + "source": [ + "v_1=25000 #miles/hr\n", + "u=25000 #miles/hr\n", + "c=6.7*10**8 #miles/hr\n", + "x=1+((v_1*u)/(c)**2)\n", + "v=(v_1+u)/x\n", + "print(\"Speed of light in miles/hour= %.0f\"%v)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Lz458Y6.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Lz458Y6.ipynb new file mode 100644 index 00000000..0209a02b --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Lz458Y6.ipynb @@ -0,0 +1,184 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 42 REFLECTION AND REFRACTION SPHERICAL WAVES AND SPHERICAL SURFACES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.4 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=n2/i\n", + "x= 0.05\n", + "The value of i in cm= 40.0\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "n1=1\n", + "n2=2\n", + "o=20 #in cm\n", + "r=10 #in cm\n", + "print(\"x=n2/i\")\n", + "x=((n2-n1)/r)-(n1/o)\n", + "print(\"x=\",x)\n", + "i=n2/x\n", + "print(\"The value of i in cm=\",i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.5 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=n2/i\n", + "The value of i in cm= -0.03333\n", + "The value of i in cm= -30\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "n1=2\n", + "n2=1\n", + "o=15 #in cm\n", + "r=-10 #in cm\n", + "print(\"x=n2/i\")\n", + "x=((n2-n1)/r)-(n1/o)\n", + "print(\"The value of i in cm= %.5f\"%x)\n", + "i=n2/x\n", + "print(\"The value of i in cm= %d\"%i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.7 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=1/f in cm= 0.0325\n", + "f=1/x\n", + "f in cm= 30.76923\n" + ] + } + ], + "source": [ + "n=1.65\n", + "r_1=40 #in cm\n", + "r_2=-40 #in cm\n", + "x=(n-1)*((1/r_1)-(1/r_2))\n", + "print(\"x=1/f in cm= %.4f\"%x)\n", + "print(\"f=1/x\")\n", + "f=1/x\n", + "print(\"f in cm= %.5f\"%f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.8 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=1/i in cm= -0.06944\n", + "i in cm= -14.4\n", + "Lateral magnification =\n", + "m= 1.6\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "o=9 #in cm\n", + "f=24 #in cm\n", + "x=(1/f)-(1/o)\n", + "print(\"x=1/i in cm= %.5f\"%x)\n", + "i=1/x\n", + "print(\"i in cm= %.1f\"%i)\n", + "print(\"Lateral magnification =\")\n", + "m=-(i/o)\n", + "print('m= %.1f'%m)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG81yt8.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG81yt8.ipynb new file mode 100644 index 00000000..6cc02fdd --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG81yt8.ipynb @@ -0,0 +1,157 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 47 LIGHT AND QUANTUM PHYSICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.1 Velocity" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity in cycles/s 0.71176\n" + ] + } + ], + "source": [ + "import math\n", + "k=20 #in nt/m\n", + "m=1 #in kg\n", + "\n", + "v=(math.sqrt((k)/(m)))*(1/(2*math.pi))\n", + "print(\"Velocity in cycles/s %.5f\"%v)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.2 Time calculation" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power in j-sec 1.000000e-23\n", + "('Time reqired in sec =', 80000.0)\n", + "Time required in hour 22.22224\n" + ] + } + ], + "source": [ + "P=(10**(-3))*(3*10**(-18))/(300)\n", + "print(\"Power in j-sec %e\"%P)\n", + "s=1.6*(10**(-19))\n", + "t=(5*s)/P\n", + "print(\"Time reqired in sec =\",t)\n", + "one_sec=0.000277778 #hr\n", + "in_hour=one_sec*t\n", + "print(\"Time required in hour %.5f\"%in_hour)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.3 Work function for sodium" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in joule= 2.911e-19\n" + ] + } + ], + "source": [ + "h=6.63*10**(-34) #in joule/sec\n", + "v=4.39*10**(14) #cycles/sec\n", + "E_o=h*(v)\n", + "print(\"Energy in joule= %.3e\"%E_o)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.4 Kinetic energy to be imparten on recoiling electron" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "h=(6.63)*10**-34\n", + "m=9.11*10**-31\n", + "c=3*10**8\n", + "delta_h=(h/(m*c))*(1-math.cos(90))\n", + "print(\"(A) Compton shift in meter %.3e\",delta_h)\n", + "delta=1*10**-10\n", + "k=(h*c*delta_h)/(delta*(delta+delta_h))\n", + "print(\"(B) Kinetic energy in joules\",k)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG8z9eQ.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG8z9eQ.ipynb new file mode 100644 index 00000000..0209a02b --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_MG8z9eQ.ipynb @@ -0,0 +1,184 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 42 REFLECTION AND REFRACTION SPHERICAL WAVES AND SPHERICAL SURFACES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.4 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=n2/i\n", + "x= 0.05\n", + "The value of i in cm= 40.0\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "n1=1\n", + "n2=2\n", + "o=20 #in cm\n", + "r=10 #in cm\n", + "print(\"x=n2/i\")\n", + "x=((n2-n1)/r)-(n1/o)\n", + "print(\"x=\",x)\n", + "i=n2/x\n", + "print(\"The value of i in cm=\",i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.5 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=n2/i\n", + "The value of i in cm= -0.03333\n", + "The value of i in cm= -30\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "n1=2\n", + "n2=1\n", + "o=15 #in cm\n", + "r=-10 #in cm\n", + "print(\"x=n2/i\")\n", + "x=((n2-n1)/r)-(n1/o)\n", + "print(\"The value of i in cm= %.5f\"%x)\n", + "i=n2/x\n", + "print(\"The value of i in cm= %d\"%i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.7 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=1/f in cm= 0.0325\n", + "f=1/x\n", + "f in cm= 30.76923\n" + ] + } + ], + "source": [ + "n=1.65\n", + "r_1=40 #in cm\n", + "r_2=-40 #in cm\n", + "x=(n-1)*((1/r_1)-(1/r_2))\n", + "print(\"x=1/f in cm= %.4f\"%x)\n", + "print(\"f=1/x\")\n", + "f=1/x\n", + "print(\"f in cm= %.5f\"%f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.8 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=1/i in cm= -0.06944\n", + "i in cm= -14.4\n", + "Lateral magnification =\n", + "m= 1.6\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "o=9 #in cm\n", + "f=24 #in cm\n", + "x=(1/f)-(1/o)\n", + "print(\"x=1/i in cm= %.5f\"%x)\n", + "i=1/x\n", + "print(\"i in cm= %.1f\"%i)\n", + "print(\"Lateral magnification =\")\n", + "m=-(i/o)\n", + "print('m= %.1f'%m)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Oxr9B3A.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Oxr9B3A.ipynb new file mode 100644 index 00000000..0209a02b --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Oxr9B3A.ipynb @@ -0,0 +1,184 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 42 REFLECTION AND REFRACTION SPHERICAL WAVES AND SPHERICAL SURFACES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.4 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=n2/i\n", + "x= 0.05\n", + "The value of i in cm= 40.0\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "n1=1\n", + "n2=2\n", + "o=20 #in cm\n", + "r=10 #in cm\n", + "print(\"x=n2/i\")\n", + "x=((n2-n1)/r)-(n1/o)\n", + "print(\"x=\",x)\n", + "i=n2/x\n", + "print(\"The value of i in cm=\",i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.5 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=n2/i\n", + "The value of i in cm= -0.03333\n", + "The value of i in cm= -30\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "n1=2\n", + "n2=1\n", + "o=15 #in cm\n", + "r=-10 #in cm\n", + "print(\"x=n2/i\")\n", + "x=((n2-n1)/r)-(n1/o)\n", + "print(\"The value of i in cm= %.5f\"%x)\n", + "i=n2/x\n", + "print(\"The value of i in cm= %d\"%i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.7 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=1/f in cm= 0.0325\n", + "f=1/x\n", + "f in cm= 30.76923\n" + ] + } + ], + "source": [ + "n=1.65\n", + "r_1=40 #in cm\n", + "r_2=-40 #in cm\n", + "x=(n-1)*((1/r_1)-(1/r_2))\n", + "print(\"x=1/f in cm= %.4f\"%x)\n", + "print(\"f=1/x\")\n", + "f=1/x\n", + "print(\"f in cm= %.5f\"%f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 42.8 Location of image" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x=1/i in cm= -0.06944\n", + "i in cm= -14.4\n", + "Lateral magnification =\n", + "m= 1.6\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "o=9 #in cm\n", + "f=24 #in cm\n", + "x=(1/f)-(1/o)\n", + "print(\"x=1/i in cm= %.5f\"%x)\n", + "i=1/x\n", + "print(\"i in cm= %.1f\"%i)\n", + "print(\"Lateral magnification =\")\n", + "m=-(i/o)\n", + "print('m= %.1f'%m)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Pwqzb8a.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Pwqzb8a.ipynb new file mode 100644 index 00000000..047fa477 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Pwqzb8a.ipynb @@ -0,0 +1,260 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 33 THE MAGNETIC FIELD" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.1 Force acting on a proton" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of the proton in meters/sec is 30678599.55\n", + "Force acting on proton in nt is 7.363e-12\n" + ] + } + ], + "source": [ + "import math\n", + "K=5*10**6 #ev\n", + "e=1.6*10**-19 #in coul\n", + "K1=K*e #in joules\n", + "m=1.7*10**-27 #in kg\n", + "B=1.5 #wb/m\n", + "theta=math.pi/2\n", + "v=math.sqrt(2*K1/m)\n", + "print(\"Speed of the proton in meters/sec is %.2f\"%v)\n", + "F=e*v*B*math.sin(theta)\n", + "print(\"Force acting on proton in nt is %.3e\"%F)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.3 Torsional constant of the spring" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Torssional constant in nt-m/deg is 3.333e-08\n" + ] + } + ], + "source": [ + "N=250 #turns in coil\n", + "i=1.0*10**-4 #in amp\n", + "B=0.2 #wb/m2\n", + "h=2*10**-2 #coil height in m\n", + "w=1.0*10**-2 #width of coil in m\n", + "Q=30 #angular deflectin in degrees\n", + "theta=math.pi/2\n", + "A=h*w\n", + "k=N*i*A*B*math.sin(theta)/Q\n", + "print(\"Torssional constant in nt-m/deg is %.3e\"%k)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.4 Work done" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is 0.23561944901923454\n" + ] + } + ], + "source": [ + "import math\n", + "N=100 #turns in circular coil\n", + "i=0.10 #in amp\n", + "B=1.5 #in wb/m2\n", + "a=5*10**-2 #radius of coil in meter\n", + "u=N*i*math.pi*(a**2) #u is dipole moment\n", + "U1=(-u*B*math.cos(0))\n", + "U2=-u*B*math.cos(math.pi)\n", + "W=U2-U1\n", + "print(\"Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is \",W)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.5 Hall potential difference" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hall potential difference aross strip in volt is 2.232142857142857e-05 or 0.0000223\n" + ] + } + ], + "source": [ + "i=200 #current in the strip in amp\n", + "B=1.5 #magnetic field in wb/m2\n", + "n=8.4*10**28 #in m-3\n", + "e=1.6*10**-19 #in coul\n", + "h=1.0*10**-3 #thickness of copper strip in metre\n", + "w=2*10**-2 #width of copper strip in meter\n", + "Vxy=i*B/(n*e*h)\n", + "print(\"Hall potential difference aross strip in volt is\",Vxy,\"or\",\"%.7f\"%Vxy)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.6 Orbital radius Cyclotron frequency and Period of revolution" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Orbit radius in meter is 0.1080625\n", + "(B) Cyclotron frequency in rev/sec is 2798328.7\n", + "(C) Period of revolution in sec is 0.0000004\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "m=9.1*10**-31 # in kg\n", + "v=1.9*10**6 #in m/sec\n", + "q=1.6*10**-19 #charge in coul\n", + "B=1.0*10**-4 #in wb/m2\n", + "\n", + "#(A)\n", + "r=m*v/(q*B)\n", + "print(\"(A) Orbit radius in meter is %.7f\"%r)\n", + "#(B)\n", + "f=q*B/(2*math.pi*m)\n", + "print(\"(B) Cyclotron frequency in rev/sec is %.1f\"%f)\n", + "#(C)\n", + "T=1/f\n", + "print(\"(C) Period of revolution in sec is %.7f\"%T)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.7 Magnetic induction and Deuteron energy" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic induction needed to accelerate deuterons in wb/m2 is 1.5550883635269475\n", + "(B) Deuteron energy in joule is 2.669e-12\n", + " Deuteron energy in ev is 16679852\n" + ] + } + ], + "source": [ + "import math\n", + "f0=12*10**6 #cyclotron frequency in cycles/sec\n", + "r=21#dee radius in inches\n", + "R=r*0.0254 #dee radius in meter\n", + "q=1.6*10**-19 #charge in coul\n", + "m=3.3*10**-27 #in kg\n", + "#(A)\n", + "B=2*math.pi*f0*m/q\n", + "print(\"(A) Magnetic induction needed to accelerate deuterons in wb/m2 is\",B)\n", + "#(B)\n", + "K=((q**2*B**2*R**2)/(2*m))\n", + "print(\"(B) Deuteron energy in joule is %.3e\"%K)\n", + "K1=K*(1/(1.6*10**-19))\n", + "print(\" Deuteron energy in ev is %d\"%K1)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Q7PpTqw.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Q7PpTqw.ipynb new file mode 100644 index 00000000..486ad42a --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Q7PpTqw.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 39 ELECTROMAGNETIC WAVES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 39.6 Magnitude of electric and magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of E in volts/meter= 244.94897\n", + "B in weber/meter^2= 0.00000082\n" + ] + } + ], + "source": [ + "import math\n", + "r=1 #in m\n", + "p=10**3 \n", + "m=4*math.pi*10**-7 #weber/amp-m\n", + "c=3*10**8 #speed of light\n", + "x=2*math.pi\n", + "E_m=(1/r)*(math.sqrt((p*m*c)/x))\n", + "print(\"The value of E in volts/meter= %.5f\"%E_m)\n", + "B=E_m/c\n", + "print(\"B in weber/meter^2= %.8f\"%B)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_SwvijzF.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_SwvijzF.ipynb new file mode 100644 index 00000000..5d6ec9b4 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_SwvijzF.ipynb @@ -0,0 +1,177 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 43 INTERFERENCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.1 Angular position of first minimum" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sin theta = 0.00273\n", + "Angle in degree= 0.15642\n" + ] + } + ], + "source": [ + "import math\n", + "m=1\n", + "lamda=546*10**-9\n", + "d=0.10*10**-3 #in m\n", + "sin_theta=((m-0.5)*lamda)/(d)\n", + "print(\"Sin theta = %.5f\"%sin_theta)\n", + "theta=math.degrees(math.asin(sin_theta))\n", + "print(\"Angle in degree= %.5f\"%theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.2 Linear distance" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Linear distance in meter= 0.00109\n" + ] + } + ], + "source": [ + "delta=546*10**-9 #in meter\n", + "D=20*10**-2 #in meter\n", + "d=0.10*10**-3 #in meter\n", + "delta_y=(delta*D)/d\n", + "print(\"Linear distance in meter= %.5f\"%delta_y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.4 Refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When m= 1\n", + "Lambda_max= 5674.666666666667\n", + "Lambda_min= 8500.0\n", + "When m= 2\n", + "Lambda_max= 3404.8\n", + "Lambda_min= 4250.0\n" + ] + } + ], + "source": [ + "d=3200 #in A\n", + "n=1.33\n", + "for m in range(1,3):\n", + " lambda_max=(2*d*n)/(m+0.5)\n", + " lambda_min=(8500/m)\n", + " print(\"When m=\",m)\n", + " print(\"Lambda_max=\",lambda_max)\n", + " print(\"Lambda_min=\",lambda_min)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 43.5 Refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When m= 0\n", + "d in A=905.797\n", + "When m= 1\n", + "d in A=2717.391\n", + "When m= 2\n", + "d in A=4528.986\n", + "When m= 3\n", + "d in A=6340.580\n" + ] + } + ], + "source": [ + "lamda=5000 #in A\n", + "n=1.38\n", + "for m in range(0,4):\n", + " print(\"When m=\",m)\n", + " d=((m+0.5)*lamda)/(2*n)\n", + " print(\"d in A=%.3f\"%d)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UM4ptLd.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UM4ptLd.ipynb new file mode 100644 index 00000000..381ec056 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UM4ptLd.ipynb @@ -0,0 +1,195 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 38 ELECTROMAGNETIC OSCILLATIONS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.1 Current" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Max current in amps 0.5\n" + ] + } + ], + "source": [ + "import math\n", + "V_o=50 #in volts\n", + "C=1*10**-6 #in farad\n", + "L=10*10**-3\n", + "i_m=V_o*(math.sqrt(C/L))\n", + "print(\"Max current in amps \",i_m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.2 Angular frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular frequency in radians/sec= 10000.0\n" + ] + } + ], + "source": [ + "import math\n", + "L=10*(10**-3) #in henry\n", + "C=(10)**-6 #in farad\n", + "w=math.sqrt(1/(L*C))\n", + "print(\"Angular frequency in radians/sec=\",w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.3 Angular frequency and time" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular frequency in radians/sec= 10000.0\n", + "Time in sec= 0.13863\n" + ] + } + ], + "source": [ + "L=10*(10**-3) #in henry\n", + "C=10**-6 #in farad\n", + "R=0.1 #in ohm\n", + "w=math.sqrt(1/(L*C))\n", + "print(\"Angular frequency in radians/sec=\",w)\n", + "t=(2*L*math.log(2))/R\n", + "print(\"Time in sec= %.5f\"%t)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.5 Magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field in weber/m**2= 0.0000003\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "dEbydT=10**12\n", + "B=(0.5*m_0*e_0*R*dEbydT)\n", + "print(\"Magnetic field in weber/m**2= %.7f\"%B)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.6 Calculation of current" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current in amp= 0.0699004\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "dEbydT=10**12\n", + "i_d=(e_0*math.pi*R*R*dEbydT)\n", + "print(\"Current in amp= %.7f\"%i_d)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UUIzKI9.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UUIzKI9.ipynb new file mode 100644 index 00000000..21e23dc9 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_UUIzKI9.ipynb @@ -0,0 +1,168 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 30 CAPACITORS AND DIELECTRICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.1 Plate area" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Plate area in square meter is 1.130e+08\n" + ] + } + ], + "source": [ + "C=1.0 #capacitance in farad\n", + "d=1.0*10**-3 #separation b/w plates in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=d*C/epsilon0\n", + "print(\"Plate area in square meter is %.3e\"%A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.5 To calculate Capacitance Free charge Electric field strength Potential diffrence between plates" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Capacitance before the slab is inserted in farad is 8.850e-12\n", + "(b)Free charge in coul is 8.850e-10\n", + "(c)Electric field strength in the gap in volts/meter is 10000\n", + "(d)Electric field strength in the dielectric in volts/meter is 1428.5714\n", + "(e)Potential difference between the plates in volts is 57.1429\n", + "(f)Capacitance with the slab in place in farads is 1.549e-11\n" + ] + } + ], + "source": [ + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=100*10**-4#area of the plate in square meter\n", + "d=1*10**-2 #separation b/w plates in meter\n", + "b=5*10**-3 #thickness of dielectric lab in meter\n", + "V0=100#in volts\n", + "k=7\n", + "#(a)\n", + "C0=epsilon0*A/d\n", + "print(\"(a)Capacitance before the slab is inserted in farad is %.3e\"%C0)\n", + "#(b)\n", + "q=C0*V0\n", + "print(\"(b)Free charge in coul is %.3e\"%q)\n", + "#(c)\n", + "E0=q/(epsilon0*A)\n", + "print(\"(c)Electric field strength in the gap in volts/meter is %d\"%E0)\n", + "#(d)\n", + "E=q/(k*epsilon0*A)\n", + "print(\"(d)Electric field strength in the dielectric in volts/meter is %.4f\"%E)\n", + "#(e)\n", + "#Refer to fig30-12\n", + "V=E0*(d-b)+E*b\n", + "print(\"(e)Potential difference between the plates in volts is %.4f\"%V)\n", + "#(f)\n", + "C=q/V\n", + "print(\"(f)Capacitance with the slab in place in farads is %.3e\"%C)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.6 To calculate Electric displacement and Electric polarisation in dielectric and air gap" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Electric displacement in dielectric in coul/square metre is 8.859e-08\n", + "Electric polarisation in dielectric in coul/square meter is 7.593e-08\n", + "(b)Electric displacement in air gap in coul/square metre is 8.850e-08\n", + "Electric polarisation in air gap in coul/square meter is 0.0\n" + ] + } + ], + "source": [ + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=100*10**-4#area of the plate in square meter\n", + "d=1*10**-2 #separation b/w plates in meter\n", + "V0=100#in volts\n", + "E0=1*10**4 #Electric field in the air gap in volts/meter\n", + "k=7\n", + "k0=1\n", + "E=1.43*10**3 #in volts/metre\n", + "D=k*E*epsilon0\n", + "P=epsilon0*(k-1)*E\n", + "#(a)\n", + "print(\"(a)Electric displacement in dielectric in coul/square metre is %.3e\"%D)\n", + "print(\"Electric polarisation in dielectric in coul/square meter is %.3e\"%P)\n", + "#(b)\n", + "D0=k0*epsilon0*E0\n", + "print(\"(b)Electric displacement in air gap in coul/square metre is %.3e\"%D0)\n", + "P0=epsilon0*(k0-1)*E0\n", + "print(\"Electric polarisation in air gap in coul/square meter is\",P0)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VJUnpiC.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VJUnpiC.ipynb new file mode 100644 index 00000000..a0180572 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VJUnpiC.ipynb @@ -0,0 +1,139 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 41 REFLECTION AND REFRACTION OF PLANE WAVES AND PLANE SURFACES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.1 Angle between two refracted beams" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For 4000 A beam, theta_2 in degree= 19.88234\n", + "For 5000 A beam, theta_2 in degree= 19.99290\n" + ] + } + ], + "source": [ + "import math\n", + "theta_1=30\n", + "n_qa=1.4702\n", + "theta2=math.degrees(math.asin(math.sin(theta_1*math.pi/180)/n_qa))\n", + "print(\"For 4000 A beam, theta_2 in degree= %.5f\"%theta2)\n", + "\n", + "theta_1=30\n", + "n_qa=1.4624\n", + "theta2=math.degrees(math.asin(math.sin(theta_1*math.pi/180)/n_qa))\n", + "print(\"For 5000 A beam, theta_2 in degree= %.5f\"%theta2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.4 Index of glass" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Index reflection= 1.41421\n" + ] + } + ], + "source": [ + "import math\n", + "n=1/math.sin(45*math.pi/180)\n", + "print(\"Index reflection= %.5f\"%n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.5 Calculation of Angle" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle theta_c in degree= 62.45732\n", + "Actual angle of indices = 45 is less than theta_ c, so there is no internal angle reflection\n", + "Angle of refraction:\n", + "Theta_2 in degree= 52.89097\n" + ] + } + ], + "source": [ + "import math\n", + "n2=1.33\n", + "n1=1.50\n", + "theta_c=math.degrees(math.asin(n2/n1))\n", + "print(\"Angle theta_c in degree= %.5f\"%theta_c)\n", + "print(\"Actual angle of indices = 45 is less than theta_ c, so there is no internal angle reflection\")\n", + "print(\"Angle of refraction:\")\n", + "x=n1/n2\n", + "theta_2=(math.asin(x*math.sin(45*math.pi/180))*180/math.pi)\n", + "print(\"Theta_2 in degree= %.5f\"%theta_2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VRyICL4.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VRyICL4.ipynb new file mode 100644 index 00000000..381ec056 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VRyICL4.ipynb @@ -0,0 +1,195 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 38 ELECTROMAGNETIC OSCILLATIONS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.1 Current" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Max current in amps 0.5\n" + ] + } + ], + "source": [ + "import math\n", + "V_o=50 #in volts\n", + "C=1*10**-6 #in farad\n", + "L=10*10**-3\n", + "i_m=V_o*(math.sqrt(C/L))\n", + "print(\"Max current in amps \",i_m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.2 Angular frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular frequency in radians/sec= 10000.0\n" + ] + } + ], + "source": [ + "import math\n", + "L=10*(10**-3) #in henry\n", + "C=(10)**-6 #in farad\n", + "w=math.sqrt(1/(L*C))\n", + "print(\"Angular frequency in radians/sec=\",w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.3 Angular frequency and time" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular frequency in radians/sec= 10000.0\n", + "Time in sec= 0.13863\n" + ] + } + ], + "source": [ + "L=10*(10**-3) #in henry\n", + "C=10**-6 #in farad\n", + "R=0.1 #in ohm\n", + "w=math.sqrt(1/(L*C))\n", + "print(\"Angular frequency in radians/sec=\",w)\n", + "t=(2*L*math.log(2))/R\n", + "print(\"Time in sec= %.5f\"%t)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.5 Magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field in weber/m**2= 0.0000003\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "dEbydT=10**12\n", + "B=(0.5*m_0*e_0*R*dEbydT)\n", + "print(\"Magnetic field in weber/m**2= %.7f\"%B)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.6 Calculation of current" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current in amp= 0.0699004\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "dEbydT=10**12\n", + "i_d=(e_0*math.pi*R*R*dEbydT)\n", + "print(\"Current in amp= %.7f\"%i_d)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VtilP9P.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VtilP9P.ipynb new file mode 100644 index 00000000..2b7da278 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_VtilP9P.ipynb @@ -0,0 +1,183 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 27 THE ELECTRIC FIELD" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.1 Electric field strength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength E=F/q where F=mg\n", + "electric field strength in nt/coul is 5.574e-11\n" + ] + } + ], + "source": [ + "m=9.1*10**-31 #mass of electron in kg\n", + "g=9.8 #acceleration due to gravity in m/s\n", + "q=1.6*10**-19 #charge of electron in coul\n", + "print(\"Electric field strength E=F/q where F=mg\")\n", + "E=m*g/q\n", + "print(\"electric field strength in nt/coul is %.3e\"%E)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.4 The point on the line joining two charges for the electric field strength to be zero" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For the electric field strength to be zero the point should lie between the charges where E1=E2\n", + "E1=E2 which implies q1/4πϵx2 = q2/4πϵ(l-x)2\n", + "Electric field strength is zero at x=4.142 cm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "q1=1.0*10**-6 #in coul\n", + "q2=2.0*10**-6 #in coul\n", + "l=10 #sepearation b/w q1 and q2 in cm\n", + "print(\"For the electric field strength to be zero the point should lie between the charges where E1=E2\")\n", + "#\"Refer to the fig 27.9\"\n", + "#E1=electric fied strength due to q1\n", + "#E2=electric fied strength due to q2\n", + "print(\"E1=E2 which implies q1/4πϵx2 = q2/4πϵ(l-x)2\")\n", + "x=l/(1+math.sqrt(q2/q1))\n", + "print(\"Electric field strength is zero at x=%.3f cm\"%x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.9 Deflection of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Corresponding deflection in meters is 0.000337\n" + ] + } + ], + "source": [ + "e=1.6*10**-19 #charge in coul\n", + "E=1.2*10**4 #electric field in nt/coul\n", + "x=1.5*10**-2 #length of deflecting assembly in m\n", + "K0=3.2*10**-16 #kinetic energy of electron in joule\n", + "#calculation\n", + "y=e*E*x**2/(4*K0)\n", + "print(\"Corresponding deflection in meters is %.6f\"%y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.11 Torque and work done by external agent on electric dipole" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Maximum torque exerted by the fied in nt-m is\n", + "0.002\n", + "(b) Work done by the external agent to turn dipole end for end in joule is \n", + "0.004\n" + ] + } + ], + "source": [ + "import math\n", + "q=1.0*10**-6 #magnitude of two opposite charges of a electric dipole in coul\n", + "d=2.0*10**-2 #seperation b/w charges in m\n", + "E=1.0*10**5 #external field in nt/coul\n", + "#calculations\n", + "#(a)Max torque if found when theta=90 degrees\n", + "#Torque =pEsin(theta)\n", + "p=q*d #electric dipole moment\n", + "T=p*E*math.sin(math.pi/2)\n", + "print(\"(a)Maximum torque exerted by the fied in nt-m is\")\n", + "print(T)\n", + "#(b)work done by the external agent is the potential energy b/w the positions theta=180 and 0 degree\n", + "W=(-p*E*math.cos(math.pi))-(-p*E*math.cos(0))\n", + "print(\"(b) Work done by the external agent to turn dipole end for end in joule is \")\n", + "print(W)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_XvRiQzf.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_XvRiQzf.ipynb new file mode 100644 index 00000000..d197d07e --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_XvRiQzf.ipynb @@ -0,0 +1,210 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 29 ELECTRIC POTENTIAL" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.3 Magnitude of an isolated positive point charge" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential due to a point charge is V=q/4*pi*epislon0*r\n", + "Magnitude of positive point charge in coul is 1.112e-09\n" + ] + } + ], + "source": [ + "import math\n", + "V=100 #electric potential in volts\n", + "r=10*10**-2 #in meters\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "print(\"Potential due to a point charge is V=q/4*pi*epislon0*r\")\n", + "q=V*4*math.pi*epsilon0*r\n", + "print(\"Magnitude of positive point charge in coul is %.3e\"%q)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.4 Electric potential at the surface of a gold nucleus" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric potential at the surface of the nucleus in volts is 17220668\n" + ] + } + ], + "source": [ + "import math\n", + "r=6.6*10**-15 #radius of the gold nucleus in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "V=q/(4*math.pi*epsilon0*r)\n", + "print(\"Electric potential at the surface of the nucleus in volts is %d\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.5 Potential at the center of the square" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential at the center of the square in volts is 508.65\n" + ] + } + ], + "source": [ + "import math\n", + "q1=1.0*10**-8 #in coul\n", + "q2=-2.0*10**-8 #in coul\n", + "q3=3.0*10**-8 #in coul\n", + "q4=2.0*10**-8 #in coul\n", + "a=1 #side of square in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "#refer to the fig 29.7\n", + "r=a/math.sqrt(2) #distance of charges from centre in meter\n", + "V=(q1+q2+q3+q4)/(4*math.pi*epsilon0*r)\n", + "print(\"Potential at the center of the square in volts is %.2f\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.8 Mutual potential energy" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mutual electric potential energy of two proton in joules is 3.837e-14\n", + "Mutual electric potential energy of two proton in ev is 239781.46\n" + ] + } + ], + "source": [ + "import math\n", + "q1=1.6*10**-19 #charge in coul\n", + "q2=1.6*10**-19 #charge in coul\n", + "r=6.0*10**-15 #seperation b/w two protons in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "U=(q1*q2)/(4*math.pi*epsilon0*r)\n", + "print(\"Mutual electric potential energy of two proton in joules is %.3e\"%U)\n", + "V=U/q1\n", + "print(\"Mutual electric potential energy of two proton in ev is %.2f\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.9 Mutual potential energy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total energy is the sum of each pair of particles \n", + "Mutual potential energy of the particles in joules is -0.008991804694457362\n" + ] + } + ], + "source": [ + "import math\n", + "q=1.0*10**-7 #charge in coul\n", + "a=10*10**-2 #side of triangle in meter\n", + "q1=q\n", + "q2=-4*q\n", + "q3=2*q\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "print(\"Total energy is the sum of each pair of particles \")\n", + "U=(1/(4*math.pi*epsilon0))*(((q1*q2)/a)+((q1*q3)/a)+((q2*q3)/a))\n", + "print(\"Mutual potential energy of the particles in joules is\",U)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ZgH5gHk.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ZgH5gHk.ipynb new file mode 100644 index 00000000..2da66d96 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ZgH5gHk.ipynb @@ -0,0 +1,149 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 34 AMPERES LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.3 Distance" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Separation between two wires in metres 0.0054795\n" + ] + } + ], + "source": [ + "import math\n", + "i1=100 #in amp\n", + "i2=20 #in amp\n", + "W=0.073 #weight of second wire W=F/l in nt/m\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "d=u0*i1*i2/(2*math.pi*W)\n", + "print(\"Separation between two wires in metres %.7f\"%d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.5 Magnetic field and Magnetic flux" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field at center in wb/m2 is 0.0267035\n", + "Magnetic flux at the center of the solenoid in weber is 0.0000189\n" + ] + } + ], + "source": [ + "import math\n", + "l=1.0 #length of solenoid in meter\n", + "d=3*10**-2 #diameter of solenoid in meter\n", + "n=5*850 #number of layers and turns of wire\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "i0=5.0 #current in amp\n", + "#(A)\n", + "B=u0*i0*n\n", + "print(\"Magnetic field at center in wb/m2 is %.7f\"%B)\n", + "#(B)\n", + "A=math.pi*(d/2)**2\n", + "Q=B*A\n", + "print(\"Magnetic flux at the center of the solenoid in weber is %.7f\"%Q)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.9 Magnetic field and Magnetic dipole moment" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic field at the center of the orbit in wb/m2 13.404\n", + "(B) Equivalent magnetic dipole moment in amp-m2 is 8.890e-24\n" + ] + } + ], + "source": [ + "import math\n", + "from __future__ import division\n", + "e=1.6*10**-19 #in coul\n", + "R=5.1*10**-11 #radius of th enucleus in meter\n", + "f=6.8*10**15 #frequency with which elecron circulates in rev/sec\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "x=0 #x is any point on the orbit, since at center x=0\n", + "#(A)\n", + "i=e*f\n", + "B=u0*i*R**2*0.5/((R**2+x**2)**(3/2))\n", + "print(\"(A) Magnetic field at the center of the orbit in wb/m2 %.3f\"%B)\n", + "N=1 #no.of turns\n", + "A=math.pi*R**2\n", + "U=N*i*A\n", + "print(\"(B) Equivalent magnetic dipole moment in amp-m2 is %.3e\"%U)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Zo9zby0.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Zo9zby0.ipynb new file mode 100644 index 00000000..d197d07e --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_Zo9zby0.ipynb @@ -0,0 +1,210 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 29 ELECTRIC POTENTIAL" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.3 Magnitude of an isolated positive point charge" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential due to a point charge is V=q/4*pi*epislon0*r\n", + "Magnitude of positive point charge in coul is 1.112e-09\n" + ] + } + ], + "source": [ + "import math\n", + "V=100 #electric potential in volts\n", + "r=10*10**-2 #in meters\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "print(\"Potential due to a point charge is V=q/4*pi*epislon0*r\")\n", + "q=V*4*math.pi*epsilon0*r\n", + "print(\"Magnitude of positive point charge in coul is %.3e\"%q)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.4 Electric potential at the surface of a gold nucleus" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric potential at the surface of the nucleus in volts is 17220668\n" + ] + } + ], + "source": [ + "import math\n", + "r=6.6*10**-15 #radius of the gold nucleus in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "V=q/(4*math.pi*epsilon0*r)\n", + "print(\"Electric potential at the surface of the nucleus in volts is %d\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.5 Potential at the center of the square" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential at the center of the square in volts is 508.65\n" + ] + } + ], + "source": [ + "import math\n", + "q1=1.0*10**-8 #in coul\n", + "q2=-2.0*10**-8 #in coul\n", + "q3=3.0*10**-8 #in coul\n", + "q4=2.0*10**-8 #in coul\n", + "a=1 #side of square in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "#refer to the fig 29.7\n", + "r=a/math.sqrt(2) #distance of charges from centre in meter\n", + "V=(q1+q2+q3+q4)/(4*math.pi*epsilon0*r)\n", + "print(\"Potential at the center of the square in volts is %.2f\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.8 Mutual potential energy" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mutual electric potential energy of two proton in joules is 3.837e-14\n", + "Mutual electric potential energy of two proton in ev is 239781.46\n" + ] + } + ], + "source": [ + "import math\n", + "q1=1.6*10**-19 #charge in coul\n", + "q2=1.6*10**-19 #charge in coul\n", + "r=6.0*10**-15 #seperation b/w two protons in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "U=(q1*q2)/(4*math.pi*epsilon0*r)\n", + "print(\"Mutual electric potential energy of two proton in joules is %.3e\"%U)\n", + "V=U/q1\n", + "print(\"Mutual electric potential energy of two proton in ev is %.2f\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.9 Mutual potential energy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total energy is the sum of each pair of particles \n", + "Mutual potential energy of the particles in joules is -0.008991804694457362\n" + ] + } + ], + "source": [ + "import math\n", + "q=1.0*10**-7 #charge in coul\n", + "a=10*10**-2 #side of triangle in meter\n", + "q1=q\n", + "q2=-4*q\n", + "q3=2*q\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "print(\"Total energy is the sum of each pair of particles \")\n", + "U=(1/(4*math.pi*epsilon0))*(((q1*q2)/a)+((q1*q3)/a)+((q2*q3)/a))\n", + "print(\"Mutual potential energy of the particles in joules is\",U)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aMuyjoe.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aMuyjoe.ipynb new file mode 100644 index 00000000..381ec056 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aMuyjoe.ipynb @@ -0,0 +1,195 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 38 ELECTROMAGNETIC OSCILLATIONS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.1 Current" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Max current in amps 0.5\n" + ] + } + ], + "source": [ + "import math\n", + "V_o=50 #in volts\n", + "C=1*10**-6 #in farad\n", + "L=10*10**-3\n", + "i_m=V_o*(math.sqrt(C/L))\n", + "print(\"Max current in amps \",i_m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.2 Angular frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular frequency in radians/sec= 10000.0\n" + ] + } + ], + "source": [ + "import math\n", + "L=10*(10**-3) #in henry\n", + "C=(10)**-6 #in farad\n", + "w=math.sqrt(1/(L*C))\n", + "print(\"Angular frequency in radians/sec=\",w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.3 Angular frequency and time" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular frequency in radians/sec= 10000.0\n", + "Time in sec= 0.13863\n" + ] + } + ], + "source": [ + "L=10*(10**-3) #in henry\n", + "C=10**-6 #in farad\n", + "R=0.1 #in ohm\n", + "w=math.sqrt(1/(L*C))\n", + "print(\"Angular frequency in radians/sec=\",w)\n", + "t=(2*L*math.log(2))/R\n", + "print(\"Time in sec= %.5f\"%t)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.5 Magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field in weber/m**2= 0.0000003\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "dEbydT=10**12\n", + "B=(0.5*m_0*e_0*R*dEbydT)\n", + "print(\"Magnetic field in weber/m**2= %.7f\"%B)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 38.6 Calculation of current" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current in amp= 0.0699004\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "dEbydT=10**12\n", + "i_d=(e_0*math.pi*R*R*dEbydT)\n", + "print(\"Current in amp= %.7f\"%i_d)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aOrqAnb.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aOrqAnb.ipynb new file mode 100644 index 00000000..57d1a771 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aOrqAnb.ipynb @@ -0,0 +1,227 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 45 GRATING AND SPECTRA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.1 Calculation of angle" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The first order diffraction pattern in degree= 7.249\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "m=1\n", + "lamda=4000 #in A\n", + "d=31700 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"The first order diffraction pattern in degree= %.3f\"%theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.2 Calculation of angle theta" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) The first order diffraction pattern in degree= 13.408\n", + "(B) Angle of seperation in degree= 0.0002388\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "m=1\n", + "lamda=5890 #in A\n", + "d=25400 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"(A) The first order diffraction pattern in degree= %.3f\"%theta)\n", + "del_lambda=5.9 #in A\n", + "delta_theta=(m*(del_lambda))/(d*(math.cos(theta*math.pi/180)))\n", + "print(\"(B) Angle of seperation in degree= %.7f\"%delta_theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.3 Calculation of Sodium Doublet" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resolving power= 998.305\n", + "Number of rulings needed is= 332.768\n" + ] + } + ], + "source": [ + "lamda=5890 #A\n", + "lamda_1=5895.9 #A\n", + "m=3\n", + "delta_lambda=(lamda_1-lamda) #in A\n", + "R=lamda/(delta_lambda)\n", + "print(\"Resolving power= %.3f\"%R)\n", + "N=(R/m)\n", + "print(\"Number of rulings needed is= %.3f\"%N)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.4 Calculation of Dispersion" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The first order diffraction pattern in degree= 31.11244\n", + "(A) The dispersion in radian/A= 0.0001105\n", + "(B) Wave length difference in A= 0.13650\n" + ] + } + ], + "source": [ + "import math\n", + "m=3\n", + "m1=5\n", + "lamda=5460 #in A\n", + "d=31700 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"The first order diffraction pattern in degree= %.5f\"%theta)\n", + "D=m/(d*math.cos(theta*math.pi/180))\n", + "print(\"(A) The dispersion in radian/A= %.7f\"%D)\n", + "N=8000\n", + "lamda=5460\n", + "R=N*m1\n", + "delta_lambda=lamda/R\n", + "print(\"(B) Wave length difference in A= %.5f\"%delta_lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.5 Calculation of Angles" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Interplanar spacing d in A= 2.51781\n", + "Diffracted beam occurs when m=1,m=2 and m=3\n", + "When m1=1, Theta in degree= 12.61763\n", + "When m1=2, Theta in degree= 25.90544\n", + "When m1=3, Theta in degree= 40.94473\n" + ] + } + ], + "source": [ + "import math\n", + "a_o=5.63 #A\n", + "d=a_o/math.sqrt(5)\n", + "lamda=1.10 #in A\n", + "print(\"Interplanar spacing d in A= %.5f\"%d)\n", + "print(\"Diffracted beam occurs when m=1,m=2 and m=3\")\n", + "m1=1\n", + "x=(m1*lamda)/(2*d)\n", + "theta_1=math.degrees(math.asin(x))\n", + "print(\"When m1=1, Theta in degree= %.5f\"%theta_1)\n", + "m2=2\n", + "x=(m2*lamda)/(2*d)\n", + "theta_2=math.degrees(math.asin(x))\n", + "print('When m1=2, Theta in degree= %.5f'%theta_2)\n", + "m3=3\n", + "x=(m3*lamda)/(2*d)\n", + "theta_3=math.degrees(math.asin(x))\n", + "print('When m1=3, Theta in degree= %.5f'%theta_3)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aXglZdg.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aXglZdg.ipynb new file mode 100644 index 00000000..80d62fec --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_aXglZdg.ipynb @@ -0,0 +1,206 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 48 WAVES AND PROPOGATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.1 Velocity and Wavelength of particle" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity in m/s 5929994.5\n", + "Wavelength in A 1.222\n" + ] + } + ], + "source": [ + "import math\n", + "k=100*(1.6*(10**-19))\n", + "m=9.1*(10**-31)\n", + "\n", + "v=math.sqrt(((2*k)/(m)))\n", + "print(\"Velocity in m/s %.1f\"%v)\n", + "h=6.6*(10**-34)\n", + "p=5.4*(10**-34)\n", + "lamda=h/p\n", + "print(\"Wavelength in A %.3f\"%lamda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.2 Quantized energy" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in Joule= 5.984e-20\n" + ] + } + ], + "source": [ + "n=1\n", + "h=(6.6)*10**-34 #j/sec\n", + "m=9.1*(10**-31) #in kg\n", + "l=1*(10**-9) #in m\n", + "E=(n**2)*((h**2)/(8*m*(l**2)))\n", + "print(\"Energy in Joule= %.3e\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.3 Quantum number" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in joule= 5.000e-22\n", + "Quantum number= 3.030e+14\n" + ] + } + ], + "source": [ + "m=10**-9 #in kg\n", + "v=10**-6 #in m/s\n", + "l=10**-4 #in m\n", + "h=(6.6)*(10**-34) #j/s\n", + "E=(0.5)*m*(v**2)\n", + "print(\"Energy in joule= %.3e\"%E)\n", + "n=(l/h)*(math.sqrt(8*m*E))\n", + "print(\"Quantum number= %.3e\"%n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.5 Position of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The electrom momentum in kg-m/s= 2.730e-28\n", + "Delta_p in kg-m/s= 2.730e-32\n", + "Minimum uncertainaity in m= 0.02418\n" + ] + } + ], + "source": [ + "m=9.1*(10**-31) #in kg\n", + "v=300 #in m/s\n", + "h=6.6*(10**-34) #in j-s\n", + "p=m*v\n", + "print(\"The electrom momentum in kg-m/s= %.3e\"%p)\n", + "delta_p=(0.0001)*p\n", + "print(\"Delta_p in kg-m/s= %.3e\"%delta_p)\n", + "delta_x=(h/delta_p)\n", + "print(\"Minimum uncertainaity in m= %.5f\"%delta_x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.6 Position of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Momentum in kg-m/s= 15.0\n", + "Delta_x in meter= 4.400e-35\n" + ] + } + ], + "source": [ + "m=0.05 #in kg\n", + "v=300 #m/s\n", + "delta_p=m*v\n", + "print(\"Momentum in kg-m/s=\",delta_p)\n", + "delta_x=(6.6*10**-34)/delta_p\n", + "print(\"Delta_x in meter= %.3e\"%delta_x)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_b69VCaT.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_b69VCaT.ipynb new file mode 100644 index 00000000..80d62fec --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_b69VCaT.ipynb @@ -0,0 +1,206 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 48 WAVES AND PROPOGATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.1 Velocity and Wavelength of particle" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity in m/s 5929994.5\n", + "Wavelength in A 1.222\n" + ] + } + ], + "source": [ + "import math\n", + "k=100*(1.6*(10**-19))\n", + "m=9.1*(10**-31)\n", + "\n", + "v=math.sqrt(((2*k)/(m)))\n", + "print(\"Velocity in m/s %.1f\"%v)\n", + "h=6.6*(10**-34)\n", + "p=5.4*(10**-34)\n", + "lamda=h/p\n", + "print(\"Wavelength in A %.3f\"%lamda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.2 Quantized energy" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in Joule= 5.984e-20\n" + ] + } + ], + "source": [ + "n=1\n", + "h=(6.6)*10**-34 #j/sec\n", + "m=9.1*(10**-31) #in kg\n", + "l=1*(10**-9) #in m\n", + "E=(n**2)*((h**2)/(8*m*(l**2)))\n", + "print(\"Energy in Joule= %.3e\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.3 Quantum number" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in joule= 5.000e-22\n", + "Quantum number= 3.030e+14\n" + ] + } + ], + "source": [ + "m=10**-9 #in kg\n", + "v=10**-6 #in m/s\n", + "l=10**-4 #in m\n", + "h=(6.6)*(10**-34) #j/s\n", + "E=(0.5)*m*(v**2)\n", + "print(\"Energy in joule= %.3e\"%E)\n", + "n=(l/h)*(math.sqrt(8*m*E))\n", + "print(\"Quantum number= %.3e\"%n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.5 Position of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The electrom momentum in kg-m/s= 2.730e-28\n", + "Delta_p in kg-m/s= 2.730e-32\n", + "Minimum uncertainaity in m= 0.02418\n" + ] + } + ], + "source": [ + "m=9.1*(10**-31) #in kg\n", + "v=300 #in m/s\n", + "h=6.6*(10**-34) #in j-s\n", + "p=m*v\n", + "print(\"The electrom momentum in kg-m/s= %.3e\"%p)\n", + "delta_p=(0.0001)*p\n", + "print(\"Delta_p in kg-m/s= %.3e\"%delta_p)\n", + "delta_x=(h/delta_p)\n", + "print(\"Minimum uncertainaity in m= %.5f\"%delta_x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.6 Position of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Momentum in kg-m/s= 15.0\n", + "Delta_x in meter= 4.400e-35\n" + ] + } + ], + "source": [ + "m=0.05 #in kg\n", + "v=300 #m/s\n", + "delta_p=m*v\n", + "print(\"Momentum in kg-m/s=\",delta_p)\n", + "delta_x=(6.6*10**-34)/delta_p\n", + "print(\"Delta_x in meter= %.3e\"%delta_x)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_bg51CID.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_bg51CID.ipynb new file mode 100644 index 00000000..21e23dc9 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_bg51CID.ipynb @@ -0,0 +1,168 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 30 CAPACITORS AND DIELECTRICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.1 Plate area" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Plate area in square meter is 1.130e+08\n" + ] + } + ], + "source": [ + "C=1.0 #capacitance in farad\n", + "d=1.0*10**-3 #separation b/w plates in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=d*C/epsilon0\n", + "print(\"Plate area in square meter is %.3e\"%A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.5 To calculate Capacitance Free charge Electric field strength Potential diffrence between plates" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Capacitance before the slab is inserted in farad is 8.850e-12\n", + "(b)Free charge in coul is 8.850e-10\n", + "(c)Electric field strength in the gap in volts/meter is 10000\n", + "(d)Electric field strength in the dielectric in volts/meter is 1428.5714\n", + "(e)Potential difference between the plates in volts is 57.1429\n", + "(f)Capacitance with the slab in place in farads is 1.549e-11\n" + ] + } + ], + "source": [ + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=100*10**-4#area of the plate in square meter\n", + "d=1*10**-2 #separation b/w plates in meter\n", + "b=5*10**-3 #thickness of dielectric lab in meter\n", + "V0=100#in volts\n", + "k=7\n", + "#(a)\n", + "C0=epsilon0*A/d\n", + "print(\"(a)Capacitance before the slab is inserted in farad is %.3e\"%C0)\n", + "#(b)\n", + "q=C0*V0\n", + "print(\"(b)Free charge in coul is %.3e\"%q)\n", + "#(c)\n", + "E0=q/(epsilon0*A)\n", + "print(\"(c)Electric field strength in the gap in volts/meter is %d\"%E0)\n", + "#(d)\n", + "E=q/(k*epsilon0*A)\n", + "print(\"(d)Electric field strength in the dielectric in volts/meter is %.4f\"%E)\n", + "#(e)\n", + "#Refer to fig30-12\n", + "V=E0*(d-b)+E*b\n", + "print(\"(e)Potential difference between the plates in volts is %.4f\"%V)\n", + "#(f)\n", + "C=q/V\n", + "print(\"(f)Capacitance with the slab in place in farads is %.3e\"%C)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 30.6 To calculate Electric displacement and Electric polarisation in dielectric and air gap" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Electric displacement in dielectric in coul/square metre is 8.859e-08\n", + "Electric polarisation in dielectric in coul/square meter is 7.593e-08\n", + "(b)Electric displacement in air gap in coul/square metre is 8.850e-08\n", + "Electric polarisation in air gap in coul/square meter is 0.0\n" + ] + } + ], + "source": [ + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "A=100*10**-4#area of the plate in square meter\n", + "d=1*10**-2 #separation b/w plates in meter\n", + "V0=100#in volts\n", + "E0=1*10**4 #Electric field in the air gap in volts/meter\n", + "k=7\n", + "k0=1\n", + "E=1.43*10**3 #in volts/metre\n", + "D=k*E*epsilon0\n", + "P=epsilon0*(k-1)*E\n", + "#(a)\n", + "print(\"(a)Electric displacement in dielectric in coul/square metre is %.3e\"%D)\n", + "print(\"Electric polarisation in dielectric in coul/square meter is %.3e\"%P)\n", + "#(b)\n", + "D0=k0*epsilon0*E0\n", + "print(\"(b)Electric displacement in air gap in coul/square metre is %.3e\"%D0)\n", + "P0=epsilon0*(k0-1)*E0\n", + "print(\"Electric polarisation in air gap in coul/square meter is\",P0)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_dsYxoMq.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_dsYxoMq.ipynb new file mode 100644 index 00000000..80d62fec --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_dsYxoMq.ipynb @@ -0,0 +1,206 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 48 WAVES AND PROPOGATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.1 Velocity and Wavelength of particle" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity in m/s 5929994.5\n", + "Wavelength in A 1.222\n" + ] + } + ], + "source": [ + "import math\n", + "k=100*(1.6*(10**-19))\n", + "m=9.1*(10**-31)\n", + "\n", + "v=math.sqrt(((2*k)/(m)))\n", + "print(\"Velocity in m/s %.1f\"%v)\n", + "h=6.6*(10**-34)\n", + "p=5.4*(10**-34)\n", + "lamda=h/p\n", + "print(\"Wavelength in A %.3f\"%lamda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.2 Quantized energy" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in Joule= 5.984e-20\n" + ] + } + ], + "source": [ + "n=1\n", + "h=(6.6)*10**-34 #j/sec\n", + "m=9.1*(10**-31) #in kg\n", + "l=1*(10**-9) #in m\n", + "E=(n**2)*((h**2)/(8*m*(l**2)))\n", + "print(\"Energy in Joule= %.3e\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.3 Quantum number" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in joule= 5.000e-22\n", + "Quantum number= 3.030e+14\n" + ] + } + ], + "source": [ + "m=10**-9 #in kg\n", + "v=10**-6 #in m/s\n", + "l=10**-4 #in m\n", + "h=(6.6)*(10**-34) #j/s\n", + "E=(0.5)*m*(v**2)\n", + "print(\"Energy in joule= %.3e\"%E)\n", + "n=(l/h)*(math.sqrt(8*m*E))\n", + "print(\"Quantum number= %.3e\"%n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.5 Position of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The electrom momentum in kg-m/s= 2.730e-28\n", + "Delta_p in kg-m/s= 2.730e-32\n", + "Minimum uncertainaity in m= 0.02418\n" + ] + } + ], + "source": [ + "m=9.1*(10**-31) #in kg\n", + "v=300 #in m/s\n", + "h=6.6*(10**-34) #in j-s\n", + "p=m*v\n", + "print(\"The electrom momentum in kg-m/s= %.3e\"%p)\n", + "delta_p=(0.0001)*p\n", + "print(\"Delta_p in kg-m/s= %.3e\"%delta_p)\n", + "delta_x=(h/delta_p)\n", + "print(\"Minimum uncertainaity in m= %.5f\"%delta_x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 48.6 Position of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Momentum in kg-m/s= 15.0\n", + "Delta_x in meter= 4.400e-35\n" + ] + } + ], + "source": [ + "m=0.05 #in kg\n", + "v=300 #m/s\n", + "delta_p=m*v\n", + "print(\"Momentum in kg-m/s=\",delta_p)\n", + "delta_x=(6.6*10**-34)/delta_p\n", + "print(\"Delta_x in meter= %.3e\"%delta_x)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_eobmuMh.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_eobmuMh.ipynb new file mode 100644 index 00000000..7cae8043 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_eobmuMh.ipynb @@ -0,0 +1,167 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 40 NATURE AND PROPOGATION OF LIGHT" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.1 Force and energy reflected" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Energy reflected from mirror in joule= 36000.0\n", + "Momentum after 1 hr illumination in kg-m/sec= 0.00024\n", + "(B) Force in newton= 6.667e-08\n" + ] + } + ], + "source": [ + "u=(10)*(1.0)*3600 #in Joules\n", + "c=3*10**8 #in m/sec\n", + "t=3600 #in sec\n", + "print(\"(A) Energy reflected from mirror in joule=\",u)\n", + "p=(2*u)/c\n", + "print(\"Momentum after 1 hr illumination in kg-m/sec= %.5f\"%p)\n", + "f=p/t\n", + "print(\"(B) Force in newton= %.3e\"%f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.2 Angular speed" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angular speed in rev/sec= 12.07030\n" + ] + } + ], + "source": [ + "theta=1/1440\n", + "c=3*10**8 #in m/sec\n", + "l=8630 #in m\n", + "w=(c*theta)/(2*l)\n", + "print(\"Angular speed in rev/sec= %.5f\"%w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.3 Calculation of c" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Lambda_g in cm= 3.9\n", + "Value of c in m/sec= 2.992e+10\n" + ] + } + ], + "source": [ + "l=15.6 #in cm\n", + "n=8\n", + "lambda_g=(2*l)/n\n", + "print(\"Lambda_g in cm=\",lambda_g)\n", + "lamda=3.15 #in cm\n", + "f=9.5*10**9 #cycles/sec\n", + "c=lamda*f\n", + "print(\"Value of c in m/sec= %.3e\"%c)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 40.4 Percentage error" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of light in miles/hour= 50000\n" + ] + } + ], + "source": [ + "v_1=25000 #miles/hr\n", + "u=25000 #miles/hr\n", + "c=6.7*10**8 #miles/hr\n", + "x=1+((v_1*u)/(c)**2)\n", + "v=(v_1+u)/x\n", + "print(\"Speed of light in miles/hour= %.0f\"%v)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_fq4RONl.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_fq4RONl.ipynb new file mode 100644 index 00000000..d8f167d7 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_fq4RONl.ipynb @@ -0,0 +1,181 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 37 MAGNETIC PROPERTIES OF MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.2 Orbital dipole moment" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Orbital dipole moment in amp-m2 is 9.061e-24\n" + ] + } + ], + "source": [ + "import math\n", + "e=1.6*10**-19 #in coul\n", + "r=5.1*10**-11 #radius of hydrogen atom in meter\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "p=((e**2)/4)*math.sqrt(r/(math.pi*epsilon0*m))\n", + "print(\"Orbital dipole moment in amp-m2 is %.3e\"%p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.4 Change in magnetic moment" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in Orbital dipole moment in amp-m2 is + 0r - 3.659e-29\n" + ] + } + ], + "source": [ + "e=1.6*10**-19 #in coul\n", + "r=5.1*10**-11 #radius of hydrogen atom in meter\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "B=2 #in wb/m2\n", + "delta_p=(e**2*B*r**2)/(4*m)\n", + "print(\"Change in Orbital dipole moment in amp-m2 is + 0r - %.3e\"%delta_p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.5 Precession frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Precession frequency of phoyon in given magnetic field in cps is 21020464.18\n" + ] + } + ], + "source": [ + "import math\n", + "u=1.4*10**-26 #in amp-m2\n", + "B=0.50 #wb/m2\n", + "Lp=0.53*10**-34 #in joule-sec\n", + "fp=u*B/(2*math.pi*Lp)\n", + "print(\"Precession frequency of phoyon in given magnetic field in cps is %.2f\"%fp)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 37.6 Magnetic field strength Magnetisation Effective magnetising current and Permeability" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic field strength in amp/m is 2000\n", + "(B) Magnetisation is Zero when core is removed\n", + " Magnetisation when the core is replaced in amp/m 793774.72\n", + "(C) Effective magnetizing current i=i(M,0)=M*(2*math.pi*r0/N0)=M/n\n", + " Effective magnetizing current in amp is 793.77472\n", + "(D) Permeability 397.88736\n" + ] + } + ], + "source": [ + "import math\n", + "n=10*10**2 #turns/m\n", + "i=2 #in amp\n", + "B=1.0 #in wb/m\n", + "u0=4*math.pi*10**-7 #in wb/amp-m\n", + "#(A)\n", + "H=n*i\n", + "print(\"(A) Magnetic field strength in amp/m is\",H)\n", + "#(B)\n", + "M=(B-u0*H)/u0\n", + "print(\"(B) Magnetisation is Zero when core is removed\")\n", + "print(\" Magnetisation when the core is replaced in amp/m %.2f\"%M)\n", + "#(C)\n", + "print(\"(C) Effective magnetizing current i=i(M,0)=M*(2*math.pi*r0/N0)=M/n\")\n", + "i=M/n\n", + "print(\" Effective magnetizing current in amp is %.5f\"%i)\n", + "#D\n", + "Km=B/(u0*H)\n", + "print(\"(D) Permeability %.5f\"%Km)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_gAk3z0j.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_gAk3z0j.ipynb new file mode 100644 index 00000000..412d8eb1 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_gAk3z0j.ipynb @@ -0,0 +1,99 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 28 GAUSS'S LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 28.3 Electric field strength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength at the surface of the gold atom in nt/coul is 1.138e+13\n" + ] + } + ], + "source": [ + "r=1*10**-10 #radius of the atom in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "E=(9.0*10**9)*q/r**2\n", + "print(\"Electric field strength at the surface of the gold atom in nt/coul is %.3e\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 28.4 Electric field strength at the nuclear surface" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength at the surface of the gold atom in nt/coul is 2.389e+21\n" + ] + } + ], + "source": [ + "r=6.9*10**-15 #radius of the gold nucleus in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "E=(9.0*10**9)*q/r**2\n", + "print(\"Electric field strength at the surface of the gold atom in nt/coul is %.3e\"%E)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hCfFR8F.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hCfFR8F.ipynb new file mode 100644 index 00000000..4651a1a4 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hCfFR8F.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 44 DIFFRACTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.1 Calculation of wavelength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a in A=13000\n" + ] + } + ], + "source": [ + "import math\n", + "m=1\n", + "lamda=6500 #in A\n", + "a=(m*lamda)/math.sin(30*math.pi/180)\n", + "print(\"a in A=%d\"%a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.2 Calculation of wavelength" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Wavelength in A = 4333.333\n" + ] + } + ], + "source": [ + "lamda=6500\n", + "lambda_1=lamda/1.5\n", + "print(\"Wavelength in A = %.3f\"%lambda_1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.5 Current" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current in amp= 0.06990\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "byd=10**12\n", + "i_d=(e_0*math.pi*R*R*byd)\n", + "print(\"Current in amp= %.5f\"%i_d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.7 Delta Y" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) D in m= 0.00240\n" + ] + } + ], + "source": [ + "lamda=480*10**-9 #in m\n", + "d=0.10*10**-3 #in m\n", + "D=50*10**-2 #in m\n", + "a=0.02*10**-3\n", + "delta_y=(lamda*D)/d\n", + "print(\"(A) D in m= %.5f\"%delta_y)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hK5EJWu.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hK5EJWu.ipynb new file mode 100644 index 00000000..412d8eb1 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_hK5EJWu.ipynb @@ -0,0 +1,99 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 28 GAUSS'S LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 28.3 Electric field strength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength at the surface of the gold atom in nt/coul is 1.138e+13\n" + ] + } + ], + "source": [ + "r=1*10**-10 #radius of the atom in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "E=(9.0*10**9)*q/r**2\n", + "print(\"Electric field strength at the surface of the gold atom in nt/coul is %.3e\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 28.4 Electric field strength at the nuclear surface" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength at the surface of the gold atom in nt/coul is 2.389e+21\n" + ] + } + ], + "source": [ + "r=6.9*10**-15 #radius of the gold nucleus in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "E=(9.0*10**9)*q/r**2\n", + "print(\"Electric field strength at the surface of the gold atom in nt/coul is %.3e\"%E)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iL7yFH3.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iL7yFH3.ipynb new file mode 100644 index 00000000..6cc02fdd --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iL7yFH3.ipynb @@ -0,0 +1,157 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 47 LIGHT AND QUANTUM PHYSICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.1 Velocity" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity in cycles/s 0.71176\n" + ] + } + ], + "source": [ + "import math\n", + "k=20 #in nt/m\n", + "m=1 #in kg\n", + "\n", + "v=(math.sqrt((k)/(m)))*(1/(2*math.pi))\n", + "print(\"Velocity in cycles/s %.5f\"%v)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.2 Time calculation" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power in j-sec 1.000000e-23\n", + "('Time reqired in sec =', 80000.0)\n", + "Time required in hour 22.22224\n" + ] + } + ], + "source": [ + "P=(10**(-3))*(3*10**(-18))/(300)\n", + "print(\"Power in j-sec %e\"%P)\n", + "s=1.6*(10**(-19))\n", + "t=(5*s)/P\n", + "print(\"Time reqired in sec =\",t)\n", + "one_sec=0.000277778 #hr\n", + "in_hour=one_sec*t\n", + "print(\"Time required in hour %.5f\"%in_hour)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.3 Work function for sodium" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in joule= 2.911e-19\n" + ] + } + ], + "source": [ + "h=6.63*10**(-34) #in joule/sec\n", + "v=4.39*10**(14) #cycles/sec\n", + "E_o=h*(v)\n", + "print(\"Energy in joule= %.3e\"%E_o)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.4 Kinetic energy to be imparten on recoiling electron" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "h=(6.63)*10**-34\n", + "m=9.11*10**-31\n", + "c=3*10**8\n", + "delta_h=(h/(m*c))*(1-math.cos(90))\n", + "print(\"(A) Compton shift in meter %.3e\",delta_h)\n", + "delta=1*10**-10\n", + "k=(h*c*delta_h)/(delta*(delta+delta_h))\n", + "print(\"(B) Kinetic energy in joules\",k)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iMZmAfZ.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iMZmAfZ.ipynb new file mode 100644 index 00000000..a0180572 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_iMZmAfZ.ipynb @@ -0,0 +1,139 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 41 REFLECTION AND REFRACTION OF PLANE WAVES AND PLANE SURFACES" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.1 Angle between two refracted beams" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For 4000 A beam, theta_2 in degree= 19.88234\n", + "For 5000 A beam, theta_2 in degree= 19.99290\n" + ] + } + ], + "source": [ + "import math\n", + "theta_1=30\n", + "n_qa=1.4702\n", + "theta2=math.degrees(math.asin(math.sin(theta_1*math.pi/180)/n_qa))\n", + "print(\"For 4000 A beam, theta_2 in degree= %.5f\"%theta2)\n", + "\n", + "theta_1=30\n", + "n_qa=1.4624\n", + "theta2=math.degrees(math.asin(math.sin(theta_1*math.pi/180)/n_qa))\n", + "print(\"For 5000 A beam, theta_2 in degree= %.5f\"%theta2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.4 Index of glass" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Index reflection= 1.41421\n" + ] + } + ], + "source": [ + "import math\n", + "n=1/math.sin(45*math.pi/180)\n", + "print(\"Index reflection= %.5f\"%n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 41.5 Calculation of Angle" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Angle theta_c in degree= 62.45732\n", + "Actual angle of indices = 45 is less than theta_ c, so there is no internal angle reflection\n", + "Angle of refraction:\n", + "Theta_2 in degree= 52.89097\n" + ] + } + ], + "source": [ + "import math\n", + "n2=1.33\n", + "n1=1.50\n", + "theta_c=math.degrees(math.asin(n2/n1))\n", + "print(\"Angle theta_c in degree= %.5f\"%theta_c)\n", + "print(\"Actual angle of indices = 45 is less than theta_ c, so there is no internal angle reflection\")\n", + "print(\"Angle of refraction:\")\n", + "x=n1/n2\n", + "theta_2=(math.asin(x*math.sin(45*math.pi/180))*180/math.pi)\n", + "print(\"Theta_2 in degree= %.5f\"%theta_2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ighXyFk.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ighXyFk.ipynb new file mode 100644 index 00000000..2da66d96 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ighXyFk.ipynb @@ -0,0 +1,149 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 34 AMPERES LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.3 Distance" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Separation between two wires in metres 0.0054795\n" + ] + } + ], + "source": [ + "import math\n", + "i1=100 #in amp\n", + "i2=20 #in amp\n", + "W=0.073 #weight of second wire W=F/l in nt/m\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "d=u0*i1*i2/(2*math.pi*W)\n", + "print(\"Separation between two wires in metres %.7f\"%d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.5 Magnetic field and Magnetic flux" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field at center in wb/m2 is 0.0267035\n", + "Magnetic flux at the center of the solenoid in weber is 0.0000189\n" + ] + } + ], + "source": [ + "import math\n", + "l=1.0 #length of solenoid in meter\n", + "d=3*10**-2 #diameter of solenoid in meter\n", + "n=5*850 #number of layers and turns of wire\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "i0=5.0 #current in amp\n", + "#(A)\n", + "B=u0*i0*n\n", + "print(\"Magnetic field at center in wb/m2 is %.7f\"%B)\n", + "#(B)\n", + "A=math.pi*(d/2)**2\n", + "Q=B*A\n", + "print(\"Magnetic flux at the center of the solenoid in weber is %.7f\"%Q)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.9 Magnetic field and Magnetic dipole moment" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic field at the center of the orbit in wb/m2 13.404\n", + "(B) Equivalent magnetic dipole moment in amp-m2 is 8.890e-24\n" + ] + } + ], + "source": [ + "import math\n", + "from __future__ import division\n", + "e=1.6*10**-19 #in coul\n", + "R=5.1*10**-11 #radius of th enucleus in meter\n", + "f=6.8*10**15 #frequency with which elecron circulates in rev/sec\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "x=0 #x is any point on the orbit, since at center x=0\n", + "#(A)\n", + "i=e*f\n", + "B=u0*i*R**2*0.5/((R**2+x**2)**(3/2))\n", + "print(\"(A) Magnetic field at the center of the orbit in wb/m2 %.3f\"%B)\n", + "N=1 #no.of turns\n", + "A=math.pi*R**2\n", + "U=N*i*A\n", + "print(\"(B) Equivalent magnetic dipole moment in amp-m2 is %.3e\"%U)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_jacaAtE.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_jacaAtE.ipynb new file mode 100644 index 00000000..ee009cd1 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_jacaAtE.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 36 INDUCTANCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.1 Inductance of a toroid" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inductance of a toroid of recyangular cross section in henry is 0.0013863\n" + ] + } + ], + "source": [ + "import math\n", + "from __future__ import division\n", + "\n", + "u0=4*math.pi*10**-7 #in weber/amp-m Mu-not=u0\n", + "N=10**3 #no.of turns\n", + "a=5*10**-2 #im meter\n", + "b=10*10**-2 #in meter\n", + "h=1*10**-2 #in metre\n", + "L=(u0*N**2*h)/(2*math.pi)*math.log(b/a)\n", + "print(\"Inductance of a toroid of recyangular cross section in henry is %.7f\"%L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.2 Time" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time taken for the current to reach one-half of its final equilibrium in sec is 1.1552453\n" + ] + } + ], + "source": [ + "import math\n", + "L=50 #inductance in henry\n", + "R=30 #resistance in ohms\n", + "t0=math.log(2)*(L/R)\n", + "print(\"Time taken for the current to reach one-half of its final equilibrium in sec is %.7f\"%t0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.3 Maximum Current and Energy stored" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum current in amp is 5.0\n", + "Energy stored in the magnetic field in joules is 62.5\n" + ] + } + ], + "source": [ + "L=5 #inductance in henry\n", + "V=100 #emf in volts\n", + "R=20 #resistance in ohms\n", + "i=V/R\n", + "print(\"Maximum current in amp is\",i)\n", + "U=(L*i**2)/2\n", + "print(\"Energy stored in the magnetic field in joules is %.1f\"%U)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.4 Rate at which energy is stored and delivered and appeared" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The rate at which energy is delivred by the battery in watt is 0.5689085\n", + "The rate at which energy appears as Joule heat in the resistor in watt is 0.3596188\n", + "Let D=di/dt\n", + "The desired rate at which energy is being stored in the magnetic field in watt is 0.2092897\n" + ] + } + ], + "source": [ + "L=3 #inductance in henry\n", + "R=10 #resistance in ohm\n", + "V=3 #emf in volts\n", + "t=0.30 #in sec\n", + "T=0.30 #inductive time constant in sec\n", + "#(a)\n", + "i=(V/R)*(1-math.exp(-t/T))\n", + "P1=V*i\n", + "print(\"The rate at which energy is delivred by the battery in watt is %.7f\"%P1)\n", + "#(b)\n", + "P2=i**2*R\n", + "print(\"The rate at which energy appears as Joule heat in the resistor in watt is %.7f\"%P2)\n", + "#(c)\n", + "print(\"Let D=di/dt\")\n", + "D=(V/L)*math.exp(-t/T) #in amp/sec\n", + "P3=L*i*D\n", + "print(\"The desired rate at which energy is being stored in the magnetic field in watt is %.7f\"%P3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.6 Energy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Energy required to set up in the given cube on edge in electric field in joules is 0.0000445\n", + "(b)Energy required to set up in the given cube on edge in magnetic field in joules is 397.887\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "E=10**5 #elelctric field in volts/meter\n", + "B=1 #magnetic field in weber/meter2\n", + "u0=4*math.pi*10**-7 #in weber/amp-m Mu-not=u0\n", + "a=0.1 #side of the cube in meter\n", + "V0=a**3 #volume of the cube in meter3\n", + "#(a)\n", + "U1=epsilon0*E**2*V0/2 #in elelctric field\n", + "print(\"(a)Energy required to set up in the given cube on edge in electric field in joules is %.7f\"%U1)\n", + "#(b)\n", + "U2=(B**2/(2*u0))*V0\n", + "print(\"(b)Energy required to set up in the given cube on edge in magnetic field in joules is %.3f\"%U2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ktswPb3.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ktswPb3.ipynb new file mode 100644 index 00000000..2b7da278 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_ktswPb3.ipynb @@ -0,0 +1,183 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 27 THE ELECTRIC FIELD" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.1 Electric field strength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength E=F/q where F=mg\n", + "electric field strength in nt/coul is 5.574e-11\n" + ] + } + ], + "source": [ + "m=9.1*10**-31 #mass of electron in kg\n", + "g=9.8 #acceleration due to gravity in m/s\n", + "q=1.6*10**-19 #charge of electron in coul\n", + "print(\"Electric field strength E=F/q where F=mg\")\n", + "E=m*g/q\n", + "print(\"electric field strength in nt/coul is %.3e\"%E)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.4 The point on the line joining two charges for the electric field strength to be zero" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For the electric field strength to be zero the point should lie between the charges where E1=E2\n", + "E1=E2 which implies q1/4πϵx2 = q2/4πϵ(l-x)2\n", + "Electric field strength is zero at x=4.142 cm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "q1=1.0*10**-6 #in coul\n", + "q2=2.0*10**-6 #in coul\n", + "l=10 #sepearation b/w q1 and q2 in cm\n", + "print(\"For the electric field strength to be zero the point should lie between the charges where E1=E2\")\n", + "#\"Refer to the fig 27.9\"\n", + "#E1=electric fied strength due to q1\n", + "#E2=electric fied strength due to q2\n", + "print(\"E1=E2 which implies q1/4πϵx2 = q2/4πϵ(l-x)2\")\n", + "x=l/(1+math.sqrt(q2/q1))\n", + "print(\"Electric field strength is zero at x=%.3f cm\"%x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.9 Deflection of electron" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Corresponding deflection in meters is 0.000337\n" + ] + } + ], + "source": [ + "e=1.6*10**-19 #charge in coul\n", + "E=1.2*10**4 #electric field in nt/coul\n", + "x=1.5*10**-2 #length of deflecting assembly in m\n", + "K0=3.2*10**-16 #kinetic energy of electron in joule\n", + "#calculation\n", + "y=e*E*x**2/(4*K0)\n", + "print(\"Corresponding deflection in meters is %.6f\"%y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 27.11 Torque and work done by external agent on electric dipole" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Maximum torque exerted by the fied in nt-m is\n", + "0.002\n", + "(b) Work done by the external agent to turn dipole end for end in joule is \n", + "0.004\n" + ] + } + ], + "source": [ + "import math\n", + "q=1.0*10**-6 #magnitude of two opposite charges of a electric dipole in coul\n", + "d=2.0*10**-2 #seperation b/w charges in m\n", + "E=1.0*10**5 #external field in nt/coul\n", + "#calculations\n", + "#(a)Max torque if found when theta=90 degrees\n", + "#Torque =pEsin(theta)\n", + "p=q*d #electric dipole moment\n", + "T=p*E*math.sin(math.pi/2)\n", + "print(\"(a)Maximum torque exerted by the fied in nt-m is\")\n", + "print(T)\n", + "#(b)work done by the external agent is the potential energy b/w the positions theta=180 and 0 degree\n", + "W=(-p*E*math.cos(math.pi))-(-p*E*math.cos(0))\n", + "print(\"(b) Work done by the external agent to turn dipole end for end in joule is \")\n", + "print(W)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_l0DVFDN.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_l0DVFDN.ipynb new file mode 100644 index 00000000..4651a1a4 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_l0DVFDN.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 44 DIFFRACTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.1 Calculation of wavelength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a in A=13000\n" + ] + } + ], + "source": [ + "import math\n", + "m=1\n", + "lamda=6500 #in A\n", + "a=(m*lamda)/math.sin(30*math.pi/180)\n", + "print(\"a in A=%d\"%a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.2 Calculation of wavelength" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Wavelength in A = 4333.333\n" + ] + } + ], + "source": [ + "lamda=6500\n", + "lambda_1=lamda/1.5\n", + "print(\"Wavelength in A = %.3f\"%lambda_1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.5 Current" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current in amp= 0.06990\n" + ] + } + ], + "source": [ + "import math\n", + "m_0=(4*math.pi*10**-7) #in weber\n", + "e_0=(8.9*10**-12)\n", + "R=5*10**-2 #meters\n", + "byd=10**12\n", + "i_d=(e_0*math.pi*R*R*byd)\n", + "print(\"Current in amp= %.5f\"%i_d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 44.7 Delta Y" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) D in m= 0.00240\n" + ] + } + ], + "source": [ + "lamda=480*10**-9 #in m\n", + "d=0.10*10**-3 #in m\n", + "D=50*10**-2 #in m\n", + "a=0.02*10**-3\n", + "delta_y=(lamda*D)/d\n", + "print(\"(A) D in m= %.5f\"%delta_y)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_lhKq0fF.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_lhKq0fF.ipynb new file mode 100644 index 00000000..904b1c32 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_lhKq0fF.ipynb @@ -0,0 +1,220 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 31 CURRENT AND RESISTANCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.1 Current density" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current density in Aluminium wire in amp/square inches 1273.240\n", + "Current density in copper wire in amp/square inches 3108.495\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "d1=0.10 #diameter of aluminium wire in inches\n", + "d2=0.064 #diameter of copper wire in inches\n", + "i=10 #current carried by composite wire in amperes\n", + "A1=math.pi*(d1/2)**2 #crosssectional area of aluminium wire in square inches\n", + "A2=math.pi*(d2/2)**2 #crosssectional area of copper wire in square inches\n", + "j1=i/A1\n", + "j2=i/A2\n", + "print(\"Current density in Aluminium wire in amp/square inches %.3f\"%j1)\n", + "print(\"Current density in copper wire in amp/square inches %.3f\"%j2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.2 Drift speed" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "No.of free electrons per unit volume in atoms/mole 8.438e+22\n", + "Drift speed of electron in cm/sec is 0.03556\n" + ] + } + ], + "source": [ + "j=480 #current density for copper wire in amp/cm2\n", + "N0=6*10**23 #avagadro number in atoms/mole\n", + "M=64 #molecular wt in gm/mole\n", + "d=9.0 #density in gm/cm3\n", + "e=1.6*10**-19 #elecron charge in coul\n", + "n=d*N0/M \n", + "print(\"No.of free electrons per unit volume in atoms/mole %.3e\"%n)\n", + "Vd=j/(n*e)\n", + "print(\"Drift speed of electron in cm/sec is %.5f\"%Vd)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.3 Resistance and resistivity" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of rectangular carbon block are 1.0cm*1.0cm*50cm\n", + "(a) Resistance measured b/w the two square ends in ohm is 0.175\n", + "(a) Resistance measured b/w the two opposite rectangular faces in ohm is 7.0e-05\n" + ] + } + ], + "source": [ + "\n", + "print(\"Dimensions of rectangular carbon block are 1.0cm*1.0cm*50cm\")\n", + "l=1.0*10**-2 #in meter\n", + "b=1.0*10**-2#in meter\n", + "h=50*10**-2 #in meter\n", + "p=3.5*10**-5 #resisivity of carbon in ohm-m\n", + "#(a)Resistance b/w two square ends\n", + "l1=h\n", + "A1=b*l\n", + "R1=p*l1/A1\n", + "print(\"(a) Resistance measured b/w the two square ends in ohm is %.3f\"%R1)\n", + "l2=l\n", + "A2=b*h\n", + "R2=p*l2/A2\n", + "print(\"(a) Resistance measured b/w the two opposite rectangular faces in ohm is %.1e\"%R2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.4 Mean time and Mean free path" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Mean time b/w collisions in sec is 4.979e-14\n", + "(b) Mean free path in cm is 0.000008\n" + ] + } + ], + "source": [ + "m=9.1*10**-31 #in kg\n", + "n=8.4*10**28 #in m-1\n", + "e=1.6*10**-19 #in coul\n", + "p=1.7*10**-8 #in ohm-m\n", + "v=1.6*10**8 #in cm/sec\n", + "T=2*m/(n*p*e**2)\n", + "print(\"(a) Mean time b/w collisions in sec is %.3e\"%T)\n", + "Lambda=T*v\n", + "print(\"(b) Mean free path in cm is %f\"%Lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.5 Power" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Power for the single coil in watts is 504.167\n", + "(b)Power for a coil of half the length in watts is 1008.333\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "\n", + "V=110 #in volt\n", + "R=24 #ohms\n", + "P1=V**2/R\n", + "print(\"(a)Power for the single coil in watts is %.3f\"%P1)\n", + "P2=V**2/(R/2)\n", + "print(\"(b)Power for a coil of half the length in watts is %.3f\"%P2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_m7Qc24V.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_m7Qc24V.ipynb new file mode 100644 index 00000000..cd850cd0 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_m7Qc24V.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 46 POLARIZATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.1 Calculation of theta" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Polarization angle theta= 135.0\n" + ] + } + ], + "source": [ + "import math\n", + "theta=math.degrees(math.acos(1/math.sqrt(2)))\n", + "theta=180-theta\n", + "print(\"Polarization angle theta=\",theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.2 Angle of refraction" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Theta_p in degrees=56.30993\n", + "Angle of refraction fron Snells law in degrees=33.69007\n" + ] + } + ], + "source": [ + "import math\n", + "theta_p= math.degrees(math.atan(1.5))\n", + "print(\"Theta_p in degrees=%.5f\"%theta_p)\n", + "sin_theta_r= (math.sin(theta_p*math.pi/180))/1.5\n", + "theta_r=math.degrees(math.asin(sin_theta_r))\n", + "print(\"Angle of refraction fron Snells law in degrees=%.5f\"%theta_r)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 46.3 Thickness of slab" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Value of x in m= 163611.111111113\n" + ] + } + ], + "source": [ + "lamda=5890 #A\n", + "n_e=1.553\n", + "n_o=1.544\n", + "s=(n_e)-(n_o)\n", + "x=(lamda)/(4*s)\n", + "\n", + "print(\"The Value of x in m=\",x)\n", + "#The answer provided in the textbook is wrong" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_nCBI46r.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_nCBI46r.ipynb new file mode 100644 index 00000000..34883c4a --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_nCBI46r.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 35 FARADAYS LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 35.1 Induced EMF" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field at center in wb/m2 is 0.0376991\n", + "Magnetic flux at the center of the solenoid in weber is 0.0000118\n", + "Induced EMF in volts is -0.0473741\n" + ] + } + ], + "source": [ + "import math \n", + "l=1.0 #length of solenoid in meter\n", + "r=3*10**-2 #radius of solenoid in meter\n", + "n=200*10**2 #number of turns in solenoid per meter\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "i=1.5 #current in amp\n", + "N=100 #no.of turns in a close packed coil placed at the center of solenoid\n", + "d=2*10**-2 #diameter of coil in meter\n", + "delta_T=0.050 #in sec\n", + "#(A)\n", + "B=u0*i*n\n", + "print(\"Magnetic field at center in wb/m2 is %.7f\"%B)\n", + "#(B)\n", + "A=math.pi*(d/2)**2\n", + "Q=B*A\n", + "print(\"Magnetic flux at the center of the solenoid in weber is %.7f\"%Q)\n", + "delta_Q=Q-(-Q)\n", + "E=-(N*delta_Q/delta_T)\n", + "print(\"Induced EMF in volts is %.7f\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 35.7 Induced electric field and EMF" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let S be the frame of reference fixed w.r.t the magnet and Z be the frame of reference w.r.t the loop\n", + "(A) Induced electric field in volt/m observed by Z 2.0\n", + "(B) Force acting on charge carrier in nt w.r.t S is 3.2e-19\n", + "Force acting on charge carrier in nt w.r.t Z is 3.2e-19\n", + "(C) Induced emf in volt observed by S is 0.2\n", + "Induced emf in volt observed by Z is 0.2\n" + ] + } + ], + "source": [ + "B=2 #magnetic field in wb/m2\n", + "l=10*10**-2 #in m\n", + "v=1.0 #in m/sec\n", + "q=1.6*10**-19 #charge in coul\n", + "print(\"Let S be the frame of reference fixed w.r.t the magnet and Z be the frame of reference w.r.t the loop\")\n", + "#(A)\n", + "E=v*B\n", + "print(\"(A) Induced electric field in volt/m observed by Z\",E)\n", + "#(B)\n", + "F=q*v*B\n", + "print(\"(B) Force acting on charge carrier in nt w.r.t S is %.1e\"%F)\n", + "F1=q*E\n", + "print(\"Force acting on charge carrier in nt w.r.t Z is %.1e\"%F1)\n", + "#(C)\n", + "emf1=B*l*v\n", + "print(\"(C) Induced emf in volt observed by S is\",emf1)\n", + "emf2=E*l\n", + "print(\"Induced emf in volt observed by Z is\",emf2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_oSlKePW.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_oSlKePW.ipynb new file mode 100644 index 00000000..047fa477 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_oSlKePW.ipynb @@ -0,0 +1,260 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 33 THE MAGNETIC FIELD" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.1 Force acting on a proton" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of the proton in meters/sec is 30678599.55\n", + "Force acting on proton in nt is 7.363e-12\n" + ] + } + ], + "source": [ + "import math\n", + "K=5*10**6 #ev\n", + "e=1.6*10**-19 #in coul\n", + "K1=K*e #in joules\n", + "m=1.7*10**-27 #in kg\n", + "B=1.5 #wb/m\n", + "theta=math.pi/2\n", + "v=math.sqrt(2*K1/m)\n", + "print(\"Speed of the proton in meters/sec is %.2f\"%v)\n", + "F=e*v*B*math.sin(theta)\n", + "print(\"Force acting on proton in nt is %.3e\"%F)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.3 Torsional constant of the spring" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Torssional constant in nt-m/deg is 3.333e-08\n" + ] + } + ], + "source": [ + "N=250 #turns in coil\n", + "i=1.0*10**-4 #in amp\n", + "B=0.2 #wb/m2\n", + "h=2*10**-2 #coil height in m\n", + "w=1.0*10**-2 #width of coil in m\n", + "Q=30 #angular deflectin in degrees\n", + "theta=math.pi/2\n", + "A=h*w\n", + "k=N*i*A*B*math.sin(theta)/Q\n", + "print(\"Torssional constant in nt-m/deg is %.3e\"%k)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.4 Work done" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is 0.23561944901923454\n" + ] + } + ], + "source": [ + "import math\n", + "N=100 #turns in circular coil\n", + "i=0.10 #in amp\n", + "B=1.5 #in wb/m2\n", + "a=5*10**-2 #radius of coil in meter\n", + "u=N*i*math.pi*(a**2) #u is dipole moment\n", + "U1=(-u*B*math.cos(0))\n", + "U2=-u*B*math.cos(math.pi)\n", + "W=U2-U1\n", + "print(\"Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is \",W)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.5 Hall potential difference" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hall potential difference aross strip in volt is 2.232142857142857e-05 or 0.0000223\n" + ] + } + ], + "source": [ + "i=200 #current in the strip in amp\n", + "B=1.5 #magnetic field in wb/m2\n", + "n=8.4*10**28 #in m-3\n", + "e=1.6*10**-19 #in coul\n", + "h=1.0*10**-3 #thickness of copper strip in metre\n", + "w=2*10**-2 #width of copper strip in meter\n", + "Vxy=i*B/(n*e*h)\n", + "print(\"Hall potential difference aross strip in volt is\",Vxy,\"or\",\"%.7f\"%Vxy)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.6 Orbital radius Cyclotron frequency and Period of revolution" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Orbit radius in meter is 0.1080625\n", + "(B) Cyclotron frequency in rev/sec is 2798328.7\n", + "(C) Period of revolution in sec is 0.0000004\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "m=9.1*10**-31 # in kg\n", + "v=1.9*10**6 #in m/sec\n", + "q=1.6*10**-19 #charge in coul\n", + "B=1.0*10**-4 #in wb/m2\n", + "\n", + "#(A)\n", + "r=m*v/(q*B)\n", + "print(\"(A) Orbit radius in meter is %.7f\"%r)\n", + "#(B)\n", + "f=q*B/(2*math.pi*m)\n", + "print(\"(B) Cyclotron frequency in rev/sec is %.1f\"%f)\n", + "#(C)\n", + "T=1/f\n", + "print(\"(C) Period of revolution in sec is %.7f\"%T)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 33.7 Magnetic induction and Deuteron energy" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic induction needed to accelerate deuterons in wb/m2 is 1.5550883635269475\n", + "(B) Deuteron energy in joule is 2.669e-12\n", + " Deuteron energy in ev is 16679852\n" + ] + } + ], + "source": [ + "import math\n", + "f0=12*10**6 #cyclotron frequency in cycles/sec\n", + "r=21#dee radius in inches\n", + "R=r*0.0254 #dee radius in meter\n", + "q=1.6*10**-19 #charge in coul\n", + "m=3.3*10**-27 #in kg\n", + "#(A)\n", + "B=2*math.pi*f0*m/q\n", + "print(\"(A) Magnetic induction needed to accelerate deuterons in wb/m2 is\",B)\n", + "#(B)\n", + "K=((q**2*B**2*R**2)/(2*m))\n", + "print(\"(B) Deuteron energy in joule is %.3e\"%K)\n", + "K1=K*(1/(1.6*10**-19))\n", + "print(\" Deuteron energy in ev is %d\"%K1)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_pG48gQ4.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_pG48gQ4.ipynb new file mode 100644 index 00000000..412d8eb1 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_pG48gQ4.ipynb @@ -0,0 +1,99 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 28 GAUSS'S LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 28.3 Electric field strength" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength at the surface of the gold atom in nt/coul is 1.138e+13\n" + ] + } + ], + "source": [ + "r=1*10**-10 #radius of the atom in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "E=(9.0*10**9)*q/r**2\n", + "print(\"Electric field strength at the surface of the gold atom in nt/coul is %.3e\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 28.4 Electric field strength at the nuclear surface" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric field strength at the surface of the gold atom in nt/coul is 2.389e+21\n" + ] + } + ], + "source": [ + "r=6.9*10**-15 #radius of the gold nucleus in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "E=(9.0*10**9)*q/r**2\n", + "print(\"Electric field strength at the surface of the gold atom in nt/coul is %.3e\"%E)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_rk3KbDl.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_rk3KbDl.ipynb new file mode 100644 index 00000000..6cc02fdd --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_rk3KbDl.ipynb @@ -0,0 +1,157 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 47 LIGHT AND QUANTUM PHYSICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.1 Velocity" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Velocity in cycles/s 0.71176\n" + ] + } + ], + "source": [ + "import math\n", + "k=20 #in nt/m\n", + "m=1 #in kg\n", + "\n", + "v=(math.sqrt((k)/(m)))*(1/(2*math.pi))\n", + "print(\"Velocity in cycles/s %.5f\"%v)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.2 Time calculation" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power in j-sec 1.000000e-23\n", + "('Time reqired in sec =', 80000.0)\n", + "Time required in hour 22.22224\n" + ] + } + ], + "source": [ + "P=(10**(-3))*(3*10**(-18))/(300)\n", + "print(\"Power in j-sec %e\"%P)\n", + "s=1.6*(10**(-19))\n", + "t=(5*s)/P\n", + "print(\"Time reqired in sec =\",t)\n", + "one_sec=0.000277778 #hr\n", + "in_hour=one_sec*t\n", + "print(\"Time required in hour %.5f\"%in_hour)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.3 Work function for sodium" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy in joule= 2.911e-19\n" + ] + } + ], + "source": [ + "h=6.63*10**(-34) #in joule/sec\n", + "v=4.39*10**(14) #cycles/sec\n", + "E_o=h*(v)\n", + "print(\"Energy in joule= %.3e\"%E_o)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 47.4 Kinetic energy to be imparten on recoiling electron" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "h=(6.63)*10**-34\n", + "m=9.11*10**-31\n", + "c=3*10**8\n", + "delta_h=(h/(m*c))*(1-math.cos(90))\n", + "print(\"(A) Compton shift in meter %.3e\",delta_h)\n", + "delta=1*10**-10\n", + "k=(h*c*delta_h)/(delta*(delta+delta_h))\n", + "print(\"(B) Kinetic energy in joules\",k)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_sns7nwl.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_sns7nwl.ipynb new file mode 100644 index 00000000..904b1c32 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_sns7nwl.ipynb @@ -0,0 +1,220 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 31 CURRENT AND RESISTANCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.1 Current density" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current density in Aluminium wire in amp/square inches 1273.240\n", + "Current density in copper wire in amp/square inches 3108.495\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "d1=0.10 #diameter of aluminium wire in inches\n", + "d2=0.064 #diameter of copper wire in inches\n", + "i=10 #current carried by composite wire in amperes\n", + "A1=math.pi*(d1/2)**2 #crosssectional area of aluminium wire in square inches\n", + "A2=math.pi*(d2/2)**2 #crosssectional area of copper wire in square inches\n", + "j1=i/A1\n", + "j2=i/A2\n", + "print(\"Current density in Aluminium wire in amp/square inches %.3f\"%j1)\n", + "print(\"Current density in copper wire in amp/square inches %.3f\"%j2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.2 Drift speed" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "No.of free electrons per unit volume in atoms/mole 8.438e+22\n", + "Drift speed of electron in cm/sec is 0.03556\n" + ] + } + ], + "source": [ + "j=480 #current density for copper wire in amp/cm2\n", + "N0=6*10**23 #avagadro number in atoms/mole\n", + "M=64 #molecular wt in gm/mole\n", + "d=9.0 #density in gm/cm3\n", + "e=1.6*10**-19 #elecron charge in coul\n", + "n=d*N0/M \n", + "print(\"No.of free electrons per unit volume in atoms/mole %.3e\"%n)\n", + "Vd=j/(n*e)\n", + "print(\"Drift speed of electron in cm/sec is %.5f\"%Vd)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.3 Resistance and resistivity" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of rectangular carbon block are 1.0cm*1.0cm*50cm\n", + "(a) Resistance measured b/w the two square ends in ohm is 0.175\n", + "(a) Resistance measured b/w the two opposite rectangular faces in ohm is 7.0e-05\n" + ] + } + ], + "source": [ + "\n", + "print(\"Dimensions of rectangular carbon block are 1.0cm*1.0cm*50cm\")\n", + "l=1.0*10**-2 #in meter\n", + "b=1.0*10**-2#in meter\n", + "h=50*10**-2 #in meter\n", + "p=3.5*10**-5 #resisivity of carbon in ohm-m\n", + "#(a)Resistance b/w two square ends\n", + "l1=h\n", + "A1=b*l\n", + "R1=p*l1/A1\n", + "print(\"(a) Resistance measured b/w the two square ends in ohm is %.3f\"%R1)\n", + "l2=l\n", + "A2=b*h\n", + "R2=p*l2/A2\n", + "print(\"(a) Resistance measured b/w the two opposite rectangular faces in ohm is %.1e\"%R2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.4 Mean time and Mean free path" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Mean time b/w collisions in sec is 4.979e-14\n", + "(b) Mean free path in cm is 0.000008\n" + ] + } + ], + "source": [ + "m=9.1*10**-31 #in kg\n", + "n=8.4*10**28 #in m-1\n", + "e=1.6*10**-19 #in coul\n", + "p=1.7*10**-8 #in ohm-m\n", + "v=1.6*10**8 #in cm/sec\n", + "T=2*m/(n*p*e**2)\n", + "print(\"(a) Mean time b/w collisions in sec is %.3e\"%T)\n", + "Lambda=T*v\n", + "print(\"(b) Mean free path in cm is %f\"%Lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 31.5 Power" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Power for the single coil in watts is 504.167\n", + "(b)Power for a coil of half the length in watts is 1008.333\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "\n", + "V=110 #in volt\n", + "R=24 #ohms\n", + "P1=V**2/R\n", + "print(\"(a)Power for the single coil in watts is %.3f\"%P1)\n", + "P2=V**2/(R/2)\n", + "print(\"(b)Power for a coil of half the length in watts is %.3f\"%P2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_t48qDiD.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_t48qDiD.ipynb new file mode 100644 index 00000000..57d1a771 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_t48qDiD.ipynb @@ -0,0 +1,227 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 45 GRATING AND SPECTRA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.1 Calculation of angle" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The first order diffraction pattern in degree= 7.249\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "m=1\n", + "lamda=4000 #in A\n", + "d=31700 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"The first order diffraction pattern in degree= %.3f\"%theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.2 Calculation of angle theta" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) The first order diffraction pattern in degree= 13.408\n", + "(B) Angle of seperation in degree= 0.0002388\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "m=1\n", + "lamda=5890 #in A\n", + "d=25400 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"(A) The first order diffraction pattern in degree= %.3f\"%theta)\n", + "del_lambda=5.9 #in A\n", + "delta_theta=(m*(del_lambda))/(d*(math.cos(theta*math.pi/180)))\n", + "print(\"(B) Angle of seperation in degree= %.7f\"%delta_theta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.3 Calculation of Sodium Doublet" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resolving power= 998.305\n", + "Number of rulings needed is= 332.768\n" + ] + } + ], + "source": [ + "lamda=5890 #A\n", + "lamda_1=5895.9 #A\n", + "m=3\n", + "delta_lambda=(lamda_1-lamda) #in A\n", + "R=lamda/(delta_lambda)\n", + "print(\"Resolving power= %.3f\"%R)\n", + "N=(R/m)\n", + "print(\"Number of rulings needed is= %.3f\"%N)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.4 Calculation of Dispersion" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The first order diffraction pattern in degree= 31.11244\n", + "(A) The dispersion in radian/A= 0.0001105\n", + "(B) Wave length difference in A= 0.13650\n" + ] + } + ], + "source": [ + "import math\n", + "m=3\n", + "m1=5\n", + "lamda=5460 #in A\n", + "d=31700 #in A\n", + "theta=math.degrees(math.asin((m*lamda)/d))\n", + "print(\"The first order diffraction pattern in degree= %.5f\"%theta)\n", + "D=m/(d*math.cos(theta*math.pi/180))\n", + "print(\"(A) The dispersion in radian/A= %.7f\"%D)\n", + "N=8000\n", + "lamda=5460\n", + "R=N*m1\n", + "delta_lambda=lamda/R\n", + "print(\"(B) Wave length difference in A= %.5f\"%delta_lambda)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 45.5 Calculation of Angles" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Interplanar spacing d in A= 2.51781\n", + "Diffracted beam occurs when m=1,m=2 and m=3\n", + "When m1=1, Theta in degree= 12.61763\n", + "When m1=2, Theta in degree= 25.90544\n", + "When m1=3, Theta in degree= 40.94473\n" + ] + } + ], + "source": [ + "import math\n", + "a_o=5.63 #A\n", + "d=a_o/math.sqrt(5)\n", + "lamda=1.10 #in A\n", + "print(\"Interplanar spacing d in A= %.5f\"%d)\n", + "print(\"Diffracted beam occurs when m=1,m=2 and m=3\")\n", + "m1=1\n", + "x=(m1*lamda)/(2*d)\n", + "theta_1=math.degrees(math.asin(x))\n", + "print(\"When m1=1, Theta in degree= %.5f\"%theta_1)\n", + "m2=2\n", + "x=(m2*lamda)/(2*d)\n", + "theta_2=math.degrees(math.asin(x))\n", + "print('When m1=2, Theta in degree= %.5f'%theta_2)\n", + "m3=3\n", + "x=(m3*lamda)/(2*d)\n", + "theta_3=math.degrees(math.asin(x))\n", + "print('When m1=3, Theta in degree= %.5f'%theta_3)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_u1j27Ap.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_u1j27Ap.ipynb new file mode 100644 index 00000000..ee009cd1 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_u1j27Ap.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 36 INDUCTANCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.1 Inductance of a toroid" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inductance of a toroid of recyangular cross section in henry is 0.0013863\n" + ] + } + ], + "source": [ + "import math\n", + "from __future__ import division\n", + "\n", + "u0=4*math.pi*10**-7 #in weber/amp-m Mu-not=u0\n", + "N=10**3 #no.of turns\n", + "a=5*10**-2 #im meter\n", + "b=10*10**-2 #in meter\n", + "h=1*10**-2 #in metre\n", + "L=(u0*N**2*h)/(2*math.pi)*math.log(b/a)\n", + "print(\"Inductance of a toroid of recyangular cross section in henry is %.7f\"%L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.2 Time" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time taken for the current to reach one-half of its final equilibrium in sec is 1.1552453\n" + ] + } + ], + "source": [ + "import math\n", + "L=50 #inductance in henry\n", + "R=30 #resistance in ohms\n", + "t0=math.log(2)*(L/R)\n", + "print(\"Time taken for the current to reach one-half of its final equilibrium in sec is %.7f\"%t0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.3 Maximum Current and Energy stored" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Maximum current in amp is 5.0\n", + "Energy stored in the magnetic field in joules is 62.5\n" + ] + } + ], + "source": [ + "L=5 #inductance in henry\n", + "V=100 #emf in volts\n", + "R=20 #resistance in ohms\n", + "i=V/R\n", + "print(\"Maximum current in amp is\",i)\n", + "U=(L*i**2)/2\n", + "print(\"Energy stored in the magnetic field in joules is %.1f\"%U)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.4 Rate at which energy is stored and delivered and appeared" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The rate at which energy is delivred by the battery in watt is 0.5689085\n", + "The rate at which energy appears as Joule heat in the resistor in watt is 0.3596188\n", + "Let D=di/dt\n", + "The desired rate at which energy is being stored in the magnetic field in watt is 0.2092897\n" + ] + } + ], + "source": [ + "L=3 #inductance in henry\n", + "R=10 #resistance in ohm\n", + "V=3 #emf in volts\n", + "t=0.30 #in sec\n", + "T=0.30 #inductive time constant in sec\n", + "#(a)\n", + "i=(V/R)*(1-math.exp(-t/T))\n", + "P1=V*i\n", + "print(\"The rate at which energy is delivred by the battery in watt is %.7f\"%P1)\n", + "#(b)\n", + "P2=i**2*R\n", + "print(\"The rate at which energy appears as Joule heat in the resistor in watt is %.7f\"%P2)\n", + "#(c)\n", + "print(\"Let D=di/dt\")\n", + "D=(V/L)*math.exp(-t/T) #in amp/sec\n", + "P3=L*i*D\n", + "print(\"The desired rate at which energy is being stored in the magnetic field in watt is %.7f\"%P3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 36.6 Energy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Energy required to set up in the given cube on edge in electric field in joules is 0.0000445\n", + "(b)Energy required to set up in the given cube on edge in magnetic field in joules is 397.887\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "import math\n", + "\n", + "epsilon0=8.9*10**-12 #in coul2/nt-m2\n", + "E=10**5 #elelctric field in volts/meter\n", + "B=1 #magnetic field in weber/meter2\n", + "u0=4*math.pi*10**-7 #in weber/amp-m Mu-not=u0\n", + "a=0.1 #side of the cube in meter\n", + "V0=a**3 #volume of the cube in meter3\n", + "#(a)\n", + "U1=epsilon0*E**2*V0/2 #in elelctric field\n", + "print(\"(a)Energy required to set up in the given cube on edge in electric field in joules is %.7f\"%U1)\n", + "#(b)\n", + "U2=(B**2/(2*u0))*V0\n", + "print(\"(b)Energy required to set up in the given cube on edge in magnetic field in joules is %.3f\"%U2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_vTg4lNU.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_vTg4lNU.ipynb new file mode 100644 index 00000000..2da66d96 --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_vTg4lNU.ipynb @@ -0,0 +1,149 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 34 AMPERES LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.3 Distance" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Separation between two wires in metres 0.0054795\n" + ] + } + ], + "source": [ + "import math\n", + "i1=100 #in amp\n", + "i2=20 #in amp\n", + "W=0.073 #weight of second wire W=F/l in nt/m\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "d=u0*i1*i2/(2*math.pi*W)\n", + "print(\"Separation between two wires in metres %.7f\"%d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.5 Magnetic field and Magnetic flux" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field at center in wb/m2 is 0.0267035\n", + "Magnetic flux at the center of the solenoid in weber is 0.0000189\n" + ] + } + ], + "source": [ + "import math\n", + "l=1.0 #length of solenoid in meter\n", + "d=3*10**-2 #diameter of solenoid in meter\n", + "n=5*850 #number of layers and turns of wire\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "i0=5.0 #current in amp\n", + "#(A)\n", + "B=u0*i0*n\n", + "print(\"Magnetic field at center in wb/m2 is %.7f\"%B)\n", + "#(B)\n", + "A=math.pi*(d/2)**2\n", + "Q=B*A\n", + "print(\"Magnetic flux at the center of the solenoid in weber is %.7f\"%Q)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 34.9 Magnetic field and Magnetic dipole moment" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(A) Magnetic field at the center of the orbit in wb/m2 13.404\n", + "(B) Equivalent magnetic dipole moment in amp-m2 is 8.890e-24\n" + ] + } + ], + "source": [ + "import math\n", + "from __future__ import division\n", + "e=1.6*10**-19 #in coul\n", + "R=5.1*10**-11 #radius of th enucleus in meter\n", + "f=6.8*10**15 #frequency with which elecron circulates in rev/sec\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "x=0 #x is any point on the orbit, since at center x=0\n", + "#(A)\n", + "i=e*f\n", + "B=u0*i*R**2*0.5/((R**2+x**2)**(3/2))\n", + "print(\"(A) Magnetic field at the center of the orbit in wb/m2 %.3f\"%B)\n", + "N=1 #no.of turns\n", + "A=math.pi*R**2\n", + "U=N*i*A\n", + "print(\"(B) Equivalent magnetic dipole moment in amp-m2 is %.3e\"%U)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_wF4TlOQ.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_wF4TlOQ.ipynb new file mode 100644 index 00000000..34883c4a --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_wF4TlOQ.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 35 FARADAYS LAW" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 35.1 Induced EMF" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic field at center in wb/m2 is 0.0376991\n", + "Magnetic flux at the center of the solenoid in weber is 0.0000118\n", + "Induced EMF in volts is -0.0473741\n" + ] + } + ], + "source": [ + "import math \n", + "l=1.0 #length of solenoid in meter\n", + "r=3*10**-2 #radius of solenoid in meter\n", + "n=200*10**2 #number of turns in solenoid per meter\n", + "u0=4*math.pi*10**-7 #in weber/amp-m\n", + "i=1.5 #current in amp\n", + "N=100 #no.of turns in a close packed coil placed at the center of solenoid\n", + "d=2*10**-2 #diameter of coil in meter\n", + "delta_T=0.050 #in sec\n", + "#(A)\n", + "B=u0*i*n\n", + "print(\"Magnetic field at center in wb/m2 is %.7f\"%B)\n", + "#(B)\n", + "A=math.pi*(d/2)**2\n", + "Q=B*A\n", + "print(\"Magnetic flux at the center of the solenoid in weber is %.7f\"%Q)\n", + "delta_Q=Q-(-Q)\n", + "E=-(N*delta_Q/delta_T)\n", + "print(\"Induced EMF in volts is %.7f\"%E)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 35.7 Induced electric field and EMF" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let S be the frame of reference fixed w.r.t the magnet and Z be the frame of reference w.r.t the loop\n", + "(A) Induced electric field in volt/m observed by Z 2.0\n", + "(B) Force acting on charge carrier in nt w.r.t S is 3.2e-19\n", + "Force acting on charge carrier in nt w.r.t Z is 3.2e-19\n", + "(C) Induced emf in volt observed by S is 0.2\n", + "Induced emf in volt observed by Z is 0.2\n" + ] + } + ], + "source": [ + "B=2 #magnetic field in wb/m2\n", + "l=10*10**-2 #in m\n", + "v=1.0 #in m/sec\n", + "q=1.6*10**-19 #charge in coul\n", + "print(\"Let S be the frame of reference fixed w.r.t the magnet and Z be the frame of reference w.r.t the loop\")\n", + "#(A)\n", + "E=v*B\n", + "print(\"(A) Induced electric field in volt/m observed by Z\",E)\n", + "#(B)\n", + "F=q*v*B\n", + "print(\"(B) Force acting on charge carrier in nt w.r.t S is %.1e\"%F)\n", + "F1=q*E\n", + "print(\"Force acting on charge carrier in nt w.r.t Z is %.1e\"%F1)\n", + "#(C)\n", + "emf1=B*l*v\n", + "print(\"(C) Induced emf in volt observed by S is\",emf1)\n", + "emf2=E*l\n", + "print(\"Induced emf in volt observed by Z is\",emf2)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_xPlbJ6n.ipynb b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_xPlbJ6n.ipynb new file mode 100644 index 00000000..d197d07e --- /dev/null +++ b/Physics_For_Students_Of_Science_And_Engineering_Part_2_by_D_Halliday_and_R_Resnick/Cha_xPlbJ6n.ipynb @@ -0,0 +1,210 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 29 ELECTRIC POTENTIAL" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.3 Magnitude of an isolated positive point charge" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential due to a point charge is V=q/4*pi*epislon0*r\n", + "Magnitude of positive point charge in coul is 1.112e-09\n" + ] + } + ], + "source": [ + "import math\n", + "V=100 #electric potential in volts\n", + "r=10*10**-2 #in meters\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "print(\"Potential due to a point charge is V=q/4*pi*epislon0*r\")\n", + "q=V*4*math.pi*epsilon0*r\n", + "print(\"Magnitude of positive point charge in coul is %.3e\"%q)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.4 Electric potential at the surface of a gold nucleus" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electric potential at the surface of the nucleus in volts is 17220668\n" + ] + } + ], + "source": [ + "import math\n", + "r=6.6*10**-15 #radius of the gold nucleus in meter\n", + "Z=79 #gold atomic number\n", + "e=1.6*10**-19 #charge in coul\n", + "q=Z*e #total positive charge in coul\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "V=q/(4*math.pi*epsilon0*r)\n", + "print(\"Electric potential at the surface of the nucleus in volts is %d\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.5 Potential at the center of the square" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential at the center of the square in volts is 508.65\n" + ] + } + ], + "source": [ + "import math\n", + "q1=1.0*10**-8 #in coul\n", + "q2=-2.0*10**-8 #in coul\n", + "q3=3.0*10**-8 #in coul\n", + "q4=2.0*10**-8 #in coul\n", + "a=1 #side of square in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "#refer to the fig 29.7\n", + "r=a/math.sqrt(2) #distance of charges from centre in meter\n", + "V=(q1+q2+q3+q4)/(4*math.pi*epsilon0*r)\n", + "print(\"Potential at the center of the square in volts is %.2f\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.8 Mutual potential energy" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mutual electric potential energy of two proton in joules is 3.837e-14\n", + "Mutual electric potential energy of two proton in ev is 239781.46\n" + ] + } + ], + "source": [ + "import math\n", + "q1=1.6*10**-19 #charge in coul\n", + "q2=1.6*10**-19 #charge in coul\n", + "r=6.0*10**-15 #seperation b/w two protons in meter\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "U=(q1*q2)/(4*math.pi*epsilon0*r)\n", + "print(\"Mutual electric potential energy of two proton in joules is %.3e\"%U)\n", + "V=U/q1\n", + "print(\"Mutual electric potential energy of two proton in ev is %.2f\"%V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 29.9 Mutual potential energy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total energy is the sum of each pair of particles \n", + "Mutual potential energy of the particles in joules is -0.008991804694457362\n" + ] + } + ], + "source": [ + "import math\n", + "q=1.0*10**-7 #charge in coul\n", + "a=10*10**-2 #side of triangle in meter\n", + "q1=q\n", + "q2=-4*q\n", + "q3=2*q\n", + "epsilon0=8.85*10**-12 #coul2/nt-m2\n", + "print(\"Total energy is the sum of each pair of particles \")\n", + "U=(1/(4*math.pi*epsilon0))*(((q1*q2)/a)+((q1*q3)/a)+((q2*q3)/a))\n", + "print(\"Mutual potential energy of the particles in joules is\",U)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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" + }, + "widgets": { + "state": {}, + "version": "1.1.2" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |