summaryrefslogtreecommitdiff
path: root/Principles_of_Physics_by_P_V_Naik/3-Potential_Energy.ipynb
blob: 15331289e5b6ceac6e8613af5baca18932521cf3 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 3: Potential Energy"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.1: Potential_energy.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//Input data\n",
"m=0.04//Mass of stone in kg\n",
"vi=25//Initial velocity in m/s\n",
"vf=0//Final velocity in m/s\n",
"yi=0//Initial height in m\n",
"\n",
"//Calculations\n",
"Ui=(m*9.81*yi)//Initial potential energy in J\n",
"Ki=(1/2)*m*vi^2//Initial kinetic energy in J\n",
"Etotal=(Ui+Ki)//Total energy in J\n",
"h=(Etotal/(m*9.8))//Maximum height in m\n",
"//when the stone is at (2/3)h, total energy is again same\n",
"v=sqrt((Etotal-(m*9.8*(2/3)*h))/((1/2)*m))//Velocity at (2/3) of its maximum height in m/s\n",
"\n",
"//Output\n",
"printf('Maximum height it will reach is %3.1f m \n Potential energy at that height is %3.1f J \n velocity when it is at the two-third of its maximum height is %3.2f m/s',h,Etotal,v)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.2: Potential_energy.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//Input data\n",
"m=0.5//Mass of the sphere in kg\n",
"vi=100//Initial velocity in m/s\n",
"vf=20//Final velocity in m/s\n",
"\n",
"//Calculations\n",
"h=(vi^2-vf^2)/(2*9.8)//Height in m\n",
"PE=(m*9.8*h)//Potential energy in J\n",
"\n",
"//Calculations\n",
"printf('Potential energy of the sphere is %i J',PE)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.3: Potential_Energy.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//Input data\n",
"m=0.5//Mass of the block in kg\n",
"x=0.05//Distance to which block is pulled in m\n",
"k=300//Force constant of the spring in N/m\n",
"\n",
"//Calculations\n",
"U=(1/2)*k*x^2//Potential energy of the block in J\n",
"v=x*sqrt(k/m)//Velocity of the block in m/s\n",
"\n",
"//Output\n",
"printf('Potential energy of the block when spring is in stretched position is %3.3f J \n Velocity of the block when it passes through the equilibrium position is %3.2f m/s',U,v)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.4: Speed.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//Input data\n",
"l=0.8//Length of a simple pendulum in m\n",
"q=30//Angle with the vertical through which the bob is released in degrees\n",
"q1=10//Required angle in degrees\n",
"\n",
"//Calculations\n",
"v=sqrt(2*9.8*l*(cosd(q1)-cosd(q)))//Speed in m/s\n",
"\n",
"//Output\n",
"printf('Speed when the bob is at the angle of %i degrees with the vertical is %3.2f m/s',q1,v)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.5: Rest_and_total_energy.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//Input data\n",
"m=(9.1*10^-31)//Mass of the electron in kg\n",
"v=(3*10^8)//Velocity of light in m/s\n",
"c=(1.6*10^-19)//Charge of the electron in coloumbs\n",
"\n",
"//Calculations\n",
"Re=(m*v^2)/(c*10^6)//Rest energy in MeV\n",
"E=(Re/sqrt(1-0.9^2))//Total energy in MeV\n",
"\n",
"//Output\n",
"printf('Rest energy of the electron is %3.3f MeV \n Total energy is %3.4f MeV',Re,E)"
   ]
   }
],
"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
}