summaryrefslogtreecommitdiff
path: root/24/CH8/EX8.7/Example8_7.sce
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.7/Example8_7.sce
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.7/Example8_7.sce')
-rwxr-xr-x24/CH8/EX8.7/Example8_7.sce17
1 files changed, 17 insertions, 0 deletions
diff --git a/24/CH8/EX8.7/Example8_7.sce b/24/CH8/EX8.7/Example8_7.sce
new file mode 100755
index 000000000..65009de85
--- /dev/null
+++ b/24/CH8/EX8.7/Example8_7.sce
@@ -0,0 +1,17 @@
+//Given that
+mass = 2.0 //in kg
+v1 = 4.0 //in m/s^2
+Ff = 15 //in N
+k = 10^4 //in N/m
+
+//Sample Problem 8-7
+printf("**Sample Problem 8-7**\n")
+//Using energy conservation
+//Ki = Uf + TEf
+Ki = .5* mass* v1^2
+//Uf = .5*k*x^2
+//TEf = Ff* x
+s=poly(0,"s")
+p = .5*k*s^2 + Ff* s - Ki
+x = roots(p)
+printf("The compression in the spring is equal to %fcm", x(1)*100) \ No newline at end of file