summaryrefslogtreecommitdiff
path: root/24/CH8/EX8.2
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /24/CH8/EX8.2
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '24/CH8/EX8.2')
-rwxr-xr-x24/CH8/EX8.2/Example8_2.sce21
-rwxr-xr-x24/CH8/EX8.2/Example8_2_result.txt8
2 files changed, 29 insertions, 0 deletions
diff --git a/24/CH8/EX8.2/Example8_2.sce b/24/CH8/EX8.2/Example8_2.sce
new file mode 100755
index 000000000..efe8e106c
--- /dev/null
+++ b/24/CH8/EX8.2/Example8_2.sce
@@ -0,0 +1,21 @@
+//Given that
+mass = 2 //in kg
+y1 = 5 //in meter
+g = 9.8 //in m/s^2
+ref = [0, 3, 5, 6]
+
+//Sample Problem 8-2a
+printf("**Sample Problem 8-2a**\n")
+for x = ref
+ U = mass* g* (y1 - x)
+ printf("The potential energy at y1 is %dJ if reference is assumed to be at y=%d\n", U, x)
+end
+
+//sample Probelm 8-2b
+printf("\n**Sample Problem 8-2b**\n")
+y2 = 0
+//The change in potential energy doesn't depend on choice of reference
+deltaY = y2 - y1
+//because the deltaY doesn't depend upon the choice of references
+deltaU = mass* g* deltaY
+printf("The change in potential energy is %dJ same for all the references", deltaU) \ No newline at end of file
diff --git a/24/CH8/EX8.2/Example8_2_result.txt b/24/CH8/EX8.2/Example8_2_result.txt
new file mode 100755
index 000000000..4586169da
--- /dev/null
+++ b/24/CH8/EX8.2/Example8_2_result.txt
@@ -0,0 +1,8 @@
+**Sample Problem 8-2a**
+The potential energy at y1 is 98J if reference is assumed to be at y=0
+The potential energy at y1 is 39J if reference is assumed to be at y=3
+The potential energy at y1 is 0J if reference is assumed to be at y=5
+The potential energy at y1 is -19J if reference is assumed to be at y=6
+
+**Sample Problem 8-2b**
+The change in potential energy is -98J same for all the references \ No newline at end of file