summaryrefslogtreecommitdiff
path: root/3819/CH4/EX4.11/Ex4_11.sce
blob: 9f65f88939f18b426e480cce363f4b153b0d9733 (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
// A Textbook of Fluid Mecahnics and Hydraulic Machines - By R K Bansal
// Chapter 4-Buoyancy and Floatation
//// Problem 4.11

//Given Data Set in the Problem
dens=1000
g=9.81
D=3
d=1.8
V_disp=0.6
CB1=1.95
CG=1.2
W_tot=3.9*1000*g
//For meta centric height
//Weight of water displaced=weight density of water*Volume of water displaced
x=poly(0,"x")
function [f]=F(x)           //solves for x=height of body above water surface
    f=W_tot-(dens*g*(%pi/4*D^2*(1.8-x)+V_disp))
endfunction
x=10
x=fsolve(x,F)
//Let B2 is the centre of buoyancy of the cylindrical part and B of the whole body
//for COB of the cylindrical part
CB2=x+0.5*(1.8-x)
//COB of the whole body is 
V_cyl=%pi*(D/2)^2*(1.8-x)
CB=((V_disp*CB1)+(V_cyl*CB2))/(V_disp+V_cyl)
//For meta centric height
BG=CB-CG
I_yy=%pi/64*D^4
V_sub=V_disp+V_cyl
GM=I_yy/V_sub-BG
mprintf("The Meta centric height is at %f m\n",GM)