/* D:\j_Iam_TEMP\_jh\jh_k123_Rectangle_v6.wxmx */
/* Rectangle */
(%i10) kill ( all ) ;

\[\operatorname{ }\ensuremath{\mathrm{done}}\]

(%i4) ro : 1000 ; g : 9 . 81 ; H : 3 ; B : 1 ;

\[\operatorname{ }1000\]

\[\operatorname{ }9.81\]

\[\operatorname{ }3\]

\[\operatorname{ }1\]

(%i5) P : integrate ( ro · g · ( H h ) · B , h , 0 , H ) ;

\[\operatorname{ }44145.0\]

(%i6) mP : integrate ( ro · g · ( ( H h ) · · 2 ) · B , h , 0 , H ) ;

\[\operatorname{ }88290.0\]

(%i7) h_D : mP / P ;

\[\operatorname{ }2.0\]

/* Variant 2 (from down coordinates) */
(%i8) mP_down : integrate ( ( ro · g · ( H h ) · B ) · h , h , 0 , H ) ;

\[\operatorname{ }44145.0\]

(%i9) h_D_down : mP_down / P ;

\[\operatorname{ }1.0\]

/* Rectangle with h1 */
(%i10) h1 : 1 ;

\[\operatorname{ }1\]

(%i11) P_h1 : integrate ( ro · g · ( H h + h1 ) · B , h , 0 , H ) ;

\[\operatorname{ }73575.0\]

(%i12) mP_h1 : integrate ( ro · g · ( ( H h + h1 ) · · 2 ) · B , h , 0 , H ) ;

\[\operatorname{ }206010.0\]

(%i13) h_D_h1 : mP_h1 / P_h1 ;

\[\operatorname{ }2.8\]

/* Rectangle with h1 (down) */
(%i14) mP_h1_down : integrate ( ro · g · ( ( H h + h1 ) · h ) · B , h , 0 , H ) ;

\[\operatorname{ }88290.0\]

(%i15) h_D_h1_down : mP_h1_down / P_h1 ;

\[\operatorname{ }1.2\]

/* test rectangle + h1 */
(%i16) h_D_h1 + h_D_h1_down ;

\[\operatorname{ }4.0\]

--> /*  Rectangle with h1 (up) + p_m */
(%i73) p_m : 10000 ;

\[\operatorname{ }10000\]

(%i74) P_h1_pm : integrate ( ro · g · ( H h + h1 + p_m / ( ro · g ) ) · B , h , 0 , H ) ;

\[\]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 12.038735983690112 by 11810/981 = 12.038735983690112 \]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 16.077471967380223 by 15772/981 = 16.077471967380223\]

\[\operatorname{ }157720.0\]

(%i75) mP_h1_pm_up : integrate ( ro · g · ( H h + h1 + p_m / ( ro · g ) ) · ( H h ) · B , h , 0 , H ) ;

\[\]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056\]

\[\operatorname{ }367760.0\]

(%i76) h_D_h1_pm_up : mP_h1_pm_up / P_h1_pm ;

\[\operatorname{ }2.3317271113365456\]

--> /*  Rectangle with h1 (down) + p_m */
(%i66) P_h1_pm : integrate ( ro · g · ( H h + h1 + p_m / ( ro · g ) ) · B , h , 0 , H ) ;

\[\]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 12.038735983690112 by 11810/981 = 12.038735983690112 \]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 16.077471967380223 by 15772/981 = 16.077471967380223\]

\[\operatorname{ }157720.0\]

(%i67) mP_h1_pm_down : integrate ( ro · g · ( H h + h1 + p_m / ( ro · g ) ) · h · B , h , 0 , H ) ;

\[\]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056 \]\[rat: replaced 6.019367991845056 by 5905/981 = 6.019367991845056\]

\[\operatorname{ }263120.0\]

(%i68) h_D_h1_pm_down : mP_h1_pm_down / P_h1_pm ;

\[\operatorname{ }1.6682728886634541\]

(%i77) /* test all H = 4  OK! */
h_D_h1_pm_up + h_D_h1_pm_down ;

\[\operatorname{ }4.0\]

/* -----------Triangle------------- */
(%i17) H : 4 ;

\[\operatorname{ }4\]

(%i18) fB ( h ) : = ( B / H ) · ( H h ) ;

\[\operatorname{ }\operatorname{fB}(h)\operatorname{:=}\frac{B}{H} \left( H\operatorname{-}h\right) \]

(%i20) fB ( 0 ) ; fB ( H ) ;

\[\operatorname{ }1\]

\[\operatorname{ }0\]

(%i21) P_tri : integrate ( ro · g · ( H h ) · fB ( h ) , h , 0 , H ) ;

\[\operatorname{ }52320.0\]

(%i22) mP_tri : integrate ( ro · g · ( ( H h ) · · 2 ) · fB ( h ) , h , 0 , H ) ;

