{ "metadata": { "name": "MP-16" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": "Cosmology: Origin and Fate of Universe" }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": "Example 16.1 Page 529" }, { "cell_type": "code", "collapsed": false, "input": "#initiation of variable\nfrom math import log\nN2=0.25;N1=0.75; #various given values\nL2=1.0;L1=0.0;\nE1_E2=-4.7*(10**-4); #Energy difference\n\n#calculation\na=(N2/N1); b=(((2*L2)+1)/((2*L1)+1));c=E1_E2; #various terms involved in the formula of ratio of population\nkT=(c/log(a/b)); #value of k*T\nk=0.0000856; #constant\nT=kT/k; #temperature of interstellar space\n\n#result\nprint \"The temperature of interstellar space was found out to be in K\",round(T,3);", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "The temperature of interstellar space was found out to be in K 2.499\n" } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": "Example 16.2 Page 536" }, { "cell_type": "code", "collapsed": false, "input": "#initiation of variable\nmc2=940.0*10**6; k=8.6*10**-5; #various constants and given values in suitable units\n\n#calculation\nT= mc2/k; #temperature of the photons\n\n#result\nprint \"The temperature of the photons must be in K %.1e\" %round(T,3);\n\n#part2\nt=((1.5*10**10)/T)**2; #age of universe when the photons have the above temperature\n\n#result\nprint\"The age of the universe for the temperature of the photon to be as obtained above in seconds is %.01e\" %t;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "The temperature of the photons must be in K 1.1e+13\nThe age of the universe for the temperature of the photon to be as obtained above in seconds is 1.883318e-06\n" } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": "Example 16.3 Page 539" }, { "cell_type": "code", "collapsed": false, "input": "#initation of variable\nfrom math import exp\nk=8.62*10**-5; #various values and constants\nT= 1.5*10**10;\ndelE=1.3*10**6;\n\n#calculation\na= delE/(k*T); #exponent in boltzmann factor\nb=exp(-a); #ratio of neutron to protons\nr=(1/(1+b))*100; #relative number of protons\n\n#result\nprint\"The percentage of protons is\",round(r),\" neutrons is \",round(100-r);", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "The percentage of protons is 73.0 neutrons is 27.0\n" } ], "prompt_number": 6 } ], "metadata": {} } ] }