blob: 75dc22ab64626923a43826cf52a30bec7df04ec6 (
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
|
// A Textbook of Fluid Mecahnics and Hydraulic Machines - By R K Bansal
// Chapter 4-Buoyancy and Floatation
// Problem 4.9
//Given Data Set in the Problem
dens=1000
g=9.81
V=2*1*0.8
sg=0.7
//calculations
h=poly(0,"h")
w_d=dens*g*2*1*h
//we know thtat at equilibrium; weight of wooden piece =weight of wter displaced
w_w=sg*dens*g*2*1*0.8
function[f] = F(h)
f=w_w-(dens*g*2*1*h) //w_wood-w_displaced
endfunction
h=1
h=fsolve(h,F)
//For centre of buoyancy
AB=h/2
AG=0.8/2
BG=AG-AB
//Meta centric heinght
I_yy=1/12*2*1^3
v_sub=2*1*h
//hence GM is
GM=I_yy/v_sub-BG
mprintf("The Meta centric height is %f m\n",GM)
|