diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /3137/CH10/EX10.27/Ex10_27.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '3137/CH10/EX10.27/Ex10_27.sce')
-rwxr-xr-x | 3137/CH10/EX10.27/Ex10_27.sce | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/3137/CH10/EX10.27/Ex10_27.sce b/3137/CH10/EX10.27/Ex10_27.sce new file mode 100755 index 000000000..691ca3f32 --- /dev/null +++ b/3137/CH10/EX10.27/Ex10_27.sce @@ -0,0 +1,18 @@ +//Initilization Of Variables
+a=0 //Lower Limit oF the Integral
+b=0.3 //Upper Limit of the Integral
+n=10 //Interval of the integral
+g=9.8 //m/s^2
+rho=1000 //kg/m^3
+//Calculation
+//Using Trapezoidal Rule for Intergration
+function[I1]=Trap_Composite1(f,a,b,n)
+ h=(b-a)/n
+ t=linspace(a,b,n+1)
+ I1=(h/2)*((2*sum(f(t)))-f(t(1))-f(t(n+1)))
+endfunction
+deff('[y]=f(t)','y=(g*0.6*rho*1.2*t)-(0.6*g*rho*t^2)')
+B=Trap_Composite1(f,a,b,n)/(2*b) //N
+//Result
+clc
+printf('The value of B is %f N',B)
|