D:\j_Iam_TEMP\_jh\_jh_ex1.wxmx

# Conversion Factors

0.00001667 m3/s = 1 L/min 
0.002228 ft3/s = 1 gal/min
0.0145 lb/in2 = 1 mbar
0.3048m = 1ft 
2.54 cm = 1 in
3.281 ft = 1 m
4 qt = 1 gal 
4.184 kJ = 1 kcal
4.448 N = 1 lb 
6.894 kN/m2 = 1 lb/in2
7.48 gal = 1ft3
12 in = 1 ft 
14.59 kg = 1 slug
25.4 mm = 1 in
60 min = 1 h
60 s = 1 min
100 cm = 1 m
100 kPa = 1 bar
101.3 kPa = 1 atm 
144 in2 = 1 ft2
550 ft-lb/s = 1 hp
778ft-lb = l Btu
1000 N = 1 kN 
1000L=lm’
1000 mm = 1 m
1000 Pa = 1 kPa
1728 in3 = 1 ft3 
2000 lb = 1 ton
3600s=lh
4184 J = 1 kcal
5280 ft = 1 mile
86 400s = 1 day
1000 000N = 1MN
1 000 000 Pa = 1 MPa
1 0000000(X)N = 1 GN 
1000 000 000 Pa = 1 GPa

quarter circle

_jh_ex1a.ai   -----------------------------

D:\j_Iam_TEMP\_jh\_jh_ex1a.jpg

D:\j_Iam_TEMP\_jh\_jh_ex1b.jpg

kill(all);

R:1;B:2;ro:1000;g:9.81;H:R;

P_x:integrate(ro*g*(H-h)*B,h,0,R);

W_z:integrate((sqrt(R**2-(R-h)**2))*B,h,0,R)$W_z,numer;

W:((%pi*(R**2))/4)*B,numer;

P_z:W_z*ro*g,numer;

phi_rad:atan(P_z/P_x),numer;phi_g:(180/%pi)*phi_rad,numer;

x_C - Center of gravity of body volume pressure  (Центр ваги об'єма тіла тиску)

w:integrate((sqrt(R**2-(R-h)**2))*B,h,0,R);

mw:integrate((sqrt(R**2-(R-h)**2))*B*((sqrt(R**2-(R-h)**2))/2),h,0,R);

x_C:mw/w,numer;

# Numerical methods, K123 (Чисельні методи, K123)

Numerical calculation methods (Чисельні методи розрахунку)

kill(all);

R:1;B:2;ro:1000;g:9.81;H:R;

# P_x

dh:R/10000;

h:0;P_x:0;

for i: 1 while h <= R do(Pi:ro*g*(H-h)*B*dh,P_x:P_x+Pi,h:h+dh);P_x;

h:0;mP_x:0;

for i: 1 while h <= R do(mPi:ro*g*((H-h)**2)*B*dh,mP_x:mP_x+mPi,h:h+dh);mP_x;

h:0;mP_x_down:0;

for i: 1 while h <= R do(mPi:ro*g*(H-h)*h*B*dh,mP_x_down:mP_x_down+mPi,h:h+dh);mP_x_down;

h_D:mP_x/P_x;

h_D_down:mP_x_down/P_x;

h_D+h_D_down;

# P_z

R:1;B:2;ro:1000;g:9.81;H:R;

n:10000; dh:R/n;

h:0;P_z:0;

fB(h):=(sqrt(R**2-(R-h)**2));fB(0);fB(R);

fb:fB(h);

for i: 1 thru n step 1 do(fb1:fB(h),dfb:fb1-fb,Pi:ro*g*(H-h)*dfb*B,P_z:P_z+Pi,h:h+dh,fb:fb1);Pz:P_z,numer;

h:0;mP_z:0;

fb:fB(h);

for i: 1 thru n step 1 do(fb1:fB(h),dfb:fb1-fb,mPi:ro*g*(H-h)*dfb*B*fB(h),mP_z:mP_z+mPi,h:h+dh,fb:fb1);mPz:mP_z,numer;

x_D:mPz/Pz;

# Analytical calculations using the three-team method K123

Аналітичні розрахунки методом трьох команд К123

kill(all);

R:1;B:2;ro:1000;g:9.81;H:R;

# P_x

P:integrate(rho*gi*(Hi-h)*Bi,h);

fP(h):=B*g*(R*h-((h**2)/2))*ro;

fP_x(B,g,R,ro,h):=B*g*(R*h-((h**2)/2))*ro;

fP_x(2,9.81,1,1000,1);

plot2d(fP_x(2,9.81,1,1000,h),[h,0,R]);

mP:integrate(rho*gi*((Hi-h)**2)*Bi,h);

mP_d:integrate(rho*gi*(Hi-h)*Bi*h,h);

fmP_x(B,g,H,ro,h):=B*g*(h^3/3-H*h^2+H^2*h)*ro;

plot2d(fmP_x(2,9.81,1,1000,h),[h,0,R]);

fmP_x(2,9.81,1,1000,1);

fh_D:(fmP_x(2,9.81,1,1000,1))/(fP_x(2,9.81,1,1000,1));

plot2d([fP_x(2,9.81,1,1000,h),fmP_x(2,9.81,1,1000,h)],[h,0,R]);

plot2d([fmP_x(2,9.81,1,1000,h)/fP_x(2,9.81,1,1000,h)],[h,0,R]);

# P_z

_jh_ex1c.ai   -----------------------------

D:\j_Iam_TEMP\_jh\_jh_ex1c.jpg

D:\j_Iam_TEMP\_jh\_jh_ex1d.jpg

kill(all);

R:1;B:2;ro:1000;g:9.81;H:R;

P_x:integrate(ro*g*(H-h)*B,h,0,R);P_x/9;

fB(h):=R-sqrt(R**2-h**2);fB(0);fB(R);

P_z:integrate(fB(h)*B*ro*g,h,0,R),numer;

mP_z:integrate(fB(h)*B*ro*g*(R-fB(h)/2),h,0,R),numer;

x_C:mP_z/P_z;x_C_:R-x_C;295*0.22336793894575135;295*0.7766320610542486;

W_test:integrate(fB(h)*B,h,0,R),numer;P_z_test:W_test*ro*g;

W_test:(R**2-((%pi*(R**2))/4))*B,numer;

P_z_test:W_test*ro*g;P_z_test/9;

P:sqrt(P_x**2+P_z**2);P/9;

phi_rad:atan(P_z/P_x),numer;phi_g:(180/%pi)*phi_rad,numer;

----------------------------------------------

kill(all);

S:300;

R:1;B:2;ro:1000;g:9.81;H:R/2,numer;

P_x:integrate(ro*g*(R-h)*B,h,0,H);

mP_x:integrate(ro*g*(R-h)*B*(R-h),h,0,H);

h_D:mP_x/P_x;(R-h_D);(R-h_D)*S;

fB(h):=sqrt(R**2-(R-h)**2);

P_z:integrate(ro*g*(R-h)*(fB(h))*B,h,0,H),numer;

P:sqrt(P_x**2+P_z**2);

phi_rad:atan(P_z/P_x),numer;phi_g:(180/%pi)*phi_rad,numer;

P_z:integrate(fB(h)*B*ro*g,h,0,H),numer;

mP_z:integrate(fB(h)*B*ro*g*(fB(h)/2),h,0,H),numer;

x_C:mP_z/P_z,numer;S*x_C;

----------------------------------------------

x:600;y:150;x2:x/2;

sr:0.4244;sr_1:1-sr;

z_c:x2*sr;z_c_1:x2*sr_1;z_c+z_c_1;