summaryrefslogtreecommitdiff
path: root/Modern_Physics_by_R_A_Serway/16-Cosmology.ipynb
blob: 8b5cd2f9f2361fe601f106a8f49c4e227f7bc5f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 16: Cosmology"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 16.1: Hubbles_law.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Scilab code Ex16.1: Pg 15 (2005)\n",
"clc; clear;\n",
"c = 3e+05;   // Velocity of light, km/s\n",
"v = c/4;    // Recessional velocity, km/s\n",
"H_0 = 20e-06;    // Hubble's constant, km/s/lightyear\n",
"// From Hubble's law, v = H_o*R_max, solving for R_max\n",
"R_max = v/H_0;  // Maximum distance at which Hubble's law applies without relativistic correction, lightyears\n",
"printf('\nThe maximum distance at which Hubbles law applies without relativistic correction = %1.0e ly', R_max);\n",
"printf('\n');\n",
"\n",
"// Result\n",
"// The maximum distance at which Hubbles law applies without relativistic correction = 4e+09 ly"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 16.2: Critical_density_of_universe.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Scilab code Ex16.2: Pg 22 (2005)\n",
"clc; clear;\n",
"H = 23e-03/(9.46e15);    // Hubble's constant, km/s/ly\n",
"G = 6.67e-11;      // Gravitational constant, N-m^2/kg^2\n",
"//  Since H^2 = (8*%pi*G*p_c)/3, solving for p_c\n",
"p_c = (3*H^2)/(8*%pi*G);    // Critical mass density of universe, kg/m^3\n",
"printf('\nCritical mass density of universe = %4.2e kg per metre cube', p_c);\n",
"\n",
"\n",
"// Result\n",
"// Critical mass density of universe = %1.06e-27 kg/m^3"
   ]
   }
],
"metadata": {
		  "kernelspec": {
		   "display_name": "Scilab",
		   "language": "scilab",
		   "name": "scilab"
		  },
		  "language_info": {
		   "file_extension": ".sce",
		   "help_links": [
			{
			 "text": "MetaKernel Magics",
			 "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
			}
		   ],
		   "mimetype": "text/x-octave",
		   "name": "scilab",
		   "version": "0.7.1"
		  }
		 },
		 "nbformat": 4,
		 "nbformat_minor": 0
}