\[\operatorname{ }156960.0\]

(%i23) h_D_tri : mP_tri / P_tri ;

\[\operatorname{ }3.0\]

/* Trapetion */
(%i24) P_trap : integrate ( ro · g · ( H h ) · fB ( h ) , h , 0 , H / 2 ) ;

\[\operatorname{ }45780.0\]

(%i25) mP_trap : integrate ( ro · g · ( ( H h ) · · 2 ) · fB ( h ) , h , 0 , H / 2 ) ;

\[\operatorname{ }147150.0\]

(%i26) h_D_trap : mP_trap / P_trap ;

\[\operatorname{ }3.2142857142857144\]

(%i27) mP_trap_down : integrate ( ro · g · ( ( H h ) · h ) · fB ( h ) , h , 0 , H / 2 ) ;

\[\operatorname{ }35970.0\]

(%i28) h_D_trap_down : mP_trap_down / P_trap ;

\[\operatorname{ }0.7857142857142857\]

/* Circle UP half */
(%i29) R : 1 ;

\[\operatorname{ }1\]

(%i30) fB_circle ( h ) : = 2 · sqrt ( R · · 2 h · · 2 ) ;

\[\operatorname{ }\operatorname{fB\_ circle}(h)\operatorname{:=}2 \sqrt{{{R}^{2}}\operatorname{-}{{h}^{2}}}\]

(%i32) fB_circle ( 0 ) ; fB_circle ( R ) ;

\[\operatorname{ }2\]

\[\operatorname{ }0\]

(%i33) P_cir_up : integrate ( ro · g · ( R h ) · fB_circle ( h ) , h , 0 , R ) ;

\[\operatorname{ }19620.0 \left( \frac{\ensuremath{\pi} }{4}\operatorname{-}\frac{1}{3}\right) \]

(%i34) P_cir_up , numer ;

\[\operatorname{ }8869.511965857935\]

(%i35) mP_cir_up : integrate ( ro · g · ( ( R h ) · · 2 ) · fB_circle ( h ) , h , 0 , R ) ;

\[\operatorname{ }19620.0 \left( \frac{5 \ensuremath{\pi} }{16}\operatorname{-}\frac{2}{3}\right) \]

(%i36) h_D_cir_up : mP_cir_up / P_cir_up , numer ;

\[\operatorname{ }0.6969819738807302\]

/* Test of Circle UP half */
(%i41) 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 ;

\[\operatorname{ }0.5756\]

\[\operatorname{ }5646.636\]

\[\operatorname{ }\frac{\ensuremath{\pi} }{2}\]

\[\operatorname{ }8869.715087547827\]

\[\operatorname{ }0.1098\]

(%i42) h_D : h_c + I / ( h_c · w ) , numer ;

\[\operatorname{ }0.6970399774252266\]

/* Circle DOWN half */
(%i44) fB_circle_d ( h ) : = 2 · sqrt ( R · · 2 ( R h ) · · 2 ) ;

\[\operatorname{ }\operatorname{fB\_ circle\_ d}(h)\operatorname{:=}2 \sqrt{{{R}^{2}}\operatorname{-}{{\left( R\operatorname{-}h\right) }^{2}}}\]

(%i46) fB_circle_d ( 0 ) ; fB_circle_d ( R ) ;

\[\operatorname{ }0\]

\[\operatorname{ }2\]

(%i48) P_cir_d : integrate ( ro · g · ( R h ) · fB_circle_d ( h ) , h , 0 , R ) ;

\[\operatorname{ }6540.0\]

(%i49) mP_cir_d : integrate ( ro · g · ( ( R h ) · h ) · fB_circle_d ( h ) , h , 0 , R ) ;

\[\operatorname{ }19620.0 \left( \frac{1}{3}\operatorname{-}\frac{\ensuremath{\pi} }{16}\right) \]

(%i50) h_D_cir_d : mP_cir_d / P_cir_d , numer ;

\[\operatorname{ }0.41095137745191374\]

/* Test of Circle DOWN half */
(%i55) h_c : ( 0 . 4244 ) · R ; p : ro · g · h_c ; w : ( %pi · ( R · · 2 ) ) / 2 ; P : p · w , numer ; I : 0 . 1098 · R · · 4 ;

\[\operatorname{ }0.4244\]

\[\operatorname{ }4163.364\]

\[\operatorname{ }\frac{\ensuremath{\pi} }{2}\]

\[\operatorname{ }6539.796878310107\]

\[\operatorname{ }0.1098\]

(%i60) h_D : h_c + I / ( h_c · w ) , numer ;

\[\operatorname{ }0.5891051154711603\]

(%i61) /* test from down coordinates */
R h_D ;

\[\operatorname{ }0.4108948845288397\]


Created with wxMaxima.

The source of this Maxima session can be downloaded here.