D:\jknuba_2024_winter\j_MAXIMA_Iam\jh_k123_Rectangle.wxmx

Rectangle

kill(all);

ro:1000;g:9.81;H:3;B:1;

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

mP:integrate(ro*g*((H-h)**2)*B,h,0,H);

h_D:mP/P;

Var 2 (down)

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

h_D_down:mP_down/P;

Rectangle with h1

h1:1;

P_h1:integrate(ro*g*(H-h+h1)*B,h,0,H);

mP_h1:integrate(ro*g*((H-h+h1)**2)*B,h,0,H);

h_D_h1:mP_h1/P_h1;

Rectangle with h1 (down)

mP_h1_down:integrate(ro*g*((H-h+h1)*h)*B,h,0,H);

h_D_h1_down:mP_h1_down/P_h1;

test rectangle + h1

h_D_h1+h_D_h1_down;

-----------Triangle-------------

H:4;

fB(h):=(B/H)*(H-h);

fB(0);fB(H);

P_tri:integrate(ro*g*(H-h)*fB(h),h,0,H);

mP_tri:integrate(ro*g*((H-h)**2)*fB(h),h,0,H);

h_D_tri:mP_tri/P_tri;

Trapetion

P_trap:integrate(ro*g*(H-h)*fB(h),h,0,H/2);

mP_trap:integrate(ro*g*((H-h)**2)*fB(h),h,0,H/2);

h_D_trap:mP_trap/P_trap;

mP_trap_down:integrate(ro*g*((H-h)*h)*fB(h),h,0,H/2);

h_D_trap_down:mP_trap_down/P_trap;

Circle UP half

R:1;

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

fB_circle(0);fB_circle(R);

P_cir_up:integrate(ro*g*(R-h)*fB_circle(h),h,0,R);

P_cir_up,numer;

mP_cir_up:integrate(ro*g*((R-h)**2)*fB_circle(h),h,0,R);

h_D_cir_up:mP_cir_up/P_cir_up,numer;

test

h_c:(1-0.4244)*R;p:ro*g*h_c;w:(%pi*(R**2))/2;P:p*w,numer;I:0.1098*R**4;

h_D:h_c+I/(h_c*w),numer;